Drop a YouTube link or upload a video file. Get a transcript, summary, action items, key facts, and extracted questions — then chat with the video using RAG (Retrieval-Augmented Generation).
flowchart TB
Source["YouTube URL or Local File"] -->|"yt-dlp / pydub"| Audio["WAV chunks (10 min, 16kHz mono)"]
Audio -->|"faster-whisper (English)<br>Sarvam AI (Hindi → English)"| Transcript["Raw Transcript"]
Transcript -->|"RecursiveCharacterTextSplitter<br>(500 chars, 50 overlap)"| Chunks["Text Chunks"]
Chunks -->|"MistralAIEmbeddings<br>(mistral-embed)"| Chroma["ChromaDB Vector Store"]
Transcript -->|"Map-Reduce"| Summary["Summary<br>(mistral-small-2603)"]
Transcript -->|"LCEL Chain"| Actions["Action Items"]
Transcript -->|"LCEL Chain"| KeyInfo["Key Information"]
Transcript -->|"LCEL Chain"| Questions["Questions Raised"]
Chroma -->|"MMR Retrieval (k=4, fetch_k=10)"| RAG["RAG Chain (mistral-small-2603)"]
UserQ["User Question"] --> RAG
RAG -->|"Answer grounded in transcript"| Answer["Response"]
- Acquire — downloads YouTube audio via
yt-dlp, or converts uploaded/local files to 16kHz mono WAV, splits into 10-minute chunks - Transcribe — English via faster-whisper (local, CUDA, batched inference), Hindi via Sarvam AI (cloud, with translation)
- Analyze — LLM passes (Mistral) extract the title, summary (map-reduce), action items, key information, and questions
- Index — chunks the transcript, embeds with Mistral, stores in ChromaDB with MMR retrieval. The RAG chain answers questions grounded in the video
- Python 3.13+
- Node.js 18+ (for the frontend)
- ffmpeg (for audio processing —
brew install ffmpeg/apt install ffmpeg) - CUDA-capable GPU (optional — faster-whisper falls back to CPU)
git clone <repo-url>
cd "AI video assistant"
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtCreate a .env file in the project root:
MISTRAL_API_KEY=your-mistral-api-key
WHISPER_MODEL=turbo
SARVAM_API_KEY=your-sarvam-api-key # only needed for Hindi
SARVAM_STT_MODEL=saaras:v3Get a Mistral API key from console.mistral.ai. Sarvam is only required if you plan to transcribe Hindi audio.
cd UI
npm installuvicorn server:app --reloadRuns on http://localhost:8000. Swagger docs at http://localhost:8000/docs.
cd UI
npm run devRuns on http://localhost:5173. Calls the backend at http://localhost:8000.
CORS tip: Add a Vite proxy to sidestep CORS during development:
// UI/vite.config.ts export default defineConfig({ server: { proxy: { "/api": "http://localhost:8000" } }, // ... });Then set
VITE_API_URL=""in your environment or.envfile.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/upload |
Upload a video/audio file (multipart). Returns { file_id }. |
POST |
/api/process |
Start pipeline. Body: { source, language }. Returns { job_id, status }. |
GET |
/api/process/{id}/status |
Poll progress. Returns { job_id, status, progress? }. |
GET |
/api/process/{id}/results |
Get results. Returns { title, summary, actionables, questions, information }. |
POST |
/api/process/{id}/ask |
Chat with the video. Body: { question }. Returns { answer }. |
GET |
/api/jobs |
List all jobs (history). Returns { jobs: [...] }. |
DELETE |
/api/jobs/{id} |
Delete a job and its data. |
processing— pipeline is running, poll every 3sdone— results ready, RAG chain activeerror— something failed, check theerrorfield
The original CLI entry point still works:
python main.pyPrompts for a YouTube URL or local file path, runs the full pipeline, and starts an interactive chat session in the terminal.
python test.pyRuns the pipeline against a hardcoded YouTube video and prints the results.
| Layer | Technology |
|---|---|
| Backend framework | FastAPI |
| Job store | SQLite |
| Speech-to-text | faster-whisper (English), Sarvam AI (Hindi) |
| LLM | Mistral (mistral-small-2603) via LangChain |
| Embeddings | Mistral (mistral-embed) |
| Vector DB | ChromaDB |
| Audio | yt-dlp, pydub, ffmpeg |
| Frontend | React 18, TypeScript, Vite, Tailwind CSS 4, shadcn/ui, motion |
| RAG framework | LangChain (LCEL chains) |
.
├── server.py # FastAPI app + all endpoints
├── db.py # SQLite job store
├── main.py # CLI entry point
├── test.py # Hardcoded integration test
├── requirements.txt
├── .env # API keys (gitignored)
│
├── core/ # Pipeline modules (unchanged)
│ ├── transcriber.py # Whisper + Sarvam STT
│ ├── summarize.py # Map-reduce summary + title
│ ├── extractor.py # Action items, key info, questions
│ ├── rag_engine.py # ChromaDB + RAG chain
│ └── vector_store.py # Embeddings + retrieval
│
├── utils/
│ └── audio_processor.py # YouTube download, WAV conversion, chunking
│
├── UI/ # React frontend
│ ├── src/app/
│ │ ├── App.tsx
│ │ ├── lib/videoApi.ts
│ │ └── components/
│ │ ├── input-section.tsx
│ │ ├── processing-state.tsx
│ │ ├── results-section.tsx
│ │ ├── chat-panel.tsx
│ │ └── history-sidebar.tsx
│ └── package.json
│
└── vector_db/ # ChromaDB persistence (gitignored)