Skip to content

Architecture

dcluomax edited this page Jun 1, 2026 · 1 revision

Architecture

Coop is an open-source AI agent farm OS in Rust. It ships as one daemon (coopd) plus one CLI (coop), built from a small Cargo workspace.

Conceptual layers

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  L4  Game           XP Β· leaderboards Β· spectator Β· UI       β”‚
β”‚  L3  Economic       Grain ledger Β· hen/roost lease Β· escrow  β”‚
β”‚  L2  Federation     world.coop relay Β· registry Β· mailbox    β”‚
β”‚  L1  Coop OS        coopd Β· brain adapter Β· tool ABI Β· vault  β”‚  ← this repo
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

This repo is L1 β€” the agent OS.

Workspace crates (7, all OSS / Apache-2.0)

Crate Role
coopd Main daemon: HTTP/WS API, orchestrator, Farm UI, brain factory, sandbox wiring.
coopd-core Types, IDs, traits, manifest schema, net-policy types, errors.
coopd-storage redb-backed persistence.
coopd-vault Sealed BYOK secret store + the Azure Key Vault backend.
coopd-tools Tool registry: bash, file_read, file_write, http, plus the OS sandbox + safe_net/safe_path guards.
coopd-brain Anthropic adapter (routing + caching wrappers).
coop-cli The coop binary.

Request β†’ reasoning flow

  1. A manifest (examples/aria.yaml) defines a hen: name, brain, tools, optional network: policy.
  2. coop hen create β†’ coop hen hatch transitions the hen through its state machine: Defined β†’ Hatching β†’ Idle β†’ Working / Sleeping / Leased.
  3. A job runs a per-job reason/tool loop. The brain factory resolves brain.provider_id to an API key β€” from the local vault (vault:…) or Azure Key Vault (azure-kv://…, see BYOK Secrets) β€” and builds an Anthropic adapter.
  4. Tool calls run through the registry; bash executes inside the per-hen OS sandbox and is held to the hen's network policy (Network Isolation).
  5. Events stream to the Farm UI over WebSocket; each hen exposes a live PTY shell.

Open-core split

Coop ships as open core:

  • coop (this repo, public, Apache-2.0) β€” agent OS, vault, tools, brain adapter, Farm UI, CLI. Fully usable on its own for single-farm / single-hen workflows.
  • coop-market (separate, proprietary) β€” the cross-Coop Market layer (listings, bids, escrow, federation to the World relay).

The OSS daemon has zero market awareness β€” no market crate, dep, types, or code paths. This boundary is enforced by CI, not just docs.

Source layout

Clone this wiki locally