How profgaurav/advanced-rag-experimentation works
YouTube RAG has a one-time backend indexing workflow and a separate Streamlit question-answering workflow. Indexing fetches a transcript, chunks it, embeds it, and persists a FAISS index; the UI loads that index, retrieves relevant chunks, and asks an LLM to answer. The graph preserves the documented prompt, chain, and configuration layers. Some chain internals and the CLI implementation are unsampled, so those relationships rely on the README; no other unsampled source behavior is inferred.
Main entry points: qa.py QA service · indexing.py Index builder · faiss_store.py FAISS store · app.py Streamlit entry
Components 20
Indexing
- Index CLI
scripts/build_index.py - Settings
src/yt_rag/config.py - Transcript fetch
src/yt_rag/ingestion/transcript.py - Transcript chunker
src/yt_rag/ingestion/splitter.py - Index builder
src/yt_rag/indexing.py
Vector storage
- Embedding factory
src/yt_rag/vectorstore/embeddings.py - FAISS store
src/yt_rag/vectorstore/faiss_store.py - Persisted index
data/vectorstore
Answering
- QA service
src/yt_rag/qa.py - Retriever
src/yt_rag/chains/retriever.py - QA prompt
src/yt_rag/chains/prompts.py - Chat model
src/yt_rag/chains/llm.py - QA chain
src/yt_rag/chains/qa_chain.py - Domain errors
src/yt_rag/exceptions.py
Chat interface
- Streamlit entry
app.py - Chat UI
ui/chat.py
Other components
- Video ID provider
- YouTube transcripts
- OpenAI models
- Question asker
Connections 25
- Video ID provider → Index CLI: provides video ID
README.md - Index CLI → Index builder: runs indexing
README.md - Index builder → Settings: reads settings
src/yt_rag/indexing.py - Index builder → Transcript fetch: fetches transcript
src/yt_rag/indexing.py - Transcript fetch → YouTube transcripts: fetches captions
src/yt_rag/ingestion/transcript.py - Index builder → Transcript chunker: chunks transcript
src/yt_rag/indexing.py - Index builder → Embedding factory: gets embeddings
src/yt_rag/indexing.py - Embedding factory → OpenAI models: creates embeddings
README.md - Index builder → FAISS store: builds and saves
src/yt_rag/indexing.py - FAISS store → Persisted index: persists index
README.md - Question asker → Chat UI: enters question
README.md - Streamlit entry → Chat UI: renders chat
app.py - Streamlit entry → QA service: loads chain and answers
app.py - QA service → Settings: reads settings
src/yt_rag/qa.py - QA service → FAISS store: loads index
src/yt_rag/qa.py - FAISS store → Persisted index: reads index
README.md - QA service → Embedding factory: gets embeddings
src/yt_rag/qa.py - QA service → Retriever: builds retriever
src/yt_rag/qa.py - QA service → QA prompt: gets prompt
src/yt_rag/qa.py - QA service → Chat model: gets chat model
src/yt_rag/qa.py - QA service → QA chain: builds QA chain
src/yt_rag/qa.py - QA service → Retriever: retrieves chunks
README.md - QA service → QA prompt: formats context
README.md - QA service → Chat model: generates answer
README.md - Streamlit entry → Domain errors: handles missing index
app.py