All projects

RAG · LangChain

YouTube Transcript Q&A

Ask questions about any YouTube video and get answers grounded in what was actually said, instead of the model's guesses.

PythonLangChainRAGEmbeddingsVector search
View code (opens in a new tab) Live demo coming soon
Diagram of the YouTube Transcript Q&A pipeline
How the pipeline works, step by step.

The problem

Long videos such as lectures, talks and tutorials hide the one answer you need somewhere in an hour of speech. Asking a general chatbot about them is risky: it hasn't watched the video, so it may invent an answer.

This project lets you ask questions about a specific video and answers only from its transcript.

How it works

  1. Load the transcript

    Takes a YouTube video and retrieves its transcript, the text of everything said in the video.

  2. Split into chunks

    Splits the transcript into overlapping pieces with LangChain text splitters, so each piece is small enough to search but keeps its context.

  3. Embed and store

    Turns each chunk into an embedding (a vector of numbers that captures its meaning) and stores them in a vector store.

  4. Retrieve and answer

    For each question, finds the most relevant chunks and gives them to an LLM, which writes an answer based only on those passages.

What I learned

Building a full RAG pipeline end to end with LangChain: loading documents, chunking strategy, embeddings, retrieval, and prompting an LLM to stay grounded in the retrieved context.