# mariam-ebrahim/video_talky architecture

> Architecture diagram of the GitHub repository mariam-ebrahim/video_talky, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mariam-ebrahim/video_talky
- Repository: https://github.com/mariam-ebrahim/video_talky

## Overview

VidTalk is a Streamlit app that turns a YouTube link into a timestamped transcript and searchable video workspace. The main path fetches captions or falls back to audio transcription, then builds an index, sections, and summary; users can chat, take a quiz, find similar videos, jump to source times, and export PDFs. The README documents these product branches; some implementations were not excerpted, so only evidenced calls are connected. The model server is an external GPU service reached through the LLM client.

Main entry points: [`core/pipeline.py`](https://github.com/mariam-ebrahim/video_talky/blob/main/core/pipeline.py) (Video preparation), [`app.py`](https://github.com/mariam-ebrahim/video_talky/blob/main/app.py) (Streamlit entry), [`ui/workspace.py`](https://github.com/mariam-ebrahim/video_talky/blob/main/ui/workspace.py) (Video workspace), [`core/llm_json.py`](https://github.com/mariam-ebrahim/video_talky/blob/main/core/llm_json.py) (Structured responses)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Video workspace"]
  node_app["Streamlit entry<br/>[app.py]"]
  node_home["Link intake<br/>[home.py]"]
  node_state["Video session<br/>[state.py]"]
  node_workspace["Video workspace<br/>[workspace.py]"]
  node_chat_ui["Chat tab<br/>[chat_tab.py]"]
  node_summary_ui["Summary tab<br/>[summary_tab.py]"]
  node_quiz_ui["Quiz tab<br/>[quiz_tab.py]"]
  node_quiz_results["Quiz review<br/>[quiz_results.py]"]
  node_similar_ui["Similar tab<br/>[similar_tab.py]"]
  node_downloads["PDF downloads<br/>[downloads.py]"]
  node_sidebar["Video sidebar<br/>[sidebar.py]"]
end

subgraph group_processing["Video preparation"]
  node_pipeline["Video preparation<br/>[pipeline.py]"]
  node_transcript["Caption retrieval<br/>[transcript.py]"]
  node_audio["Audio acquisition<br/>[audio.py]"]
  node_speech["Whisper transcription<br/>[speech.py]"]
  node_chunker["Transcript chunking<br/>[chunker.py]"]
  node_rag[("Search index<br/>[rag.py]")]
  node_sections["Section generation<br/>[sections.py]"]
end

subgraph group_features["Learning features"]
  node_summary["Summary generation<br/>[summary.py]"]
  node_chat["Video-grounded chat<br/>[chat.py]"]
  node_quiz["Quiz generation<br/>[quiz.py]"]
  node_grading["Quiz grading<br/>[grading.py]"]
  node_similar["Related videos<br/>[similar.py]"]
  node_pdf["PDF formatting<br/>[pdf_export.py]"]
end

subgraph group_model["Model access"]
  node_llm_json["Structured responses<br/>[llm_json.py]"]
  node_llm_client["Model client<br/>[llm_client.py]"]
  node_llm_server["GPU model server<br/>[llm_server.py]"]
end

node_user(("Viewer"))
node_youtube(("YouTube"))
node_gpu(("Kaggle GPU"))

node_user -->|"opens app"| node_app
node_app -->|"routes UI"| node_home
node_app -->|"renders"| node_sidebar
node_app -->|"initializes"| node_state
node_app -->|"renders"| node_workspace
node_home -->|"processes link"| node_state
node_state -->|"processes video"| node_pipeline
node_pipeline -->|"fetches captions"| node_transcript
node_pipeline -->|"transcribes fallback"| node_speech
node_pipeline -->|"chunks transcript"| node_chunker
node_pipeline -->|"builds index"| node_rag
node_pipeline -->|"creates sections"| node_sections
node_pipeline -->|"creates summary"| node_summary
node_transcript -->|"fetches captions"| node_youtube
node_audio -->|"downloads audio"| node_youtube
node_speech -->|"gets audio"| node_audio
node_speech -->|"requests transcription"| node_llm_client
node_speech -->|"returns transcript"| node_transcript
node_workspace -->|"renders tab"| node_chat_ui
node_workspace -->|"renders tab"| node_summary_ui
node_workspace -->|"renders tab"| node_quiz_ui
node_workspace -->|"renders tab"| node_similar_ui
node_chat_ui -->|"asks question"| node_chat
node_chat -->|"retrieves context"| node_rag
node_chat -->|"requests answer"| node_llm_client
node_sections -->|"labels blocks"| node_llm_json
node_summary -->|"writes summary"| node_llm_json
node_quiz_ui -->|"starts quiz"| node_quiz
node_quiz -->|"generates questions"| node_llm_json
node_quiz_ui -->|"shows results"| node_quiz_results
node_quiz_results -->|"grades answers"| node_grading
node_quiz_results -->|"builds quiz PDF"| node_pdf
node_summary_ui -->|"builds summary PDF"| node_pdf
node_summary_ui -->|"offers download"| node_downloads
node_quiz_results -->|"offers download"| node_downloads
node_downloads -->|"creates file"| node_pdf
node_similar_ui -->|"finds related"| node_similar
node_similar -->|"formats results"| node_llm_json
node_llm_json -->|"requests JSON"| node_llm_client
node_llm_client -->|"sends API requests"| node_llm_server
node_llm_server -.->|"runs models"| node_gpu

click node_app "https://github.com/mariam-ebrahim/video_talky/blob/main/app.py"
click node_home "https://github.com/mariam-ebrahim/video_talky/blob/main/ui/home.py"
click node_state "https://github.com/mariam-ebrahim/video_talky/blob/main/ui/state.py"
click node_workspace "https://github.com/mariam-ebrahim/video_talky/blob/main/ui/workspace.py"
click node_chat_ui "https://github.com/mariam-ebrahim/video_talky/blob/main/ui/chat_tab.py"
click node_summary_ui "https://github.com/mariam-ebrahim/video_talky/blob/main/ui/summary_tab.py"
click node_quiz_ui "https://github.com/mariam-ebrahim/video_talky/blob/main/ui/quiz_tab.py"
click node_quiz_results "https://github.com/mariam-ebrahim/video_talky/blob/main/ui/quiz_results.py"
click node_similar_ui "https://github.com/mariam-ebrahim/video_talky/blob/main/ui/similar_tab.py"
click node_downloads "https://github.com/mariam-ebrahim/video_talky/blob/main/ui/downloads.py"
click node_sidebar "https://github.com/mariam-ebrahim/video_talky/blob/main/ui/sidebar.py"
click node_pipeline "https://github.com/mariam-ebrahim/video_talky/blob/main/core/pipeline.py"
click node_transcript "https://github.com/mariam-ebrahim/video_talky/blob/main/core/transcript.py"
click node_audio "https://github.com/mariam-ebrahim/video_talky/blob/main/core/audio.py"
click node_speech "https://github.com/mariam-ebrahim/video_talky/blob/main/core/speech.py"
click node_chunker "https://github.com/mariam-ebrahim/video_talky/blob/main/core/chunker.py"
click node_rag "https://github.com/mariam-ebrahim/video_talky/blob/main/core/rag.py"
click node_sections "https://github.com/mariam-ebrahim/video_talky/blob/main/core/sections.py"
click node_summary "https://github.com/mariam-ebrahim/video_talky/blob/main/core/summary.py"
click node_chat "https://github.com/mariam-ebrahim/video_talky/blob/main/core/chat.py"
click node_quiz "https://github.com/mariam-ebrahim/video_talky/blob/main/core/quiz.py"
click node_grading "https://github.com/mariam-ebrahim/video_talky/blob/main/core/grading.py"
click node_similar "https://github.com/mariam-ebrahim/video_talky/blob/main/core/similar.py"
click node_pdf "https://github.com/mariam-ebrahim/video_talky/blob/main/core/pdf_export.py"
click node_llm_json "https://github.com/mariam-ebrahim/video_talky/blob/main/core/llm_json.py"
click node_llm_client "https://github.com/mariam-ebrahim/video_talky/blob/main/core/llm_client.py"
click node_llm_server "https://github.com/mariam-ebrahim/video_talky/blob/main/core/llm_server.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_app,node_home,node_state,node_workspace,node_chat_ui,node_summary_ui,node_quiz_ui,node_quiz_results,node_similar_ui,node_downloads,node_sidebar,node_user toneBlue
class node_pipeline,node_transcript,node_audio,node_speech,node_chunker,node_rag,node_sections toneAmber
class node_summary,node_chat,node_quiz,node_grading,node_similar,node_pdf toneMint
class node_llm_json,node_llm_client,node_llm_server toneRose
class node_youtube,node_gpu toneIndigo
```

## Components

### Video workspace

- [Streamlit entry](https://github.com/mariam-ebrahim/video_talky/blob/main/app.py): `app.py`
- [Link intake](https://github.com/mariam-ebrahim/video_talky/blob/main/ui/home.py): `ui/home.py`
- [Video session](https://github.com/mariam-ebrahim/video_talky/blob/main/ui/state.py): `ui/state.py`
- [Video workspace](https://github.com/mariam-ebrahim/video_talky/blob/main/ui/workspace.py): `ui/workspace.py`
- [Chat tab](https://github.com/mariam-ebrahim/video_talky/blob/main/ui/chat_tab.py): `ui/chat_tab.py`
- [Summary tab](https://github.com/mariam-ebrahim/video_talky/blob/main/ui/summary_tab.py): `ui/summary_tab.py`
- [Quiz tab](https://github.com/mariam-ebrahim/video_talky/blob/main/ui/quiz_tab.py): `ui/quiz_tab.py`
- [Quiz review](https://github.com/mariam-ebrahim/video_talky/blob/main/ui/quiz_results.py): `ui/quiz_results.py`
- [Similar tab](https://github.com/mariam-ebrahim/video_talky/blob/main/ui/similar_tab.py): `ui/similar_tab.py`
- [PDF downloads](https://github.com/mariam-ebrahim/video_talky/blob/main/ui/downloads.py): `ui/downloads.py`
- [Video sidebar](https://github.com/mariam-ebrahim/video_talky/blob/main/ui/sidebar.py): `ui/sidebar.py`

### Video preparation

- [Video preparation](https://github.com/mariam-ebrahim/video_talky/blob/main/core/pipeline.py): `core/pipeline.py`
- [Caption retrieval](https://github.com/mariam-ebrahim/video_talky/blob/main/core/transcript.py): `core/transcript.py`
- [Audio acquisition](https://github.com/mariam-ebrahim/video_talky/blob/main/core/audio.py): `core/audio.py`
- [Whisper transcription](https://github.com/mariam-ebrahim/video_talky/blob/main/core/speech.py): `core/speech.py`
- [Transcript chunking](https://github.com/mariam-ebrahim/video_talky/blob/main/core/chunker.py): `core/chunker.py`
- [Search index](https://github.com/mariam-ebrahim/video_talky/blob/main/core/rag.py): `core/rag.py`
- [Section generation](https://github.com/mariam-ebrahim/video_talky/blob/main/core/sections.py): `core/sections.py`

### Learning features

- [Summary generation](https://github.com/mariam-ebrahim/video_talky/blob/main/core/summary.py): `core/summary.py`
- [Video-grounded chat](https://github.com/mariam-ebrahim/video_talky/blob/main/core/chat.py): `core/chat.py`
- [Quiz generation](https://github.com/mariam-ebrahim/video_talky/blob/main/core/quiz.py): `core/quiz.py`
- [Quiz grading](https://github.com/mariam-ebrahim/video_talky/blob/main/core/grading.py): `core/grading.py`
- [Related videos](https://github.com/mariam-ebrahim/video_talky/blob/main/core/similar.py): `core/similar.py`
- [PDF formatting](https://github.com/mariam-ebrahim/video_talky/blob/main/core/pdf_export.py): `core/pdf_export.py`

### Model access

- [Structured responses](https://github.com/mariam-ebrahim/video_talky/blob/main/core/llm_json.py): `core/llm_json.py`
- [Model client](https://github.com/mariam-ebrahim/video_talky/blob/main/core/llm_client.py): `core/llm_client.py`
- [GPU model server](https://github.com/mariam-ebrahim/video_talky/blob/main/core/llm_server.py): `core/llm_server.py`

### Other components

- **Viewer**
- **YouTube**
- **Kaggle GPU**

## Connections

- Viewer → Streamlit entry: opens app (evidence: `README.md`)
- Streamlit entry → Link intake: routes UI (evidence: `app.py`)
- Streamlit entry → Video sidebar: renders (evidence: `app.py`)
- Streamlit entry → Video session: initializes (evidence: `app.py`)
- Streamlit entry → Video workspace: renders (evidence: `app.py`)
- Link intake → Video session: processes link (evidence: `ui/state.py`)
- Video session → Video preparation: processes video (evidence: `ui/state.py`)
- Video preparation → Caption retrieval: fetches captions (evidence: `core/pipeline.py`)
- Video preparation → Whisper transcription: transcribes fallback (evidence: `core/pipeline.py`)
- Video preparation → Transcript chunking: chunks transcript (evidence: `core/pipeline.py`)
- Video preparation → Search index: builds index (evidence: `core/pipeline.py`)
- Video preparation → Section generation: creates sections (evidence: `core/pipeline.py`)
- Video preparation → Summary generation: creates summary (evidence: `core/pipeline.py`)
- Caption retrieval → YouTube: fetches captions (evidence: `README.md`)
- Audio acquisition → YouTube: downloads audio (evidence: `README.md`)
- Whisper transcription → Audio acquisition: gets audio (evidence: `core/speech.py`)
- Whisper transcription → Model client: requests transcription (evidence: `core/speech.py`)
- Whisper transcription → Caption retrieval: returns transcript (evidence: `core/speech.py`)
- Video workspace → Chat tab: renders tab (evidence: `ui/workspace.py`)
- Video workspace → Summary tab: renders tab (evidence: `ui/workspace.py`)
- Video workspace → Quiz tab: renders tab (evidence: `ui/workspace.py`)
- Video workspace → Similar tab: renders tab (evidence: `ui/workspace.py`)
- Chat tab → Video-grounded chat: asks question (evidence: `ui/chat_tab.py`)
- Video-grounded chat → Search index: retrieves context (evidence: `core/chat.py`)
- Video-grounded chat → Model client: requests answer (evidence: `core/chat.py`)
- Section generation → Structured responses: labels blocks (evidence: `core/sections.py`)
- Summary generation → Structured responses: writes summary (evidence: `core/summary.py`)
- Quiz tab → Quiz generation: starts quiz (evidence: `ui/quiz_tab.py`)
- Quiz generation → Structured responses: generates questions (evidence: `core/quiz.py`)
- Quiz tab → Quiz review: shows results (evidence: `ui/quiz_tab.py`)
- Quiz review → Quiz grading: grades answers (evidence: `ui/quiz_results.py`)
- Quiz review → PDF formatting: builds quiz PDF (evidence: `ui/quiz_results.py`)
- Summary tab → PDF formatting: builds summary PDF (evidence: `README.md`)
- Summary tab → PDF downloads: offers download (evidence: `README.md`)
- Quiz review → PDF downloads: offers download (evidence: `ui/quiz_results.py`)
- PDF downloads → PDF formatting: creates file (evidence: `ui/downloads.py`)
- Similar tab → Related videos: finds related (evidence: `README.md`)
- Related videos → Structured responses: formats results (evidence: `core/similar.py`)
- Structured responses → Model client: requests JSON (evidence: `core/llm_json.py`)
- Model client → GPU model server: sends API requests (evidence: `core/llm_client.py`)
- GPU model server → Kaggle GPU: runs models (evidence: `README.md`)
