# rr28yosizumi/ai_meeting_recorder architecture

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

- Interactive diagram: https://gitdiagram.com/rr28yosizumi/ai_meeting_recorder
- Repository: https://github.com/rr28yosizumi/ai_meeting_recorder

## Overview

##### Project type and purpose
- This is a desktop “full-stack” (single-executable) meeting-recorder application with a GUI front end, local audio capture & processing, Whisper-based transcription, and Google Gemini API-based summarization.

##### File structure
- Top level:
- ai_meeting_recorder.py / src/main.py → entry points
- setup.py, pyproject.toml, MANIFEST.in → packaging/build
- src/ → all application modules
- Inside src/:
- view.py, gui_control.py, controller.py → GUI and MVC controller
- model.py, ai_control.py, sound_control.py → core business logic
- resource_util.py, resource/ → static assets (logo) and I/O helpers
- setting.py → load/save YAML config
- main.py → application bootstrap
- No microservices—everything runs in one process, with background threads for recording and AI tasks.

##### README insights
- Uses sounddevice + FFMpeg for audio capture/mixing
- Uses Whisper (local) and Google Gemini API (remote)
- Data flow: user config → record WAV → (optionally) transcribe → summarize → save text
- Persistent state: init.yml (YAML)
- Multi-threaded operations for UI responsiveness

##### Main components
a. Frontend (GUI layer)
- view.py: Tkinter windows, splash, main UI
- gui_control.py: binds UI events to controller
b. Application Controller
- controller.py: orchestrates user commands, spawns threads
c. Core Logic / Model
- model.py: data structures (RecordingSession, Transcript, Summary)
- sound_control.py: handles audio capture via sounddevice, FFMpeg mix
- ai_control.py: calls Whisper library and Google-GenerativeAI SDK
d. Persistence & Resources
- setting.py: load/save init.yml
- resource_util.py + src/resource/: manage logos and static files
e. External Services & Libraries
- Sounddevice / FFMpeg (audio I/O)
- OpenAI Whisper (local transcription)
- Google Gemini API (remote summarization)
f. File System
- WAV output folder
- Text summary output folder
- init.yml (config)

##### Relationships & interactions
- User clicks “Record” in GUI → gui_control → controller
- controller → spawns RecordingThread (sound_control) → writes WAV
- User clicks “Transcribe & Summarize” → controller → spawns AIThread
- AIThread → ai_control.transcribe(wav) → Whisper
- AIThread → ai_control.summarize(text) → Gemini API
- On complete → controller → view shows/save dialog
- Persistence: setting.py saves/loads on startup/shutdown

##### Architectural patterns & design principles
- MVC: view / gui_control (View + Presenter) → controller (Controller) → model & services
- Single process with worker threads for I/O-bound tasks
- Dependency injection via module boundaries (e.g., ai_control hides API details)
- Configuration via YAML, not hard-coded

##### Elements
- Blue for internal modules
- Green for external services/APIs
- Yellow for file system / config files
- Threads: RecordingThread, AIThread

##### Detailed capture of essential elements
- Data flow end-to-end: User → GUI → Controller → Audio/AI → File System → User

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry Points
    subgraph "Entry Points"
        AIRecorder["ai_meeting_recorder.py"]:::internal
        MainSrc["src/main.py"]:::internal
    end

    %% Frontend (GUI Layer)
    subgraph "Frontend (GUI Layer)"
        View["view.py"]:::internal
        GUIControl["gui_control.py"]:::internal
    end

    %% Application Controller
    subgraph "Controller"
        Controller["controller.py"]:::internal
    end

    %% Core Logic / Model
    subgraph "Core Logic"
        Model["model.py"]:::internal
    end

    %% Audio Subsystem
    subgraph "Audio Subsystem"
        Sound["sound_control.py"]:::internal
        SoundDevice["Sounddevice + FFMpeg"]:::external
    end

    %% AI Subsystem
    subgraph "AI Subsystem"
        AIControl["ai_control.py"]:::internal
        Whisper["OpenAI Whisper"]:::external
        Gemini["Google Gemini API"]:::external
    end

    %% Persistence & Resources
    subgraph "Persistence & Resources"
        Setting["setting.py"]:::internal
        ResourceUtil["resource_util.py"]:::internal
        ResourceDir["resource/"]:::internal
    end

    %% File System
    subgraph "File System"
        InitYML(("init.yml")):::storage
        WAV(("WAV Output Folder")):::storage
        Text(("Text Summary Folder")):::storage
    end

    %% Packaging / Build Config
    subgraph "Packaging / Build Config"
        Setup["setup.py"]:::internal
        PyProject["pyproject.toml"]:::internal
        Manifest["MANIFEST.in"]:::internal
        Readme["Readme.md"]:::internal
        License["LICENSE"]:::internal
        GitIgnore[".gitignore"]:::internal
        ThirdParty["THIRD_PARTY_LICENSES"]:::internal
    end

    %% Connections
    AIRecorder -->|"bootstrap"| MainSrc
    MainSrc -->|"load config"| Setting
    Setting -->|"reads"| InitYML
    MainSrc --> View
    MainSrc --> Controller

    View -->|UI event| GUIControl
    GUIControl -->|command| Controller

    Controller -->|spawn RecordingThread| Sound
    Sound -->|uses| SoundDevice
    Sound -->|writes WAV| WAV

    Controller -->|spawn AIThread| AIControl
    AIControl -->|transcribe| Whisper
    Whisper -->|returns text| AIControl
    AIControl -->|summarize| Gemini
    Gemini -->|returns summary| AIControl
    AIControl -->|results| Controller
    Controller -->|display/save| Text

    MainSrc -->|resource init| ResourceUtil
    ResourceUtil --> ResourceDir

    Setting -->|writes| InitYML
    GUIControl -->|loads assets| ResourceUtil

    %% Click Events
    click View "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/src/view.py"
    click GUIControl "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/src/gui_control.py"
    click Controller "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/src/controller.py"
    click Model "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/src/model.py"
    click Sound "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/src/sound_control.py"
    click AIControl "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/src/ai_control.py"
    click Setting "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/src/setting.py"
    click ResourceUtil "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/src/resource_util.py"
    click ResourceDir "https://github.com/rr28yosizumi/ai_meeting_recorder/tree/main/src/resource/"
    click AIRecorder "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/ai_meeting_recorder.py"
    click MainSrc "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/src/main.py"
    click Setup "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/setup.py"
    click PyProject "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/pyproject.toml"
    click Manifest "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/MANIFEST.in"
    click Readme "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/Readme.md"
    click License "https://github.com/rr28yosizumi/ai_meeting_recorder/tree/main/LICENSE"
    click GitIgnore "https://github.com/rr28yosizumi/ai_meeting_recorder/blob/main/.gitignore"
    click ThirdParty "https://github.com/rr28yosizumi/ai_meeting_recorder/tree/main/THIRD_PARTY_LICENSES"

    %% Styles
    classDef internal fill:#D6EAF8,stroke:#2980B9,color:#000
    classDef external fill:#D5F5E3,stroke:#27AE60,color:#000
    classDef storage fill:#FCF3CF,stroke:#F1C40F,color:#000
```
