# heshengtao/super-agent-party architecture

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

- Interactive diagram: https://gitdiagram.com/heshengtao/super-agent-party
- Repository: https://github.com/heshengtao/super-agent-party

## Overview

Super Agent Party is an AI desktop companion combining chat, agent tools, persistent memory, animated characters, messaging bots, and live-stream integrations. The principal user workflow is to send a request through the chat interface, have an agent use tools or background tasks as needed, and receive a result; the README documents these capabilities, but the server and Electron wiring were not excerpted. The graph therefore keeps those connections conservative. It includes the sampled settings, memory, behavior, messaging, livestream, and speech-runtime layers without assuming unshown calls.

Main entry points: [`server.py`](https://github.com/heshengtao/super-agent-party/blob/main/server.py) (API and app server), [`py/behavior_engine.py`](https://github.com/heshengtao/super-agent-party/blob/main/py/behavior_engine.py) (Behavior scheduler), [`py/feishu_bot_manager.py`](https://github.com/heshengtao/super-agent-party/blob/main/py/feishu_bot_manager.py) (Feishu bot), [`py/qq_bot_manager.py`](https://github.com/heshengtao/super-agent-party/blob/main/py/qq_bot_manager.py) (QQ bot)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop experience"]
  node_desktop_host["Desktop host<br/>[main.js]"]
  node_chat_ui["Chat interface<br/>[renderer.js]"]
  node_avatar_ui["Avatar interface<br/>[vrm.js]"]
end

subgraph group_agents["Agents and memory"]
  node_api_server["API and app server<br/>[server.py]"]
  node_settings[("Settings and state<br/>[get_setting.py]")]
  node_agent_tools["Agent tools<br/>[agent_tool.py]"]
  node_task_center["Background tasks<br/>[task_center.py]"]
  node_diary_engine["Memory scheduler<br/>[diary_engine.py]"]
  node_diary_chat["Chat memory integration"]
  node_diary_system["Memory system<br/>[diary_system.py]"]
  node_behavior["Behavior scheduler<br/>[behavior_engine.py]"]
  node_shortcuts["Shortcut commands"]
end

subgraph group_integrations["Messaging integrations"]
  node_feishu["Feishu bot"]
  node_qq["QQ bot<br/>[qq_bot_manager.py]"]
  node_wechat["WeChat bot"]
  node_im_adapters["Other IM bots"]
end

subgraph group_live["Live streaming"]
  node_live_router["Live-stream routing<br/>[live_router.py]"]
  node_live_client["Bilibili connection<br/>[ws_base.py]"]
  node_live_handlers["Live message dispatch<br/>[handlers.py]"]
  node_live_models["Live message models<br/>[web.py]"]
end

subgraph group_media["Character and speech"]
  node_tha["THA character engine<br/>[tha_engine.py]"]
  node_vts["VTube Studio control<br/>[vts_manager.py]"]
  node_tts_runtime["Speech runtime<br/>[tts_runtime.py]"]
  node_onnx_runtime["ONNX speech runtime<br/>[ort_cpu_runtime.py]"]
  node_tts_normalizer["Speech normalizer"]
end

node_user(("User"))

node_user -->|"sends requests"| node_chat_ui
node_chat_ui -.->|"submits chat"| node_api_server
node_api_server -.->|"invokes tools"| node_agent_tools
node_api_server -->|"starts tasks"| node_task_center
node_api_server -->|"uses chat memory"| node_diary_chat
node_diary_chat -->|"uses memory system"| node_diary_system
node_diary_engine -->|"loads settings"| node_settings
node_diary_engine -->|"dispatches behavior"| node_behavior
node_feishu -->|"updates behavior"| node_behavior
node_qq -.->|"uses behavior"| node_behavior
node_wechat -->|"updates behavior"| node_behavior
node_feishu -->|"parses commands"| node_shortcuts
node_wechat -->|"parses commands"| node_shortcuts
node_qq -.->|"uses commands"| node_shortcuts
node_user -->|"messages bot"| node_feishu
node_user -->|"messages bot"| node_qq
node_user -->|"messages bot"| node_wechat
node_user -->|"messages bot"| node_im_adapters
node_live_router -.->|"connects stream"| node_live_client
node_live_client -.->|"dispatches messages"| node_live_handlers
node_live_handlers -->|"converts messages"| node_live_models
node_avatar_ui -->|"renders character"| node_tha
node_avatar_ui -->|"controls model"| node_vts
node_tts_runtime -->|"uses runtime"| node_onnx_runtime
node_tts_runtime -->|"uses normalizer"| node_tts_normalizer

click node_desktop_host "https://github.com/heshengtao/super-agent-party/blob/main/main.js"
click node_chat_ui "https://github.com/heshengtao/super-agent-party/blob/main/static/js/renderer.js"
click node_avatar_ui "https://github.com/heshengtao/super-agent-party/blob/main/static/js/vrm.js"
click node_api_server "https://github.com/heshengtao/super-agent-party/blob/main/server.py"
click node_settings "https://github.com/heshengtao/super-agent-party/blob/main/py/get_setting.py"
click node_agent_tools "https://github.com/heshengtao/super-agent-party/blob/main/py/agent_tool.py"
click node_task_center "https://github.com/heshengtao/super-agent-party/blob/main/py/task_center.py"
click node_diary_engine "https://github.com/heshengtao/super-agent-party/blob/main/py/diary_engine.py"
click node_diary_chat "https://github.com/heshengtao/super-agent-party/blob/main/py/diary_chat_integration.py"
click node_diary_system "https://github.com/heshengtao/super-agent-party/blob/main/py/diary_system.py"
click node_behavior "https://github.com/heshengtao/super-agent-party/blob/main/py/behavior_engine.py"
click node_shortcuts "https://github.com/heshengtao/super-agent-party/blob/main/py/shortcut_commands.py"
click node_feishu "https://github.com/heshengtao/super-agent-party/blob/main/py/feishu_bot_manager.py"
click node_qq "https://github.com/heshengtao/super-agent-party/blob/main/py/qq_bot_manager.py"
click node_wechat "https://github.com/heshengtao/super-agent-party/blob/main/py/wechat_bot_manager.py"
click node_im_adapters "https://github.com/heshengtao/super-agent-party/blob/main/py/discord_bot_manager.py"
click node_live_router "https://github.com/heshengtao/super-agent-party/blob/main/py/live_router.py"
click node_live_client "https://github.com/heshengtao/super-agent-party/blob/main/py/blivedm/clients/ws_base.py"
click node_live_handlers "https://github.com/heshengtao/super-agent-party/blob/main/py/blivedm/handlers.py"
click node_live_models "https://github.com/heshengtao/super-agent-party/blob/main/py/blivedm/models/web.py"
click node_tha "https://github.com/heshengtao/super-agent-party/blob/main/py/tha_engine.py"
click node_vts "https://github.com/heshengtao/super-agent-party/blob/main/py/vts_manager.py"
click node_tts_runtime "https://github.com/heshengtao/super-agent-party/blob/main/py/moss/tts_runtime.py"
click node_onnx_runtime "https://github.com/heshengtao/super-agent-party/blob/main/py/moss/ort_cpu_runtime.py"
click node_tts_normalizer "https://github.com/heshengtao/super-agent-party/blob/main/py/moss/tts_robust_normalizer_single_script.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_desktop_host,node_chat_ui,node_avatar_ui,node_user toneBlue
class node_api_server,node_settings,node_agent_tools,node_task_center,node_diary_engine,node_diary_chat,node_diary_system,node_behavior,node_shortcuts toneAmber
class node_feishu,node_qq,node_wechat,node_im_adapters toneMint
class node_live_router,node_live_client,node_live_handlers,node_live_models toneRose
class node_tha,node_vts,node_tts_runtime,node_onnx_runtime,node_tts_normalizer toneIndigo
```

## Components

### Desktop experience

- [Desktop host](https://github.com/heshengtao/super-agent-party/blob/main/main.js): `main.js`
- [Chat interface](https://github.com/heshengtao/super-agent-party/blob/main/static/js/renderer.js): `static/js/renderer.js`
- [Avatar interface](https://github.com/heshengtao/super-agent-party/blob/main/static/js/vrm.js): `static/js/vrm.js`

### Agents and memory

- [API and app server](https://github.com/heshengtao/super-agent-party/blob/main/server.py): `server.py`
- [Settings and state](https://github.com/heshengtao/super-agent-party/blob/main/py/get_setting.py): `py/get_setting.py`
- [Agent tools](https://github.com/heshengtao/super-agent-party/blob/main/py/agent_tool.py): `py/agent_tool.py`
- [Background tasks](https://github.com/heshengtao/super-agent-party/blob/main/py/task_center.py): `py/task_center.py`
- [Memory scheduler](https://github.com/heshengtao/super-agent-party/blob/main/py/diary_engine.py): `py/diary_engine.py`
- [Chat memory integration](https://github.com/heshengtao/super-agent-party/blob/main/py/diary_chat_integration.py): `py/diary_chat_integration.py`
- [Memory system](https://github.com/heshengtao/super-agent-party/blob/main/py/diary_system.py): `py/diary_system.py`
- [Behavior scheduler](https://github.com/heshengtao/super-agent-party/blob/main/py/behavior_engine.py): `py/behavior_engine.py`
- [Shortcut commands](https://github.com/heshengtao/super-agent-party/blob/main/py/shortcut_commands.py): `py/shortcut_commands.py`

### Messaging integrations

- [Feishu bot](https://github.com/heshengtao/super-agent-party/blob/main/py/feishu_bot_manager.py): `py/feishu_bot_manager.py`
- [QQ bot](https://github.com/heshengtao/super-agent-party/blob/main/py/qq_bot_manager.py): `py/qq_bot_manager.py`
- [WeChat bot](https://github.com/heshengtao/super-agent-party/blob/main/py/wechat_bot_manager.py): `py/wechat_bot_manager.py`
- [Other IM bots](https://github.com/heshengtao/super-agent-party/blob/main/py/discord_bot_manager.py): `py/discord_bot_manager.py`

### Live streaming

- [Live-stream routing](https://github.com/heshengtao/super-agent-party/blob/main/py/live_router.py): `py/live_router.py`
- [Bilibili connection](https://github.com/heshengtao/super-agent-party/blob/main/py/blivedm/clients/ws_base.py): `py/blivedm/clients/ws_base.py`
- [Live message dispatch](https://github.com/heshengtao/super-agent-party/blob/main/py/blivedm/handlers.py): `py/blivedm/handlers.py`
- [Live message models](https://github.com/heshengtao/super-agent-party/blob/main/py/blivedm/models/web.py): `py/blivedm/models/web.py`

### Character and speech

- [THA character engine](https://github.com/heshengtao/super-agent-party/blob/main/py/tha_engine.py): `py/tha_engine.py`
- [VTube Studio control](https://github.com/heshengtao/super-agent-party/blob/main/py/vts_manager.py): `py/vts_manager.py`
- [Speech runtime](https://github.com/heshengtao/super-agent-party/blob/main/py/moss/tts_runtime.py): `py/moss/tts_runtime.py`
- [ONNX speech runtime](https://github.com/heshengtao/super-agent-party/blob/main/py/moss/ort_cpu_runtime.py): `py/moss/ort_cpu_runtime.py`
- [Speech normalizer](https://github.com/heshengtao/super-agent-party/blob/main/py/moss/tts_robust_normalizer_single_script.py): `py/moss/tts_robust_normalizer_single_script.py`

### Other components

- **User**

## Connections

- User → Chat interface: sends requests (evidence: `README.md`)
- Chat interface → API and app server: submits chat
- API and app server → Agent tools: invokes tools
- API and app server → Background tasks: starts tasks (evidence: `README.md`)
- API and app server → Chat memory integration: uses chat memory (evidence: `py/diary_engine.py`)
- Chat memory integration → Memory system: uses memory system (evidence: `py/diary_chat_integration.py`)
- Memory scheduler → Settings and state: loads settings (evidence: `py/diary_engine.py`)
- Memory scheduler → Behavior scheduler: dispatches behavior (evidence: `py/diary_engine.py`)
- Feishu bot → Behavior scheduler: updates behavior (evidence: `py/feishu_bot_manager.py`)
- QQ bot → Behavior scheduler: uses behavior
- WeChat bot → Behavior scheduler: updates behavior (evidence: `py/wechat_bot_manager.py`)
- Feishu bot → Shortcut commands: parses commands (evidence: `py/feishu_bot_manager.py`)
- WeChat bot → Shortcut commands: parses commands (evidence: `py/wechat_bot_manager.py`)
- QQ bot → Shortcut commands: uses commands (evidence: `py/qq_bot_manager.py`)
- User → Feishu bot: messages bot (evidence: `README.md`)
- User → QQ bot: messages bot (evidence: `README.md`)
- User → WeChat bot: messages bot (evidence: `README.md`)
- User → Other IM bots: messages bot (evidence: `README.md`)
- Live-stream routing → Bilibili connection: connects stream
- Bilibili connection → Live message dispatch: dispatches messages (evidence: `py/blivedm/clients/ws_base.py`)
- Live message dispatch → Live message models: converts messages (evidence: `py/blivedm/handlers.py`)
- Avatar interface → THA character engine: renders character (evidence: `README.md`)
- Avatar interface → VTube Studio control: controls model (evidence: `README.md`)
- Speech runtime → ONNX speech runtime: uses runtime (evidence: `py/moss/tts_runtime.py`)
- Speech runtime → Speech normalizer: uses normalizer (evidence: `py/moss/tts_runtime.py`)
