# snansrin/sonalore architecture

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

- Interactive diagram: https://gitdiagram.com/snansrin/sonalore
- Repository: https://github.com/snansrin/sonalore

## Overview

SonaLore is a local-first audio/video transcription and meeting-review application, delivered through a native Tk desktop and a compatible CLI. Users select media, run transcription (optionally with speaker separation and noise cleanup), then search, review, correct, summarize, and archive reports as offline HTML and transcript files. The graph preserves README-described archive, speaker, and local-AI capabilities. Some desktop and CLI excerpts are partial; uncertain internal links are omitted. External model services are shown only where the excerpts establish their use.

Main entry points: [`sonalore/cli.py`](https://github.com/snansrin/sonalore/blob/main/sonalore/cli.py) (CLI commands), [`sonalore/desktop.py`](https://github.com/snansrin/sonalore/blob/main/sonalore/desktop.py) (Studio desktop), [`sonalore/core.py`](https://github.com/snansrin/sonalore/blob/main/sonalore/core.py) (Transcription engine), [`sonalore/summary.py`](https://github.com/snansrin/sonalore/blob/main/sonalore/summary.py) (Meeting notes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_desktop["Studio desktop<br/>[desktop.py]"]
  node_cli["CLI commands<br/>[cli.py]"]
end

subgraph group_analysis["Media analysis"]
  node_pipeline["Transcription engine<br/>[core.py]"]
  node_runtime["Runtime checks<br/>[runtime.py]"]
  node_progress["Progress and cancel<br/>[progress.py]"]
  node_speakers["Speaker separation<br/>[speakers.py]"]
end

subgraph group_knowledge["Reports and review"]
  node_summary["Meeting notes<br/>[summary.py]"]
  node_report["HTML reports<br/>[report.py]"]
  node_editor["Transcript editor"]
  node_corrections["Correction workflow<br/>[corrections.py]"]
  node_review["Search and playback<br/>[review.py]"]
end

subgraph group_local["Local data and privacy"]
  node_archive[("Report archive<br/>[archive.py]")]
  node_privacy["Private data paths<br/>[privacy.py]"]
end

node_user(("User"))
node_media["Audio/video files"]
node_ollama["Local Ollama"]
node_whisper["Whisper models"]
node_pyannote["Pyannote models"]

node_user -->|"selects media"| node_desktop
node_user -->|"runs command"| node_cli
node_desktop -->|"launches job"| node_cli
node_cli -->|"reads files"| node_media
node_cli -->|"runs analysis"| node_pipeline
node_pipeline -->|"transcribes audio"| node_whisper
node_pipeline -->|"checks CUDA"| node_runtime
node_pipeline -->|"reports stages"| node_progress
node_cli -->|"prepares speakers"| node_speakers
node_speakers -.->|"uses diarization"| node_pyannote
node_cli -->|"creates notes"| node_summary
node_summary -->|"requests local notes"| node_ollama
node_cli -->|"renders report"| node_report
node_desktop -->|"manages reports"| node_archive
node_desktop -->|"opens editor"| node_editor
node_editor -->|"validates edits"| node_corrections
node_cli -->|"revises transcript"| node_corrections
node_corrections -->|"refreshes notes"| node_summary
node_corrections -->|"rerenders report"| node_report
node_desktop -->|"supports review"| node_review
node_review -->|"plays excerpts"| node_media
node_cli -->|"configures local data"| node_privacy
node_summary -->|"checks model"| node_privacy

click node_desktop "https://github.com/snansrin/sonalore/blob/main/sonalore/desktop.py"
click node_cli "https://github.com/snansrin/sonalore/blob/main/sonalore/cli.py"
click node_pipeline "https://github.com/snansrin/sonalore/blob/main/sonalore/core.py"
click node_runtime "https://github.com/snansrin/sonalore/blob/main/sonalore/runtime.py"
click node_progress "https://github.com/snansrin/sonalore/blob/main/sonalore/progress.py"
click node_speakers "https://github.com/snansrin/sonalore/blob/main/sonalore/speakers.py"
click node_summary "https://github.com/snansrin/sonalore/blob/main/sonalore/summary.py"
click node_report "https://github.com/snansrin/sonalore/blob/main/sonalore/report.py"
click node_editor "https://github.com/snansrin/sonalore/blob/main/sonalore/transcript_editor.py"
click node_corrections "https://github.com/snansrin/sonalore/blob/main/sonalore/corrections.py"
click node_review "https://github.com/snansrin/sonalore/blob/main/sonalore/review.py"
click node_archive "https://github.com/snansrin/sonalore/blob/main/sonalore/archive.py"
click node_privacy "https://github.com/snansrin/sonalore/blob/main/sonalore/privacy.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_desktop,node_cli,node_user toneBlue
class node_pipeline,node_runtime,node_progress,node_speakers toneAmber
class node_summary,node_report,node_editor,node_corrections,node_review toneMint
class node_archive,node_privacy toneRose
class node_media,node_ollama,node_whisper,node_pyannote toneIndigo
```

## Components

### User interfaces

- [Studio desktop](https://github.com/snansrin/sonalore/blob/main/sonalore/desktop.py): `sonalore/desktop.py`
- [CLI commands](https://github.com/snansrin/sonalore/blob/main/sonalore/cli.py): `sonalore/cli.py`

### Media analysis

- [Transcription engine](https://github.com/snansrin/sonalore/blob/main/sonalore/core.py): `sonalore/core.py`
- [Runtime checks](https://github.com/snansrin/sonalore/blob/main/sonalore/runtime.py): `sonalore/runtime.py`
- [Progress and cancel](https://github.com/snansrin/sonalore/blob/main/sonalore/progress.py): `sonalore/progress.py`
- [Speaker separation](https://github.com/snansrin/sonalore/blob/main/sonalore/speakers.py): `sonalore/speakers.py`

### Reports and review

- [Meeting notes](https://github.com/snansrin/sonalore/blob/main/sonalore/summary.py): `sonalore/summary.py`
- [HTML reports](https://github.com/snansrin/sonalore/blob/main/sonalore/report.py): `sonalore/report.py`
- [Transcript editor](https://github.com/snansrin/sonalore/blob/main/sonalore/transcript_editor.py): `sonalore/transcript_editor.py`
- [Correction workflow](https://github.com/snansrin/sonalore/blob/main/sonalore/corrections.py): `sonalore/corrections.py`
- [Search and playback](https://github.com/snansrin/sonalore/blob/main/sonalore/review.py): `sonalore/review.py`

### Local data and privacy

- [Report archive](https://github.com/snansrin/sonalore/blob/main/sonalore/archive.py): `sonalore/archive.py`
- [Private data paths](https://github.com/snansrin/sonalore/blob/main/sonalore/privacy.py): `sonalore/privacy.py`

### Other components

- **User**
- **Audio/video files**
- **Local Ollama**
- **Whisper models**
- **Pyannote models**

## Connections

- User → Studio desktop: selects media (evidence: `README.md`)
- User → CLI commands: runs command (evidence: `README.md`)
- Studio desktop → CLI commands: launches job (evidence: `sonalore/desktop.py`)
- CLI commands → Audio/video files: reads files (evidence: `sonalore/cli.py`)
- CLI commands → Transcription engine: runs analysis (evidence: `sonalore/cli.py`)
- Transcription engine → Whisper models: transcribes audio (evidence: `sonalore/core.py`)
- Transcription engine → Runtime checks: checks CUDA (evidence: `sonalore/core.py`)
- Transcription engine → Progress and cancel: reports stages (evidence: `sonalore/core.py`)
- CLI commands → Speaker separation: prepares speakers (evidence: `sonalore/cli.py`)
- Speaker separation → Pyannote models: uses diarization
- CLI commands → Meeting notes: creates notes (evidence: `sonalore/cli.py`)
- Meeting notes → Local Ollama: requests local notes (evidence: `sonalore/summary.py`)
- CLI commands → HTML reports: renders report (evidence: `sonalore/cli.py`)
- Studio desktop → Report archive: manages reports (evidence: `sonalore/desktop.py`)
- Studio desktop → Transcript editor: opens editor (evidence: `sonalore/desktop.py`)
- Transcript editor → Correction workflow: validates edits (evidence: `sonalore/transcript_editor.py`)
- CLI commands → Correction workflow: revises transcript (evidence: `sonalore/cli.py`)
- Correction workflow → Meeting notes: refreshes notes (evidence: `sonalore/corrections.py`)
- Correction workflow → HTML reports: rerenders report (evidence: `sonalore/corrections.py`)
- Studio desktop → Search and playback: supports review (evidence: `sonalore/desktop.py`)
- Search and playback → Audio/video files: plays excerpts (evidence: `sonalore/review.py`)
- CLI commands → Private data paths: configures local data (evidence: `sonalore/cli.py`)
- Meeting notes → Private data paths: checks model (evidence: `sonalore/summary.py`)
