# namadeku/aion architecture

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

- Interactive diagram: https://gitdiagram.com/namadeku/aion
- Repository: https://github.com/namadeku/aion

## Overview

Aion is a desktop voice assistant with a text-capable web UI. Its main workflow captures speech, detects activation, transcribes it, routes the request to commands or an LLM, and speaks a response; plugins add skills, while mood, memory, and avatar features enrich interaction. The Python application container wires runtime services, and the authenticated UI backend exposes settings and events to the frontend. README claims preserve documented capabilities even where their source was not sampled; those subsystems are represented at supported directory paths. Unshown runtime links are omitted or marked unverified.

Main entry points: [`src/aion/app.py`](https://github.com/namadeku/aion/blob/main/src/aion/app.py) (Application runtime), [`src/aion/core/dialog.py`](https://github.com/namadeku/aion/blob/main/src/aion/core/dialog.py) (Dialog manager), [`src/aion/llm/brain.py`](https://github.com/namadeku/aion/blob/main/src/aion/llm/brain.py) (LLM & streaming), [`src/aion/audio/pipeline.py`](https://github.com/namadeku/aion/blob/main/src/aion/audio/pipeline.py) (Voice pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Interaction"]
  node_frontend["Desktop UI<br/>[main.ts]"]
  node_ui_backend["UI API &amp; events<br/>[server.py]"]
  node_web_api["UI API client<br/>[api.ts]"]
  node_config_ui["Settings pages<br/>[llm.ts]"]
  node_audio["Voice pipeline<br/>[pipeline.py]"]
  node_stt["Speech recognition<br/>[whisper_engine.py]"]
end

subgraph group_conversation["Conversation"]
  node_router["Intent routing<br/>[router.py]"]
  node_dialog["Dialog manager<br/>[dialog.py]"]
  node_llm["LLM &amp; streaming<br/>[brain.py]"]
  node_memory["Memory &amp; episodes<br/>[memory.py]"]
  node_tts["Speech synthesis<br/>[base.py]"]
end

subgraph group_skills["Skills"]
  node_commands["User commands<br/>[engine.py]"]
  node_command_store[("Command definitions<br/>[store.py]")]
  node_plugins["Plugin manager<br/>[manager.py]"]
  node_plugin_sdk["Plugin SDK<br/>[plugin.py]"]
  node_mcp["MCP tools<br/>[mcp_hub.py]"]
  node_builtins["Built-in skills"]
end

subgraph group_experience["Character &amp; voice"]
  node_mood["Mood &amp; initiative<br/>[mood.py]"]
  node_avatar["Avatar rendering<br/>[motion.ts]"]
  node_desktop_character["Desktop character<br/>[desktop.py]"]
end

subgraph group_platform["App platform"]
  node_events["Event bus<br/>[events.py]"]
  node_app["Application runtime<br/>[app.py]"]
  node_config["Configuration<br/>[schema.py]"]
end

node_user(("User"))
node_external_models{{"Model services"}}
node_telegram{{"Telegram bot"}}

node_user -->|"speaks to"| node_audio
node_user -->|"types into"| node_frontend
node_audio -->|"transcribes with"| node_stt
node_audio -.->|"submits request"| node_dialog
node_dialog -->|"routes intent"| node_router
node_router -->|"dispatches commands"| node_commands
node_dialog -.->|"asks model"| node_llm
node_llm -.->|"uses memory"| node_memory
node_llm -.->|"calls MCP tools"| node_mcp
node_dialog -.->|"speaks response"| node_tts
node_commands -->|"reads commands"| node_command_store
node_plugins -->|"loads plugins"| node_plugin_sdk
node_plugins -.->|"discovers skills"| node_builtins
node_app -->|"starts voice"| node_audio
node_app -->|"loads plugins"| node_plugins
node_app -->|"creates bus"| node_events
node_app -->|"reads settings"| node_config
node_ui_backend -->|"streams events"| node_events
node_ui_backend -->|"reads and updates"| node_config
node_frontend -.->|"uses API"| node_web_api
node_web_api -.->|"HTTP requests"| node_ui_backend
node_config_ui -->|"loads settings"| node_web_api
node_app -.->|"starts mood"| node_mood
node_mood -.->|"drives expression"| node_avatar
node_tts -.->|"lip-syncs"| node_avatar
node_frontend -.->|"opens desktop mode"| node_desktop_character
node_external_models -.->|"provides models"| node_stt
node_llm -.->|"uses optional providers"| node_external_models
node_telegram -.->|"remote control"| node_builtins

click node_frontend "https://github.com/namadeku/aion/blob/main/frontend/src/main.ts"
click node_ui_backend "https://github.com/namadeku/aion/blob/main/src/aion/ui/server.py"
click node_web_api "https://github.com/namadeku/aion/blob/main/frontend/src/api.ts"
click node_config_ui "https://github.com/namadeku/aion/blob/main/frontend/src/pages/llm.ts"
click node_audio "https://github.com/namadeku/aion/blob/main/src/aion/audio/pipeline.py"
click node_stt "https://github.com/namadeku/aion/blob/main/src/aion/stt/whisper_engine.py"
click node_router "https://github.com/namadeku/aion/blob/main/src/aion/core/router.py"
click node_dialog "https://github.com/namadeku/aion/blob/main/src/aion/core/dialog.py"
click node_llm "https://github.com/namadeku/aion/blob/main/src/aion/llm/brain.py"
click node_memory "https://github.com/namadeku/aion/blob/main/src/aion/llm/memory.py"
click node_tts "https://github.com/namadeku/aion/blob/main/src/aion/tts/base.py"
click node_commands "https://github.com/namadeku/aion/blob/main/src/aion/commands/engine.py"
click node_command_store "https://github.com/namadeku/aion/blob/main/src/aion/commands/store.py"
click node_plugins "https://github.com/namadeku/aion/blob/main/src/aion/plugins/manager.py"
click node_plugin_sdk "https://github.com/namadeku/aion/blob/main/src/aion/sdk/plugin.py"
click node_mcp "https://github.com/namadeku/aion/blob/main/src/aion/llm/mcp_hub.py"
click node_builtins "https://github.com/namadeku/aion/tree/main/src/aion/plugins/builtin"
click node_events "https://github.com/namadeku/aion/blob/main/src/aion/core/events.py"
click node_app "https://github.com/namadeku/aion/blob/main/src/aion/app.py"
click node_config "https://github.com/namadeku/aion/blob/main/src/aion/config/schema.py"
click node_mood "https://github.com/namadeku/aion/blob/main/src/aion/core/mood.py"
click node_avatar "https://github.com/namadeku/aion/blob/main/frontend/src/avatar/motion.ts"
click node_desktop_character "https://github.com/namadeku/aion/blob/main/src/aion/ui/desktop.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_frontend,node_ui_backend,node_web_api,node_config_ui,node_audio,node_stt,node_user toneBlue
class node_router,node_dialog,node_llm,node_memory,node_tts toneAmber
class node_commands,node_command_store,node_plugins,node_plugin_sdk,node_mcp,node_builtins toneMint
class node_mood,node_avatar,node_desktop_character toneRose
class node_events,node_app,node_config,node_external_models,node_telegram toneIndigo
```

## Components

### Interaction

- [Desktop UI](https://github.com/namadeku/aion/blob/main/frontend/src/main.ts): `frontend/src/main.ts`
- [UI API & events](https://github.com/namadeku/aion/blob/main/src/aion/ui/server.py): `src/aion/ui/server.py`
- [UI API client](https://github.com/namadeku/aion/blob/main/frontend/src/api.ts): `frontend/src/api.ts`
- [Settings pages](https://github.com/namadeku/aion/blob/main/frontend/src/pages/llm.ts): `frontend/src/pages/llm.ts`
- [Voice pipeline](https://github.com/namadeku/aion/blob/main/src/aion/audio/pipeline.py): `src/aion/audio/pipeline.py`
- [Speech recognition](https://github.com/namadeku/aion/blob/main/src/aion/stt/whisper_engine.py): `src/aion/stt/whisper_engine.py`

### Conversation

- [Intent routing](https://github.com/namadeku/aion/blob/main/src/aion/core/router.py): `src/aion/core/router.py`
- [Dialog manager](https://github.com/namadeku/aion/blob/main/src/aion/core/dialog.py): `src/aion/core/dialog.py`
- [LLM & streaming](https://github.com/namadeku/aion/blob/main/src/aion/llm/brain.py): `src/aion/llm/brain.py`
- [Memory & episodes](https://github.com/namadeku/aion/blob/main/src/aion/llm/memory.py): `src/aion/llm/memory.py`
- [Speech synthesis](https://github.com/namadeku/aion/blob/main/src/aion/tts/base.py): `src/aion/tts/base.py`

### Skills

- [User commands](https://github.com/namadeku/aion/blob/main/src/aion/commands/engine.py): `src/aion/commands/engine.py`
- [Command definitions](https://github.com/namadeku/aion/blob/main/src/aion/commands/store.py): `src/aion/commands/store.py`
- [Plugin manager](https://github.com/namadeku/aion/blob/main/src/aion/plugins/manager.py): `src/aion/plugins/manager.py`
- [Plugin SDK](https://github.com/namadeku/aion/blob/main/src/aion/sdk/plugin.py): `src/aion/sdk/plugin.py`
- [MCP tools](https://github.com/namadeku/aion/blob/main/src/aion/llm/mcp_hub.py): `src/aion/llm/mcp_hub.py`
- [Built-in skills](https://github.com/namadeku/aion/tree/main/src/aion/plugins/builtin): `src/aion/plugins/builtin`

### Character & voice

- [Mood & initiative](https://github.com/namadeku/aion/blob/main/src/aion/core/mood.py): `src/aion/core/mood.py`
- [Avatar rendering](https://github.com/namadeku/aion/blob/main/frontend/src/avatar/motion.ts): `frontend/src/avatar/motion.ts`
- [Desktop character](https://github.com/namadeku/aion/blob/main/src/aion/ui/desktop.py): `src/aion/ui/desktop.py`

### App platform

- [Event bus](https://github.com/namadeku/aion/blob/main/src/aion/core/events.py): `src/aion/core/events.py`
- [Application runtime](https://github.com/namadeku/aion/blob/main/src/aion/app.py): `src/aion/app.py`
- [Configuration](https://github.com/namadeku/aion/blob/main/src/aion/config/schema.py): `src/aion/config/schema.py`

### Other components

- **User**
- **Model services**
- **Telegram bot**

## Connections

- User → Voice pipeline: speaks to
- User → Desktop UI: types into
- Voice pipeline → Speech recognition: transcribes with (evidence: `src/aion/audio/pipeline.py`)
- Voice pipeline → Dialog manager: submits request
- Dialog manager → Intent routing: routes intent (evidence: `src/aion/core/dialog.py`)
- Intent routing → User commands: dispatches commands (evidence: `src/aion/commands/engine.py`)
- Dialog manager → LLM & streaming: asks model
- LLM & streaming → Memory & episodes: uses memory
- LLM & streaming → MCP tools: calls MCP tools
- Dialog manager → Speech synthesis: speaks response
- User commands → Command definitions: reads commands (evidence: `src/aion/commands/engine.py`)
- Plugin manager → Plugin SDK: loads plugins (evidence: `src/aion/plugins/manager.py`)
- Plugin manager → Built-in skills: discovers skills
- Application runtime → Voice pipeline: starts voice (evidence: `src/aion/app.py`)
- Application runtime → Plugin manager: loads plugins (evidence: `src/aion/app.py`)
- Application runtime → Event bus: creates bus (evidence: `src/aion/app.py`)
- Application runtime → Configuration: reads settings (evidence: `src/aion/app.py`)
- UI API & events → Event bus: streams events (evidence: `src/aion/ui/server.py`)
- UI API & events → Configuration: reads and updates (evidence: `src/aion/ui/server.py`)
- Desktop UI → UI API client: uses API (evidence: `frontend/src/main.ts`)
- UI API client → UI API & events: HTTP requests
- Settings pages → UI API client: loads settings (evidence: `frontend/src/pages/llm.ts`)
- Application runtime → Mood & initiative: starts mood (evidence: `src/aion/app.py`)
- Mood & initiative → Avatar rendering: drives expression
- Speech synthesis → Avatar rendering: lip-syncs
- Desktop UI → Desktop character: opens desktop mode
- Model services → Speech recognition: provides models
- LLM & streaming → Model services: uses optional providers
- Telegram bot → Built-in skills: remote control
