Stigmergic Coordination
also known as Trace-Mediated Coordination, Environment-as-Channel, Indirect Coordination
Agents coordinate indirectly by leaving and reading marks in a shared environment (files, queues, scratchpads, world model) so that one agent's trace stimulates another's next action, with no direct messaging.
This pattern helps complete certain larger patterns —
- specialisesBlackboard·— Give multiple agents a shared, queryable workspace they can read from and write to as they collaborate.
Context
Multiple agents share an environment — a workspace directory, a task queue, a shared scratchpad, a vector store. The environment is the only thing they all see; direct point-to-point messaging is either expensive (per-message coordination overhead), unreliable, or simply unavailable across agent boundaries (different processes, different products, different time windows).
Problem
Forcing every coordination event through direct messaging adds overhead and creates an N×N communication graph. Agents must know each other's identities and protocols. Asynchronous coordination across time windows (one agent finishing a task hours before the next picks it up) needs persistence the messaging layer doesn't have. Without environment-mediated coordination, multi-agent systems either over-couple through direct chatter or fail to coordinate at all when direct channels aren't available.
Forces
- Direct messaging assumes liveness and identity that may not hold.
- Environment is the natural shared state agents already touch.
- Traces in the environment must be readable by other agents without prior agreement on a protocol.
- Traces decay over time; agents must handle stale marks.
Example
Three coding agents work on the same repository across different sessions. The first writes a TODO file noting which tasks it started and didn't finish. The second reads the TODO, picks up incomplete tasks, and updates it. The third, opening hours later, reads the same TODO and continues. No direct messages pass between them; the TODO file is the coordination channel.
Diagram
Solution
Therefore:
Define a structured trace format the environment carries — a TODO file, a queue of jobs, status markers in a scratchpad, named entries in a vector store. Each agent's action writes a trace; each agent's next decision reads traces left by others. Traces include enough context that a fresh agent can act on them. Traces decay or are explicitly cleared. No direct messaging is required. Inspired by stigmergy in social insects (ants follow pheromone trails; termites build mounds via local rules).
What this pattern forbids. Multi-agent coordination must not require point-to-point direct messaging when the environment can carry traces; agents read and write structured traces in the shared environment.
And the patterns that stand alongside it, or against it —
- complementsWorld Model as Tool·— Let a planning agent invoke a generative world model as a tool to roll out hypothetical futures before committing to an action, treating the world model as a callable simulator rather than a training target.
- alternative-toActor-Model Agents★— Implement each agent as an independent actor with its own mailbox, processing asynchronous messages one at a time and never sharing mutable state with peers.
- complementsEvent-Driven Agent★★— Trigger the agent on external events (webhooks, message queues, file changes) instead of user requests or schedules.
- alternative-toPerformative Message★★— Inter-agent messages are typed by communicative intent (request, inform, propose, accept, refuse, query) rather than by free-form prose, so receivers can dispatch on act type.
- alternative-toDistributed Constraint Optimization·— A group of agents jointly assigns values to shared variables to minimise (or maximise) a global cost defined by inter-agent constraints, exchanging only the messages needed.
- alternative-toJoint Commitment Team·— A team of agents adopts a shared goal plus the meta-commitment that each member will notify the others as soon as it believes the goal is achieved, impossible, or no longer relevant.
Neighbourhood
Click any neighbour to follow the language. Scroll to zoom, drag to pan.