Home

Evolving agents

Almost every way we improve an agent today comes down to editing its prompt, by hand or with an optimizer. I wanted to try something closer to breeding. Give each agent a few numbers that shape its personality, let the agents that do well have children, and watch what the population turns into over many generations.

In 2025 I ran that experiment on a small colony of LLM farmers and got a clean, exciting result. In October 2026 I rebuilt the colony without the LLM, ran it thirty times, and found out the result was mostly luck. Both halves are worth telling. The idea held up. My way of testing it didn't.

Personality as a handful of dials

Each agent's prompt carries four numbers between 0 and 100: curiosity, greed, caution and foresight. Think of them as dials. A farmer with greed turned up claims land aggressively. One with caution turned up checks the soil before every planting. One with foresight turned down forgets to plant for the turn after next.

In genetic terms the dials are the agent's genes. When an agent has a child, the child inherits the parent's settings, each nudged a little up or down at random. That nudge is mutation. Agents whose settings suit the environment live long enough to reproduce, and their settings spread. That's selection. Nobody rewrites a prompt; the population drifts toward whatever works.

This is different from prompt optimizers like DSPy, GEPA or EvoPrompt, which rewrite the prompt's text. Here the text never changes, only four values inside it. The two approaches can sit side by side: a long system prompt tuned one way, a short genome tuned the other.

Does the model actually read the number?

The whole idea depends on one thing. If you tell a model its complexity is 20% rather than 80%, does it actually write differently? If not, the dials are decoration and there's nothing for evolution to work on.

I tested it with a complexity dial, swept from -100% to 100%, and measured the reading level of what the agent wrote.

01The number moves the writing
10152025-100%-80%-60%-40%-20%020%40%60%80%100%Grade level23.1
Reading level of an agent's output, as a Flesch-Kincaid school grade, against the setting of its complexity dial. One dip at -40%; otherwise it climbs steadily.

It does. At the bottom of the dial the agent writes at about an 11th-grade level. At the top it writes like a dense academic paper. The model reads the number, understands what it means, and adjusts. That's the property that makes the rest possible: a fuzzy behavior gets a numeric handle, so mutation is just arithmetic and selection is just comparing scores.

The colony

To see whether selection would find good settings on its own, I built a small farming game. Five founders started with random dials. They lived on a 10×10 map where some tiles were rich and some nearly barren, and they had to eat every turn, plant crops that took two turns to grow, and save up enough food to have a child before they died of old age. Checking whether a tile was fertile cost them one of their eight actions a turn, so there was always a trade-off between looking and doing.

The dials mattered. Too much caution and an agent spent its turns checking soil and starved. Too little foresight and it ran out of crops. Greed without curiosity claimed bad land.

Here is how the colony's average dials moved over a hundred turns.

02Greed up, caution down
0204060801001102030405060708090100Curiosity69Foresight27Caution5Greed96
Average dial settings among the living, every ten turns of the 2025 run. The colony stayed at four or five agents until turn 70, then grew to 15.

Greed climbed to 96 and caution fell to 5. The population tripled over nine generations. I wrote it up as natural selection discovering that this environment rewards aggression, and I was pleased that nobody had told the agents to be greedy.

What actually happened

Months later I looked at who was alive at the end. All fifteen agents descended from a single founder, Agent_3. And Agent_3 had started the game with greed at 100 and caution at 0.

So the dials never moved toward anything. Agent_3's family took over the farm, and the colony's averages simply became Agent_3's settings. Biologists call this the founder effect. Blow a handful of birds onto an empty island, and whatever those few birds happen to carry becomes the species, whether or not it's the best thing to carry.

Maybe Agent_3 won because greed really does pay on that map. Maybe it planted early on a good tile and got lucky. With five agents and one run, there's no way to tell, and I had written it up as if there were.

Rebuilding it without the LLM

