# gust-feng/agentarbor architecture

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

- Interactive diagram: https://gitdiagram.com/gust-feng/agentarbor
- Repository: https://github.com/gust-feng/agentarbor

## Overview

AgentArbor is a local-first desktop agent workbench. The main workflow is a user submitting a task in the workbench, the panel server routing it to an ordinary-agent run, and the agent using a model and available tools to work with real files; run observations return to the UI. Spaces organize work, while editable memory and the personal knowledge vault preserve reusable assets. The README documents model providers, MCP, Skills and delegated sub-agents as capabilities. Sampled source excerpts are partial, so some subsystem connections are shown only where the tree, documentation or excerpts support them.

Main entry points: [`src/app/panel-server/ordinary-routes.ts`](https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-server/ordinary-routes.ts) (Conversation routes), [`src/app/panel-server/space-routes.ts`](https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-server/space-routes.ts) (Space routes), [`src/app/ordinary-agent/ordinary-agent-feature.ts`](https://github.com/gust-feng/agentarbor/blob/main/src/app/ordinary-agent/ordinary-agent-feature.ts) (Ordinary agent), [`src/app/model-runtime/agent-loop.ts`](https://github.com/gust-feng/agentarbor/blob/main/src/app/model-runtime/agent-loop.ts) (Agent loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workbench["Workbench UI"]
  node_panel_ui["Desktop workbench<br/>[App.tsx]"]
  node_conversation_ui["Conversation UI"]
  node_preview_ui["Document previews"]
end

subgraph group_panel["Panel server"]
  node_server_runtime["Panel runtime<br/>[runtime.ts]"]
  node_ordinary_routes["Conversation routes<br/>[ordinary-routes.ts]"]
  node_space_routes["Space routes<br/>[space-routes.ts]"]
  node_deep_routes["Multi-agent routes<br/>[deep-routes.ts]"]
end

subgraph group_agent["Agent execution"]
  node_ordinary_feature["Ordinary agent"]
  node_agent_loop["Agent loop<br/>[agent-loop.ts]"]
  node_session_repo[("Agent sessions")]
  node_agent_definitions["Agent definitions"]
  node_deep_manager["Deep manager"]
end

subgraph group_assets["Spaces and assets"]
  node_spaces["Spaces and references<br/>[space-routes.ts]"]
  node_filesystem["Local files<br/>[index.ts]"]
  node_memory["Agent memory"]
  node_knowledge_vault[("Personal knowledge vault<br/>[index.ts]")]
  node_vault_sync["Vault sync"]
end

subgraph group_integrations["Models and tools"]
  node_model_runtime["Model runtime<br/>[factory.ts]"]
  node_model_providers["Model providers<br/>[index.ts]"]
  node_mcp["MCP tools<br/>[mcp-manager.ts]"]
  node_capabilities["Tool capabilities"]
  node_settings["Workbench settings<br/>[index.ts]"]
end

node_user(("Workbench user"))

node_user -->|"submits task"| node_conversation_ui
node_conversation_ui -->|"sends request"| node_ordinary_routes
node_ordinary_routes -->|"submits turn"| node_ordinary_feature
node_ordinary_feature -->|"executes run"| node_agent_loop
node_ordinary_feature -->|"persists session"| node_session_repo
node_agent_loop -->|"requests inference"| node_model_runtime
node_model_runtime -->|"dispatches model call"| node_model_providers
node_agent_loop -->|"uses tools"| node_capabilities
node_capabilities -->|"accesses files"| node_filesystem
node_capabilities -.->|"dispatches MCP tools"| node_mcp
node_ordinary_routes -->|"streams run updates"| node_conversation_ui
node_user -->|"organizes work"| node_panel_ui
node_panel_ui -->|"requests space operations"| node_space_routes
node_space_routes -->|"reads and mutates"| node_spaces
node_preview_ui -->|"fetches previews"| node_space_routes
node_space_routes -->|"returns preview"| node_preview_ui
node_ordinary_routes -->|"serves memory routes"| node_memory
node_user -->|"maintains knowledge"| node_knowledge_vault
node_vault_sync -->|"synchronizes assets"| node_knowledge_vault
node_server_runtime -->|"provides runtime"| node_ordinary_feature
node_server_runtime -->|"configures agents"| node_agent_definitions
node_deep_routes -->|"runs multi-agent turns"| node_deep_manager
node_deep_manager -->|"requests model turns"| node_model_runtime
node_user -->|"configures providers and tools"| node_settings
node_settings -->|"configures access"| node_model_providers

click node_panel_ui "https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-ui/src/App.tsx"
click node_conversation_ui "https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-ui/src/personal-workbench/workbench/app/components/ConversationPage.tsx"
click node_preview_ui "https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-ui/src/personal-workbench/workbench/app/components/referencePreviewClient.ts"
click node_server_runtime "https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-server/runtime.ts"
click node_ordinary_routes "https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-server/ordinary-routes.ts"
click node_space_routes "https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-server/space-routes.ts"
click node_deep_routes "https://github.com/gust-feng/agentarbor/blob/main/src/deferred/deep-routes.ts"
click node_ordinary_feature "https://github.com/gust-feng/agentarbor/blob/main/src/app/ordinary-agent/ordinary-agent-feature.ts"
click node_agent_loop "https://github.com/gust-feng/agentarbor/blob/main/src/app/model-runtime/agent-loop.ts"
click node_session_repo "https://github.com/gust-feng/agentarbor/blob/main/src/adapters/intelligence/file-system-agent-session-repository.ts"
click node_agent_definitions "https://github.com/gust-feng/agentarbor/blob/main/src/app/agent-definitions/agent-definition-runtime.ts"
click node_deep_manager "https://github.com/gust-feng/agentarbor/blob/main/src/deferred/deep/deep-manager-turns.ts"
click node_spaces "https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-server/space-routes.ts"
click node_filesystem "https://github.com/gust-feng/agentarbor/blob/main/src/app/local-filesystem/index.ts"
click node_memory "https://github.com/gust-feng/agentarbor/blob/main/src/app/agent-notes/agent-notes-feature.ts"
click node_knowledge_vault "https://github.com/gust-feng/agentarbor/blob/main/src/app/content-vault/index.ts"
click node_vault_sync "https://github.com/gust-feng/agentarbor/blob/main/src/app/content-vault-sync/content-vault-sync-feature.ts"
click node_model_runtime "https://github.com/gust-feng/agentarbor/blob/main/src/app/model-runtime/factory.ts"
click node_model_providers "https://github.com/gust-feng/agentarbor/blob/main/src/adapters/intelligence/index.ts"
click node_mcp "https://github.com/gust-feng/agentarbor/blob/main/src/adapters/mcp/mcp-manager.ts"
click node_capabilities "https://github.com/gust-feng/agentarbor/blob/main/src/app/capability/capability-center.ts"
click node_settings "https://github.com/gust-feng/agentarbor/blob/main/src/app/config-center/index.ts"

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_panel_ui,node_conversation_ui,node_preview_ui,node_user toneBlue
class node_server_runtime,node_ordinary_routes,node_space_routes,node_deep_routes toneAmber
class node_ordinary_feature,node_agent_loop,node_session_repo,node_agent_definitions,node_deep_manager toneMint
class node_spaces,node_filesystem,node_memory,node_knowledge_vault,node_vault_sync toneRose
class node_model_runtime,node_model_providers,node_mcp,node_capabilities,node_settings toneIndigo
```

## Components

### Workbench UI

- [Desktop workbench](https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-ui/src/App.tsx): `src/app/panel-ui/src/App.tsx`
- [Conversation UI](https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-ui/src/personal-workbench/workbench/app/components/ConversationPage.tsx): `src/app/panel-ui/src/personal-workbench/workbench/app/components/ConversationPage.tsx`
- [Document previews](https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-ui/src/personal-workbench/workbench/app/components/referencePreviewClient.ts): `src/app/panel-ui/src/personal-workbench/workbench/app/components/referencePreviewClient.ts`

### Panel server

- [Panel runtime](https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-server/runtime.ts): `src/app/panel-server/runtime.ts`
- [Conversation routes](https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-server/ordinary-routes.ts): `src/app/panel-server/ordinary-routes.ts`
- [Space routes](https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-server/space-routes.ts): `src/app/panel-server/space-routes.ts`
- [Multi-agent routes](https://github.com/gust-feng/agentarbor/blob/main/src/deferred/deep-routes.ts): `src/deferred/deep-routes.ts`

### Agent execution

- [Ordinary agent](https://github.com/gust-feng/agentarbor/blob/main/src/app/ordinary-agent/ordinary-agent-feature.ts): `src/app/ordinary-agent/ordinary-agent-feature.ts`
- [Agent loop](https://github.com/gust-feng/agentarbor/blob/main/src/app/model-runtime/agent-loop.ts): `src/app/model-runtime/agent-loop.ts`
- [Agent sessions](https://github.com/gust-feng/agentarbor/blob/main/src/adapters/intelligence/file-system-agent-session-repository.ts): `src/adapters/intelligence/file-system-agent-session-repository.ts`
- [Agent definitions](https://github.com/gust-feng/agentarbor/blob/main/src/app/agent-definitions/agent-definition-runtime.ts): `src/app/agent-definitions/agent-definition-runtime.ts`
- [Deep manager](https://github.com/gust-feng/agentarbor/blob/main/src/deferred/deep/deep-manager-turns.ts): `src/deferred/deep/deep-manager-turns.ts`

### Spaces and assets

- [Spaces and references](https://github.com/gust-feng/agentarbor/blob/main/src/app/panel-server/space-routes.ts): `src/app/panel-server/space-routes.ts`
- [Local files](https://github.com/gust-feng/agentarbor/blob/main/src/app/local-filesystem/index.ts): `src/app/local-filesystem/index.ts`
- [Agent memory](https://github.com/gust-feng/agentarbor/blob/main/src/app/agent-notes/agent-notes-feature.ts): `src/app/agent-notes/agent-notes-feature.ts`
- [Personal knowledge vault](https://github.com/gust-feng/agentarbor/blob/main/src/app/content-vault/index.ts): `src/app/content-vault/index.ts`
- [Vault sync](https://github.com/gust-feng/agentarbor/blob/main/src/app/content-vault-sync/content-vault-sync-feature.ts): `src/app/content-vault-sync/content-vault-sync-feature.ts`

### Models and tools

- [Model runtime](https://github.com/gust-feng/agentarbor/blob/main/src/app/model-runtime/factory.ts): `src/app/model-runtime/factory.ts`
- [Model providers](https://github.com/gust-feng/agentarbor/blob/main/src/adapters/intelligence/index.ts): `src/adapters/intelligence/index.ts`
- [MCP tools](https://github.com/gust-feng/agentarbor/blob/main/src/adapters/mcp/mcp-manager.ts): `src/adapters/mcp/mcp-manager.ts`
- [Tool capabilities](https://github.com/gust-feng/agentarbor/blob/main/src/app/capability/capability-center.ts): `src/app/capability/capability-center.ts`
- [Workbench settings](https://github.com/gust-feng/agentarbor/blob/main/src/app/config-center/index.ts): `src/app/config-center/index.ts`

### Other components

- **Workbench user**

## Connections

- Workbench user → Conversation UI: submits task
- Conversation UI → Conversation routes: sends request
- Conversation routes → Ordinary agent: submits turn
- Ordinary agent → Agent loop: executes run
- Ordinary agent → Agent sessions: persists session
- Agent loop → Model runtime: requests inference
- Model runtime → Model providers: dispatches model call
- Agent loop → Tool capabilities: uses tools
- Tool capabilities → Local files: accesses files
- Tool capabilities → MCP tools: dispatches MCP tools
- Conversation routes → Conversation UI: streams run updates
- Workbench user → Desktop workbench: organizes work
- Desktop workbench → Space routes: requests space operations
- Space routes → Spaces and references: reads and mutates
- Document previews → Space routes: fetches previews
- Space routes → Document previews: returns preview
- Conversation routes → Agent memory: serves memory routes
- Workbench user → Personal knowledge vault: maintains knowledge
- Vault sync → Personal knowledge vault: synchronizes assets
- Panel runtime → Ordinary agent: provides runtime
- Panel runtime → Agent definitions: configures agents
- Multi-agent routes → Deep manager: runs multi-agent turns
- Deep manager → Model runtime: requests model turns
- Workbench user → Workbench settings: configures providers and tools
- Workbench settings → Model providers: configures access
