Back to News & Insights
Artificial Intelligence September 27, 2026 · 11 min read

What an anthill can teach us about orchestrating agents.

Findings from ant-sim, a colony simulator I wrote in 2021 and reworked in 2026. Every number below...

What an anthill can teach us about orchestrating agents.

Findings from ant-sim, a colony simulator I wrote in 2021 and reworked in 2026. Every number below comes from seeded runs on commit d430093; pnpm sim:ablation reproduces the table to the digit, and the raw outputs are in docs/results/. Try the live simulation.

Every few months someone rediscovers that ant colonies have no manager and decides our agent systems should work the same way. I understand the instinct. I don't think the analogy gets us very far on its own. An ant colony shows that a particular way of allocating work can function under particular conditions. The interesting question is what those conditions are, and whether they still hold when the ants become software.

I wrote a small simulator in 2021 to explore that question. It follows the distributed task allocation studied in Deborah Gordon's harvester ants, rather than the ant colony optimization literature. There is no pheromone route converging on a solution. Workers decide what to do next, one at a time. This year I reworked the simulator, added instrumentation, and tested the rules I had built into it. Some of the results matched the story I expected. Most of the useful ones came from bugs and couplings that quietly made the colony behave badly.

Before getting into the numbers, this is my engineering model of a colony. “Measured” means measured in the simulator, and “the ants” means its simulated ants. Gordon's biology motivates parts of the design; it does not validate every mechanism I put in the code. The implications for AI agents are proposals, not results from an agent benchmark.

Each ant reads a public board of needs. For every task, the board records how much work has been requested and how much has recently been delivered. The ant combines that signal with its own estimate of how crowded each task is, based on the ants it has met. It compares its current task with the most pressing alternative and may switch, according to an individual response threshold. No ant assigns work to another. A completed task changes the board: food brought home creates a need to store it, and new brood creates a need for care. What we call the colony's behaviour comes from those individual decisions and from the couplings between tasks.

The biological connection has limits. Gordon's field work supports the role of encounters near the nest entrance in regulating foraging and the role of successful returns in stimulating it. The public board covering every task is my construction. It makes the colony's state available to its workers, which is easy to implement in software, but I am not claiming real ants read anything like it.

I originally thought the mechanism needed three things: the board, an estimate of how many ants were already working on each task, and different thresholds for different ants. To test that, I ran ablations on the same eight generated worlds. Half the foragers died at minute 50 in each run. I measured how far the tasks stayed from balance, how often foraging was under-served, how much switching occurred, and what happened after the shock.

An earlier version of this comparison had a flaw. Its “board only” condition removed the crowding estimate and a rule that prevented decisions until an ant had encountered workers from most tasks. A reviewer caught the confound. The single-mechanism rows below now remove exactly one component at a time; the final row shows what happens when both are removed.

| Rule | Mean tracking error | Foraging under-served (share of time) | Switches per ant per minute | Herd after the shock | Recovered after the shock | |---|---:|---:|---:|---:|---| | Full rule | 0.74 | 76% | 0.22 | 16 | 0 of 8 | | No crowding estimate | 0.69 | 22% | 0.17 | 28 | 7 of 8, in 6.1 min | | No sample gate | 0.72 | 66% | 0.34 | 18 | 0 of 8 | | Encounters anywhere, not only at the entrance | 0.86 | 78% | 0.34 | 16 | 0 of 8; starvation in 2 worlds | | No board | 1.81 | 100% | 0.20 | 9 | 0 of 8; starvation in 3 worlds | | Same threshold for every ant | 0.74 | 68% | 0.24 | 18 | 0 of 8 | | Board only (no estimate, no gate) | 0.78 | 22% | 0.42 | 73 | 8 of 8, in 1.5 min |

The board is the essential piece in this model. Remove it and foraging is under-served throughout every run; three of the eight worlds starve. The crowding estimate is much harder to defend. Removing it cuts the time foraging spends under-served from 76% to 22%, improves the mean tracking error, and lets seven of eight colonies recover from the shock. Its benefit is that fewer ants rush into foraging together: the largest herd rises from 16 to 28 without it. Why this estimate does so much damage becomes clearer when we look at how encounters are sampled.

The sample gate also has an effect I did not intend when I added it. An ant waits until it has met workers from at least six of the eight tasks before deciding again. That cuts switching by about a third and limits herding. Remove both the gate and the crowding estimate and 73 ants move toward foraging after the shock, roughly four times the herd under the full rule. Recovery is also fastest in that configuration. A herd can be useful when it happens to run in the right direction.

Individual thresholds, meanwhile, barely move these metrics. I had a story about how their variation would damp oscillation; the runs do not support it.

For an agent pool, this suggests a design hypothesis rather than a proven architecture. A board showing current task demand may do most of the allocation work. A peer-count estimate may be useful for damping a herd, provided it is sampled properly, and delaying decisions made from thin samples may reduce both herds and churn. I have not compared this system with a dispatcher, measured deadlines, or priced the cost of switching agents. The simulator makes those choices worth testing; it does not settle them.

One of the most revealing bugs was a ratio of two running totals. The board stored every unit of work ever requested and every unit ever delivered. Need divided by actual work gradually became a lifetime average. Early in a run, a spike moved the ratio by 17%. Three hours later, the same spike moved it by 0.003%. The colony stopped reacting to change, without producing an obvious failure. It simply became deaf to new information.

Decaying both totals with a half-life made the ratio describe recent rates again. This matters for any agent pool that allocates work from a metric. The current backlog tells you something about what needs attention. The lifetime number of processed items does not.

Several task couplings had a subtler problem. They created demand from a stock rather than from unfinished work. Each one looked reasonable in isolation. Together, they sent the colony in directions I would not have predicted by reading the allocation rule.

The first was food storage. Store need scaled with all the food in the granary, so a seed that was already stored kept asking to be stored again. Give the colony more food and it pulled workers into storing and digging while its brood died. Across eight worlds, doubling food availability produced smaller colonies, with a mean population of 180 instead of 206. The relevant stimulus was the load arriving at the door, not the stock already inside. Once I changed that, richer worlds produced richer colonies.

Digging had a similar problem. Food deliveries, nursery trips, births and other activity all raised the need to expand the nest. The nest kept growing even when the population did not. At generation 23, one colony had 140 ants and had dug out 93% of its territory. It had about forty mostly empty rooms, 25 diggers and only 8 nurses caring for 58 brood. I made digging respond to crowding, meaning that food, brood or sleeping ants actually had no room. Nest size fell to a third and the number of diggers to a quarter, without reducing the population.

Want to discuss this further?

Book a free strategy call with our team to see how these insights apply to your specific business goals.

Book a consultation