# heyongjun666/aicu-graph architecture

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

- Interactive diagram: https://gitdiagram.com/heyongjun666/aicu-graph
- Repository: https://github.com/heyongjun666/aicu-graph

## Overview

AICU-Graph is a multi-agent task orchestration workbench. A user creates and resumes a session; a Manager plans work into a graph, Workers execute tasks through installed AI CLIs, and the Manager reviews results and may request revisions. The web workbench displays graph state, logs, events, and shared workspace content. The README also documents role and skill configuration, MCP integrations, and session-level provider settings. Some runtime internals were not sampled, so their connections are shown only where documented or referenced by the source index.

Main entry points: [`executables/worker.py`](https://github.com/heyongjun666/aicu-graph/blob/main/executables/worker.py) (Worker agent), [`executables/manager.py`](https://github.com/heyongjun666/aicu-graph/blob/main/executables/manager.py) (Manager agent), [`frontend/src/App.tsx`](https://github.com/heyongjun666/aicu-graph/blob/main/frontend/src/App.tsx) (Workbench app), [`runtime/runtime.py`](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/runtime.py) (Graph runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Service and sessions"]
  node_main["Runtime entry<br/>[main.py]"]
  node_session_api["Session API<br/>[session_server.py]"]
  node_sessions["Session lifecycle<br/>[session_manager.py]"]
end

subgraph group_planning["Planning and execution"]
  node_planner["Task planner<br/>[planner.py]"]
  node_manager["Manager agent<br/>[manager.py]"]
  node_worker["Worker agent<br/>[worker.py]"]
  node_executable_base["Executable protocol<br/>[base.py]"]
end

subgraph group_runtime["Runtime services"]
  node_runtime_core["Graph runtime<br/>[runtime.py]"]
  node_graph["Task graph<br/>[graph.py]"]
  node_roles["Role management<br/>[roles_manager.py]"]
  node_skills["Skills management<br/>[skills_manager.py]"]
  node_workspace["Shared workspace"]
  node_event_bus["Event bus<br/>[event_bus.py]"]
  node_sse["Event streaming<br/>[sse_manager.py]"]
  node_persistence[("Session persistence<br/>[persistence.py]")]
end

subgraph group_integration["Agent integrations"]
  node_cli_adapters["CLI adapters<br/>[cli_adapters.py]"]
  node_aicu["AICU agent client<br/>[aicu.py]"]
  node_mcp_registry["MCP registry<br/>[mcp_manager.py]"]
  node_mcp_client["MCP connections<br/>[mcp_client.py]"]
end

subgraph group_workbench["Web workbench"]
  node_app["Workbench app<br/>[App.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_graph_store["Graph state<br/>[GraphStore.ts]"]
  node_ui_state["UI state<br/>[UIStateStore.ts]"]
  node_sse_provider["Live events<br/>[SSEProvider.tsx]"]
  node_settings["Workbench settings"]
end

node_user(("User"))
node_browser(("Workbench user"))

node_user -->|"creates tasks"| node_app
node_app -->|"requests data"| node_api_client
node_api_client -->|"calls HTTP API"| node_session_api
node_main -->|"starts service"| node_session_api
node_main -->|"creates manager"| node_sessions
node_sessions -->|"manages sessions"| node_runtime_core
node_runtime_core -.->|"maintains graph"| node_graph
node_runtime_core -.->|"dispatches work"| node_manager
node_manager -->|"plans tasks"| node_planner
node_manager -->|"assigns work"| node_worker
node_manager -->|"requests review"| node_aicu
node_worker -->|"runs task"| node_aicu
node_worker -->|"implements protocol"| node_executable_base
node_manager -->|"implements protocol"| node_executable_base
node_aicu -->|"uses adapters"| node_cli_adapters
node_worker -.->|"loads role config"| node_roles
node_worker -.->|"uses skills"| node_skills
node_aicu -->|"loads MCP config"| node_mcp_registry
node_mcp_client -->|"resolves servers"| node_mcp_registry
node_worker -->|"uses workspace"| node_workspace
node_runtime_core -.->|"publishes events"| node_event_bus
node_sse -->|"subscribes"| node_event_bus
node_sessions -.->|"stores session state"| node_persistence
node_browser -->|"uses workbench"| node_app
node_app -->|"updates graph"| node_graph_store
node_app -->|"opens event stream"| node_sse_provider
node_sse_provider -.->|"fetches event data"| node_api_client
node_settings -.->|"loads settings"| node_api_client
node_settings -.->|"updates preferences"| node_ui_state

click node_main "https://github.com/heyongjun666/aicu-graph/blob/main/main.py"
click node_session_api "https://github.com/heyongjun666/aicu-graph/blob/main/runtime/session_server.py"
click node_sessions "https://github.com/heyongjun666/aicu-graph/blob/main/runtime/session_manager.py"
click node_runtime_core "https://github.com/heyongjun666/aicu-graph/blob/main/runtime/runtime.py"
click node_graph "https://github.com/heyongjun666/aicu-graph/blob/main/runtime/graph.py"
click node_planner "https://github.com/heyongjun666/aicu-graph/blob/main/runtime/planner.py"
click node_manager "https://github.com/heyongjun666/aicu-graph/blob/main/executables/manager.py"
click node_worker "https://github.com/heyongjun666/aicu-graph/blob/main/executables/worker.py"
click node_executable_base "https://github.com/heyongjun666/aicu-graph/blob/main/executables/base.py"
click node_cli_adapters "https://github.com/heyongjun666/aicu-graph/blob/main/cli_adapters.py"
click node_aicu "https://github.com/heyongjun666/aicu-graph/blob/main/aicu.py"
click node_roles "https://github.com/heyongjun666/aicu-graph/blob/main/runtime/roles_manager.py"
click node_skills "https://github.com/heyongjun666/aicu-graph/blob/main/runtime/skills_manager.py"
click node_mcp_registry "https://github.com/heyongjun666/aicu-graph/blob/main/runtime/mcp_manager.py"
click node_mcp_client "https://github.com/heyongjun666/aicu-graph/blob/main/runtime/mcp_client.py"
click node_workspace "https://github.com/heyongjun666/aicu-graph/blob/main/runtime/workspace_resolver.py"
click node_event_bus "https://github.com/heyongjun666/aicu-graph/blob/main/runtime/event_bus.py"
click node_sse "https://github.com/heyongjun666/aicu-graph/blob/main/runtime/sse_manager.py"
click node_persistence "https://github.com/heyongjun666/aicu-graph/blob/main/runtime/persistence.py"
click node_app "https://github.com/heyongjun666/aicu-graph/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/heyongjun666/aicu-graph/blob/main/frontend/src/utils/api.ts"
click node_graph_store "https://github.com/heyongjun666/aicu-graph/blob/main/frontend/src/stores/GraphStore.ts"
click node_ui_state "https://github.com/heyongjun666/aicu-graph/blob/main/frontend/src/stores/UIStateStore.ts"
click node_sse_provider "https://github.com/heyongjun666/aicu-graph/blob/main/frontend/src/providers/SSEProvider.tsx"
click node_settings "https://github.com/heyongjun666/aicu-graph/blob/main/frontend/src/components/WorkbenchSettings.tsx"

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_main,node_session_api,node_sessions,node_user,node_browser toneBlue
class node_planner,node_manager,node_worker,node_executable_base toneAmber
class node_runtime_core,node_graph,node_roles,node_skills,node_workspace,node_event_bus,node_sse,node_persistence toneMint
class node_cli_adapters,node_aicu,node_mcp_registry,node_mcp_client toneRose
class node_app,node_api_client,node_graph_store,node_ui_state,node_sse_provider,node_settings toneIndigo
```

## Components

### Service and sessions

- [Runtime entry](https://github.com/heyongjun666/aicu-graph/blob/main/main.py): `main.py`
- [Session API](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/session_server.py): `runtime/session_server.py`
- [Session lifecycle](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/session_manager.py): `runtime/session_manager.py`

### Planning and execution

- [Task planner](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/planner.py): `runtime/planner.py`
- [Manager agent](https://github.com/heyongjun666/aicu-graph/blob/main/executables/manager.py): `executables/manager.py`
- [Worker agent](https://github.com/heyongjun666/aicu-graph/blob/main/executables/worker.py): `executables/worker.py`
- [Executable protocol](https://github.com/heyongjun666/aicu-graph/blob/main/executables/base.py): `executables/base.py`

### Runtime services

- [Graph runtime](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/runtime.py): `runtime/runtime.py`
- [Task graph](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/graph.py): `runtime/graph.py`
- [Role management](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/roles_manager.py): `runtime/roles_manager.py`
- [Skills management](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/skills_manager.py): `runtime/skills_manager.py`
- [Shared workspace](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/workspace_resolver.py): `runtime/workspace_resolver.py`
- [Event bus](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/event_bus.py): `runtime/event_bus.py`
- [Event streaming](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/sse_manager.py): `runtime/sse_manager.py`
- [Session persistence](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/persistence.py): `runtime/persistence.py`

### Agent integrations

- [CLI adapters](https://github.com/heyongjun666/aicu-graph/blob/main/cli_adapters.py): `cli_adapters.py`
- [AICU agent client](https://github.com/heyongjun666/aicu-graph/blob/main/aicu.py): `aicu.py`
- [MCP registry](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/mcp_manager.py): `runtime/mcp_manager.py`
- [MCP connections](https://github.com/heyongjun666/aicu-graph/blob/main/runtime/mcp_client.py): `runtime/mcp_client.py`

### Web workbench

- [Workbench app](https://github.com/heyongjun666/aicu-graph/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/heyongjun666/aicu-graph/blob/main/frontend/src/utils/api.ts): `frontend/src/utils/api.ts`
- [Graph state](https://github.com/heyongjun666/aicu-graph/blob/main/frontend/src/stores/GraphStore.ts): `frontend/src/stores/GraphStore.ts`
- [UI state](https://github.com/heyongjun666/aicu-graph/blob/main/frontend/src/stores/UIStateStore.ts): `frontend/src/stores/UIStateStore.ts`
- [Live events](https://github.com/heyongjun666/aicu-graph/blob/main/frontend/src/providers/SSEProvider.tsx): `frontend/src/providers/SSEProvider.tsx`
- [Workbench settings](https://github.com/heyongjun666/aicu-graph/blob/main/frontend/src/components/WorkbenchSettings.tsx): `frontend/src/components/WorkbenchSettings.tsx`

### Other components

- **User**
- **Workbench user**

## Connections

- User → Workbench app: creates tasks (evidence: `README.md`)
- Workbench app → API client: requests data (evidence: `frontend/src/App.tsx`)
- API client → Session API: calls HTTP API (evidence: `README.md`)
- Runtime entry → Session API: starts service (evidence: `main.py`)
- Runtime entry → Session lifecycle: creates manager (evidence: `main.py`)
- Session lifecycle → Graph runtime: manages sessions (evidence: `runtime/session_manager.py`)
- Graph runtime → Task graph: maintains graph
- Graph runtime → Manager agent: dispatches work
- Manager agent → Task planner: plans tasks (evidence: `README.md`)
- Manager agent → Worker agent: assigns work (evidence: `README.md`)
- Manager agent → AICU agent client: requests review (evidence: `executables/manager.py`)
- Worker agent → AICU agent client: runs task (evidence: `executables/worker.py`)
- Worker agent → Executable protocol: implements protocol (evidence: `executables/worker.py`)
- Manager agent → Executable protocol: implements protocol (evidence: `executables/manager.py`)
- AICU agent client → CLI adapters: uses adapters (evidence: `aicu.py`)
- Worker agent → Role management: loads role config
- Worker agent → Skills management: uses skills
- AICU agent client → MCP registry: loads MCP config (evidence: `aicu.py`)
- MCP connections → MCP registry: resolves servers (evidence: `runtime/mcp_client.py`)
- Worker agent → Shared workspace: uses workspace (evidence: `executables/worker.py`)
- Graph runtime → Event bus: publishes events
- Event streaming → Event bus: subscribes (evidence: `runtime/sse_manager.py`)
- Session lifecycle → Session persistence: stores session state (evidence: `runtime/session_manager.py`)
- Workbench user → Workbench app: uses workbench (evidence: `README.md`)
- Workbench app → Graph state: updates graph (evidence: `frontend/src/App.tsx`)
- Workbench app → Live events: opens event stream (evidence: `frontend/src/App.tsx`)
- Live events → API client: fetches event data
- Workbench settings → API client: loads settings
- Workbench settings → UI state: updates preferences
