# vishesh162/video-lens architecture

> Architecture diagram of the GitHub repository vishesh162/video-lens, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vishesh162/video-lens
- Repository: https://github.com/vishesh162/video-lens

## Overview

Video Lens turns an uploaded recording or public YouTube link into a transcript, structured notes, transcript-grounded chat, and a downloadable PDF. The main path runs from the workspace through the HTTP job API and Python analysis pipeline; transcript retrieval and note generation are distinct stages. The graph also preserves the documented walkthrough and local YouTube setup. Some frontend-to-API details and unsampled analysis capabilities are documented rather than verified from source excerpts, so those links cite the README.

Main entry points: [`frontend/src/components/workspace.tsx`](https://github.com/vishesh162/video-lens/blob/main/frontend/src/components/workspace.tsx) (Analysis Workspace), [`main.py`](https://github.com/vishesh162/video-lens/blob/main/main.py) (Analysis Orchestrator), [`core/rag_engine.py`](https://github.com/vishesh162/video-lens/blob/main/core/rag_engine.py) (Transcript Q&A), [`api_server.py`](https://github.com/vishesh162/video-lens/blob/main/api_server.py) (HTTP Job API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Workspace UI"]
  node_workspace["Analysis Workspace<br/>[workspace.tsx]"]
  node_api_client["API Client<br/>[api.ts]"]
  node_notes_ui["Notes and Chat<br/>[notes-panel.tsx]"]
  node_chat_ui["Assistant Chat<br/>[assistant-chat.tsx]"]
  node_player["Video Player<br/>[video-player.tsx]"]
  node_pdf["PDF Export<br/>[notes.ts]"]
  node_walkthrough["Prepared Walkthrough<br/>[walkthrough.ts]"]
  node_youtube_guide["Local YouTube Guide"]
end

subgraph group_api["HTTP and Jobs"]
  node_http_api["HTTP Job API<br/>[api_server.py]"]
  node_upload["Streamed Upload<br/>[upload_stream.py]"]
end

subgraph group_analysis["Recording Analysis"]
  node_pipeline["Analysis Orchestrator<br/>[main.py]"]
  node_audio["Audio Preparation<br/>[audio_processor.py]"]
  node_transcription["Transcription<br/>[transcriber.py]"]
end

subgraph group_intelligence["Notes and Retrieval"]
  node_summary["Summary and Title<br/>[summarizer.py]"]
  node_extraction["Structured Findings<br/>[extractor.py]"]
  node_rag["Transcript Q&amp;A<br/>[rag_engine.py]"]
  node_search["Lexical Retrieval"]
  node_vector[("Vector Retrieval<br/>[vector_stores.py]")]
  node_llm["Chat Model Adapter<br/>[llm.py]"]
end

node_person(("Recording User"))
node_whisper["Whisper Service"]
node_sarvam["Sarvam Service"]
node_model_provider["Configured LLM Provider"]
node_youtube["YouTube"]

node_person -->|"uses"| node_workspace
node_workspace -->|"requests analysis"| node_api_client
node_api_client -->|"calls API"| node_http_api
node_workspace -->|"shows notes"| node_notes_ui
node_workspace -->|"shows chat"| node_chat_ui
node_workspace -->|"shows playback"| node_player
node_notes_ui -.->|"exports PDF"| node_pdf
node_workspace -->|"offers walkthrough"| node_walkthrough
node_person -->|"opens setup guide"| node_youtube_guide
node_http_api -->|"streams recording"| node_upload
node_http_api -->|"runs analysis"| node_pipeline
node_pipeline -->|"prepares source"| node_audio
node_pipeline -->|"transcribes chunks"| node_transcription
node_pipeline -->|"generates notes"| node_summary
node_pipeline -->|"extracts findings"| node_extraction
node_pipeline -->|"builds Q&amp;A"| node_rag
node_audio -->|"downloads audio"| node_youtube
node_transcription -->|"transcribes English"| node_whisper
node_transcription -->|"transcribes Hinglish"| node_sarvam
node_summary -->|"uses model"| node_llm
node_extraction -->|"uses model"| node_llm
node_rag -->|"generates answers"| node_llm
node_rag -->|"retrieves passages"| node_search
node_rag -.->|"uses optional store"| node_vector
node_llm -.->|"calls configured API"| node_model_provider
node_http_api -->|"answers chat"| node_rag

click node_workspace "https://github.com/vishesh162/video-lens/blob/main/frontend/src/components/workspace.tsx"
click node_api_client "https://github.com/vishesh162/video-lens/blob/main/frontend/src/lib/api.ts"
click node_notes_ui "https://github.com/vishesh162/video-lens/blob/main/frontend/src/components/notes-panel.tsx"
click node_chat_ui "https://github.com/vishesh162/video-lens/blob/main/frontend/src/components/assistant-chat.tsx"
click node_player "https://github.com/vishesh162/video-lens/blob/main/frontend/src/components/video-player.tsx"
click node_pdf "https://github.com/vishesh162/video-lens/blob/main/frontend/src/lib/notes.ts"
click node_walkthrough "https://github.com/vishesh162/video-lens/blob/main/frontend/src/lib/walkthrough.ts"
click node_youtube_guide "https://github.com/vishesh162/video-lens/blob/main/frontend/src/components/youtube-local-guide.tsx"
click node_http_api "https://github.com/vishesh162/video-lens/blob/main/api_server.py"
click node_upload "https://github.com/vishesh162/video-lens/blob/main/utils/upload_stream.py"
click node_pipeline "https://github.com/vishesh162/video-lens/blob/main/main.py"
click node_audio "https://github.com/vishesh162/video-lens/blob/main/utils/audio_processor.py"
click node_transcription "https://github.com/vishesh162/video-lens/blob/main/core/transcriber.py"
click node_summary "https://github.com/vishesh162/video-lens/blob/main/core/summarizer.py"
click node_extraction "https://github.com/vishesh162/video-lens/blob/main/core/extractor.py"
click node_rag "https://github.com/vishesh162/video-lens/blob/main/core/rag_engine.py"
click node_search "https://github.com/vishesh162/video-lens/blob/main/core/transcript_search.py"
click node_vector "https://github.com/vishesh162/video-lens/blob/main/core/vector_stores.py"
click node_llm "https://github.com/vishesh162/video-lens/blob/main/core/llm.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_workspace,node_api_client,node_notes_ui,node_chat_ui,node_player,node_pdf,node_walkthrough,node_youtube_guide,node_person toneBlue
class node_http_api,node_upload toneAmber
class node_pipeline,node_audio,node_transcription toneMint
class node_summary,node_extraction,node_rag,node_search,node_vector,node_llm toneRose
class node_whisper,node_sarvam,node_model_provider,node_youtube toneIndigo
```

## Components

### Workspace UI

- [Analysis Workspace](https://github.com/vishesh162/video-lens/blob/main/frontend/src/components/workspace.tsx): `frontend/src/components/workspace.tsx`
- [API Client](https://github.com/vishesh162/video-lens/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [Notes and Chat](https://github.com/vishesh162/video-lens/blob/main/frontend/src/components/notes-panel.tsx): `frontend/src/components/notes-panel.tsx`
- [Assistant Chat](https://github.com/vishesh162/video-lens/blob/main/frontend/src/components/assistant-chat.tsx): `frontend/src/components/assistant-chat.tsx`
- [Video Player](https://github.com/vishesh162/video-lens/blob/main/frontend/src/components/video-player.tsx): `frontend/src/components/video-player.tsx`
- [PDF Export](https://github.com/vishesh162/video-lens/blob/main/frontend/src/lib/notes.ts): `frontend/src/lib/notes.ts`
- [Prepared Walkthrough](https://github.com/vishesh162/video-lens/blob/main/frontend/src/lib/walkthrough.ts): `frontend/src/lib/walkthrough.ts`
- [Local YouTube Guide](https://github.com/vishesh162/video-lens/blob/main/frontend/src/components/youtube-local-guide.tsx): `frontend/src/components/youtube-local-guide.tsx`

### HTTP and Jobs

- [HTTP Job API](https://github.com/vishesh162/video-lens/blob/main/api_server.py): `api_server.py`
- [Streamed Upload](https://github.com/vishesh162/video-lens/blob/main/utils/upload_stream.py): `utils/upload_stream.py`

### Recording Analysis

- [Analysis Orchestrator](https://github.com/vishesh162/video-lens/blob/main/main.py): `main.py`
- [Audio Preparation](https://github.com/vishesh162/video-lens/blob/main/utils/audio_processor.py): `utils/audio_processor.py`
- [Transcription](https://github.com/vishesh162/video-lens/blob/main/core/transcriber.py): `core/transcriber.py`

### Notes and Retrieval

- [Summary and Title](https://github.com/vishesh162/video-lens/blob/main/core/summarizer.py): `core/summarizer.py`
- [Structured Findings](https://github.com/vishesh162/video-lens/blob/main/core/extractor.py): `core/extractor.py`
- [Transcript Q&A](https://github.com/vishesh162/video-lens/blob/main/core/rag_engine.py): `core/rag_engine.py`
- [Lexical Retrieval](https://github.com/vishesh162/video-lens/blob/main/core/transcript_search.py): `core/transcript_search.py`
- [Vector Retrieval](https://github.com/vishesh162/video-lens/blob/main/core/vector_stores.py): `core/vector_stores.py`
- [Chat Model Adapter](https://github.com/vishesh162/video-lens/blob/main/core/llm.py): `core/llm.py`

### Other components

- **Recording User**
- **Whisper Service**
- **Sarvam Service**
- **Configured LLM Provider**
- **YouTube**

## Connections

- Recording User → Analysis Workspace: uses (evidence: `README.md`)
- Analysis Workspace → API Client: requests analysis (evidence: `README.md`)
- API Client → HTTP Job API: calls API (evidence: `README.md`)
- Analysis Workspace → Notes and Chat: shows notes (evidence: `frontend/src/components/workspace.tsx`)
- Analysis Workspace → Assistant Chat: shows chat (evidence: `frontend/src/components/workspace.tsx`)
- Analysis Workspace → Video Player: shows playback (evidence: `frontend/src/components/workspace.tsx`)
- Notes and Chat → PDF Export: exports PDF
- Analysis Workspace → Prepared Walkthrough: offers walkthrough (evidence: `README.md`)
- Recording User → Local YouTube Guide: opens setup guide (evidence: `README.md`)
- HTTP Job API → Streamed Upload: streams recording (evidence: `api_server.py`)
- HTTP Job API → Analysis Orchestrator: runs analysis (evidence: `api_server.py`)
- Analysis Orchestrator → Audio Preparation: prepares source (evidence: `main.py`)
- Analysis Orchestrator → Transcription: transcribes chunks (evidence: `main.py`)
- Analysis Orchestrator → Summary and Title: generates notes (evidence: `main.py`)
- Analysis Orchestrator → Structured Findings: extracts findings (evidence: `main.py`)
- Analysis Orchestrator → Transcript Q&A: builds Q&A (evidence: `main.py`)
- Audio Preparation → YouTube: downloads audio (evidence: `utils/audio_processor.py`)
- Transcription → Whisper Service: transcribes English (evidence: `core/transcriber.py`)
- Transcription → Sarvam Service: transcribes Hinglish (evidence: `core/transcriber.py`)
- Summary and Title → Chat Model Adapter: uses model (evidence: `core/summarizer.py`)
- Structured Findings → Chat Model Adapter: uses model (evidence: `core/extractor.py`)
- Transcript Q&A → Chat Model Adapter: generates answers (evidence: `core/rag_engine.py`)
- Transcript Q&A → Lexical Retrieval: retrieves passages (evidence: `core/rag_engine.py`)
- Transcript Q&A → Vector Retrieval: uses optional store (evidence: `core/rag_engine.py`)
- Chat Model Adapter → Configured LLM Provider: calls configured API
- HTTP Job API → Transcript Q&A: answers chat (evidence: `api_server.py`)
