# kali-arthur/mon-ia architecture

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

- Interactive diagram: https://gitdiagram.com/kali-arthur/mon-ia
- Repository: https://github.com/kali-arthur/mon-ia

## Overview

Blad is a personal AI assistant exposed through an authenticated FastAPI service, with chat, voice, memory, desktop control, cybersecurity, vision, and avatar route families. The main demonstrated workflow is an authenticated chat request: intent and context are processed, a response is generated, and the exchange is saved. Voice has both API and local pipeline entry points. Several route implementations are unsampled, so their documented-by-routing capabilities are shown without speculative internal links; the web interface appears to be an unmodified starter and is omitted.

Main entry points: [`api/routes/chat.py`](https://github.com/kali-arthur/mon-ia/blob/main/api/routes/chat.py) (Chat endpoint), [`api/server.py`](https://github.com/kali-arthur/mon-ia/blob/main/api/server.py) (FastAPI server), [`voice/pipeline.py`](https://github.com/kali-arthur/mon-ia/blob/main/voice/pipeline.py) (Voice pipeline), [`api/routes/voice.py`](https://github.com/kali-arthur/mon-ia/blob/main/api/routes/voice.py) (Voice endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and access"]
  node_server["FastAPI server<br/>[server.py]"]
  node_auth["JWT authentication<br/>[auth.py]"]
  node_chat_route["Chat endpoint<br/>[chat.py]"]
  node_memory_route["Memory endpoints<br/>[memory.py]"]
  node_voice_route["Voice endpoints<br/>[voice.py]"]
  node_cyber_route["Cyber endpoints<br/>[cyber.py]"]
  node_vision_route["Vision endpoints<br/>[vision.py]"]
  node_avatar_route["Avatar endpoints<br/>[avatar.py]"]
  node_desktop_route["Desktop endpoints<br/>[desktop.py]"]
  node_execute_route["Execution endpoint<br/>[execute.py]"]
end

subgraph group_assistant["Assistant and memory"]
  node_brain["Assistant reasoning<br/>[llm.py]"]
  node_intent["Intent detection<br/>[intent.py]"]
  node_prompt["Prompt building<br/>[prompt.py]"]
  node_emotion["Emotion detection<br/>[emotion.py]"]
  node_formatting["Response formatting<br/>[formatter.py]"]
  node_learning["Conversation learning<br/>[learner.py]"]
  node_search["Web search<br/>[search.py]"]
  node_memory[("Long-term memory<br/>[long_term.py]")]
  node_semantic[("Semantic memory<br/>[semantic.py]")]
  node_short_memory["Short-term memory<br/>[short_term.py]"]
end

subgraph group_modalities["Voice and perception"]
  node_voice_pipeline["Voice pipeline<br/>[pipeline.py]"]
  node_auto_voice["Wake-word pipeline<br/>[auto_pipeline.py]"]
  node_stt["Speech recognition<br/>[stt.py]"]
  node_tts["Speech synthesis<br/>[tts.py]"]
  node_wake["Wake-word detection<br/>[wake_word.py]"]
  node_vision_camera["Camera capture<br/>[camera.py]"]
  node_face_id["Face recognition<br/>[face_id.py]"]
  node_scene["Scene understanding<br/>[scene.py]"]
  node_avatar["Avatar rendering<br/>[face_engine.py]"]
  node_expressions["Avatar expressions<br/>[expressions.py]"]
  node_lip_sync["Lip synchronization<br/>[lip_sync.py]"]
end

subgraph group_actions["Actions and security"]
  node_cyber["Cybersecurity tools<br/>[scanner.py]"]
  node_desktop["Desktop control<br/>[desktop.py]"]
end

node_caller(("API client"))

node_caller -.->|"sends requests"| node_server
node_server -->|"routes to"| node_chat_route
node_server -->|"routes to"| node_memory_route
node_server -->|"routes to"| node_voice_route
node_server -->|"routes to"| node_cyber_route
node_server -->|"routes to"| node_vision_route
node_server -->|"routes to"| node_avatar_route
node_server -->|"routes to"| node_desktop_route
node_server -->|"routes to"| node_execute_route
node_chat_route -->|"requires token"| node_auth
node_memory_route -->|"requires token"| node_auth
node_voice_route -->|"requires token"| node_auth
node_chat_route -->|"detects intent"| node_intent
node_chat_route -->|"builds messages"| node_prompt
node_chat_route -->|"requests response"| node_brain
node_chat_route -->|"detects emotion"| node_emotion
node_chat_route -->|"formats response"| node_formatting
node_chat_route -->|"learns exchange"| node_learning
node_chat_route -->|"searches web"| node_search
node_chat_route -->|"stores exchange"| node_memory
node_memory_route -->|"reads and writes"| node_memory
node_prompt -->|"uses history"| node_memory
node_learning -->|"uses stored memory"| node_memory
node_voice_route -->|"transcribes audio"| node_stt
node_voice_route -->|"synthesizes audio"| node_tts
node_voice_route -->|"starts listening"| node_voice_pipeline
node_voice_pipeline -->|"transcribes speech"| node_stt
node_voice_pipeline -->|"builds messages"| node_prompt
node_voice_pipeline -->|"requests response"| node_brain
node_voice_pipeline -->|"speaks response"| node_tts
node_voice_pipeline -->|"saves exchange"| node_memory
node_voice_pipeline -->|"uses context"| node_short_memory
node_voice_pipeline -->|"stores embedding"| node_semantic
node_auto_voice -->|"starts listening"| node_wake
node_auto_voice -->|"transcribes speech"| node_stt
node_auto_voice -->|"requests response"| node_brain
node_auto_voice -->|"speaks response"| node_tts
node_avatar -->|"uses expressions"| node_expressions
node_avatar -->|"uses lip sync"| node_lip_sync
node_desktop_route -->|"controls desktop"| node_desktop
node_vision_route -.->|"uses camera"| node_vision_camera
node_vision_route -.->|"uses face recognition"| node_face_id
node_vision_route -.->|"uses scene analysis"| node_scene
node_cyber_route -.->|"dispatches security tools"| node_cyber
node_execute_route -.->|"dispatches actions"| node_desktop

click node_server "https://github.com/kali-arthur/mon-ia/blob/main/api/server.py"
click node_auth "https://github.com/kali-arthur/mon-ia/blob/main/api/auth.py"
click node_chat_route "https://github.com/kali-arthur/mon-ia/blob/main/api/routes/chat.py"
click node_memory_route "https://github.com/kali-arthur/mon-ia/blob/main/api/routes/memory.py"
click node_voice_route "https://github.com/kali-arthur/mon-ia/blob/main/api/routes/voice.py"
click node_cyber_route "https://github.com/kali-arthur/mon-ia/blob/main/api/routes/cyber.py"
click node_vision_route "https://github.com/kali-arthur/mon-ia/blob/main/api/routes/vision.py"
click node_avatar_route "https://github.com/kali-arthur/mon-ia/blob/main/api/routes/avatar.py"
click node_desktop_route "https://github.com/kali-arthur/mon-ia/blob/main/api/routes/desktop.py"
click node_execute_route "https://github.com/kali-arthur/mon-ia/blob/main/api/routes/execute.py"
click node_brain "https://github.com/kali-arthur/mon-ia/blob/main/brain/llm.py"
click node_intent "https://github.com/kali-arthur/mon-ia/blob/main/brain/intent.py"
click node_prompt "https://github.com/kali-arthur/mon-ia/blob/main/brain/prompt.py"
click node_emotion "https://github.com/kali-arthur/mon-ia/blob/main/brain/emotion.py"
click node_formatting "https://github.com/kali-arthur/mon-ia/blob/main/brain/formatter.py"
click node_learning "https://github.com/kali-arthur/mon-ia/blob/main/brain/learner.py"
click node_search "https://github.com/kali-arthur/mon-ia/blob/main/brain/search.py"
click node_memory "https://github.com/kali-arthur/mon-ia/blob/main/memory/long_term.py"
click node_semantic "https://github.com/kali-arthur/mon-ia/blob/main/memory/semantic.py"
click node_short_memory "https://github.com/kali-arthur/mon-ia/blob/main/memory/short_term.py"
click node_voice_pipeline "https://github.com/kali-arthur/mon-ia/blob/main/voice/pipeline.py"
click node_auto_voice "https://github.com/kali-arthur/mon-ia/blob/main/voice/auto_pipeline.py"
click node_stt "https://github.com/kali-arthur/mon-ia/blob/main/voice/stt.py"
click node_tts "https://github.com/kali-arthur/mon-ia/blob/main/voice/tts.py"
click node_wake "https://github.com/kali-arthur/mon-ia/blob/main/voice/wake_word.py"
click node_vision_camera "https://github.com/kali-arthur/mon-ia/blob/main/vision/camera.py"
click node_face_id "https://github.com/kali-arthur/mon-ia/blob/main/vision/face_id.py"
click node_scene "https://github.com/kali-arthur/mon-ia/blob/main/vision/scene.py"
click node_avatar "https://github.com/kali-arthur/mon-ia/blob/main/avatar/face_engine.py"
click node_expressions "https://github.com/kali-arthur/mon-ia/blob/main/avatar/expressions.py"
click node_lip_sync "https://github.com/kali-arthur/mon-ia/blob/main/avatar/lip_sync.py"
click node_cyber "https://github.com/kali-arthur/mon-ia/blob/main/cyber/scanner.py"
click node_desktop "https://github.com/kali-arthur/mon-ia/blob/main/executor/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_server,node_auth,node_chat_route,node_memory_route,node_voice_route,node_cyber_route,node_vision_route,node_avatar_route,node_desktop_route,node_execute_route,node_caller toneBlue
class node_brain,node_intent,node_prompt,node_emotion,node_formatting,node_learning,node_search,node_memory,node_semantic,node_short_memory toneAmber
class node_voice_pipeline,node_auto_voice,node_stt,node_tts,node_wake,node_vision_camera,node_face_id,node_scene,node_avatar,node_expressions,node_lip_sync toneMint
class node_cyber,node_desktop toneRose
```

## Components

### API and access

- [FastAPI server](https://github.com/kali-arthur/mon-ia/blob/main/api/server.py): `api/server.py`
- [JWT authentication](https://github.com/kali-arthur/mon-ia/blob/main/api/auth.py): `api/auth.py`
- [Chat endpoint](https://github.com/kali-arthur/mon-ia/blob/main/api/routes/chat.py): `api/routes/chat.py`
- [Memory endpoints](https://github.com/kali-arthur/mon-ia/blob/main/api/routes/memory.py): `api/routes/memory.py`
- [Voice endpoints](https://github.com/kali-arthur/mon-ia/blob/main/api/routes/voice.py): `api/routes/voice.py`
- [Cyber endpoints](https://github.com/kali-arthur/mon-ia/blob/main/api/routes/cyber.py): `api/routes/cyber.py`
- [Vision endpoints](https://github.com/kali-arthur/mon-ia/blob/main/api/routes/vision.py): `api/routes/vision.py`
- [Avatar endpoints](https://github.com/kali-arthur/mon-ia/blob/main/api/routes/avatar.py): `api/routes/avatar.py`
- [Desktop endpoints](https://github.com/kali-arthur/mon-ia/blob/main/api/routes/desktop.py): `api/routes/desktop.py`
- [Execution endpoint](https://github.com/kali-arthur/mon-ia/blob/main/api/routes/execute.py): `api/routes/execute.py`

### Assistant and memory

- [Assistant reasoning](https://github.com/kali-arthur/mon-ia/blob/main/brain/llm.py): `brain/llm.py`
- [Intent detection](https://github.com/kali-arthur/mon-ia/blob/main/brain/intent.py): `brain/intent.py`
- [Prompt building](https://github.com/kali-arthur/mon-ia/blob/main/brain/prompt.py): `brain/prompt.py`
- [Emotion detection](https://github.com/kali-arthur/mon-ia/blob/main/brain/emotion.py): `brain/emotion.py`
- [Response formatting](https://github.com/kali-arthur/mon-ia/blob/main/brain/formatter.py): `brain/formatter.py`
- [Conversation learning](https://github.com/kali-arthur/mon-ia/blob/main/brain/learner.py): `brain/learner.py`
- [Web search](https://github.com/kali-arthur/mon-ia/blob/main/brain/search.py): `brain/search.py`
- [Long-term memory](https://github.com/kali-arthur/mon-ia/blob/main/memory/long_term.py): `memory/long_term.py`
- [Semantic memory](https://github.com/kali-arthur/mon-ia/blob/main/memory/semantic.py): `memory/semantic.py`
- [Short-term memory](https://github.com/kali-arthur/mon-ia/blob/main/memory/short_term.py): `memory/short_term.py`

### Voice and perception

- [Voice pipeline](https://github.com/kali-arthur/mon-ia/blob/main/voice/pipeline.py): `voice/pipeline.py`
- [Wake-word pipeline](https://github.com/kali-arthur/mon-ia/blob/main/voice/auto_pipeline.py): `voice/auto_pipeline.py`
- [Speech recognition](https://github.com/kali-arthur/mon-ia/blob/main/voice/stt.py): `voice/stt.py`
- [Speech synthesis](https://github.com/kali-arthur/mon-ia/blob/main/voice/tts.py): `voice/tts.py`
- [Wake-word detection](https://github.com/kali-arthur/mon-ia/blob/main/voice/wake_word.py): `voice/wake_word.py`
- [Camera capture](https://github.com/kali-arthur/mon-ia/blob/main/vision/camera.py): `vision/camera.py`
- [Face recognition](https://github.com/kali-arthur/mon-ia/blob/main/vision/face_id.py): `vision/face_id.py`
- [Scene understanding](https://github.com/kali-arthur/mon-ia/blob/main/vision/scene.py): `vision/scene.py`
- [Avatar rendering](https://github.com/kali-arthur/mon-ia/blob/main/avatar/face_engine.py): `avatar/face_engine.py`
- [Avatar expressions](https://github.com/kali-arthur/mon-ia/blob/main/avatar/expressions.py): `avatar/expressions.py`
- [Lip synchronization](https://github.com/kali-arthur/mon-ia/blob/main/avatar/lip_sync.py): `avatar/lip_sync.py`

### Actions and security

- [Cybersecurity tools](https://github.com/kali-arthur/mon-ia/blob/main/cyber/scanner.py): `cyber/scanner.py`
- [Desktop control](https://github.com/kali-arthur/mon-ia/blob/main/executor/desktop.py): `executor/desktop.py`

### Other components

- **API client**

## Connections

- API client → FastAPI server: sends requests
- FastAPI server → Chat endpoint: routes to (evidence: `api/server.py`)
- FastAPI server → Memory endpoints: routes to (evidence: `api/server.py`)
- FastAPI server → Voice endpoints: routes to (evidence: `api/server.py`)
- FastAPI server → Cyber endpoints: routes to (evidence: `api/server.py`)
- FastAPI server → Vision endpoints: routes to (evidence: `api/server.py`)
- FastAPI server → Avatar endpoints: routes to (evidence: `api/server.py`)
- FastAPI server → Desktop endpoints: routes to (evidence: `api/server.py`)
- FastAPI server → Execution endpoint: routes to (evidence: `api/server.py`)
- Chat endpoint → JWT authentication: requires token (evidence: `api/routes/chat.py`)
- Memory endpoints → JWT authentication: requires token (evidence: `api/routes/memory.py`)
- Voice endpoints → JWT authentication: requires token (evidence: `api/routes/voice.py`)
- Chat endpoint → Intent detection: detects intent (evidence: `api/routes/chat.py`)
- Chat endpoint → Prompt building: builds messages (evidence: `api/routes/chat.py`)
- Chat endpoint → Assistant reasoning: requests response (evidence: `api/routes/chat.py`)
- Chat endpoint → Emotion detection: detects emotion (evidence: `api/routes/chat.py`)
- Chat endpoint → Response formatting: formats response
- Chat endpoint → Conversation learning: learns exchange (evidence: `api/routes/chat.py`)
- Chat endpoint → Web search: searches web (evidence: `api/routes/chat.py`)
- Chat endpoint → Long-term memory: stores exchange (evidence: `api/routes/chat.py`)
- Memory endpoints → Long-term memory: reads and writes (evidence: `api/routes/memory.py`)
- Prompt building → Long-term memory: uses history (evidence: `brain/prompt.py`)
- Conversation learning → Long-term memory: uses stored memory (evidence: `brain/learner.py`)
- Voice endpoints → Speech recognition: transcribes audio (evidence: `api/routes/voice.py`)
- Voice endpoints → Speech synthesis: synthesizes audio (evidence: `api/routes/voice.py`)
- Voice endpoints → Voice pipeline: starts listening (evidence: `api/routes/voice.py`)
- Voice pipeline → Speech recognition: transcribes speech (evidence: `voice/pipeline.py`)
- Voice pipeline → Prompt building: builds messages (evidence: `voice/pipeline.py`)
- Voice pipeline → Assistant reasoning: requests response (evidence: `voice/pipeline.py`)
- Voice pipeline → Speech synthesis: speaks response (evidence: `voice/pipeline.py`)
- Voice pipeline → Long-term memory: saves exchange (evidence: `voice/pipeline.py`)
- Voice pipeline → Short-term memory: uses context (evidence: `voice/pipeline.py`)
- Voice pipeline → Semantic memory: stores embedding (evidence: `voice/pipeline.py`)
- Wake-word pipeline → Wake-word detection: starts listening (evidence: `voice/auto_pipeline.py`)
- Wake-word pipeline → Speech recognition: transcribes speech (evidence: `voice/auto_pipeline.py`)
- Wake-word pipeline → Assistant reasoning: requests response (evidence: `voice/auto_pipeline.py`)
- Wake-word pipeline → Speech synthesis: speaks response (evidence: `voice/auto_pipeline.py`)
- Avatar rendering → Avatar expressions: uses expressions (evidence: `avatar/face_engine.py`)
- Avatar rendering → Lip synchronization: uses lip sync (evidence: `avatar/face_engine.py`)
- Desktop endpoints → Desktop control: controls desktop (evidence: `api/routes/desktop.py`)
- Vision endpoints → Camera capture: uses camera
- Vision endpoints → Face recognition: uses face recognition
- Vision endpoints → Scene understanding: uses scene analysis
- Cyber endpoints → Cybersecurity tools: dispatches security tools
- Execution endpoint → Desktop control: dispatches actions
