# death34018-hue/aionshome architecture

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

- Interactive diagram: https://gitdiagram.com/death34018-hue/aionshome
- Repository: https://github.com/death34018-hue/aionshome

## Overview

Aion Chat is a self-hosted, multi-device AI companion: browser or Android clients send chat and feature requests to a FastAPI service, which builds context, invokes an AI provider, and streams results back. Its documented capabilities include memory, voice, camera monitoring, scheduling, group chat, MCP entertainment, and many domain pages. The tree also contains an Android companion shell and a separate Visitor Lounge service. Edges follow the README’s stated architecture and the sampled source; several unsampled feature internals are represented at their documented module or directory level.

Main entry points: [`aion-chat/routes`](https://github.com/death34018-hue/aionshome/tree/main/aion-chat/routes) (Feature APIs), [`aion-chat/main.py`](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/main.py) (FastAPI entry), [`AionApp/app/src/main/java/com/aion/chat/WebViewActivity.java`](https://github.com/death34018-hue/aionshome/blob/main/AionApp/app/src/main/java/com/aion/chat/WebViewActivity.java) (Android shell), [`aion-chat/static/chat.js`](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/static/chat.js) (Web client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_browser["Web client<br/>[chat.js]"]
  node_android["Android shell"]
end

subgraph group_service["API and orchestration"]
  node_server["FastAPI entry<br/>[main.py]"]
  node_chatapi["Chat API"]
  node_routes["Feature APIs"]
  node_ws["WebSocket hub<br/>[ws.py]"]
end

subgraph group_ai["Conversation intelligence"]
  node_context["Context builder<br/>[context_builder.py]"]
  node_providers["AI providers<br/>[ai_providers.py]"]
  node_memory["Memory retrieval<br/>[memory.py]"]
end

subgraph group_features["Product capabilities"]
  node_schedule["Schedules and alarms<br/>[schedule.py]"]
  node_camera["Camera monitoring<br/>[camera.py]"]
  node_voice["Voice and TTS<br/>[voice.py]"]
  node_chatroom["Group chat<br/>[chatroom.py]"]
  node_theater["Interactive theater<br/>[theater_studio.py]"]
  node_mcp["MCP entertainment<br/>[mcp_client.py]"]
  node_repair["Repair workflow<br/>[repair_routes.py]"]
  node_lounge["Visitor Lounge<br/>[visitor_app.py]"]
end

subgraph group_state["State and integrations"]
  node_db[("SQLite state<br/>[database.py]")]
  node_devices["Device bridges"]
end

node_user(("User"))
node_external{{"AI services"}}

node_user -->|"uses"| node_browser
node_user -->|"uses"| node_android
node_browser -->|"HTTP requests"| node_server
node_android -->|"loads and syncs"| node_server
node_server -->|"registers routes"| node_chatapi
node_server -->|"serves WebSocket"| node_ws
node_chatapi -->|"builds context"| node_context
node_chatapi -->|"requests generation"| node_providers
node_context -->|"retrieves memories"| node_memory
node_memory -->|"reads and writes"| node_db
node_chatapi -->|"persists messages"| node_db
node_providers -->|"calls models"| node_external
node_chatapi -->|"streams replies"| node_ws
node_ws -->|"pushes updates"| node_browser
node_server -->|"registers APIs"| node_routes
node_routes -->|"manages schedules"| node_schedule
node_routes -->|"controls monitoring"| node_camera
node_routes -->|"controls voice"| node_voice
node_routes -->|"serves group chat"| node_chatroom
node_routes -->|"serves theater"| node_theater
node_routes -->|"exposes tool calls"| node_mcp
node_routes -->|"serves repair tasks"| node_repair
node_android -->|"provides native bridges"| node_devices
node_user -.->|"visits"| node_lounge

click node_browser "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/static/chat.js"
click node_android "https://github.com/death34018-hue/aionshome/blob/main/AionApp/app/src/main/java/com/aion/chat/WebViewActivity.java"
click node_server "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/main.py"
click node_routes "https://github.com/death34018-hue/aionshome/tree/main/aion-chat/routes"
click node_ws "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/ws.py"
click node_context "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/context_builder.py"
click node_providers "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/ai_providers.py"
click node_memory "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/memory.py"
click node_db "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/database.py"
click node_schedule "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/schedule.py"
click node_camera "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/camera.py"
click node_voice "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/voice.py"
click node_chatroom "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/chatroom.py"
click node_theater "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/theater_studio.py"
click node_mcp "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/mcp_client.py"
click node_repair "https://github.com/death34018-hue/aionshome/blob/main/aion-chat/repair_routes.py"
click node_devices "https://github.com/death34018-hue/aionshome/blob/main/AionApp/app/src/main/java/com/aion/chat/AionPushService.java"
click node_lounge "https://github.com/death34018-hue/aionshome/blob/main/AionsHome-Visitor-Lounge/src/visitor_lounge/visitor_app.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_browser,node_android,node_user toneBlue
class node_server,node_chatapi,node_routes,node_ws toneAmber
class node_context,node_providers,node_memory toneMint
class node_schedule,node_camera,node_voice,node_chatroom,node_theater,node_mcp,node_repair,node_lounge toneRose
class node_db,node_devices,node_external toneIndigo
```

## Components

### User clients

- [Web client](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/static/chat.js): `aion-chat/static/chat.js`
- [Android shell](https://github.com/death34018-hue/aionshome/blob/main/AionApp/app/src/main/java/com/aion/chat/WebViewActivity.java): `AionApp/app/src/main/java/com/aion/chat/WebViewActivity.java`

### API and orchestration

- [FastAPI entry](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/main.py): `aion-chat/main.py`
- **Chat API**
- [Feature APIs](https://github.com/death34018-hue/aionshome/tree/main/aion-chat/routes): `aion-chat/routes`
- [WebSocket hub](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/ws.py): `aion-chat/ws.py`

### Conversation intelligence

- [Context builder](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/context_builder.py): `aion-chat/context_builder.py`
- [AI providers](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/ai_providers.py): `aion-chat/ai_providers.py`
- [Memory retrieval](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/memory.py): `aion-chat/memory.py`

### Product capabilities

- [Schedules and alarms](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/schedule.py): `aion-chat/schedule.py`
- [Camera monitoring](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/camera.py): `aion-chat/camera.py`
- [Voice and TTS](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/voice.py): `aion-chat/voice.py`
- [Group chat](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/chatroom.py): `aion-chat/chatroom.py`
- [Interactive theater](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/theater_studio.py): `aion-chat/theater_studio.py`
- [MCP entertainment](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/mcp_client.py): `aion-chat/mcp_client.py`
- [Repair workflow](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/repair_routes.py): `aion-chat/repair_routes.py`
- [Visitor Lounge](https://github.com/death34018-hue/aionshome/blob/main/AionsHome-Visitor-Lounge/src/visitor_lounge/visitor_app.py): `AionsHome-Visitor-Lounge/src/visitor_lounge/visitor_app.py`

### State and integrations

- [SQLite state](https://github.com/death34018-hue/aionshome/blob/main/aion-chat/database.py): `aion-chat/database.py`
- [Device bridges](https://github.com/death34018-hue/aionshome/blob/main/AionApp/app/src/main/java/com/aion/chat/AionPushService.java): `AionApp/app/src/main/java/com/aion/chat/AionPushService.java`

### Other components

- **User**
- **AI services**

## Connections

- User → Web client: uses
- User → Android shell: uses
- Web client → FastAPI entry: HTTP requests
- Android shell → FastAPI entry: loads and syncs
- FastAPI entry → Chat API: registers routes
- FastAPI entry → WebSocket hub: serves WebSocket
- Chat API → Context builder: builds context
- Chat API → AI providers: requests generation
- Context builder → Memory retrieval: retrieves memories
- Memory retrieval → SQLite state: reads and writes
- Chat API → SQLite state: persists messages
- AI providers → AI services: calls models
- Chat API → WebSocket hub: streams replies
- WebSocket hub → Web client: pushes updates
- FastAPI entry → Feature APIs: registers APIs
- Feature APIs → Schedules and alarms: manages schedules
- Feature APIs → Camera monitoring: controls monitoring
- Feature APIs → Voice and TTS: controls voice
- Feature APIs → Group chat: serves group chat
- Feature APIs → Interactive theater: serves theater
- Feature APIs → MCP entertainment: exposes tool calls
- Feature APIs → Repair workflow: serves repair tasks
- Android shell → Device bridges: provides native bridges
- User → Visitor Lounge: visits
