Social insects like ants and termites build nests that are some of the most complex structures in the animal kingdom. They have specialized chambers for different purposes, connected with tunnels in a way that takes into account ventilation, cooling, and being able to efficiently get around. They’re also built to be structurally sound so you don’t get tunnel or mound collapses. The insects build these, despite never attending engineering or architectural school. And they do it without any kind of centralized plan for the nest.

In a previous article, I talked about how interactions between ants create a closed-loop that regulates how many go out to forage. With nest building, there’s an important difference: many of the signals ants and termites use to tell them what to do don’t come from direct interactions with their nestmates. Instead they come from the environment that the insects are collectively interacting with.
For example, in a study of the nest building of the ant Lasius niger (black garden ant), researchers investigated how the ants coordinate. They found the ants start by picking up soil and forming it into pellets for building. Then, if there is a nearby deposit of pellets, they add it to the pile; otherwise they just put it down wherever (which initiates a new pile). This very simple rule ensures the pillars are spaced out properly and allows ants to cooperate while building up pillars without a central plan.
When the pillars are tall enough (judged, adorably, by whether they are taller than the ant is tall), the ants start extending the top of the pillar outward to create a roof.
What I want to explore here is how the ants use the environment itself to coordinate. This concept has deep implications, but I hadn’t even heard the name for it until very recently: stigmergy.
Stigmergy
Instead of having a central plan or direct communication, the ants building their nest coordinate through altering the environment. One ant drops a pellet in a spot, and the pellet acts as a signal for where to add more pellets.
This is one form of stigmergy:
Stigmergy is an indirect, mediated mechanism of coordination between actions, in which the trace of an action left on a medium stimulates the performance of a subsequent action.
In the ant pillar case, the trace is the pellets and their location, and the medium is the nest site itself.

