Jeffrey JohnsonRSS

Pheromones for AI Agents

By Jeffrey Michael JohnsonPublished: June 24, 20268 min read

I spend most of my days running a lot of AI agents at once. GBuild, the macOS app I'm building, orchestrates a fleet of coding agents from one interface. When you run a fleet that size, you learn fast that the bottleneck is not model quality. It is context. Every token an agent has to read before it can act is a token you paid for, and at scale that bill gets loud.

So I went looking for a cheaper way to carry meaning. I found it in ant colonies. This is the write-up of that research, which I'm calling the Semiochemical Context Layer.

Insight

This piece has a live, interactive version below: drive the simulations, tap a code to watch it bloom into its full protocol, and drag the compression-versus-fidelity knee yourself.

The problem: context is expensive

Here is the part nobody puts on the marketing page. A cold subagent in my system loads about 26,000 tokens of manifests, personas, and rules before it does a single useful thing. Spin up a 100-agent wave and that cold-start alone burns roughly 2.6 million tokens. Meanwhile the agent's entire persistent memory is a frozen, keyword-only block of about 800 tokens, and the same boilerplate paragraph is copied across 20-plus persona files because there was no better way to share it.

Every byte of that is natural-language prose. There is no symbolic shorthand anywhere in the pipeline. That is a strange thing to admit in 2026: we have agents that can reason about category theory, and we are still handing them their operating rules as long English paragraphs, over and over, fresh every time.

The insight: the meaning was never in the molecule

An ant smells one alarm pheromone and the whole colony shifts in seconds. A trail network routes millions of ants to food with no map, no manager, and no single ant holding a picture of the whole. How does one molecule carry that much meaning?

It does not. The molecule is tiny. The information lives in the receiver's pre-installed decoder, a genetically shared lookup table of fixed actions. The pheromone is just a pointer into that table. Because sender and receiver share the codebook, the message itself shrinks to almost nothing. That is not biology being clever. That is Shannon: when both ends share a codebook, the message collapses to which entry, not the size of the entry.

The meaning was never in the molecule. It is in the receiver. And that one fact is the whole invention.

So you install a shared decoder once. It is cheap, and you amortize it across the whole swarm. Then every behavioral rule becomes a one-token reference that the agent dereferences into a full protocol. I call that installed decoder the Antenna. Every agent is born with one.

Three inventions

The layer is built from three machines that share one nervous system. Each is anchored in a different mechanic from chemical ecology, and each one is designed to work the same whether it is guiding 12 agents or 12 million.

PHEROCODE is the density engine: a compact instruction set of 1 to 3 character codes, each one hardwired in the Antenna to a full protocol, a fixed action pattern. Releasers fire an instant action (Hx is alarm-halt, Tr is reuse-the-trail, Fx is forage-broadly). Primers shift the agent's caste for a whole session, the way a queen's pheromone reprograms a worker. Intensity comes from repetition (Hx to Hx2 to Hx3, warn to alarm to halt-everything), scope comes from targeting (Hx2@auth), and a blend ratio carries nuance (Fx:Vr=3:1 reads as mostly forage, some verify). A tiny alphabet times ratios is a vast message space.

STIGFIELD is the scale engine. Agents do not message each other and do not hold global state. They read, write, and reinforce marks in a shared field, and the field itself coordinates them. This is stigmergy, the same mechanism behind ant colony optimization and the paths worn across a lawn. Every mark evaporates. Unused trails fade, busy ones strengthen, so an agent loads only the live trail near it instead of the whole world. Forgetting is the memory management. Decay rate encodes priority: alarms fade in minutes, architectural decisions persist for weeks.

KAIROGRADIENT is the coordination engine, with no dispatcher. Signals carry a gradient, and agents climb toward the strongest source by local hill-climbing. A stuck worker emits a difficulty gradient, the orchestrator reads it, and a stronger model gets routed toward the source. Help finds you. Decisions fire through quorum sensing: a merge happens only when enough independent agents vote past a threshold, the leaderless way thousands of bee scouts settle on one nest.

The lab, and the honest frontier

A one-token code is only worth its protocol if the model reliably decodes it. Density without fidelity is just a faster way to be wrong. So I never report a compression number alone. There is a lab, and it reports the whole curve.

The compression is honest in three numbers. Per-signal density, a roughly 1-token code against the protocol it stands for, measures 79x to 145x for the current 20-code set, with a mean near 97x. A deliberately conservative floor, where you inline a decoder line on every single use and amortize nothing, is still about 6x. You may have seen a 100x-to-10,000x figure attached to this idea. That is the architectural ceiling, one code standing for an entire playbook, not a measurement of what v0.1 does today. I label it that way everywhere, and you should read it that way.

The install is not free, and I measured it. The Antenna costs 535 tokens for the full 20-code gloss, paid once. On a 12-protocol spawn, after that install, the net saving is 426 tokens, and it grows every time the Antenna is reused.

Then the part that actually matters. I measured decode fidelity with Claude Sonnet and an LLM-as-judge: does the agent behave as if it read the full protocol, given only the code and the Antenna's short gloss? Full-prose baselines averaged 0.91. The 1-token pherocode form averaged 0.69. Four of the twelve codes held at 0.8 or above.

That gap is the finding, and it has a clean shape. Compression is effectively lossless for simple fixed actions: taboo Zx scored 1.00, halt Hx 0.90, trail-follow Tr 0.84, forage Fx 0.82. It is lossy for complex multi-step protocols: the verify-gate Vr dropped to 0.41 and the build-caste primer Cb to 0.33, because their meaning does not fit in a short gloss. Fixed actions compress cleanly. Playbooks need a fuller Antenna entry to hold their fidelity. That boundary is the frontier, and the whole discipline is knowing where it bends and never crossing it. No density claim ships without the fidelity number beside it.

I want to be precise about status, because it would be easy to oversell this. The Semiochemical Context Layer is research with a measured frontier. It is not proven in production. Wiring it live into GBuild is a deliberate next step, not a thing I am quietly claiming is already done.

What it means for GBuild

The reason I'm confident this is worth building is that it bolts onto machinery GBuild already runs instead of replacing it. The hook that already prepends shared context to every agent spawn gains a codebook block. The router that already scores work without an LLM call becomes the gradient climber. The distiller's decaying memory pulse becomes one unified evaporating field. Several proto-pheromones already live in the codebase as capability tags, fallback markers, and tier labels. I'm naming and unifying them, not inventing from nothing.

If you want the longer story on GBuild itself, the orchestrator and the fleet it runs, I wrote that up in One Orchestrator, Many Agents. The interactive version of this research, with all three simulations running live, is here. And the marketing site has the waitlist.

The conventional wisdom says the model is the bottleneck. Once you are running several good models at once, the bottleneck moves. It becomes: how do you give every agent everything it needs to know, in the smallest possible signal, without the meaning falling apart on the way in? An ant solved that a hundred million years ago. I'm just borrowing the grammar.

Occasional updates when I publish. No spam.