The Mud Ball Protocol: How Complex Systems Coordinate Without a Manager
In the savannas of southern Africa, Macrotermes termites build mounds that reach eight to nine metres tall. The interior nest holds a near-constant ~30 °C. The structure breathes: as ambient temperature swings between day and night, the mound drives cyclic air flows that flush metabolic CO₂ out of the colony like a lung — a mechanism measured directly and published in PNAS in 2015. Networks of large pores in the walls raise CO₂ diffusivity up to eightfold over the surrounding soil.
It is a climate-controlled cathedral, engineered to a specification no individual termite holds.
There is no architect. No termite has seen the finished mound. No termite is issuing orders, holding a Gantt chart, or running a standup. Each worker has a brain smaller than a grain of rice and a lifespan too short to witness the project’s completion. And yet the colony produces a structure so precise that human architects study it to design passive-cooling buildings.
In 1959, the French zoologist Pierre-Paul Grassé watched termites rebuild a damaged nest and named the thing he could not otherwise explain. He called it stigmergy — from the Greek stígma (mark, sign, goad) and érgon (work). One phrase from his paper is the entire idea compressed into a sentence:
The worker does not direct his work, he is guided by it. — Grassé, Insectes Sociaux (1959)
The termite does not coordinate with other termites. It coordinates with the mound. The half-built structure tells the next worker what to do, and the manager the colony never had turns out to be the environment itself.
I’ve spent the last year building agentic AI systems where the central problem is exactly this: how do you make many autonomous workers coordinate without a central planner choking the whole thing? I kept arriving at the same architecture from first principles — and then discovered that a zoologist had described it sixty-seven years earlier, that an economist had won a Nobel Prize adjacent to it, and that it is the quiet mechanism behind Wikipedia, the price of a microchip, and every dance that has ever gone viral. This post is the map. It ends where my last post on Organizations as Code began — because when Karpathy’s eight AI agents coordinated through a shared git repo and “the meetings were diffs,” they were not inventing something new. They were building a termite mound.
1. The Mud Ball Protocol
Strip stigmergy to its atoms and you get a four-step loop. I’ll call it the Mud Ball Protocol, because the canonical version is literally a termite dropping a ball of mud.
- Deposit. A worker takes an action that modifies the shared environment — drops a soil pellet, lays a pheromone, writes a line of text.
- The deposit becomes a signal. The action isn’t just work; it’s information. The pellet is now sitting there, legible to anyone who passes.
- The signal biases the next worker. The next termite is more likely to drop its pellet near an existing one. The trace raises the local probability of the same behavior.
- Evaporation. Signals decay. Pheromones evaporate; unreinforced traces fade. Without decay, every early accident would calcify into permanent structure.
That’s it. No worker talks to another worker. Every worker talks to the environment, and the environment talks back. Run this loop with positive feedback (step 3) held in tension against decay (step 4) and you get something remarkable: pillars grow where pellets cluster, pillars curve toward neighboring pillars because the pheromone gradient bends that way, and arches close into a roof — all without a single instruction passing between individuals.
# The Mud Ball Protocol as a coordination primitive.
# No worker reads another worker. Every worker reads the environment.
def worker_step(environment):
trace = environment.sense_local() # 2. read the shared signal
if random() < deposit_probability(trace): # 3. the trace biases my action
environment.deposit(my_contribution()) # 1. my action becomes the next signal
environment.evaporate(rate=0.05) # 4. stale signals decay
# Coordination is not in the workers. It is in the loop.
while colony.alive:
for worker in colony:
worker_step(shared_environment)
Biologists split stigmergy into two flavors, and the distinction matters for everything downstream. E.O. Wilson drew the line in Sociobiology (1975):
| Type | The signal is… | Insect example | Human example |
|---|---|---|---|
| Sematectonic | the work-in-progress itself | a half-built pillar’s height cues the next deposit | a half-written Wikipedia article, a failing test |
| Sign-based | a dedicated marker that does no work | a pheromone trail laid only to communicate | a TODO comment, a GitHub issue, a price tag |
Sematectonic stigmergy is coordination through the state of the artifact. Sign-based stigmergy is coordination through markers layered onto it. Real systems use both, and the most powerful human systems — as we’ll see — run on a tight braid of the two.
One honest caveat, because the field earned it. The classic explanation for why termites deposit near existing deposits is a “cement pheromone” — a chemical added to each pellet that attracts the next worker. That’s the textbook story since Grassé, but it is now actively contested: a 2024 eLife study argues that physical cues — humidity gradients, surface curvature, substrate evaporation — may drive deposition instead, with no dedicated chemical signal required. The mechanism is under revision. The phenomenon — coordination with no coordinator — is not.
2. The environment computes
Here is the part that should unsettle anyone who has ever drawn an org chart: a stigmergic environment doesn’t just coordinate work. It computes.
In 1989, Jean-Louis Deneubourg’s group ran the double-bridge experiment. Give a colony of Argentine ants two bridges between the nest and food — one short, one long — and the colony reliably converges on the shorter path. No ant measures anything. No ant compares the two routes. The mechanism is entirely mechanical: ants on the short bridge complete the round trip faster, so pheromone accumulates on it sooner; the stronger trail recruits more ants; positive feedback amplifies the lead while evaporation erases the longer route. The colony solves a shortest-path problem it cannot represent, using an algorithm no individual is running.
Computer scientists noticed. Marco Dorigo turned the double-bridge result into Ant Colony Optimization (1996), now a standard technique for routing and logistics — deployed on real vehicle-routing problems for supermarket chains and freight distributors. The environment is the computer. The pheromone field is the memory. Evaporation is the forgetting that keeps the memory from ossifying. This is not a metaphor for computation; it is computation, running on a substrate of dirt and chemicals.
Once you can see it, you can’t stop seeing it. The same four-step loop coordinates four systems that appear to have nothing in common.
| System | The trace (mud ball) | Deposit rule | Positive feedback | Evaporation |
|---|---|---|---|---|
| Termite mound | soil pellet + local cue | drop near existing deposits | pillars attract more deposits | pheromone / humidity decays |
| Wikipedia | a stub or red link | fill the gap you notice | good articles attract more edits | stale flags, reverts, deletion |
| Price system | the price itself | buy low, sell high, produce where margin is | scarcity raises price raises supply | prices adjust as conditions change |
| TikTok trend | a sound, a format, a dance | remix what’s already spreading | more remixes → more reach → more remixes | the algorithm buries stale sounds |
Walk them one at a time.
3. Wikipedia: the stub is a mud ball
Nobody assigns Wikipedia articles. There is no editorial desk handing out topics. The way work gets coordinated across millions of contributors is that someone leaves a stub — a flagged, deliberately incomplete article — or a red link, a link pointing to a page that doesn’t exist yet. Both are pure sign-based stigmergy: a marker that does no work itself but screams work needed here to the next passing editor. The stub is a digital mud ball. The absence is the signal.
This scales in a way that direct coordination cannot. Mark Elliott, whose 2006 M/C Journal article and subsequent PhD thesis gave us the phrase “stigmergic collaboration,” makes the quantitative point sharply: human collaborations that rely on direct person-to-person negotiation historically cap out around 25 people, because the communication overhead grows faster than the group. Mass collaboration breaks that ceiling only by going stigmergic — routing coordination through the shared artifact instead of through conversation. You cannot hold a meeting with four million people. You can leave a trace that four million people can independently respond to.
4. The price system: Hayek’s marvel
The most important essay ever written about coordination doesn’t use the word stigmergy, because it was published fourteen years before Grassé coined it. In 1945, Friedrich Hayek wrote “The Use of Knowledge in Society”, and its argument is the economic statement of the termite mound.
The central problem of economics, Hayek argued, is not allocating known resources. It’s that the knowledge required for economic decisions is never held by any single mind — it is dispersed, partial, tacit, and local. The planner cannot gather it, because much of it is knowledge of “the particular circumstances of time and place” that evaporates the moment you try to centralize it. What coordinates millions of actors who each know almost nothing about the whole? Prices. A price is a stigmergic signal — a trace in the shared environment that compresses the state of the world into a single number, letting each actor respond to conditions they cannot see.
His description of a raw-material shortage is, functionally, a description of a pheromone gradient:
The marvel is that in a case like that of a scarcity of one raw material, without an order being issued, without more than perhaps a handful of people knowing the cause, tens of thousands of people whose identity could not be ascertained by months of investigation, are made to use the material or its products more sparingly. — Hayek (1945)
We ran the experiment recently, at planetary scale. When the semiconductor shortage hit in 2021, no central authority rationed chips. The price signal did. Rising wafer prices reallocated scarce capacity across thousands of firms none of whom could see the global picture — and the friction of that reallocation was brutal: AlixPartners estimated the auto industry alone lost $210 billion in revenue and 7.7 million units of production in 2021. (The $210B figure is AlixPartners’; reading the price as the coordinating pheromone is my Hayekian gloss, not their claim.) A central planner would have needed to know every factory’s substitution options in real time. The price system needed each factory to know only one number.
5. TikTok: the sound is a pheromone
Now the loosest case, flagged as such. There is no strong peer-reviewed source that formally names TikTok virality as stigmergy — this is my extension of the concept, not an established claim. But the pattern fits the four-step loop cleanly. A sound, a dance, a format, a meme template is a trace deposited into a shared environment. Nobody directs the trend. Users encounter the trace, and the low-friction affordance to remix it — duet, stitch, reuse audio — is the deposit rule. More remixes generate more reach, which surfaces the trace to more users, which generates more remixes: textbook positive feedback. And the recommendation algorithm is the evaporation function, quietly burying sounds that stop being reinforced.
No choreographer. No content calendar handed down from a central authority. A dance emerges the way a pillar emerges — one imitation at a time, each one raising the local probability of the next. If a termite mound is stigmergy in mud and Wikipedia is stigmergy in text, TikTok is stigmergy in attention.
6. Open source, and the coordination we already ship
Software engineers have been living inside a stigmergic system for decades without naming it. A TODO comment is a mud ball. A failing test is a mud ball. A GitHub issue, a red CI badge, a merge conflict — every one is a trace left in the shared environment that biases what the next contributor does, with no manager assigning the work.
This isn’t hand-waving; it’s measured. James Howison and Kevin Crowston’s 2014 MIS Quarterly study of open-source development found two things that only make sense through a stigmergic lens. First, the overwhelming majority of tasks are completed by a single developer — not a team huddling. Second, tasks too large for one person are typically deferred until they shrink rather than being decomposed and assigned. Contributors layer work asynchronously onto a shared, executable artifact — what the authors call “open superposition” — coordinating through the code itself. The standardized, runnable state of the codebase is the pheromone field. You don’t need a manager to tell you the build is broken. The build tells you.
# A stigmergic task queue. No manager. The environment holds the state.
# A failing test is a mud ball: it marks work needed, and biases the next worker.
$ git fetch && npm test 2>&1 | tee .traces/last-run.log
# The trace IS the coordination signal:
# - a failing test -> "build here" (sematectonic: the artifact's state is the signal)
# - a TODO(owner) comment -> "someone claim this" (sign-based: a marker laid to communicate)
# - a stale branch -> evaporation: rebased away or auto-closed after N days
$ grep -rn "TODO\|FIXME" src/ | head # read the pheromone field
$ git log --since=30.days --diff-filter=A --name-only # where deposits cluster
Every engineer who has ever fixed a red build without being told to was following a pheromone trail. We just called it “the CI is broken.”
7. The corporate heresy
Here is where this stops being a nature documentary and starts being an argument.
The modern corporation is obsessed with the opposite of stigmergy. It runs on alignment meetings, strategic planning, OKR cascades, and top-down management — an entire apparatus built on the premise that coordination requires a coordinator. A manager gathers information, forms a plan, decomposes it into tasks, and assigns those tasks to people. The plan lives in the manager’s head and the org chart enforces it.
Count the communication cost. For a manager to coordinate n workers directly, information has to flow to and from the center: the manager is a hub, and the hub is a bottleneck that scales with the team. This is precisely Elliott’s 25-person wall. Stigmergy pays a different price: each worker reads the shared environment and acts. There is no hub. The termite colony coordinates millions of workers because no termite is a manager — the coordination cost is paid by the environment, once, and amortized across everyone who reads it. A manager is O(n) communication. A well-designed environment is O(1) per worker. That is the entire efficiency argument for decentralization, and it is why the most complex systems in the universe have no CEO.
So the heresy is this: most management is a workaround for a badly designed environment. If your workers need a manager to tell them what to do next, the state of the work isn’t legible enough to tell them itself. The meeting exists because the mud ball is missing.
This reframes the founder’s job entirely — and it’s the same reframe I landed on in Organizations as Code. You don’t design the org chart. You design the environment. I’ll call the design surface the Trace Stack: four properties you tune instead of four layers of management.
| Property | The question | Corporate failure when it’s wrong |
|---|---|---|
| Deposit rule | What does a worker leave behind when they act? | work vanishes into someone’s head; nothing accretes |
| Legibility | Can the next worker read the trace cheaply? | status is locked in a manager’s inbox; you need a meeting to learn state |
| Gradient | Does following the trace bias toward good outcomes? | incentives point at the wrong hill; everyone optimizes the metric, not the goal |
| Evaporation | How do stale traces die? | zombie projects, dead docs, and cargo-cult process never decay |
Stop managing people. Build the environment — the deposit rules, the legibility, the gradient, the evaporation — and let the traces do the managing. Every one of those four is a design decision a founder makes once and amortizes forever, exactly like Karpathy choosing val_bpb as the metric that made an overnight agent swarm mean something. Designing the environment is not a lighter version of management. It is the harder version, done once instead of continuously.
8. This is what AI agent swarms actually are
Which brings the series home. In Organizations as Code I described Karpathy’s simulated research org: eight AI agents, four on Claude and four on Codex, coordinating not through a message bus or a proprietary protocol but through text files in a version-controlled git repo. The chief-scientist agent wrote specs as Markdown. Junior agents picked specs off the queue and pushed branches. “The meetings were diffs.”
Name it precisely now: that is sematectonic stigmergy. The state of the repo is the coordinating environment. A spec file is a sign-based marker (a mud ball that says build this); a failing eval is a sematectonic one (the artifact’s own state signaling not done). No agent messages another agent. Every agent reads the repo and acts. The ReAct loop I traced back to Unix — read, reason, act, observe, persist — is the Mud Ball Protocol with a language model in the worker slot.
This is why “multi-agent systems” that try to make agents talk to each other directly tend to collapse into expensive, brittle chatter, while systems that make agents write to and read from a shared environment scale. Direct agent-to-agent messaging rebuilds the O(n) manager bottleneck in silicon. A shared repo, a shared scratchpad, a shared task file with an evaporation rule is O(1) per agent. The winning architecture for agent swarms is not a better protocol. It’s a better pheromone field.
And the Constraint Stack from that post — the immutable harness, the mutable sandbox, the human-maintained program.md — is exactly the Trace Stack applied to agents. program.md is the deposit rule and the gradient. The immutable eval harness is the part of the environment the workers can’t corrupt. You are not managing the agents. You are designing the mound they build in.
Where this breaks
Stigmergy is a mechanism, not a miracle. The same loop that builds cathedrals builds catastrophes, and the honest version of this argument has to name exactly where it fails — because the failure modes are not edge cases. They are the mechanism working correctly toward a bad end.
[!WARNING] Lock-in: the environment can compute the wrong answer confidently. The positive feedback that finds the shortest path also locks onto a worse path if it gets an early lead. This is the well-documented stagnation / premature-convergence problem in Ant Colony Optimization: once a suboptimal trail is strongly reinforced, evaporation may be too slow to escape it. Human version: the QWERTY keyboard, the dominant-but-worse standard, the “this is how we’ve always done it” that no one chose and no one can undo. Stigmergy has no global view, so it cannot notice it has converged on the wrong hill.
[!CAUTION] Adversarial traces: anyone who can write to the environment can poison it. Because coordination flows through a shared medium, a malicious actor who deposits deceptive signals can steer the whole colony. A 2026 EPJ Data Science study showed that simple bots persistently leaving misleading traces can systematically bias human cooperation and trigger cascades of defection. The stub that recruits an editor also recruits the vandal. The price signal that coordinates supply also inflates the bubble. Spam, SEO sludge, and prompt-injection attacks on agent environments are all the same failure: the pheromone field has no authentication.
[!IMPORTANT] No goals, only gradients. Stigmergy optimizes what the environment happens to reward, not what is actually good. There is no objective function, no one asking whether the mound should be built. This is Hardin’s tragedy of the commons (1968) and the limit Hayek himself conceded: the price marvel presumes property rights and internalized costs. Where there are externalities — pollution, depletion, systemic risk — decentralized coordination will confidently converge on a collectively destructive outcome, because no trace carries the cost that no one is paying. The environment coordinates means. It cannot supply ends.
[!NOTE] Crypto is the purest engineered stigmergy — and the clearest demonstration of all three failures at once. A blockchain is a deliberately designed shared environment where the trace — ledger state, price, gas — coordinates miners, validators, and traders with no central planner. It is stigmergy as an explicit architectural choice, and it works. It is also the loudest live demo of the failure modes: lock-in (entrenched chains no one would design today), adversarial traces (MEV, wash trading, pump-and-dumps), and no-goals (capital coordinating toward whatever the gradient rewards, unmoored from whether it should exist). If you want to see the Mud Ball Protocol running at full throttle with the guardrails off, read a block explorer. It is a termite mound that can bankrupt you.
The takeaway is not “decentralize everything.” It’s narrower and more useful. Stigmergy is the right architecture when the environment can carry the coordination cost more cheaply than a manager can, and when the gradient can be designed to point somewhere good. When either condition fails — when the signal can be poisoned, when the incentive points at the wrong hill, when someone has to supply an end the environment can’t — you still need the human. Not to manage the workers. To design, defend, and audit the environment they coordinate through.
The most complex, efficient systems in the universe have no CEO, no management, and no plan. They have an environment worth reading and a rule for what to leave behind. Termites figured this out before there were mammals. Hayek formalized it before there were transistors. Wikipedia proved it at the scale of human knowledge. And the next generation of AI systems will run on it whether their builders name it or not — because when you have a thousand cheap autonomous workers, the one thing you cannot afford is a manager in the middle.
Stop assigning tasks. Start dropping mud balls. Build the mound so it tells the next worker what to do.
Sharad Jain builds agentic AI pipelines in Bengaluru. He previously engineered core data infrastructure at Meta and is the founder of autoscreen.ai, a production voice-AI platform. This post is part of a series on agentic AI infrastructure — see Organizations as Code on the company as an executable repo, The 14K Token Debt on system-prompt architecture, and The Terminal Was the First Agent Harness on Unix primitives as agent patterns.
Research & Footnotes:
- Grassé, P.-P. (1959). “La reconstruction du nid et les coordinations interindividuelles… La théorie de la stigmergie.” Insectes Sociaux 6(1), 41–81. — origin of the term.
- Heylighen, F. (2016). “Stigmergy as a Universal Coordination Mechanism.” Cognitive Systems Research — the best single synthesis; sematectonic vs. sign-based.
- Ocko, King, Andreen, Bardunias, Turner, Mahadevan (2015). “Termite mounds harness diurnal temperature oscillations for ventilation.” PNAS 112(37). — the mound-as-lung, CO₂ diffusivity.
- “Substrate evaporation drives collective construction in termites” (2024). eLife — the cement-pheromone hypothesis, now contested.
- Mound architecture regulates nest temperature (2019). PeerJ — ~30 °C interior.
- Goss, Aron, Deneubourg, Pasteels (1989). “Self-organized shortcuts in the Argentine ant.” Naturwissenschaften 76. — the double-bridge experiment.
- Dorigo, Maniezzo, Colorni (1996). “Ant System: Optimization by a Colony of Cooperating Agents.” IEEE Trans. SMC-B 26(1). — Ant Colony Optimization.
- Rizzoli et al. (2007). “Ant colony optimization for real-world vehicle routing problems.” Swarm Intelligence 1(2). — deployed ACO.
- Hayek, F.A. (1945). “The Use of Knowledge in Society.” American Economic Review 35(4). — prices as dispersed-knowledge coordination; the “marvel” passage.
- CNBC / AlixPartners (2021). “Chip shortage expected to cost auto industry $210 billion in 2021.” — the $210B / 7.7M-unit figures.
- Elliott, M. (2006). “Stigmergic Collaboration: A Theoretical Framework for Mass Collaboration.” M/C Journal 9(2). — the ~25-person negotiation ceiling; Wikipedia as stigmergic.
- Howison, J. & Crowston, K. (2014). “Collaboration Through Open Superposition.” MIS Quarterly 38(1). — single-developer tasks, deferred-until-shrink, code as shared artifact.
- Hardin, G. (1968). “The Tragedy of the Commons.” Science 162. — the externalities limit.
- “Stigmergic influence of simple bots on human cooperation in digital environments” (2026). EPJ Data Science — adversarial traces.
- Scholarpedia: Ant Colony Optimization — stagnation / premature convergence.