An end-to-end Retrieval-Augmented Generation (RAG) system that enables semantic question answering over YouTube video content. The system extracts transcripts, performs embedding-based retrieval, and generates context-aware responses using a Large Language Model (LLM).
This project implements a production-style RAG pipeline that allows users to query YouTube videos using natural language. It leverages transcript extraction, semantic search over embeddings, and LLM-based generation to produce accurate, context-grounded answers while minimizing hallucinations.
-
Semantic Retrieval over Video Transcripts
Retrieves relevant content using embedding-based similarity search -
Context-Grounded Response Generation
Constrains LLM output using retrieved transcript segments -
Efficient Handling of Long Content
Uses chunking to process and query large transcripts -
Modular Pipeline Design
Separates ingestion, retrieval, and generation components
YouTube URL → Transcript Extraction (yt-dlp) → Transcript Parsing & Cleaning → Text Chunking (LangChain Recursive Splitter) → Embedding Generation (Gemini Embeddings - gemini-embedding-001) → Vector Storage (FAISS) → User Query → Query Embedding → Top-K Semantic Retrieval → Prompt Construction → LLM Inference (Groq API) → Final Answer
- Extract subtitles using yt-dlp in JSON3 format
- Parse and clean transcript into structured segments
- Split transcript into semantically meaningful chunks
- Convert text chunks into vector embeddings (Gemini Embeddings - gemini-embedding-001)
- Store embeddings in FAISS vector index
- Convert user query into embedding
- Retrieve top-K relevant chunks using similarity search
- Construct prompt using retrieved context + user query
- Generate response using LLM via Groq API
- Retrieval-Augmented Generation (RAG)
- Large Language Models (LLMs) via Groq API
- Prompt Engineering
- FAISS (Vector Database)
- Google Generative AI Embeddings (gemini-embedding-001)
- LangChain
- yt-dlp (Transcript Extraction)
- youtube-transcript-api
- tiktoken
- python-dotenv
- Grounded responses reduce hallucination
- Efficient semantic retrieval over long transcripts
- Scalable and modular pipeline design
- Works effectively on unstructured video data
- Provide a YouTube video URL
- System extracts transcript automatically
- Ask questions related to the video
- Receive accurate, context-aware answers
- Multi-video knowledge base support
- Conversational memory (multi-turn chat)
- Hybrid search (keyword + vector retrieval)
- Response evaluation metrics (accuracy, relevance)
- Deployment (FastAPI backend + React frontend)