RAG-powered video understanding with timestamp-grounded Q&A, dual-video comparison, and production-ready UX.
Landing page visual placeholder (asset from frontend/public)
ClipIQ transforms long YouTube videos into verifiable intelligence:
- executive summaries with key takeaways
- evidence-grounded chat answers
- clickable timestamps for instant seek
- dual-video analysis with scoped reasoning (Video A / Video B / both)
- history restore for continued sessions
- URL ingestion with transcript + metadata extraction
- adaptive chunking and vector indexing
- chat mode with grounded answers and timestamp sources
- summary generation with starter prompts
- side-by-side contrast map
- scope-aware chat routing for A-only, B-only, or both
- common-theme and comparative question handling
- optional study-mode workflow
- hybrid retrieval (self-query, dense, lexical, temporal expansion)
- timestamp alignment and chip-safe emission rules
- fallback handling for unsupported / out-of-scope queries
- transcript ingestion fallbacks for robust caption retrieval paths
- responsive desktop + mobile layouts
- smooth scrolling and route sync
- global toast alerts for system feedback
- paginated history views and session restore
User Input (URL / Question)
-> FastAPI Route Layer
-> RAG Pipeline (single or dual)
-> Transcript + Metadata + Chunking
-> Embeddings + Chroma persistent index
-> Hybrid Retrieval + Ranking + Grounding
-> LLM Response Policy + Formatting
-> Frontend Chat/Summary UI + Timestamp Seek
YoutubeRAGSystem/
backend/
app/
config.py
schemas.py
routes/
video.py
rag/
pipeline.py # single-video orchestration
multi_video_pipeline.py # dual-video orchestration
compare_service.py # compare service wiring
transcript.py # transcript + metadata ingestion
retriever.py # Chroma + retriever builders
retrieval_helpers.py # ranking/timestamp helper utilities
policy_helpers.py # route/policy classification helpers
embeddings.py # safe embedding wrapper + sanitization
main.py
requirements.txt
.env.example
frontend/
public/
ytlogo.svg
src/
components/
pages/
lib/
App.tsx
main.tsx
index.css
package.json
.env.example
notebooks/
README.md
pipeline.py: single-video processing, chat, summary, cleanupmulti_video_pipeline.py: dual-video retrieval, scope routing, compare chat generationtranscript.py: video ID parsing, metadata fetch, transcript extraction/fallback, chunk prepretriever.py: Chroma vectorstore create/load/delete + self-query retriever wiringretrieval_helpers.py: hybrid ranking, timestamp extraction/alignment, lexical fallbackpolicy_helpers.py: response policy classification (CHAT,RAG,SUMMARY)embeddings.py: embedding safety layer, input sanitization, retry robustness
GET /: root health messageGET /api/health: API health checkPOST /api/process: process single videoPOST /api/chat: single-video chatPOST /api/summary: single-video summaryPOST /api/compare: dual-video compare/chatPOST /api/check-technical: study suitability checkPOST /api/cleanup: remove session + persisted artifacts
- Python
3.11.x - Node.js
18+ - Ollama available locally for embedding model usage
- OpenRouter and Google API keys
cd backend
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000cd frontend
npm install
npm run devOpen http://localhost:3000.
Place values in backend/.env:
OPENROUTER_API_KEY: OpenRouter key for response generationOPENROUTER_MODEL: model identifier used by backendGOOGLE_API_KEY: YouTube Data API key for metadataHUGGINGFACEHUB_API_TOKEN: optional alternative model tokenOLLAMA_EMBEDDING_MODEL: local embedding model name (defaultbge-m3)FRONTEND_ORIGIN: CORS origin for frontendCHROMA_PERSIST_DIR: optional custom Chroma persistence path
- Check backend logs for network restrictions to YouTube endpoints.
- On Windows,
WinError 10013indicates firewall/proxy/socket blocking. - Run cleanup and reprocess the video after network access is restored.
- Telemetry is disabled in config/retriever paths.
- If warnings persist in stale envs, reinstall with pinned requirements and restart backend.
pip check
python -m py_compile app/rag/pipeline.py app/rag/multi_video_pipeline.py app/rag/transcript.py- Session state is kept in-memory by
session_id. - Vector indexes persist in backend
.chroma_db. - Cleanup endpoint supports deleting both session cache and persisted indexes.
- streaming responses for better perceived latency
- regression evaluation set for timestamp accuracy
- telemetry for retrieval quality and latency diagnostics
- optional external session store (Redis/DB)
https://github.com/XynaxDev/youtube-rag-system
Built with focused iteration on retrieval quality, grounding accuracy, and UX clarity.
UI collaboration credit: Shakshi.
