Streamlit app that lets you chat with a YouTube video using a local RAG stack. The app downloads a video's audio with yt-dlp, transcribes it with Whisper, indexes the transcript with Chroma + Ollama embeddings, and answers your questions with an Ollama-served LLM.
- Paste a YouTube URL and auto-download the audio (mp3).
- Local transcription via Whisper (
basemodel). - RAG pipeline: chunking with RecursiveCharacterTextSplitter, embeddings with
nomic-embed-text, retrieval via Chroma, responses withllama3.2. - Chat-style UI built in Streamlit; transcript is viewable in-app.
- Audio file is cleaned up after processing; transcript is written to
transcription.txtfor reuse. - CLI sample (
main.py) that demonstrates the same RAG flow against a web page.
- Python 3.10+ and
pip. - FFmpeg installed and available on
PATH(required byyt-dlpand Whisper). - Ollama running locally with the models:
ollama pull nomic-embed-textollama pull llama3.2
pip install \
streamlit \
yt-dlp \
openai-whisper \
langchain \
langchain-community \
langchain-text-splitters \
langchain-ollama \
chromadbstreamlit run app.py- Open the provided local URL.
- Paste a YouTube link and click ANALYZE ⚡.
- After processing, expand Show Transcript if you want to inspect the raw text.
- Ask questions in the chat box; answers are grounded in the transcript.
Notes:
- Audio is removed after analysis; the transcript persists at
transcription.txt(also listed in.gitignore). - If the page fails to load models, confirm Ollama is running and the two models above are available.
python main.pyThe script loads a sample Turkish Wikipedia page, builds the same RAG chain, and answers questions in a loop (q to quit).
ffmpegnot found: Install FFmpeg and ensure it is onPATH.- Ollama errors / model not found: Pull the required models and restart Ollama.
- Long processing times: Whisper transcription and embedding creation are CPU-heavy; GPU-capable environments speed this up.
- Permission issues writing files: Ensure the repo directory is writable; audio and transcript files are created in the project root.
Batuhan Küçükaydın
Software Engineer | Computer Engineer | iOS Developer
📫 LinkedIn • GitHub • Medium
If you like this project, please consider giving it a star 🌟
It really helps me keep building and improving!