How sreekar-2612/youtube-sage works
YT-Sage is a YouTube-transcript chat application. A user selects a model and submits a video URL; the frontend calls the FastAPI service, which loads and chunks the transcript, builds a retriever, and creates a session. Chat requests then use either conversational retrieval or agent mode, with session history maintained in memory. The frontend renders answers and session controls. The graph follows the shown endpoint wiring and module references; optional transcript fallbacks are shown separately, and unsampled agent internals are not inferred.
Main entry points: main.py Session API · App.jsx Application state · ChatPanel.jsx Chat panel · chains.py Conversational RAG
Components 18
Web interface
- Application state
frontend/src/App.jsx - Video source
frontend/src/components/Sidebar.jsx - Engine controls
frontend/src/components/EngineConfig.jsx - Chat panel
frontend/src/components/ChatPanel.jsx - Message card
frontend/src/components/MessageCard.jsx - Turn divider
frontend/src/components/TurnDivider.jsx - HTTP client
frontend/src/api.js
API and sessions
- Session API
backend/main.py - Runtime configuration
backend/src/config.py
Transcript indexing
- Transcript loader
backend/src/youtube_loader.py - Text chunking
backend/src/text_processing.py - Vector retrieval
backend/src/vectorstore.py
Answer generation
- Model provider
backend/src/llm_setup.py - Conversational RAG
backend/src/chains.py - Agent tools
backend/src/agent_tools.py
Other components
- User
- Transcript services
- Model APIs
Connections 19
- User → Application state: interacts
frontend/src/App.jsx - Application state → Video source: renders
frontend/src/App.jsx - Application state → Engine controls: renders
frontend/src/App.jsx - Application state → Chat panel: renders
frontend/src/App.jsx - Application state → HTTP client: requests
frontend/src/App.jsx - Chat panel → Message card: renders
frontend/src/components/ChatPanel.jsx - Chat panel → Turn divider: renders
frontend/src/components/ChatPanel.jsx - HTTP client → Session API: HTTP requests
frontend/src/api.js - Session API → Runtime configuration: reads settings
backend/main.py - Session API → Transcript loader: loads transcript
backend/main.py - Session API → Text chunking: splits documents
backend/main.py - Session API → Vector retrieval: builds retriever
backend/main.py - Session API → Model provider: selects model
backend/main.py - Session API → Conversational RAG: builds and invokes
backend/main.py - Session API → Agent tools: builds agent
backend/main.py - Conversational RAG → Vector retrieval: retrieves context
backend/src/chains.py - Session API → Conversational RAG: stores chat history
backend/main.py - Transcript loader → Transcript services: fallback fetch
backend/src/youtube_loader.py - Model provider → Model APIs: inference
backend/src/llm_setup.py