Chat with any YouTube video. Paste a link → the backend fetches the transcript, uses Gemini Flash to segment it into topic-aware moments (definitions, examples, demo steps, comparisons, Q&A pairs), indexes those moments with LightRAG, and serves a streaming chat. Every answer is grounded in the transcript and ships with citation chips that seek the embedded YouTube player to the exact moment.
[YouTube URL] ──► transcript ──► 2-pass LLM segmentation ──► LightRAG (KG + vectors)
│
┌─────────────────────────────────┘
▼
hybrid retrieval ──► Gemini Flash / GPT-4o-mini (streamed) ──► chat UI
│
▼
click citation → seek video
| Layer | Choice |
|---|---|
| Frontend | React + TypeScript + Vite, plain CSS |
| Backend | FastAPI + SSE |
| Transcript | youtube-transcript-api |
| Segmenter | Gemini 2.5 Flash, structured output (2-pass) |
| RAG | LightRAG (HKUDS) — graph + vector hybrid |
| Embeddings | Gemini gemini-embedding-001 or OpenAI text-embedding-3-small (1536-dim, asymmetric task types) |
| LLM | Gemini 2.5 Flash or OpenAI gpt-4o-mini (per-video) |
# Backend
cd backend
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn app.main:app --reload --port 8000
# Frontend (in another terminal)
cd frontend
npm install
npm run dev # opens http://localhost:5173See backend/README.md and frontend/README.md for component-level docs.