A Retrieval-Augmented Generation (RAG) system that helps Friends fans find episodes based on scene descriptions. Simply describe any scene from the show, and FriendsRAG will identify the episode and provide a complete summary!
Example:
- You ask: "What's the episode where Rachel gets off the plane?"
- FriendsRAG returns: Episode title, season, episode number, and full summary
FriendsRAG/
├── RAG.ipynb # Core RAG implementation
├── RAG_Langfuse.ipynb # RAG with Langfuse monitoring
├── RAG_FastAPI.py # FastAPI endpoint
├── requirements.txt # Python dependencies
└── data/
├── FriendsEpisodes.csv # Episode metadata
└── FriendsScripts.csv # Episode scripts
Using uv (recommended):
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txtUsing pip:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtLogin with AWS SSO:
aws sso login --profile your-profile-nameUpdate the AWS configuration in each file:
REGION_NAME = "us-east-1" # Your AWS region
CREDENTIALS_PROFILE_NAME = "your-profile-name" # Your AWS profileWhat it does: Creates the vector database and allows you to query episodes interactively.
Requirements:
- AWS credentials configured
- Data files in
data/folder
How to run:
jupyter notebook RAG.ipynbRun all cells to:
- Load episode and script data
- Create embeddings and build FAISS vector database
- Query the system with natural language
What it does: Same as RAG.ipynb but adds Langfuse monitoring and evaluation metrics.
Requirements:
- AWS credentials configured
- Data files in
data/folder - Langfuse account and API keys
Setup Langfuse:
# Create a .env file with:
LANGFUSE_PUBLIC_KEY=your_public_key
LANGFUSE_SECRET_KEY=your_secret_key
LANGFUSE_BASE_URL = "https://cloud.langfuse.com"How to run:
jupyter notebook RAG_Langfuse.ipynbFeatures:
- Request/response tracing
- Evaluation metrics (correctness, relevance, groundedness)
- Dashboard at https://cloud.langfuse.com
What it does: Provides a REST API to query the RAG system.
Requirements:
- AWS credentials configured
- Vector database already created (run RAG.ipynb first to generate
./vector_database/)
How to run:
fastapi dev RAG_FastAPI.pyAPI will be available at: http://localhost:8000
Test the API:
Interactive docs:
Visit: http://localhost:8000/docs