# hayabhay/frogbase architecture

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

- Interactive diagram: https://gitdiagram.com/hayabhay/frogbase
- Repository: https://github.com/hayabhay/frogbase

## Overview

FrogBase turns web URLs or local media into searchable, timestamped knowledge: users add media, FrogBase downloads or ingests it, generates captions, embeds segments, indexes them, and returns semantic-search results. The Streamlit UI exposes ingestion, search, media browsing, library management, and model settings. The README documents the major processing integrations; sampled source confirms the core orchestration and selected UI calls, but does not expose every implementation detail, so some documented subsystem links cite the README.

Main entry points: [`frogbase/core.py`](https://github.com/hayabhay/frogbase/blob/main/frogbase/core.py) (FrogBase Orchestrator), [`frogbase/models.py`](https://github.com/hayabhay/frogbase/blob/main/frogbase/models.py) (Transcribe and Embed), [`frogbase/media.py`](https://github.com/hayabhay/frogbase/blob/main/frogbase/media.py) (Media Ingestion), [`frogbase/captions.py`](https://github.com/hayabhay/frogbase/blob/main/frogbase/captions.py) (Caption Management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Streamlit UI"]
  node_home["Home and Search<br/>[01_🏠_Home.py]"]
  node_ui_config["UI Session Config<br/>[config.py]"]
  node_library_ui["Library Management<br/>[02_📚_Libraries.py]"]
  node_settings_ui["Model Settings UI<br/>[04_⚙️_Settings.py]"]
end

subgraph group_pipeline["Media Processing"]
  node_frogbase["FrogBase Orchestrator<br/>[core.py]"]
  node_media["Media Ingestion<br/>[media.py]"]
  node_config["Runtime Config<br/>[config.py]"]
end

subgraph group_knowledge["Captions and Search"]
  node_captions["Caption Management<br/>[captions.py]"]
  node_model_ops["Transcribe and Embed<br/>[models.py]"]
  node_vector_index["Vector Index<br/>[models.py]"]
end

subgraph group_state["Library State"]
  node_tinydb[("TinyDB Library<br/>[core.py]")]
end

node_user(("User"))
node_download_service{{"yt-dlp"}}
node_whisper{{"Whisper"}}
node_encoders{{"Sentence Transformers"}}
node_platforms(("Media Platforms"))

node_user -->|"uses"| node_home
node_home -->|"adds and searches"| node_frogbase
node_ui_config -->|"creates instance"| node_frogbase
node_library_ui -->|"resets session"| node_ui_config
node_settings_ui -->|"updates settings"| node_model_ops
node_frogbase -->|"ingests media"| node_media
node_platforms -->|"provides sources"| node_download_service
node_download_service -->|"downloads files"| node_media
node_media -.->|"stores metadata"| node_tinydb
node_frogbase -->|"transcribes and embeds"| node_model_ops
node_model_ops -->|"transcribes audio"| node_whisper
node_model_ops -->|"creates captions"| node_captions
node_model_ops -->|"embeds segments"| node_encoders
node_frogbase -->|"indexes embeddings"| node_vector_index
node_vector_index -->|"resolves results"| node_captions
node_captions -.->|"stores records"| node_tinydb
node_frogbase -->|"initializes library"| node_tinydb

click node_home "https://github.com/hayabhay/frogbase/blob/main/ui/01_%F0%9F%8F%A0_Home.py"
click node_ui_config "https://github.com/hayabhay/frogbase/blob/main/ui/config.py"
click node_library_ui "https://github.com/hayabhay/frogbase/blob/main/ui/pages/02_%F0%9F%93%9A_Libraries.py"
click node_settings_ui "https://github.com/hayabhay/frogbase/blob/main/ui/pages/04_%E2%9A%99%EF%B8%8F_Settings.py"
click node_frogbase "https://github.com/hayabhay/frogbase/blob/main/frogbase/core.py"
click node_media "https://github.com/hayabhay/frogbase/blob/main/frogbase/media.py"
click node_config "https://github.com/hayabhay/frogbase/blob/main/frogbase/config.py"
click node_captions "https://github.com/hayabhay/frogbase/blob/main/frogbase/captions.py"
click node_model_ops "https://github.com/hayabhay/frogbase/blob/main/frogbase/models.py"
click node_vector_index "https://github.com/hayabhay/frogbase/blob/main/frogbase/models.py"
click node_tinydb "https://github.com/hayabhay/frogbase/blob/main/frogbase/core.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_home,node_ui_config,node_library_ui,node_settings_ui,node_user toneBlue
class node_frogbase,node_media,node_config toneAmber
class node_captions,node_model_ops,node_vector_index toneMint
class node_tinydb toneRose
class node_download_service,node_whisper,node_encoders,node_platforms toneIndigo
```

## Components

### Streamlit UI

- [Home and Search](https://github.com/hayabhay/frogbase/blob/main/ui/01_%F0%9F%8F%A0_Home.py): `ui/01_🏠_Home.py`
- [UI Session Config](https://github.com/hayabhay/frogbase/blob/main/ui/config.py): `ui/config.py`
- [Library Management](https://github.com/hayabhay/frogbase/blob/main/ui/pages/02_%F0%9F%93%9A_Libraries.py): `ui/pages/02_📚_Libraries.py`
- [Model Settings UI](https://github.com/hayabhay/frogbase/blob/main/ui/pages/04_%E2%9A%99%EF%B8%8F_Settings.py): `ui/pages/04_⚙️_Settings.py`

### Media Processing

- [FrogBase Orchestrator](https://github.com/hayabhay/frogbase/blob/main/frogbase/core.py): `frogbase/core.py`
- [Media Ingestion](https://github.com/hayabhay/frogbase/blob/main/frogbase/media.py): `frogbase/media.py`
- [Runtime Config](https://github.com/hayabhay/frogbase/blob/main/frogbase/config.py): `frogbase/config.py`

### Captions and Search

- [Caption Management](https://github.com/hayabhay/frogbase/blob/main/frogbase/captions.py): `frogbase/captions.py`
- [Transcribe and Embed](https://github.com/hayabhay/frogbase/blob/main/frogbase/models.py): `frogbase/models.py`
- [Vector Index](https://github.com/hayabhay/frogbase/blob/main/frogbase/models.py): `frogbase/models.py`

### Library State

- [TinyDB Library](https://github.com/hayabhay/frogbase/blob/main/frogbase/core.py): `frogbase/core.py`

### Other components

- **User**
- **yt-dlp**
- **Whisper**
- **Sentence Transformers**
- **Media Platforms**

## Connections

- User → Home and Search: uses (evidence: `README.md`)
- Home and Search → FrogBase Orchestrator: adds and searches (evidence: `ui/01_🏠_Home.py`)
- UI Session Config → FrogBase Orchestrator: creates instance (evidence: `ui/config.py`)
- Library Management → UI Session Config: resets session (evidence: `ui/pages/02_📚_Libraries.py`)
- Model Settings UI → Transcribe and Embed: updates settings (evidence: `ui/pages/04_⚙️_Settings.py`)
- FrogBase Orchestrator → Media Ingestion: ingests media (evidence: `README.md`)
- Media Platforms → yt-dlp: provides sources (evidence: `README.md`)
- yt-dlp → Media Ingestion: downloads files (evidence: `README.md`)
- Media Ingestion → TinyDB Library: stores metadata (evidence: `frogbase/core.py`)
- FrogBase Orchestrator → Transcribe and Embed: transcribes and embeds (evidence: `frogbase/core.py`)
- Transcribe and Embed → Whisper: transcribes audio (evidence: `README.md`)
- Transcribe and Embed → Caption Management: creates captions (evidence: `frogbase/models.py`)
- Transcribe and Embed → Sentence Transformers: embeds segments (evidence: `README.md`)
- FrogBase Orchestrator → Vector Index: indexes embeddings (evidence: `README.md`)
- Vector Index → Caption Management: resolves results (evidence: `frogbase/core.py`)
- Caption Management → TinyDB Library: stores records (evidence: `frogbase/core.py`)
- FrogBase Orchestrator → TinyDB Library: initializes library (evidence: `frogbase/core.py`)
