# agentbull/ankole architecture

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

- Interactive diagram: https://gitdiagram.com/agentbull/ankole
- Repository: https://github.com/agentbull/ankole

## Overview

Ankole is an enterprise agent harness backed by a shared Company Brain. Its main workflow admits an event, schedules an addressable actor, runs a turn on an Agent Computer worker, routes model requests through the control plane, and preserves durable state and results. The README documents the boundaries and major capabilities; sampled source confirms actor serialization and browser-session dispatch, but most subsystem internals were not sampled, so uncertain internal wiring is omitted.

Main entry points: [`app/agent_computer/src/worker/turn_execution.ts`](https://github.com/agentbull/ankole/blob/main/app/agent_computer/src/worker/turn_execution.ts) (Agent Computer), [`app/control_plane/lib/ankole/signals_gateway/actor_runtime/session_controller.ex`](https://github.com/agentbull/ankole/blob/main/app/control_plane/lib/ankole/signals_gateway/actor_runtime/session_controller.ex) (Actor Runtime), [`app/control_plane/lib/ankole/signals_gateway`](https://github.com/agentbull/ankole/tree/main/app/control_plane/lib/ankole/signals_gateway) (Signals Gateway), [`app/control_plane/lib/ankole`](https://github.com/agentbull/ankole/tree/main/app/control_plane/lib/ankole) (Schedules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_coord["Control and coordination"]
  node_signals["Signals Gateway"]
  node_schedule["Schedules"]
  node_runtime["Actor Runtime"]
  node_fabric["Runtime Fabric<br/>[fabric.ts]"]
end

subgraph group_execution["Agent execution"]
  node_worker["Agent Computer<br/>[turn_execution.ts]"]
  node_agentloop["Agent turn loop<br/>[agent-loop.ts]"]
  node_tools["Agent tools<br/>[index.ts]"]
  node_browser["Browser sessions<br/>[session-manager.ts]"]
end

subgraph group_knowledge["Knowledge and models"]
  node_brain["Company Brain"]
  node_gateway["AI Gateway"]
end

subgraph group_work["Durable work"]
  node_jobs["Background and automation jobs"]
end

subgraph group_interfaces["User interfaces"]
  node_console["Operator Console<br/>[app.tsx]"]
  node_auth["Sign-in UI<br/>[app.tsx]"]
  node_setup["Setup UI<br/>[app.tsx]"]
end

node_external(("People and events"))
node_database[("PostgreSQL")]
node_home[("Shared Agent Home")]
node_providers["AI providers"]

node_external -->|"sends events"| node_signals
node_external -->|"configures work"| node_schedule
node_signals -->|"admits actor events"| node_runtime
node_schedule -->|"wakes actors"| node_runtime
node_signals -->|"admits webhooks"| node_jobs
node_schedule -->|"triggers jobs"| node_jobs
node_runtime -->|"dispatches execution"| node_fabric
node_fabric -->|"carries actor traffic"| node_worker
node_worker -->|"runs turns"| node_agentloop
node_agentloop -->|"invokes capabilities"| node_tools
node_tools -.->|"uses browser"| node_browser
node_worker -->|"requests AI"| node_gateway
node_gateway -->|"routes provider calls"| node_providers
node_worker -.->|"uses workspaces"| node_home
node_runtime -.->|"persists actor state"| node_database
node_jobs -.->|"persists job state"| node_database
node_external -.->|"supplies knowledge"| node_brain
node_brain -.->|"stores knowledge"| node_database
node_external -->|"administers"| node_console
node_external -->|"signs in"| node_auth
node_external -->|"configures platform"| node_setup

click node_signals "https://github.com/agentbull/ankole/tree/main/app/control_plane/lib/ankole/signals_gateway"
click node_schedule "https://github.com/agentbull/ankole/tree/main/app/control_plane/lib/ankole"
click node_runtime "https://github.com/agentbull/ankole/blob/main/app/control_plane/lib/ankole/signals_gateway/actor_runtime/session_controller.ex"
click node_fabric "https://github.com/agentbull/ankole/blob/main/app/agent_computer/src/fabric/fabric.ts"
click node_worker "https://github.com/agentbull/ankole/blob/main/app/agent_computer/src/worker/turn_execution.ts"
click node_agentloop "https://github.com/agentbull/ankole/blob/main/app/agent_computer/src/core/agent-loop.ts"
click node_tools "https://github.com/agentbull/ankole/blob/main/app/agent_computer/src/tools/computer/index.ts"
click node_browser "https://github.com/agentbull/ankole/blob/main/app/ankole-browser/src/daemon/session-manager.ts"
click node_jobs "https://github.com/agentbull/ankole/tree/main/app/control_plane/lib/ankole/background_agent_jobs"
click node_brain "https://github.com/agentbull/ankole/tree/main/app/control_plane/lib/ankole/brain"
click node_gateway "https://github.com/agentbull/ankole/tree/main/app/control_plane/lib/ankole/ai_gateway"
click node_console "https://github.com/agentbull/ankole/blob/main/app/webapps/console/app.tsx"
click node_auth "https://github.com/agentbull/ankole/blob/main/app/webapps/auth/app.tsx"
click node_setup "https://github.com/agentbull/ankole/blob/main/app/webapps/setup/app.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_signals,node_schedule,node_runtime,node_fabric toneBlue
class node_worker,node_agentloop,node_tools,node_browser,node_database,node_home toneAmber
class node_brain,node_gateway toneMint
class node_jobs toneRose
class node_console,node_auth,node_setup,node_external,node_providers toneIndigo
```

## Components

### Control and coordination

- [Signals Gateway](https://github.com/agentbull/ankole/tree/main/app/control_plane/lib/ankole/signals_gateway): `app/control_plane/lib/ankole/signals_gateway`
- [Schedules](https://github.com/agentbull/ankole/tree/main/app/control_plane/lib/ankole): `app/control_plane/lib/ankole`
- [Actor Runtime](https://github.com/agentbull/ankole/blob/main/app/control_plane/lib/ankole/signals_gateway/actor_runtime/session_controller.ex): `app/control_plane/lib/ankole/signals_gateway/actor_runtime/session_controller.ex`
- [Runtime Fabric](https://github.com/agentbull/ankole/blob/main/app/agent_computer/src/fabric/fabric.ts): `app/agent_computer/src/fabric/fabric.ts`

### Agent execution

- [Agent Computer](https://github.com/agentbull/ankole/blob/main/app/agent_computer/src/worker/turn_execution.ts): `app/agent_computer/src/worker/turn_execution.ts`
- [Agent turn loop](https://github.com/agentbull/ankole/blob/main/app/agent_computer/src/core/agent-loop.ts): `app/agent_computer/src/core/agent-loop.ts`
- [Agent tools](https://github.com/agentbull/ankole/blob/main/app/agent_computer/src/tools/computer/index.ts): `app/agent_computer/src/tools/computer/index.ts`
- [Browser sessions](https://github.com/agentbull/ankole/blob/main/app/ankole-browser/src/daemon/session-manager.ts): `app/ankole-browser/src/daemon/session-manager.ts`

### Knowledge and models

- [Company Brain](https://github.com/agentbull/ankole/tree/main/app/control_plane/lib/ankole/brain): `app/control_plane/lib/ankole/brain`
- [AI Gateway](https://github.com/agentbull/ankole/tree/main/app/control_plane/lib/ankole/ai_gateway): `app/control_plane/lib/ankole/ai_gateway`

### Durable work

- [Background and automation jobs](https://github.com/agentbull/ankole/tree/main/app/control_plane/lib/ankole/background_agent_jobs): `app/control_plane/lib/ankole/background_agent_jobs`

### User interfaces

- [Operator Console](https://github.com/agentbull/ankole/blob/main/app/webapps/console/app.tsx): `app/webapps/console/app.tsx`
- [Sign-in UI](https://github.com/agentbull/ankole/blob/main/app/webapps/auth/app.tsx): `app/webapps/auth/app.tsx`
- [Setup UI](https://github.com/agentbull/ankole/blob/main/app/webapps/setup/app.tsx): `app/webapps/setup/app.tsx`

### Other components

- **People and events**
- **PostgreSQL**
- **Shared Agent Home**
- **AI providers**

## Connections

- People and events → Signals Gateway: sends events
- People and events → Schedules: configures work
- Signals Gateway → Actor Runtime: admits actor events
- Schedules → Actor Runtime: wakes actors
- Signals Gateway → Background and automation jobs: admits webhooks
- Schedules → Background and automation jobs: triggers jobs
- Actor Runtime → Runtime Fabric: dispatches execution
- Runtime Fabric → Agent Computer: carries actor traffic
- Agent Computer → Agent turn loop: runs turns
- Agent turn loop → Agent tools: invokes capabilities
- Agent tools → Browser sessions: uses browser
- Agent Computer → AI Gateway: requests AI
- AI Gateway → AI providers: routes provider calls
- Agent Computer → Shared Agent Home: uses workspaces
- Actor Runtime → PostgreSQL: persists actor state
- Background and automation jobs → PostgreSQL: persists job state
- People and events → Company Brain: supplies knowledge
- Company Brain → PostgreSQL: stores knowledge
- People and events → Operator Console: administers
- People and events → Sign-in UI: signs in
- People and events → Setup UI: configures platform
