# praveensaharan/takumi-no-koe architecture

> Architecture diagram of the GitHub repository praveensaharan/takumi-no-koe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/praveensaharan/takumi-no-koe
- Repository: https://github.com/praveensaharan/takumi-no-koe

## Overview

Takumi no Koe captures factory know-how through a veteran interview, routes proposed claims through human approval and verification, then answers staff questions only from approved claims—or routes unanswered questions back to the veteran. The graph follows the browser-to-server workflow and includes the interview, approval, answer, and manual-gap stages. Source excerpts show key gates, storage, and live-session behavior; some API wiring is documented only in the README, so those links cite it. Unsampled implementation details are not inferred beyond those documented relationships.

Main entry points: [`takumi/tools.py`](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/tools.py) (Mode-specific tools), [`takumi/app.py`](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/app.py) (FastAPI app), [`takumi/bridge.py`](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/bridge.py) (Live WebSocket bridge), [`web/app.js`](https://github.com/praveensaharan/takumi-no-koe/blob/main/web/app.js) (Interview and ask UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Browser experience"]
  node_webapp["Interview and ask UI<br/>[app.js]"]
  node_webaudio["Browser audio<br/>[audio.js]"]
  node_home["Entry screens<br/>[home.js]"]
end

subgraph group_sessions["Live sessions"]
  node_api["FastAPI app<br/>[app.py]"]
  node_bridge["Live WebSocket bridge<br/>[bridge.py]"]
  node_turn["Conversation state<br/>[turn.py]"]
  node_audio["Audio processing<br/>[audio.py]"]
end

subgraph group_knowledge["Knowledge workflow"]
  node_tools["Mode-specific tools<br/>[tools.py]"]
  node_gates["Evidence gates<br/>[gates.py]"]
  node_approval["Human approval<br/>[app.py]"]
  node_gap["Manual gap check<br/>[gap.py]"]
  node_prompts["Session prompts<br/>[prompts.py]"]
end

subgraph group_services["Models and storage"]
  node_store[("Claims and event store<br/>[store.py]")]
  node_settings["Runtime settings<br/>[config.py]"]
  node_live{{"Gemini Live"}}
  node_flash{{"Gemini Flash"}}
  node_search{{"Google Search"}}
end

node_veteran(("Veteran"))
node_worker(("Factory worker"))

node_veteran -->|"interviews and approves"| node_webapp
node_worker -->|"asks by voice"| node_webapp
node_webapp -->|"captures audio"| node_webaudio
node_webapp -->|"uses HTTP and WebSocket"| node_api
node_home -->|"loads app pages"| node_api
node_api -->|"runs live session"| node_bridge
node_api -->|"serves state and decisions"| node_store
node_api -->|"loads configuration"| node_settings
node_api -->|"checks approved claims"| node_gap
node_bridge -->|"streams session data"| node_live
node_bridge -->|"runs tool calls"| node_tools
node_bridge -->|"updates conversation state"| node_turn
node_bridge -->|"uses audio helpers"| node_audio
node_tools -->|"verifies claims and citations"| node_gates
node_tools -->|"records claims and questions"| node_store
node_tools -->|"checks heard speech"| node_turn
node_tools -->|"sets model guidance"| node_prompts
node_tools -->|"requests expert reference notes"| node_flash
node_tools -.->|"researches interview topics"| node_search
node_approval -->|"records human decision"| node_store
node_approval -->|"starts post-approval check"| node_gap
node_gap -->|"checks manual coverage"| node_flash
node_gap -->|"validates manual quote"| node_gates
node_store -->|"writes voice clips"| node_audio

click node_webapp "https://github.com/praveensaharan/takumi-no-koe/blob/main/web/app.js"
click node_webaudio "https://github.com/praveensaharan/takumi-no-koe/blob/main/web/audio.js"
click node_home "https://github.com/praveensaharan/takumi-no-koe/blob/main/web/home.js"
click node_api "https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/app.py"
click node_bridge "https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/bridge.py"
click node_turn "https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/turn.py"
click node_audio "https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/audio.py"
click node_tools "https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/tools.py"
click node_gates "https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/gates.py"
click node_approval "https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/app.py"
click node_gap "https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/gap.py"
click node_prompts "https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/prompts.py"
click node_store "https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/store.py"
click node_settings "https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/config.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_webapp,node_webaudio,node_home toneBlue
class node_api,node_bridge,node_turn,node_audio toneAmber
class node_tools,node_gates,node_approval,node_gap,node_prompts toneMint
class node_store,node_settings,node_live,node_flash,node_search,node_worker toneRose
class node_veteran toneIndigo
```

## Components

### Browser experience

- [Interview and ask UI](https://github.com/praveensaharan/takumi-no-koe/blob/main/web/app.js): `web/app.js`
- [Browser audio](https://github.com/praveensaharan/takumi-no-koe/blob/main/web/audio.js): `web/audio.js`
- [Entry screens](https://github.com/praveensaharan/takumi-no-koe/blob/main/web/home.js): `web/home.js`

### Live sessions

- [FastAPI app](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/app.py): `takumi/app.py`
- [Live WebSocket bridge](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/bridge.py): `takumi/bridge.py`
- [Conversation state](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/turn.py): `takumi/turn.py`
- [Audio processing](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/audio.py): `takumi/audio.py`

### Knowledge workflow

- [Mode-specific tools](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/tools.py): `takumi/tools.py`
- [Evidence gates](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/gates.py): `takumi/gates.py`
- [Human approval](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/app.py): `takumi/app.py`
- [Manual gap check](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/gap.py): `takumi/gap.py`
- [Session prompts](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/prompts.py): `takumi/prompts.py`

### Models and storage

- [Claims and event store](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/store.py): `takumi/store.py`
- [Runtime settings](https://github.com/praveensaharan/takumi-no-koe/blob/main/takumi/config.py): `takumi/config.py`
- **Gemini Live**
- **Gemini Flash**
- **Google Search**

### Other components

- **Veteran**
- **Factory worker**

## Connections

- Veteran → Interview and ask UI: interviews and approves (evidence: `README.md`)
- Factory worker → Interview and ask UI: asks by voice (evidence: `README.md`)
- Interview and ask UI → Browser audio: captures audio (evidence: `README.md`)
- Interview and ask UI → FastAPI app: uses HTTP and WebSocket (evidence: `README.md`)
- Entry screens → FastAPI app: loads app pages (evidence: `README.md`)
- FastAPI app → Live WebSocket bridge: runs live session (evidence: `takumi/app.py`)
- FastAPI app → Claims and event store: serves state and decisions (evidence: `takumi/app.py`)
- FastAPI app → Runtime settings: loads configuration (evidence: `takumi/app.py`)
- FastAPI app → Manual gap check: checks approved claims (evidence: `takumi/app.py`)
- Live WebSocket bridge → Gemini Live: streams session data (evidence: `README.md`)
- Live WebSocket bridge → Mode-specific tools: runs tool calls (evidence: `README.md`)
- Live WebSocket bridge → Conversation state: updates conversation state (evidence: `takumi/bridge.py`)
- Live WebSocket bridge → Audio processing: uses audio helpers (evidence: `takumi/bridge.py`)
- Mode-specific tools → Evidence gates: verifies claims and citations (evidence: `takumi/tools.py`)
- Mode-specific tools → Claims and event store: records claims and questions (evidence: `takumi/tools.py`)
- Mode-specific tools → Conversation state: checks heard speech (evidence: `takumi/tools.py`)
- Mode-specific tools → Session prompts: sets model guidance (evidence: `takumi/tools.py`)
- Mode-specific tools → Gemini Flash: requests expert reference notes (evidence: `README.md`)
- Mode-specific tools → Google Search: researches interview topics (evidence: `README.md`)
- Human approval → Claims and event store: records human decision (evidence: `takumi/app.py`)
- Human approval → Manual gap check: starts post-approval check (evidence: `takumi/app.py`)
- Manual gap check → Gemini Flash: checks manual coverage (evidence: `takumi/gap.py`)
- Manual gap check → Evidence gates: validates manual quote (evidence: `takumi/gap.py`)
- Claims and event store → Audio processing: writes voice clips (evidence: `takumi/store.py`)
