# kuafuai/andee architecture

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

## Overview

Andee is an Android resident voice-and-device agent. The main user flow is speech or text input into its persistent service, which obtains a response from its on-device or configured model, dispatches permitted device actions, and presents the result through speech and the floating interface. Separate capabilities include accessibility-based screen interaction, notification triage, scheduled scenes, private notebook memory, meetings, and device communication. Edges are limited to relationships shown by the supplied excerpts, SOURCE INDEX references, or README; several unsampled subsystem links are therefore omitted.

Main entry points: [`app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/BodyCoreService.kt) (Core service), [`app/src/main/java/net/kuafuai/andee/ui/FloatingWindowUi.kt`](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/ui/FloatingWindowUi.kt) (Floating interface), [`app/src/main/java/net/kuafuai/andee/brain/LocalBrain.kt`](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/brain/LocalBrain.kt) (Local brain), [`app/src/main/java/net/kuafuai/andee/tts/TtsController.kt`](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/tts/TtsController.kt) (Speech synthesis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Resident runtime"]
  node_body["Core service<br/>[BodyCoreService.kt]"]
  node_screen_service["Accessibility service"]
  node_dispatcher["Command dispatcher"]
  node_schemas["Tool schemas<br/>[ToolSchemas.kt]"]
  node_hub["WebSocket hub<br/>[BodyWsClient.kt]"]
end

subgraph group_intelligence["Conversation and voice"]
  node_asr["Speech recognition<br/>[AsrController.kt]"]
  node_audio["Audio capture<br/>[AudioIO.kt]"]
  node_brain["Local brain<br/>[LocalBrain.kt]"]
  node_llm["Model client<br/>[LlmClient.kt]"]
  node_tts["Speech synthesis<br/>[TtsController.kt]"]
end

subgraph group_device["Device capabilities"]
  node_screen["Screen interaction"]
  node_notifications["Notification triage"]
  node_device_actions["Device actions"]
  node_device_comms["Device communications"]
  node_meeting["Meeting recorder<br/>[MeetingRecorder.kt]"]
end

subgraph group_state["Memory and routines"]
  node_scheduler["Scheduler and scenes<br/>[Scheduler.kt]"]
  node_notebook[("Private notebook<br/>[Notebook.kt]")]
  node_config[("Voice configuration<br/>[VoiceConfig.kt]")]
end

subgraph group_experience["User experience"]
  node_floating["Floating interface"]
  node_cards["Cards and prompts<br/>[CardUi.kt]"]
  node_history[("Conversation history<br/>[ChatHistory.kt]")]
end

node_user(("User"))
node_model_service(("OpenAI-compatible model"))

node_user -->|"speaks to"| node_body
node_body -->|"starts recognition"| node_asr
node_asr -->|"captures audio"| node_audio
node_body -->|"dispatches commands"| node_dispatcher
node_dispatcher -.->|"uses tools"| node_schemas
node_body -->|"submits turns"| node_brain
node_brain -.->|"requests completions"| node_llm
node_llm -->|"sends requests"| node_model_service
node_body -->|"speaks responses"| node_tts
node_tts -->|"streams playback"| node_audio
node_tts -->|"reads settings"| node_config
node_screen_service -->|"attaches capability"| node_body
node_body -->|"uses screen tools"| node_screen
node_notifications -->|"offers notifications"| node_body
node_body -.->|"dispatches actions"| node_device_actions
node_body -.->|"dispatches communications"| node_device_comms
node_body -->|"handles meeting turns"| node_meeting
node_body -->|"sends events"| node_hub
node_body -.->|"runs routines"| node_scheduler
node_brain -.->|"keeps memories"| node_notebook
node_user -->|"interacts with"| node_floating
node_body -->|"controls overlay"| node_floating
node_body -->|"records conversation"| node_history
node_floating -->|"shows cards"| node_cards
node_floating -->|"shows history"| node_history
node_body -->|"reads preferences"| node_config

click node_body "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/BodyCoreService.kt"
click node_screen_service "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/ScreenBodyService.kt"
click node_asr "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/asr/AsrController.kt"
click node_audio "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/audio/AudioIO.kt"
click node_brain "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/brain/LocalBrain.kt"
click node_llm "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/brain/LlmClient.kt"
click node_dispatcher "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/net/CommandDispatcher.kt"
click node_schemas "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/net/ToolSchemas.kt"
click node_screen "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/screen/ScreenController.kt"
click node_notifications "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/device/NotificationRelayService.kt"
click node_device_actions "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/device/DeviceActionsController.kt"
click node_device_comms "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/device/DeviceCommsController.kt"
click node_meeting "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/meeting/MeetingRecorder.kt"
click node_scheduler "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/config/Scheduler.kt"
click node_notebook "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/config/Notebook.kt"
click node_config "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/config/VoiceConfig.kt"
click node_tts "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/tts/TtsController.kt"
click node_floating "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/ui/FloatingWindowUi.kt"
click node_cards "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/ui/CardUi.kt"
click node_history "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/ui/ChatHistory.kt"
click node_hub "https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/net/BodyWsClient.kt"

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_body,node_screen_service,node_dispatcher,node_schemas,node_hub,node_user toneBlue
class node_asr,node_audio,node_brain,node_llm,node_tts toneAmber
class node_screen,node_notifications,node_device_actions,node_device_comms,node_meeting toneMint
class node_scheduler,node_notebook,node_config toneRose
class node_floating,node_cards,node_history,node_model_service toneIndigo
```

## Components

### Resident runtime

- [Core service](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/BodyCoreService.kt): `app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`
- [Accessibility service](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/ScreenBodyService.kt): `app/src/main/java/net/kuafuai/andee/ScreenBodyService.kt`
- [Command dispatcher](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/net/CommandDispatcher.kt): `app/src/main/java/net/kuafuai/andee/net/CommandDispatcher.kt`
- [Tool schemas](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/net/ToolSchemas.kt): `app/src/main/java/net/kuafuai/andee/net/ToolSchemas.kt`
- [WebSocket hub](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/net/BodyWsClient.kt): `app/src/main/java/net/kuafuai/andee/net/BodyWsClient.kt`

### Conversation and voice

- [Speech recognition](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/asr/AsrController.kt): `app/src/main/java/net/kuafuai/andee/asr/AsrController.kt`
- [Audio capture](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/audio/AudioIO.kt): `app/src/main/java/net/kuafuai/andee/audio/AudioIO.kt`
- [Local brain](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/brain/LocalBrain.kt): `app/src/main/java/net/kuafuai/andee/brain/LocalBrain.kt`
- [Model client](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/brain/LlmClient.kt): `app/src/main/java/net/kuafuai/andee/brain/LlmClient.kt`
- [Speech synthesis](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/tts/TtsController.kt): `app/src/main/java/net/kuafuai/andee/tts/TtsController.kt`

### Device capabilities

- [Screen interaction](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/screen/ScreenController.kt): `app/src/main/java/net/kuafuai/andee/screen/ScreenController.kt`
- [Notification triage](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/device/NotificationRelayService.kt): `app/src/main/java/net/kuafuai/andee/device/NotificationRelayService.kt`
- [Device actions](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/device/DeviceActionsController.kt): `app/src/main/java/net/kuafuai/andee/device/DeviceActionsController.kt`
- [Device communications](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/device/DeviceCommsController.kt): `app/src/main/java/net/kuafuai/andee/device/DeviceCommsController.kt`
- [Meeting recorder](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/meeting/MeetingRecorder.kt): `app/src/main/java/net/kuafuai/andee/meeting/MeetingRecorder.kt`

### Memory and routines

- [Scheduler and scenes](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/config/Scheduler.kt): `app/src/main/java/net/kuafuai/andee/config/Scheduler.kt`
- [Private notebook](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/config/Notebook.kt): `app/src/main/java/net/kuafuai/andee/config/Notebook.kt`
- [Voice configuration](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/config/VoiceConfig.kt): `app/src/main/java/net/kuafuai/andee/config/VoiceConfig.kt`

### User experience

- [Floating interface](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/ui/FloatingWindowUi.kt): `app/src/main/java/net/kuafuai/andee/ui/FloatingWindowUi.kt`
- [Cards and prompts](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/ui/CardUi.kt): `app/src/main/java/net/kuafuai/andee/ui/CardUi.kt`
- [Conversation history](https://github.com/kuafuai/andee/blob/main/app/src/main/java/net/kuafuai/andee/ui/ChatHistory.kt): `app/src/main/java/net/kuafuai/andee/ui/ChatHistory.kt`

### Other components

- **User**
- **OpenAI-compatible model**

## Connections

- User → Core service: speaks to (evidence: `README.md`)
- Core service → Speech recognition: starts recognition (evidence: `app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`)
- Speech recognition → Audio capture: captures audio (evidence: `app/src/main/java/net/kuafuai/andee/asr/AsrController.kt`)
- Core service → Command dispatcher: dispatches commands (evidence: `app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`)
- Command dispatcher → Tool schemas: uses tools (evidence: `app/src/main/java/net/kuafuai/andee/net/CommandDispatcher.kt`)
- Core service → Local brain: submits turns (evidence: `app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`)
- Local brain → Model client: requests completions
- Model client → OpenAI-compatible model: sends requests (evidence: `README.md`)
- Core service → Speech synthesis: speaks responses (evidence: `app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`)
- Speech synthesis → Audio capture: streams playback (evidence: `app/src/main/java/net/kuafuai/andee/tts/TtsController.kt`)
- Speech synthesis → Voice configuration: reads settings (evidence: `app/src/main/java/net/kuafuai/andee/tts/TtsController.kt`)
- Accessibility service → Core service: attaches capability (evidence: `app/src/main/java/net/kuafuai/andee/ScreenBodyService.kt`)
- Core service → Screen interaction: uses screen tools (evidence: `app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`)
- Notification triage → Core service: offers notifications (evidence: `app/src/main/java/net/kuafuai/andee/device/NotificationRelayService.kt`)
- Core service → Device actions: dispatches actions (evidence: `app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`)
- Core service → Device communications: dispatches communications (evidence: `app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`)
- Core service → Meeting recorder: handles meeting turns (evidence: `app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`)
- Core service → WebSocket hub: sends events (evidence: `app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`)
- Core service → Scheduler and scenes: runs routines
- Local brain → Private notebook: keeps memories
- User → Floating interface: interacts with (evidence: `README.md`)
- Core service → Floating interface: controls overlay (evidence: `app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`)
- Core service → Conversation history: records conversation (evidence: `app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`)
- Floating interface → Cards and prompts: shows cards (evidence: `app/src/main/java/net/kuafuai/andee/ui/CardUi.kt`)
- Floating interface → Conversation history: shows history (evidence: `app/src/main/java/net/kuafuai/andee/ui/FloatingWindowUi.kt`)
- Core service → Voice configuration: reads preferences (evidence: `app/src/main/java/net/kuafuai/andee/BodyCoreService.kt`)
