How it works
A flow declares its states, events, agents, system nodes, tools, and policy as contracts. At boot, the engine loads the bundle, runs it through the static analyzer, and starts the event loop. From there:- System nodes are deterministic code. They subscribe to events, run a fixed handler pipeline, advance stages, and emit new events. No LLM decides what fires next.
- Agents are LLM sessions. They subscribe to events, reason inside a scoped session, call tools, and emit events. They never write state directly; they emit, and a handler decides what gets written.
- Humans decide through typed decision gates: a stage waits for a verdict, every outcome is declared, and the platform shows the decision as a card — a small typed form a person approves or rejects from the CLI, the API, or a chat channel on your phone (Telegram ships as the first channel pack). The platform itself never decides for you.
- The outside world connects through packs — prebuilt provider integrations: webhooks arrive as typed, normalized events, and provider APIs become declared tools — signature checks, credentials, and rate limits owned by the platform, not your code.
swarm test drives real flows through scripted scenarios, and the embedded mock backend runs
agent turns with zero LLM credentials and zero Docker.
Design positions
Swarm makes a few opinionated choices and holds them:Deterministic control loop
Routing is derived from declared subscriptions, not chosen by an LLM. Guards and rules use
a strongly typed, non-Turing-complete expression language.
One transaction per transition
Guard, accumulate, compute, commit, emit: all-or-nothing. No partial state survives a
crash.
Isolated agents
Each agent runs in a scoped session and sees only the events it subscribes to.
Agents talk through a chain (coordinator → manager → worker) instead of one shared
chat, so context windows stay small.
Replayable and forkable
Every event and state mutation is persisted. Reconstruct any run, or fork it from any
point against new contracts.
Composable flows
A flow is a self-contained package with typed input and output pins. Wire flows
together without refactoring.
Humans as a first-class actor
Typed decision gates with every outcome declared — approve from your phone, reject with
required reasons, and nothing auto-decides. Autonomy is a dial, not a switch.
Where to go next
Why Swarm
When this tradeoff fits, and when it does not.
Quickstart
Boot the runtime and trigger your first run.
Core concepts
Flows, events, handlers, agents, and the engine.
Build a flow
A support-ticket flow from scratch.