Running the real experiment again with LLM agents is slow and costs money every turn. So in October I rebuilt the same game with a simple rule-based player in place of the LLM. The dials still drive behavior, but through fixed rules instead of a model's judgment. That version runs thirty colonies in a few seconds, which meant I could finally ask how often the 2025 result would happen.

The first thing it showed was that the original game was barely survivable.

03Thirty colonies per set of rules
Original rulesTuned rules
Colonies that died out10 of 300 of 30
Deaths from starvation76%10%
Agents with no land, late in the run44%29%
Population, late in the runabout 35about 74
The rule-based rebuild. The original rules mirror the 2025 game on a smaller map. The tuned rules add a bigger map, ten founders, land passed to a child when its parent dies, unused land returning to the wild, and smaller mutations.

A third of the original colonies died out, and three deaths in four were starvation. That isn't an environment that selects for good traits. It's a famine, and whoever survives it is mostly whoever got lucky early. With the tuned rules, every colony survived and starvation became rare.

The view below is one of those tuned colonies, drawn as a cloth. Read it from top to bottom: each row is one turn, and each column is one tile of the farm, with the richest land on the left. Each color is one founding family. Bright tiles are ripe crops, dim ones are claimed but unplanted, and black is land nobody owns. Press play to watch it weave.

You can see the land rush in the first few rows, then the farm settling into a pattern where poor land stays mostly empty.

Greed loses

Here's the part that changed my mind. In the rebuild, greed doesn't win. It falls. Foresight rises instead. That happens under the tuned rules and even under the harsh original ones.

04The same four dials, opposite verdicts
2025, LLM colony2026, rebuildCuriosity: 2025, LLM colony 69 → 2026, rebuild 45Curiosity6945CuriosityCaution: 2025, LLM colony 5 → 2026, rebuild 49Caution549CautionGreed: 2025, LLM colony 96 → 2026, rebuild 35Greed9635GreedForesight: 2025, LLM colony 27 → 2026, rebuild 72Foresight2772Foresight
Left: the 2025 LLM colony at turn 100, a single run. Right: the rule-based rebuild under tuned rules, averaged over 30 colonies.

You can watch it happen inside one colony. In the view below, each of the four horizontal bands is one dial, running left to right through 300 turns. The vertical position within a band is the dial's value, and brightness shows how many agents have that value at that moment. Greed's band sinks and narrows early; foresight's drifts upward.

I can think of two explanations, and I can't tell them apart yet. The first is the founder effect again: the 2025 result was one family's settings, and in a real population greed doesn't pay. The second is more interesting. Maybe an LLM told its greed is 96 plays a different game than my simple rules do with the same number, and in that game greed really does win. If so, the dials are doing something richer than my rules can imitate, which is exactly what the complexity test suggests they can.

The last view is the family tree. In it, the founders sit at the center, time runs outward in rings, and every agent is a short strand from its birth to its death, branching off its parent. Color shows one dial, and you can switch which. By turn 300 only one of the ten founding families is left, under rules where hardly anyone starves.

So one surviving family, on its own, tells you almost nothing about which traits are good. That's the mistake I made with Agent_3.

What I'd still build

None of this kills the idea. The complexity test still stands: a number in a prompt reliably steers how a model behaves, and that's what makes evolution cheap. Mutation is arithmetic. Selection compares scores you're probably already collecting. An agent that runs all day, scored by an eval or by how users react to it, could evolve its dials in the background. A research agent might end up more curious than an agent that files tickets. Each user could even have their own population, tuned to them.

What the rebuild taught me is that an evolutionary loop is only as good as the world it runs in. Make the world too harsh and you're measuring who survived a famine. Start with too few founders and you're measuring which family got lucky. A cheap rule-based stand-in finds both problems in seconds, before you spend anything on LLM agents.

The next experiment is the obvious one. Put the LLM agents back into the tuned colony, run it thirty times, and see whether greed still wins. If it does, the dials are steering the model in ways simple rules can't. If it doesn't, the 2025 colony was just Agent_3's family all along.