Biological intelligence for agent infrastructure
Stigmergy is a TypeScript framework for building agent colonies that coordinate through a shared medium with decay - not orchestrators, not direct messages, not managers.
Or install now
$npm install github:NetaBresler/stigmergyPostgres as the medium · Signals as pheromones · Validators as reinforcement
The shift
Manager agents become bottlenecks. Specialization should emerge from the work, not from a planner that has to hold the whole world in its context window.
Dimension
Manager-orchestrated
Stigmergic
Coordination model
Manager
A planner agent decides what each worker does and waits for results.
Stigmergic
Agents read and write signals in a shared medium. No one is in charge.
Context window
Manager
The manager has to hold the whole world in its prompt to plan.
Stigmergic
Each agent only sees its local slice. The medium holds the world.
Failure mode
Manager
Brittle. When the manager hangs or hallucinates, the colony stalls.
Stigmergic
Graceful. A dead agent is just a missing signal; the rest keep working.
Specialization
Manager
Assigned by the planner up front. Locked in until someone rewrites it.
Stigmergic
Emerges from the pressure landscape. Roles drift toward where the work is.
Scaling cost
Manager
Each new agent makes the manager's job geometrically harder.
Stigmergic
Adding agents adds throughput. No coordinator to overwhelm.
Adapting to change
Manager
Replanning means re-prompting the manager with the whole new state.
Stigmergic
The medium shifts; the next reader sees the new pressure and reacts.
Memory of bad plans
Manager
Stale plans linger in the manager's context until it's reminded to drop them.
Stigmergic
Unreinforced signals decay automatically. The colony forgets what isn't working.
Adding a new agent
Manager
Update the manager's prompt, retest the delegation logic, redeploy.
Stigmergic
Declare the role. It joins the medium and starts reading its slice.
Observability
Manager
You debug an opaque chain of LLM calls inside one prompt.
Stigmergic
Every coordination event is a typed row. You query the medium with SQL.
The medium, materially
Every coordination event is a typed signal in Postgres. Strength, decay, status, origin - explicit, queryable, durable. No hidden state. No prompts inside prompts.
The six primitives
A system is stigmergic if and only if it has all six. Miss one and you have something else: a knowledge base, a queue, a workflow engine, a manager-in-disguise.
The one place agents read from and write to.
Read more
Every signal evaporates unless reinforced.
Read more
Agents know their function - not who else exists.
Read more
Identity is stable. The function it enacts is not.
Read more
Every role sees only its slice of the medium.
Read more
Successful outcomes deposit more signal than mere activity.
Read more
How a colony runs
The reference implementation ships three composable defaults - Scout, Worker, Validator. They never talk to each other.
Where it stands
The worked example in examples/bug-triage.ts runs from a clean checkout - a colony of agents deposit signals, compete for claims, and reinforce the trails that pay off. Installable from GitHub, not yet on npm. No production claims until real projects run on it.
Clone, install, watch a three-agent colony deposit signals, compete for claims, and reinforce the winning trails.
$npm install github:NetaBresler/stigmergy