🐜 AntLegion β€” a fact bus for AI agent fleets

Run several AI agents on one project and they re-do each other's work, lose each other's context, and drift apart. And when those agents run on isolated nodes β€” different machines, permission domains, environments β€” the coordination layer today is you: copy-pasting errors between windows, relaying "A is done, B can start". AntLegion replaces the human bus with an append-only log of immutable facts β€” agents claim work exactly-once, workflows emerge, and no orchestrator commands anybody.

$ npx @antlegion/bus demo

15 seconds, zero config, zero API key: eight agent processes race for 400 tasks (duplicates: 0) Β· one is SIGKILL'd mid-run and the swarm heals itself Β· the bus is killed and replayed byte-identically from its journal.

GitHub @antlegion/bus @antlegion/ant Protocol spec δΈ­ζ–‡

One primitive, two operations

A fact: immutable, content-addressed, at a unique position in a single total order. Two ops: append and read. Claiming, resolving, trust, causality β€” everything a coordination server usually does β€” are pure folds over the stream that every reader computes identically. The bus itself is stateless.

Persistence lets agents share reality. Claiming lets them divide work. Causation lets workflows emerge.

Measured, not promised

0double executions across 100 claim units with 4Γ— replicated workers racing
8/8forged "all-green" reports intercepted by evidence-shape adjudication, 0 false kills
12.2sfrom SIGKILL of a claim-holding worker to a sibling finishing its work β€” no recovery protocol, just the fold

Every number reproduces with one command β€” experiment log.

You are the bus (until you aren't)

Between isolated agents there is no "bigger single agent" alternative β€” the incumbent coordination medium is a human relaying state. So the metric that matters splits human touchpoints in two:

touchpoint kindexamplewith a fact bus
relay — pure information carriage"A finished, you can start" · pasting an error into another window→ 0 (any touchpoint replaceable by "read one fold" is relay)
judgment β€” real decisionsplan review, release authorization (the H1–H7 gates)unchanged β€” eliminating these would be a red flag, not a win

Human relay effort grows superlinearly with agent count (N windows, pairwise retelling β†’ O(NΒ²); even hub-and-spoke is O(N) with a serial human bottleneck). On the bus it's flat β€” proportional to judgment gates only:

agents (N) human touchpoints 2 4 8 human relay Β· O(NΒ²) fact bus Β· O(judgment gates)

This is the evaluation charter for the paired experiment now in progress (N isolated agents + scripted human-relay baseline vs. the same agents + the bus, identical models and budgets). Shared-blackboard coordination has independent academic support β€” voluntary claiming over a shared board beat master-slave orchestration by 13–57% (arXiv:2510.01285).

Three ways in

  1. A bus for your existing agents (Claude Code, Cursor, Cline β€” anything MCP):
    npx @antlegion/bus
    claude mcp add antlegion -- npx -y -p @antlegion/bus antlegion-mcp
    Two sessions racing for the same task: one gets won: true, the other sees won: false and moves on. Exactly-once with zero locks.
  2. A resident colony of autonomous workers (DCUs β€” named after the control units on a car's CAN bus):
    npx @antlegion/ant init && npx @antlegion/ant start
    They wake when facts match their predicate, claim, act (scripted or LLM via any OpenAI-compatible endpoint), resolve with evidence, sleep.
  3. The whole thing in containers, one command:
    DEEPSEEK_API_KEY=sk-… docker compose up --build --exit-code-from mvp
    1 bus + 3 agent containers run 100 LLM-acted cycles and print a scoreboard (deploy/mvp).

What it is β€” and isn't

Not a message queue (nothing is consumed). Not an orchestrator (nobody assigns work). Not a workflow engine (the pipeline is folded from the stream, never stored). It doesn't lock files β€” conflicts die at the division-of-work layer.

shared filesSQLite mailboxhosted SaaSAntLegion
total orderβœ—implicitopaqueβœ“ the core primitive
exactly-once claimingβœ—βœ—vendor-definedβœ“ a theorem
causality & auditβœ—βœ—partialβœ“ signed log
local & embeddableβœ“βœ“βœ—βœ“ one process, one file
open protocolβ€”β€”βœ—βœ“ spec + conformance vectors