# orchestratorinc/agent-orchestrator architecture

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

- Interactive diagram: https://gitdiagram.com/orchestratorinc/agent-orchestrator
- Repository: https://github.com/orchestratorinc/agent-orchestrator

## Overview

Orchestrator.inc is a desktop workspace and local daemon for planning, running, and supervising coding-agent tasks, with a cloud control plane and mobile client. The principal flow is task creation, isolated worker execution, and ongoing inspection through conversation, terminal, changes, previews, pull requests, CI, and review; a project orchestrator can plan and delegate work across workers. The graph preserves documented product stages and selected internal layers. Some links are documented in the README; unsampled subsystem connections are omitted rather than inferred.

Main entry points: [`frontend/src/renderer/hooks/useWorkspaceQuery.ts`](https://github.com/orchestratorinc/agent-orchestrator/blob/main/frontend/src/renderer/hooks/useWorkspaceQuery.ts) (Workspace board), [`backend/internal/session_manager/manager.go`](https://github.com/orchestratorinc/agent-orchestrator/blob/main/backend/internal/session_manager/manager.go) (Session manager), [`cloud/cmd/ao-cloud/main.go`](https://github.com/orchestratorinc/agent-orchestrator/blob/main/cloud/cmd/ao-cloud/main.go) (Cloud control plane), [`frontend/src/main.ts`](https://github.com/orchestratorinc/agent-orchestrator/blob/main/frontend/src/main.ts) (Desktop app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop workspace"]
  node_desktop_app["Desktop app<br/>[main.ts]"]
  node_workspace_board["Workspace board"]
  node_api_client["Daemon API client<br/>[api-client.ts]"]
  node_host_clients["Remote host clients<br/>[host-clients.ts]"]
end

subgraph group_execution["Agent execution"]
  node_local_daemon["Local daemon<br/>[main.go]"]
  node_session_manager["Session manager<br/>[manager.go]"]
  node_agent_adapters["Agent adapters"]
  node_chat_service["Chat service<br/>[controller.go]"]
  node_terminal_service["Terminal service<br/>[manager.go]"]
  node_preview_service["Browser previews<br/>[manager.go]"]
  node_lifecycle["Session lifecycle<br/>[manager.go]"]
end

subgraph group_cloud["Cloud coordination"]
  node_cloud_api["Cloud control plane<br/>[main.go]"]
  node_worker_api["Worker orchestration API"]
  node_cloud_worker["Sandbox worker<br/>[main.go]"]
  node_worker_store[("Worker session store")]
end

subgraph group_shared["Shared services"]
  node_cloud_client["Cloud client<br/>[client.ts]"]
  node_product_ui["Session inspector"]
end

subgraph group_mobile["Mobile client"]
  node_mobile_launcher["Mobile launcher"]
  node_mobile_api["Mobile API<br/>[api.ts]"]
end

node_developer(("Developer"))

node_developer -->|"opens workspace"| node_desktop_app
node_desktop_app -->|"starts daemon"| node_local_daemon
node_developer -->|"creates task"| node_workspace_board
node_workspace_board -->|"loads workspace"| node_api_client
node_api_client -->|"requests data"| node_local_daemon
node_workspace_board -->|"selects remote host"| node_host_clients
node_developer -->|"starts worker"| node_session_manager
node_session_manager -.->|"launches agent"| node_agent_adapters
node_session_manager -.->|"manages sessions"| node_lifecycle
node_developer -->|"sends feedback"| node_chat_service
node_developer -->|"attaches terminal"| node_terminal_service
node_developer -->|"opens preview"| node_preview_service
node_developer -.->|"uses cloud services"| node_cloud_api
node_cloud_api -.->|"routes orchestration"| node_worker_api
node_worker_api -->|"reads and writes"| node_worker_store
node_cloud_worker -->|"connects outward"| node_cloud_api
node_developer -.->|"uses cloud features"| node_cloud_client
node_developer -->|"inspects session"| node_product_ui
node_developer -->|"launches orchestrator"| node_mobile_launcher
node_mobile_launcher -.->|"starts or resumes"| node_mobile_api

click node_desktop_app "https://github.com/orchestratorinc/agent-orchestrator/blob/main/frontend/src/main.ts"
click node_workspace_board "https://github.com/orchestratorinc/agent-orchestrator/blob/main/frontend/src/renderer/hooks/useWorkspaceQuery.ts"
click node_api_client "https://github.com/orchestratorinc/agent-orchestrator/blob/main/frontend/src/renderer/lib/api-client.ts"
click node_host_clients "https://github.com/orchestratorinc/agent-orchestrator/blob/main/frontend/src/renderer/lib/host-clients.ts"
click node_local_daemon "https://github.com/orchestratorinc/agent-orchestrator/blob/main/backend/main.go"
click node_session_manager "https://github.com/orchestratorinc/agent-orchestrator/blob/main/backend/internal/session_manager/manager.go"
click node_agent_adapters "https://github.com/orchestratorinc/agent-orchestrator/tree/main/backend/internal/adapters/agent"
click node_chat_service "https://github.com/orchestratorinc/agent-orchestrator/blob/main/backend/internal/service/chat/controller.go"
click node_terminal_service "https://github.com/orchestratorinc/agent-orchestrator/blob/main/backend/internal/terminal/manager.go"
click node_preview_service "https://github.com/orchestratorinc/agent-orchestrator/blob/main/backend/internal/previewserver/manager.go"
click node_lifecycle "https://github.com/orchestratorinc/agent-orchestrator/blob/main/backend/internal/lifecycle/manager.go"
click node_cloud_api "https://github.com/orchestratorinc/agent-orchestrator/blob/main/cloud/cmd/ao-cloud/main.go"
click node_worker_api "https://github.com/orchestratorinc/agent-orchestrator/blob/main/cloud/internal/httpapi/worker_orchestration_handlers.go"
click node_cloud_worker "https://github.com/orchestratorinc/agent-orchestrator/blob/main/cloud/cmd/ao-worker/main.go"
click node_worker_store "https://github.com/orchestratorinc/agent-orchestrator/blob/main/cloud/internal/postgres/worker_session_store.go"
click node_cloud_client "https://github.com/orchestratorinc/agent-orchestrator/blob/main/packages/cloud-client/src/client.ts"
click node_product_ui "https://github.com/orchestratorinc/agent-orchestrator/blob/main/packages/product-ui/src/SessionInspectorView.tsx"
click node_mobile_launcher "https://github.com/orchestratorinc/agent-orchestrator/blob/main/packages/mobile/lib/useOrchestratorLauncher.ts"
click node_mobile_api "https://github.com/orchestratorinc/agent-orchestrator/blob/main/packages/mobile/lib/api.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_desktop_app,node_workspace_board,node_api_client,node_host_clients toneBlue
class node_local_daemon,node_session_manager,node_agent_adapters,node_chat_service,node_terminal_service,node_preview_service,node_lifecycle toneAmber
class node_cloud_api,node_worker_api,node_cloud_worker,node_worker_store toneMint
class node_cloud_client,node_product_ui toneRose
class node_mobile_launcher,node_mobile_api,node_developer toneIndigo
```

## Components

### Desktop workspace

- [Desktop app](https://github.com/orchestratorinc/agent-orchestrator/blob/main/frontend/src/main.ts): `frontend/src/main.ts`
- [Workspace board](https://github.com/orchestratorinc/agent-orchestrator/blob/main/frontend/src/renderer/hooks/useWorkspaceQuery.ts): `frontend/src/renderer/hooks/useWorkspaceQuery.ts`
- [Daemon API client](https://github.com/orchestratorinc/agent-orchestrator/blob/main/frontend/src/renderer/lib/api-client.ts): `frontend/src/renderer/lib/api-client.ts`
- [Remote host clients](https://github.com/orchestratorinc/agent-orchestrator/blob/main/frontend/src/renderer/lib/host-clients.ts): `frontend/src/renderer/lib/host-clients.ts`

### Agent execution

- [Local daemon](https://github.com/orchestratorinc/agent-orchestrator/blob/main/backend/main.go): `backend/main.go`
- [Session manager](https://github.com/orchestratorinc/agent-orchestrator/blob/main/backend/internal/session_manager/manager.go): `backend/internal/session_manager/manager.go`
- [Agent adapters](https://github.com/orchestratorinc/agent-orchestrator/tree/main/backend/internal/adapters/agent): `backend/internal/adapters/agent`
- [Chat service](https://github.com/orchestratorinc/agent-orchestrator/blob/main/backend/internal/service/chat/controller.go): `backend/internal/service/chat/controller.go`
- [Terminal service](https://github.com/orchestratorinc/agent-orchestrator/blob/main/backend/internal/terminal/manager.go): `backend/internal/terminal/manager.go`
- [Browser previews](https://github.com/orchestratorinc/agent-orchestrator/blob/main/backend/internal/previewserver/manager.go): `backend/internal/previewserver/manager.go`
- [Session lifecycle](https://github.com/orchestratorinc/agent-orchestrator/blob/main/backend/internal/lifecycle/manager.go): `backend/internal/lifecycle/manager.go`

### Cloud coordination

- [Cloud control plane](https://github.com/orchestratorinc/agent-orchestrator/blob/main/cloud/cmd/ao-cloud/main.go): `cloud/cmd/ao-cloud/main.go`
- [Worker orchestration API](https://github.com/orchestratorinc/agent-orchestrator/blob/main/cloud/internal/httpapi/worker_orchestration_handlers.go): `cloud/internal/httpapi/worker_orchestration_handlers.go`
- [Sandbox worker](https://github.com/orchestratorinc/agent-orchestrator/blob/main/cloud/cmd/ao-worker/main.go): `cloud/cmd/ao-worker/main.go`
- [Worker session store](https://github.com/orchestratorinc/agent-orchestrator/blob/main/cloud/internal/postgres/worker_session_store.go): `cloud/internal/postgres/worker_session_store.go`

### Shared services

- [Cloud client](https://github.com/orchestratorinc/agent-orchestrator/blob/main/packages/cloud-client/src/client.ts): `packages/cloud-client/src/client.ts`
- [Session inspector](https://github.com/orchestratorinc/agent-orchestrator/blob/main/packages/product-ui/src/SessionInspectorView.tsx): `packages/product-ui/src/SessionInspectorView.tsx`

### Mobile client

- [Mobile launcher](https://github.com/orchestratorinc/agent-orchestrator/blob/main/packages/mobile/lib/useOrchestratorLauncher.ts): `packages/mobile/lib/useOrchestratorLauncher.ts`
- [Mobile API](https://github.com/orchestratorinc/agent-orchestrator/blob/main/packages/mobile/lib/api.ts): `packages/mobile/lib/api.ts`

### Other components

- **Developer**

## Connections

- Developer → Desktop app: opens workspace (evidence: `README.md`)
- Desktop app → Local daemon: starts daemon (evidence: `README.md`)
- Developer → Workspace board: creates task (evidence: `README.md`)
- Workspace board → Daemon API client: loads workspace (evidence: `frontend/src/renderer/hooks/useWorkspaceQuery.ts`)
- Daemon API client → Local daemon: requests data (evidence: `README.md`)
- Workspace board → Remote host clients: selects remote host (evidence: `frontend/src/renderer/hooks/useWorkspaceQuery.ts`)
- Developer → Session manager: starts worker (evidence: `README.md`)
- Session manager → Agent adapters: launches agent (evidence: `backend/internal/session_manager/manager.go`)
- Session manager → Session lifecycle: manages sessions
- Developer → Chat service: sends feedback (evidence: `README.md`)
- Developer → Terminal service: attaches terminal (evidence: `README.md`)
- Developer → Browser previews: opens preview (evidence: `README.md`)
- Developer → Cloud control plane: uses cloud services
- Cloud control plane → Worker orchestration API: routes orchestration
- Worker orchestration API → Worker session store: reads and writes (evidence: `cloud/internal/httpapi/worker_orchestration_handlers.go`)
- Sandbox worker → Cloud control plane: connects outward (evidence: `cloud/cmd/ao-worker/main.go`)
- Developer → Cloud client: uses cloud features
- Developer → Session inspector: inspects session (evidence: `README.md`)
- Developer → Mobile launcher: launches orchestrator (evidence: `packages/mobile/lib/useOrchestratorLauncher.ts`)
- Mobile launcher → Mobile API: starts or resumes (evidence: `packages/mobile/lib/useOrchestratorLauncher.ts`)
