# openclaw/openclaw-enterprise architecture

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

- Interactive diagram: https://gitdiagram.com/openclaw/openclaw-enterprise
- Repository: https://github.com/openclaw/openclaw-enterprise

## Overview

OpenClaw Enterprise is a vendor-neutral control plane for deploying and managing agents. The user workflow is to configure an installation, use the browser console or API to create an agent, and have the control plane provision it through compute and other drivers; operators can also reuse settings through presets. The graph preserves the documented runtime, persistence, authentication, and CLI capabilities. Source excerpts are partial, so some subsystem connections are documented at the product level rather than traced through every runtime call.

Main entry points: [`apps/controller/src/drivers/compute`](https://github.com/openclaw/openclaw-enterprise/tree/main/apps/controller/src/drivers/compute) (Compute Drivers), [`apps/controller/src/server.mjs`](https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/server.mjs) (API Server), [`apps/controller/src/composition/installation-config.ts`](https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/composition/installation-config.ts) (Installation Configuration), [`apps/controller/src/worker.ts`](https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/worker.ts) (Reconciliation Worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_console["Browser Console"]
  node_api["HTTP API"]
  node_go_cli["OCC CLI"]
end

subgraph group_control["Control Plane"]
  node_server["API Server<br/>[server.mjs]"]
  node_auth["Human Authentication<br/>[index.ts]"]
  node_config["Installation Configuration"]
end

subgraph group_domain["Agent Lifecycle"]
  node_contracts["Resource Contracts<br/>[resources.ts]"]
  node_routes["API Route Schemas<br/>[routes.ts]"]
  node_iam["Identity and Authorization<br/>[index.ts]"]
  node_occ["Resource Lifecycle"]
  node_worker["Reconciliation Worker<br/>[worker.ts]"]
  node_queue["Work Queue"]
  node_presets["Agent Presets<br/>[presets.ts]"]
end

subgraph group_drivers["Drivers and Integrations"]
  node_compute["Compute Drivers"]
  node_kubernetes_runtime["Kubernetes Runtime"]
  node_sandbox["OpenShell Sandbox<br/>[openshell.ts]"]
  node_repo_driver["GitHub Repository Driver<br/>[driver.ts]"]
  node_slack["Slack Channel Driver<br/>[slack.ts]"]
  node_backend["Model Backends"]
end

subgraph group_platform["Platform Services"]
  node_state[("Persistent State<br/>[postgres-state.ts]")]
  node_repository_sessions["Repository Sessions"]
  node_metrics["Metrics<br/>[index.ts]"]
end

node_operator(("Operator"))

node_operator -->|"manages agents"| node_console
node_operator -->|"operates platform"| node_go_cli
node_console -.->|"uses API"| node_api
node_api -.->|"served by"| node_server
node_server -->|"configures"| node_auth
node_server -->|"loads configuration"| node_config
node_server -->|"creates metrics"| node_metrics
node_config -->|"loads drivers"| node_compute
node_api -.->|"implements routes"| node_routes
node_routes -->|"uses schemas"| node_contracts
node_worker -->|"reconciles work"| node_occ
node_worker -.->|"processes queued work"| node_queue
node_occ -.->|"persists lifecycle"| node_state
node_state -.->|"stores work"| node_queue
node_repository_sessions -.->|"persisted in"| node_state
node_worker -.->|"provisions agents"| node_compute
node_compute -->|"includes runtime"| node_kubernetes_runtime
node_compute -.->|"supports sandbox"| node_sandbox
node_compute -.->|"uses repository driver"| node_repo_driver
node_config -->|"loads channel driver"| node_slack
node_config -.->|"configures backends"| node_backend
node_operator -->|"reuses settings"| node_presets
node_presets -->|"fills draft"| node_console

click node_console "https://github.com/openclaw/openclaw-enterprise/tree/main/apps/controller/src/console"
click node_api "https://github.com/openclaw/openclaw-enterprise/tree/main/apps/controller/src/http"
click node_go_cli "https://github.com/openclaw/openclaw-enterprise/tree/main/internal/occcli"
click node_server "https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/server.mjs"
click node_auth "https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/auth/index.ts"
click node_config "https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/composition/installation-config.ts"
click node_contracts "https://github.com/openclaw/openclaw-enterprise/blob/main/packages/contracts/src/api/resources.ts"
click node_routes "https://github.com/openclaw/openclaw-enterprise/blob/main/packages/contracts/src/api/routes.ts"
click node_iam "https://github.com/openclaw/openclaw-enterprise/blob/main/packages/iam/src/index.ts"
click node_occ "https://github.com/openclaw/openclaw-enterprise/tree/main/packages/occ/src"
click node_worker "https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/worker.ts"
click node_queue "https://github.com/openclaw/openclaw-enterprise/blob/main/packages/occ/src/state/postgres-work-queue.ts"
click node_state "https://github.com/openclaw/openclaw-enterprise/blob/main/packages/occ/src/state/postgres-state.ts"
click node_repository_sessions "https://github.com/openclaw/openclaw-enterprise/blob/main/packages/occ/src/ports/repository-sessions.ts"
click node_compute "https://github.com/openclaw/openclaw-enterprise/tree/main/apps/controller/src/drivers/compute"
click node_kubernetes_runtime "https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/drivers/compute/kubernetes/runtime-entrypoints.ts"
click node_sandbox "https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/drivers/sandbox/openshell.ts"
click node_repo_driver "https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/drivers/repo/github/driver.ts"
click node_slack "https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/drivers/channel/slack.ts"
click node_backend "https://github.com/openclaw/openclaw-enterprise/tree/main/apps/controller/src/backends"
click node_presets "https://github.com/openclaw/openclaw-enterprise/blob/main/packages/contracts/src/presets.ts"
click node_metrics "https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/metrics/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_console,node_api,node_go_cli toneBlue
class node_server,node_auth,node_config toneAmber
class node_contracts,node_routes,node_iam,node_occ,node_worker,node_queue,node_presets toneMint
class node_compute,node_kubernetes_runtime,node_sandbox,node_repo_driver,node_slack,node_backend toneRose
class node_state,node_repository_sessions,node_metrics,node_operator toneIndigo
```

## Components

### User Interfaces

- [Browser Console](https://github.com/openclaw/openclaw-enterprise/tree/main/apps/controller/src/console): `apps/controller/src/console`
- [HTTP API](https://github.com/openclaw/openclaw-enterprise/tree/main/apps/controller/src/http): `apps/controller/src/http`
- [OCC CLI](https://github.com/openclaw/openclaw-enterprise/tree/main/internal/occcli): `internal/occcli`

### Control Plane

- [API Server](https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/server.mjs): `apps/controller/src/server.mjs`
- [Human Authentication](https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/auth/index.ts): `apps/controller/src/auth/index.ts`
- [Installation Configuration](https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/composition/installation-config.ts): `apps/controller/src/composition/installation-config.ts`

### Agent Lifecycle

- [Resource Contracts](https://github.com/openclaw/openclaw-enterprise/blob/main/packages/contracts/src/api/resources.ts): `packages/contracts/src/api/resources.ts`
- [API Route Schemas](https://github.com/openclaw/openclaw-enterprise/blob/main/packages/contracts/src/api/routes.ts): `packages/contracts/src/api/routes.ts`
- [Identity and Authorization](https://github.com/openclaw/openclaw-enterprise/blob/main/packages/iam/src/index.ts): `packages/iam/src/index.ts`
- [Resource Lifecycle](https://github.com/openclaw/openclaw-enterprise/tree/main/packages/occ/src): `packages/occ/src`
- [Reconciliation Worker](https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/worker.ts): `apps/controller/src/worker.ts`
- [Work Queue](https://github.com/openclaw/openclaw-enterprise/blob/main/packages/occ/src/state/postgres-work-queue.ts): `packages/occ/src/state/postgres-work-queue.ts`
- [Agent Presets](https://github.com/openclaw/openclaw-enterprise/blob/main/packages/contracts/src/presets.ts): `packages/contracts/src/presets.ts`

### Drivers and Integrations

- [Compute Drivers](https://github.com/openclaw/openclaw-enterprise/tree/main/apps/controller/src/drivers/compute): `apps/controller/src/drivers/compute`
- [Kubernetes Runtime](https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/drivers/compute/kubernetes/runtime-entrypoints.ts): `apps/controller/src/drivers/compute/kubernetes/runtime-entrypoints.ts`
- [OpenShell Sandbox](https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/drivers/sandbox/openshell.ts): `apps/controller/src/drivers/sandbox/openshell.ts`
- [GitHub Repository Driver](https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/drivers/repo/github/driver.ts): `apps/controller/src/drivers/repo/github/driver.ts`
- [Slack Channel Driver](https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/drivers/channel/slack.ts): `apps/controller/src/drivers/channel/slack.ts`
- [Model Backends](https://github.com/openclaw/openclaw-enterprise/tree/main/apps/controller/src/backends): `apps/controller/src/backends`

### Platform Services

- [Persistent State](https://github.com/openclaw/openclaw-enterprise/blob/main/packages/occ/src/state/postgres-state.ts): `packages/occ/src/state/postgres-state.ts`
- [Repository Sessions](https://github.com/openclaw/openclaw-enterprise/blob/main/packages/occ/src/ports/repository-sessions.ts): `packages/occ/src/ports/repository-sessions.ts`
- [Metrics](https://github.com/openclaw/openclaw-enterprise/blob/main/apps/controller/src/metrics/index.ts): `apps/controller/src/metrics/index.ts`

### Other components

- **Operator**

## Connections

- Operator → Browser Console: manages agents (evidence: `README.md`)
- Operator → OCC CLI: operates platform (evidence: `README.md`)
- Browser Console → HTTP API: uses API
- HTTP API → API Server: served by
- API Server → Human Authentication: configures (evidence: `apps/controller/src/server.mjs`)
- API Server → Installation Configuration: loads configuration (evidence: `apps/controller/src/server.mjs`)
- API Server → Metrics: creates metrics (evidence: `apps/controller/src/server.mjs`)
- Installation Configuration → Compute Drivers: loads drivers (evidence: `apps/controller/src/composition/installation-config.ts`)
- HTTP API → API Route Schemas: implements routes
- API Route Schemas → Resource Contracts: uses schemas (evidence: `packages/contracts/src/api/routes.ts`)
- Reconciliation Worker → Resource Lifecycle: reconciles work (evidence: `apps/controller/src/worker.ts`)
- Reconciliation Worker → Work Queue: processes queued work
- Resource Lifecycle → Persistent State: persists lifecycle
- Persistent State → Work Queue: stores work
- Repository Sessions → Persistent State: persisted in
- Reconciliation Worker → Compute Drivers: provisions agents (evidence: `apps/controller/src/worker.ts`)
- Compute Drivers → Kubernetes Runtime: includes runtime (evidence: `apps/controller/src/drivers/compute/kubernetes/repository-material.ts`)
- Compute Drivers → OpenShell Sandbox: supports sandbox
- Compute Drivers → GitHub Repository Driver: uses repository driver
- Installation Configuration → Slack Channel Driver: loads channel driver (evidence: `apps/controller/src/composition/installation-config.ts`)
- Installation Configuration → Model Backends: configures backends (evidence: `apps/controller/src/composition/installation-config.ts`)
- Operator → Agent Presets: reuses settings (evidence: `README.md`)
- Agent Presets → Browser Console: fills draft (evidence: `README.md`)