The subsequent actions are based on the environment—you can imagine the ants following a sort of conditional statement:
If there is a pellet pile nearby, then add pellets to the pile (until it’s higher than the length of your body)
While stigmergy can allow many ants to coordinate together, it can also allow an agent to coordinate with itself over time.
Self Stigmergy
Maybe the simplest example of stigmergy is a thermostat. Based on the current temperature, the thermostat turns on a heater or air conditioner. Doing so changes the temperature, leaving a “mark” on the air.
This setup provides a bunch of benefits: the thermostat doesn’t need any kind of complex inner model of how its actions affect the temperature. By just constantly reading in the current state of the environment, it keeps in perfect sync with what it’s meant to affect.
We find single-agent stigmergy in nature, as well. Enter our old friend, the slime mold.
I’ve previously talked about how slime molds, which are giant single-celled organisms, are able to use local rules to perform smart decision-making. Their veins explore the environment looking for food. Veins that find food are reinforced, becoming thicker. All veins are in competition for cytoplasm with all other veins, so those that don’t find food gradually diminish.
With these simple feedback rules, slime molds can find efficient routes through mazes and make various trade-off decisions, despite lacking a brain.
But here’s the wild thing: slime molds also have a form of memory.
If a slime mold is trying to forage efficiently through an environment, it’s going to do a lot of exploring—reaching out its tendrils searching for food sources. But without memory, it could end up searching an area it’s already been in, wasting precious resources.
Luckily slime molds have a solution: they leave behind a slime trail, and use the presence of slime as a cue that they should explore elsewhere.
So instead of needing to build up some mental map to keep track of where it’s been, the slime just uses the world as its own map. By leaving a mark in the environment, it changes its own behavior in that environment, allowing for more efficient foraging.
We humans with our complicated brains tend to keep our memories inside our skulls, but not always.
My Stigmergic Life
As a kid, I remember watching this Sesame Street bit where Ernie used strings tied around his finger to remind him of something—the first string was to remind him he had a string tied around his second finger, the string around the second finger reminded him he had a string tied around his third finger, and so on, until the last string was supposed to remind him they were out of string. Ba dum tss.
The idea of tying a string around your finger as a reminder stuck with me. I started putting odd things on my bedside table to remind myself I meant to do something as soon as I woke up—like a pencil on top of my alarm clock’s off button to remind me I had to stick my assignment in my backpack.
I was making a mark that would spark a rule. If something weird was in my environment, then try to remember why it was there. If I remembered why it was there, I remembered what I had to do.
As a parent, I’m often more slime mold than human. One of my jobs in the morning is to get the kids’ bags all packed and ready for preschool. There’s a bunch of steps to this—fill their water bottles and put them in their backpacks, put milk in their thermoses and put them in their lunch bags, put utensils in their lunch bags, and so on. But I do this while being interrupted every 30 seconds by other demands from the kids, like them needing me to cut a peanut butter sandwich into the shape of the corndog king.
Relying solely on memory, I wouldn’t be able to keep track of where I am in the process. Instead, I just rely on the environment, and take simple steps based on what I find when I look at the kitchen counter. A filled water bottle? Great, next step is to put it in the backpack. Each step I take leaves a mark on the medium of “stuff on my kitchen counter”, tracking where I am in the process.
The downside of relying on stigmergy is that it’s sensitive to disruptions in the environment. Washing away the slime of a slime mold would wipe away its memory. The Eumenid wasp, which constructs a sort of mud funnel as part of its nest, will restart from step one and build a second mud funnel if a hole is created at the right time in the nest building process—the hole acts as a cue that it’s at step 1.
Similarly, if the lunch bags got zipped up before I put utensils in them, I would be missing the environmental cue to put the utensils in, and my 5-year-old would give me an earful when he got home.
The Retracted Mind
We all use stigmergy in various forms constantly. We leave out a form on the kitchen table to make sure we remember to fill it out. We use a digital or physical calendar to prompt us when it’s time to do something.
There’s common writing advice to “just start writing”. The idea is you can edit a bad draft, but you can’t edit a blank page. This works for a lot of people—and is a form of stigmergy. The draft is more than just a worse version of the final product, it’s also a signal that kicks off a different kind of process—a set of responses to the contents of the draft that wouldn’t be possible without those marks on the medium.
If you’re familiar with the idea of the extended mind, this might all sound familiar. It’s the idea that some parts of our environment can be so fundamental to cognition, we should consider them part of the mind. Here’s a summary of the key thought experiment:
The fictional characters Otto and Inga are both travelling to a museum simultaneously. Otto has Alzheimer’s disease, and has written all of his directions down in a notebook to serve the function of his memory. Inga is able to recall the internal directions within her memory. The argument is that the only difference existing in these two cases is that Inga’s memory is being internally processed by the brain, while Otto’s memory is being served by the notebook. In other words, Otto’s mind has been extended to include the notebook as the source of his memory. The notebook qualifies as such because it is constantly and immediately accessible to Otto, and it is automatically endorsed by him.
The usual reading of this thought experiment extends the mind outward, so Otto’s notebook becomes part of the mind. But we can invert this reasoning instead: maybe we should consider Inga’s use of memory as a form of stigmergy.
At any given moment, the cognitive processes operating now are dependent on memory traces from past processes. Those past processes have no direct contact with the current ones, but they make marks in a shared medium—memories stored in the synaptic connections of the brain. The current process “picks up” those memory traces and does something different because of their presence.
Cognitive scientists often implicitly invoke stigmergy in the analogies they use. In Global Workspace Theory, they talk of a “blackboard” that many different cognitive processes read and write to. Working memory is described as having a “visuospatial scratchpad“. Engrams, the physical alterations in the brain that encode a specific memory, are the marks made in the medium of the brain, altering the later actions taken by processes.
The phonological loop is a part of working memory that stores speech that we hear for short periods (1.5-2 seconds). If you’ve ever found it easier to count up a bunch of items aloud rather than in your head, it’s because you’re relying on the phonological loop to hold the previous number. You’ve made a mark in the phonological loop to hold your place, and you know, for each number, what comes next. If seven is in my phonological loop, then grab the next item and say eight. How different is this from making a tally on a page, or using one’s fingers to keep track?
Our minds are full of different parts constantly making marks on each other, and not just for memory. From the perspective of any one process, the rest of the brain is a medium to mark up. The brain is constantly changing—connections between different neurons strengthening or weakening through various biochemical processes, allowing us to learn. These are all marks being made in the medium, memory is just the most obvious case.
Above, I mentioned how stigmergy can fail—if a mark in the medium is disrupted (like a hole added to a wasp’s mud funnel or the lunch bags getting zipped up), it can lead to a misfiring of the process relying on those marks. But our own internal stigmergy takes place in an often easily disrupted medium. When my kids desperately need me to answer a question about whether sea snails are real, it wipes out what was in my working memory. That medium just isn’t robust for when kids are around. So I instead rely on the more reliable medium in that situation: the kitchen counter.
If you enjoyed this, please hit the “Like” ❤️ button, restack, or share this article to help others find it.
If you enjoy Cognitive Wonderland, consider supporting it by becoming a paid subscriber at whatever level feels comfortable for you.
If you’re a Substack writer and have been enjoying Cognitive Wonderland, consider adding it to your recommendations. I really appreciate the support.







"As a parent, I’m often more slime mold than human." I identify with this so freaking much. Also, I clicked on your hyperlink to the Corn Dog King, and I'm super glad I did. Showing this to my boys immediately when I get home.
Yet another fascinating article Tommy. I identify a lot with this idea, as I use it a lot myself. I think it's therefore a very powerful avenue to explore. The only thing I'd say is not to ignore the context. In the case of the ants, for example, they are all engaged in a nest building project. With your morning ritual, you are engaged in a "get the kids to school" project. This clearly infers some broader awareness of a plan beyond the individual acts occurring. With the wasp the pursuit of a plan is even more obvious. So perhaps the truth is even more weird and wonderful 😊