An interactive Retrieval-Augmented Generation (RAG) web application that transforms any YouTube video into a live chat stream. Built with FastAPI, LangChain, FAISS, and Google Gemini, this tool indexes video transcripts in seconds and delivers precise, context-aware answers inside an authentic YouTube Dark Mode interface.
- ⚡ Instant Video Indexing: Paste any YouTube URL or video ID to dynamically fetch and chunk text transcripts using
youtube-transcript-api. - 🧠 Advanced RAG Pipeline: Uses
GoogleGenerativeAIEmbeddingsand an in-memory FAISS vector database for blazing-fast semantic search without the massive memory overhead of local embedding models. - 🤖 Powered by Google Gemini: Integrates Google's latest
gemini-3.1-flash-litemodel for high-speed reasoning and accurate conversational summaries without hitting strict free-tier quota limits. - 🎨 Authentic YouTube Dark UI: Designed from the ground up to mirror YouTube Live Chat, featuring pill buttons, neon live-status indicators, custom CSS username badges, and smooth scrollbar auto-locking.
- 📑 Source Inspection: An interactive accordion lets developers and users inspect the exact transcript chunks retrieved from the vector database for every answer.
- 🛡️ Zero-Censorship & Fallback Safeguards: Configured with custom safety settings and whitespace validators to prevent blank or silently blocked chat responses.
- Frontend: Streamlit, Custom CSS3 (YouTube Dark Theme)
- Backend: Python 3.10+, FastAPI, Uvicorn, Pydantic
- AI & Orchestration: LangChain, Google Generative AI (
gemini-3.1-flash-lite,models/gemini-embedding-001) - Vector Database: FAISS (Facebook AI Similarity Search - CPU)
├── streamlit_app.py # Streamlit Frontend UI
├── app.py # FastAPI server & LangChain RAG pipeline
├── requirements.txt # Locked Python package dependencies
├── .env # Hidden API keys (Not tracked in Git)
├── .gitignore # Security and cache exclusion rules
└── .gitattributes # Forces GitHub to classify repo as 100% Python
## 💻 Running the Application
* Start the FastAPI backend server with auto-reload enabled:
* uvicorn app:app --port 8000 --reload
* Open your web browser and navigate to:
* streamlit run streamlit_app.py
(Start the Streamlit frontend)
* Paste a YouTube URL (e.g., https://www.youtube.com/watch?v=Gfr50f6ZBvo), click Connect Transcript, and start chatting with the AI!