# otissy/parakeet-flow architecture

> Architecture diagram of the GitHub repository otissy/parakeet-flow, 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/otissy/parakeet-flow
- Repository: https://github.com/otissy/parakeet-flow

## Overview

Parakeet Flow is a local-first Windows dictation app: a user holds a hotkey, speaks, watches live recognition, then releases to produce cleaned and punctuated text in the focused app—or saves it as a note when note mode or safe routing applies. The main process coordinates capture, recognition, session processing, and insertion. Major branches include local AI cleanup/translation, per-app tone and slang dictionaries, settings/UI, and note export/sync and MCP access. Some wiring is documented only in the README or SOURCE INDEX; dashed links mark optional integrations.

Main entry points: [`src/main/main.js`](https://github.com/otissy/parakeet-flow/blob/master/src/main/main.js) (Electron main), [`src/core/session.js`](https://github.com/otissy/parakeet-flow/blob/master/src/core/session.js) (Dictation session), [`src/main/controller.js`](https://github.com/otissy/parakeet-flow/blob/master/src/main/controller.js) (Dictation controller), [`src/notes/service.js`](https://github.com/otissy/parakeet-flow/blob/master/src/notes/service.js) (Note service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and controls"]
  node_main["Electron main<br/>[main.js]"]
  node_controller["Dictation controller<br/>[controller.js]"]
  node_renderer["Windows and pill UI<br/>[app.js]"]
  node_settings[("Settings and history<br/>[settings.js]")]
end

subgraph group_speech["Speech pipeline"]
  node_microphone["Microphone capture<br/>[mic.js]"]
  node_asrhost["ASR host<br/>[asr-host.js]"]
  node_asrworker["ASR worker<br/>[asr-worker.js]"]
  node_segmenter["Speech segmenter<br/>[segmenter.js]"]
  node_sherpa["Sherpa Parakeet engine<br/>[engine-sherpa.js]"]
  node_modelstore["Speech model store<br/>[model-store.js]"]
end

subgraph group_text["Text processing"]
  node_session["Dictation session<br/>[session.js]"]
  node_live["Live text processing<br/>[live-typer.js]"]
  node_postprocess["Text cleanup and tone<br/>[postprocess.js]"]
  node_routing["Type or note routing<br/>[routing.js]"]
  node_slang["Slang dictionary<br/>[service.js]"]
  node_matcher["Slang matcher<br/>[matcher.js]"]
end

subgraph group_notes["Notes and sharing"]
  node_noteservice["Note service<br/>[service.js]"]
  node_outbox[("Notes outbox<br/>[outbox.js]")]
  node_markdown["Markdown export<br/>[export-md.js]"]
  node_notion["Notion sync<br/>[notion.js]"]
  node_mcp["MCP notes server<br/>[server.js]"]
  node_notionservice["Notion service connector<br/>[service.js]"]
end

subgraph group_integration["Local integrations"]
  node_llm["Local AI cleanup<br/>[cleanup.js]"]
  node_llmhost["Local AI worker<br/>[llm-host.js]"]
  node_typer["Windows text insertion<br/>[win32-typer.js]"]
end

node_user(("Speaker"))
node_target["Focused app"]

node_user -->|"speaks into"| node_microphone
node_user -->|"presses hotkey"| node_controller
node_main -->|"constructs"| node_controller
node_main -->|"wires"| node_microphone
node_main -->|"starts"| node_asrhost
node_main -->|"loads model"| node_modelstore
node_main -->|"creates worker"| node_llmhost
node_main -->|"reads and updates"| node_settings
node_main -.->|"serves windows"| node_renderer
node_controller -->|"creates session"| node_session
node_controller -->|"routes dictation"| node_routing
node_controller -->|"gets matcher"| node_slang
node_controller -.->|"saves note"| node_noteservice
node_asrhost -.->|"dispatches audio"| node_asrworker
node_asrworker -->|"uses"| node_segmenter
node_asrworker -->|"decodes with"| node_sherpa
node_session -->|"updates transcript"| node_live
node_session -->|"requests cleanup"| node_llm
node_session -->|"cleans text"| node_postprocess
node_live -->|"inserts text"| node_typer
node_live -->|"prepares text"| node_postprocess
node_session -->|"applies terms"| node_slang
node_slang -->|"compiles packs"| node_matcher
node_typer -->|"types into"| node_target
node_llm -.->|"uses local runtime"| node_llmhost
node_session -.->|"emits note"| node_noteservice
node_noteservice -->|"writes notes"| node_outbox
node_noteservice -->|"exports notes"| node_markdown
node_noteservice -->|"submits optional sync"| node_notion
node_main -->|"configures notes"| node_noteservice
node_notionservice -.->|"shares note storage"| node_outbox
node_mcp -->|"reads and updates"| node_outbox
node_renderer -.->|"uses app controls"| node_main

click node_main "https://github.com/otissy/parakeet-flow/blob/master/src/main/main.js"
click node_controller "https://github.com/otissy/parakeet-flow/blob/master/src/main/controller.js"
click node_renderer "https://github.com/otissy/parakeet-flow/blob/master/src/renderer/app.js"
click node_settings "https://github.com/otissy/parakeet-flow/blob/master/src/main/settings.js"
click node_microphone "https://github.com/otissy/parakeet-flow/blob/master/src/main/mic.js"
click node_asrhost "https://github.com/otissy/parakeet-flow/blob/master/src/asr/asr-host.js"
click node_asrworker "https://github.com/otissy/parakeet-flow/blob/master/src/asr/asr-worker.js"
click node_segmenter "https://github.com/otissy/parakeet-flow/blob/master/src/asr/segmenter.js"
click node_sherpa "https://github.com/otissy/parakeet-flow/blob/master/src/asr/engine-sherpa.js"
click node_modelstore "https://github.com/otissy/parakeet-flow/blob/master/src/asr/model-store.js"
click node_session "https://github.com/otissy/parakeet-flow/blob/master/src/core/session.js"
click node_live "https://github.com/otissy/parakeet-flow/blob/master/src/core/live-typer.js"
click node_postprocess "https://github.com/otissy/parakeet-flow/blob/master/src/core/postprocess.js"
click node_routing "https://github.com/otissy/parakeet-flow/blob/master/src/core/routing.js"
click node_slang "https://github.com/otissy/parakeet-flow/blob/master/src/slang/service.js"
click node_matcher "https://github.com/otissy/parakeet-flow/blob/master/src/slang/matcher.js"
click node_llm "https://github.com/otissy/parakeet-flow/blob/master/src/llm/cleanup.js"
click node_llmhost "https://github.com/otissy/parakeet-flow/blob/master/src/llm/llm-host.js"
click node_typer "https://github.com/otissy/parakeet-flow/blob/master/src/typer/win32-typer.js"
click node_noteservice "https://github.com/otissy/parakeet-flow/blob/master/src/notes/service.js"
click node_outbox "https://github.com/otissy/parakeet-flow/blob/master/src/notes/outbox.js"
click node_markdown "https://github.com/otissy/parakeet-flow/blob/master/src/notes/export-md.js"
click node_notion "https://github.com/otissy/parakeet-flow/blob/master/src/notes/notion.js"
click node_mcp "https://github.com/otissy/parakeet-flow/blob/master/mcp/server.js"
click node_notionservice "https://github.com/otissy/parakeet-flow/blob/master/src/notes/service.js"

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_main,node_controller,node_renderer,node_settings toneBlue
class node_microphone,node_asrhost,node_asrworker,node_segmenter,node_sherpa,node_modelstore toneAmber
class node_session,node_live,node_postprocess,node_routing,node_slang,node_matcher toneMint
class node_noteservice,node_outbox,node_markdown,node_notion,node_mcp,node_notionservice toneRose
class node_llm,node_llmhost,node_typer,node_user,node_target toneIndigo
```

## Components

### App and controls

- [Electron main](https://github.com/otissy/parakeet-flow/blob/master/src/main/main.js): `src/main/main.js`
- [Dictation controller](https://github.com/otissy/parakeet-flow/blob/master/src/main/controller.js): `src/main/controller.js`
- [Windows and pill UI](https://github.com/otissy/parakeet-flow/blob/master/src/renderer/app.js): `src/renderer/app.js`
- [Settings and history](https://github.com/otissy/parakeet-flow/blob/master/src/main/settings.js): `src/main/settings.js`

### Speech pipeline

- [Microphone capture](https://github.com/otissy/parakeet-flow/blob/master/src/main/mic.js): `src/main/mic.js`
- [ASR host](https://github.com/otissy/parakeet-flow/blob/master/src/asr/asr-host.js): `src/asr/asr-host.js`
- [ASR worker](https://github.com/otissy/parakeet-flow/blob/master/src/asr/asr-worker.js): `src/asr/asr-worker.js`
- [Speech segmenter](https://github.com/otissy/parakeet-flow/blob/master/src/asr/segmenter.js): `src/asr/segmenter.js`
- [Sherpa Parakeet engine](https://github.com/otissy/parakeet-flow/blob/master/src/asr/engine-sherpa.js): `src/asr/engine-sherpa.js`
- [Speech model store](https://github.com/otissy/parakeet-flow/blob/master/src/asr/model-store.js): `src/asr/model-store.js`

### Text processing

- [Dictation session](https://github.com/otissy/parakeet-flow/blob/master/src/core/session.js): `src/core/session.js`
- [Live text processing](https://github.com/otissy/parakeet-flow/blob/master/src/core/live-typer.js): `src/core/live-typer.js`
- [Text cleanup and tone](https://github.com/otissy/parakeet-flow/blob/master/src/core/postprocess.js): `src/core/postprocess.js`
- [Type or note routing](https://github.com/otissy/parakeet-flow/blob/master/src/core/routing.js): `src/core/routing.js`
- [Slang dictionary](https://github.com/otissy/parakeet-flow/blob/master/src/slang/service.js): `src/slang/service.js`
- [Slang matcher](https://github.com/otissy/parakeet-flow/blob/master/src/slang/matcher.js): `src/slang/matcher.js`

### Notes and sharing

- [Note service](https://github.com/otissy/parakeet-flow/blob/master/src/notes/service.js): `src/notes/service.js`
- [Notes outbox](https://github.com/otissy/parakeet-flow/blob/master/src/notes/outbox.js): `src/notes/outbox.js`
- [Markdown export](https://github.com/otissy/parakeet-flow/blob/master/src/notes/export-md.js): `src/notes/export-md.js`
- [Notion sync](https://github.com/otissy/parakeet-flow/blob/master/src/notes/notion.js): `src/notes/notion.js`
- [MCP notes server](https://github.com/otissy/parakeet-flow/blob/master/mcp/server.js): `mcp/server.js`
- [Notion service connector](https://github.com/otissy/parakeet-flow/blob/master/src/notes/service.js): `src/notes/service.js`

### Local integrations

- [Local AI cleanup](https://github.com/otissy/parakeet-flow/blob/master/src/llm/cleanup.js): `src/llm/cleanup.js`
- [Local AI worker](https://github.com/otissy/parakeet-flow/blob/master/src/llm/llm-host.js): `src/llm/llm-host.js`
- [Windows text insertion](https://github.com/otissy/parakeet-flow/blob/master/src/typer/win32-typer.js): `src/typer/win32-typer.js`

### Other components

- **Speaker**
- **Focused app**

## Connections

- Speaker → Microphone capture: speaks into (evidence: `README.md`)
- Speaker → Dictation controller: presses hotkey (evidence: `README.md`)
- Electron main → Dictation controller: constructs (evidence: `src/main/main.js`)
- Electron main → Microphone capture: wires (evidence: `src/main/main.js`)
- Electron main → ASR host: starts (evidence: `src/main/main.js`)
- Electron main → Speech model store: loads model (evidence: `src/main/main.js`)
- Electron main → Local AI worker: creates worker (evidence: `src/main/main.js`)
- Electron main → Settings and history: reads and updates (evidence: `src/main/main.js`)
- Electron main → Windows and pill UI: serves windows
- Dictation controller → Dictation session: creates session (evidence: `src/main/controller.js`)
- Dictation controller → Type or note routing: routes dictation (evidence: `src/main/controller.js`)
- Dictation controller → Slang dictionary: gets matcher (evidence: `src/main/controller.js`)
- Dictation controller → Note service: saves note
- ASR host → ASR worker: dispatches audio
- ASR worker → Speech segmenter: uses (evidence: `src/asr/asr-worker.js`)
- ASR worker → Sherpa Parakeet engine: decodes with (evidence: `src/asr/asr-worker.js`)
- Dictation session → Live text processing: updates transcript (evidence: `src/core/session.js`)
- Dictation session → Local AI cleanup: requests cleanup (evidence: `src/core/session.js`)
- Dictation session → Text cleanup and tone: cleans text (evidence: `src/core/session.js`)
- Live text processing → Windows text insertion: inserts text (evidence: `src/core/live-typer.js`)
- Live text processing → Text cleanup and tone: prepares text (evidence: `src/core/live-typer.js`)
- Dictation session → Slang dictionary: applies terms (evidence: `src/core/session.js`)
- Slang dictionary → Slang matcher: compiles packs (evidence: `src/slang/service.js`)
- Windows text insertion → Focused app: types into (evidence: `README.md`)
- Local AI cleanup → Local AI worker: uses local runtime
- Dictation session → Note service: emits note
- Note service → Notes outbox: writes notes (evidence: `src/notes/service.js`)
- Note service → Markdown export: exports notes (evidence: `src/notes/service.js`)
- Note service → Notion sync: submits optional sync (evidence: `src/notes/service.js`)
- Electron main → Note service: configures notes (evidence: `src/main/main.js`)
- Notion service connector → Notes outbox: shares note storage
- MCP notes server → Notes outbox: reads and updates (evidence: `mcp/server.js`)
- Windows and pill UI → Electron main: uses app controls
