How narsing64/youtube-chatbot works
This is a Streamlit YouTube RAG chatbot. A user provides a video and asks questions: the app fetches and segments its transcript, builds timestamped documents, retrieves and reranks relevant passages, then asks an LLM for an answer with timestamp-linked sources. The visible excerpts also establish transcript-provider fallbacks, a YouTube player, and lexical reranking fallback. Source excerpts are partial, so edges are limited to relationships shown there or documented in those excerpts.
Main entry points: app.py Streamlit app
Components 16
Chat interface
- Streamlit app
app.py - Timestamped player
app.py
Transcript ingestion
- Transcript fetching
app.py - YouTube transcripts
- Supadata API
- RapidAPI
- Transcript chunking
app.py - Timestamped documents
app.py
RAG answering
- FAISS index
app.py - Jina embeddings
app.py - Passage retrieval
app.py - Passage reranking
app.py - Jina reranker API
- Answer generation
app.py - Groq chat model
Other components
- Video viewer
Connections 18
- Video viewer → Streamlit app: asks about video
app.py - Streamlit app → Transcript fetching: fetches transcript
app.py - Transcript fetching → YouTube transcripts: tries provider
app.py - Transcript fetching → Supadata API: fallback request
app.py - Transcript fetching → RapidAPI: fallback request
app.py - Streamlit app → Transcript chunking: chunks transcript
app.py - Streamlit app → Timestamped documents: builds documents
app.py - Timestamped documents → Transcript chunking: splits text
app.py - Streamlit app → Jina embeddings: indexes documents
app.py - Streamlit app → FAISS index: creates index
app.py - Streamlit app → Passage retrieval: answers query
app.py - Passage retrieval → FAISS index: retrieves passages
app.py - Passage retrieval → Passage reranking: reranks passages
app.py - Passage reranking → Jina reranker API: requests ranking
app.py - Passage retrieval → Answer generation: invokes model
app.py - Answer generation → Groq chat model: generates answer
app.py - Streamlit app → Timestamped player: shows video
app.py - Timestamped player → Video viewer: offers timestamps
app.py