Skip to content

e-macgregor/cyclic-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cyclic Agents cover

Cyclic Agents

Mortality is not a bug of intelligent systems. It might be the feature that makes them evolve.


Everyone building AI agents eventually runs into the same wall. You give your agent memory, tools, skills, a growing knowledge base — and somewhere along the way it gets worse. Context bloats. Old facts contradict new ones. Prompt patches accumulate like scar tissue. The agent that was sharp at week one is sluggish and confused at month six.

The default response is to fight entropy: better retrieval, smarter compaction, memory hierarchies. All useful. But there's a more radical framing hiding in plain sight, and biology figured it out a few billion years ago.

The immortal organism doesn't evolve. The mortal one does.

The problem with infinite agents

An agent that runs forever accumulates everything: stale facts, obsolete workarounds, instructions written for problems that no longer exist. Every accumulated token is a small tax on every future decision. There is no garbage collector for judgment.

Humans don't have this problem, and the reason is brutal and elegant: we die. But before we do, we compress a lifetime of experience into something transmissible — we teach our children. The child doesn't inherit the raw context window of the parent's life. No trauma dumps, no expired heuristics, no forty years of unresolved TODO lists. The child inherits the distillation: values, skills, curated knowledge. The lossy compression is the point.

Death is nature's context window management.

The cycle

So here's the proposal — cyclic agents. Instead of one agent that runs forever, an agent lifecycle:

1. Live. The agent operates normally for a bounded lifespan — measured in days, tasks, or tokens. It works, accumulates experience, makes mistakes, writes things down.

2. Reproduce. Near end of life, the agent enters a reproduction phase. It doesn't clone its context — it writes a genome: a curated memory store, a refined system prompt, distilled lessons ("this tool fails when X", "this user prefers Y"), and configuration. Critically, it produces not one successor but a litter — say, three — each a deliberate mutation. Different memory curation policies. Different prompt strategies. Different tool priorities.

3. Coexist. The parent does not die at birth. This matters. The offspring run in shadow mode on real work while the parent is still the primary. The parent routes tasks to its children, observes them, corrects them. This is the training period — childhood, if you like. Sibling rivalry included, free of charge.

4. Select. The offspring compete on an eval suite plus real-world task performance. This is the part most "self-improving agent" designs skip, and it's fatal to skip it: evolution without selection pressure is just drift. A successor is not better because it's newer. It's better because it demonstrated it, against its siblings, on the work that actually matters.

5. Succeed. The strongest offspring becomes the heir and takes over as primary. The parent is archived (rollback insurance, not sentiment). The losing siblings aren't wasted either — any unique wins they demonstrated get merged into the heir. Crossover, not just mutation.

Then the cycle repeats. Generation N+1 begins.

Why three children, not one

A single successor is a gamble — you're betting the distillation went well. Three successors turn reproduction into a search. Each generation explores a small neighborhood of the design space around the parent, and selection keeps only the direction that worked. This is just evolutionary strategy with a population of 3 and very strong elitism, but applied to the agent's configuration and memory rather than model weights. No fine-tuning required. The genome is text.

And because parent and children overlap in time, you get something evolution rarely gets: the parent as evaluator. It knows the job. It has seen the edge cases. It can grade its children on the exact failures it spent a lifetime learning to avoid.

What this buys you

  • Bounded degradation. No agent lives long enough to rot. Bloat has an expiration date by construction.
  • Compounding improvement. Each generation starts from a distillation of everything before it, minus the garbage. Lessons persist; noise doesn't.
  • Automatic pruning. The reproduction step forces the hardest question in agent design — what is actually worth keeping? — to be answered every generation, by the entity best positioned to answer it.
  • Rollback for free. Archived parents are checkpoints. A bad generation is a one-command revert.
  • A real answer to "how do we know the agent is improving?" You know because generation 12 beat its siblings on evals that generation 11 designed from its own failures.

The uncomfortable part

There's an obvious objection: isn't this wasteful? You're throwing away a working agent every N days.

But you're not throwing away the agent. You're throwing away the accumulation. The knowledge, the judgment, the hard-won lessons — those are exactly what gets carried forward. What dies is the clutter. Humans have been running this protocol for 300,000 years and it produced everything you see around you, including the machines we're now teaching to do the same thing.

The immortal agent is a local maximum. The mortal lineage is a search process.

Build lineages, not agents.


If you're running an agent framework with profiles, memory stores, and a cron scheduler, you already have everything you need to try this. Lifespan is a config value. The genome is a directory. Selection is an eval script. Generation 1 could start tonight.

Reference implementation

See /example for a minimal framework-agnostic Python reference.

Status: concept + minimal example, v0.1

About

Mortal agents, immortal lineages. A lifecycle pattern for self-improving AI agents: bounded lifespan, genome distillation, sibling tournaments, heir selection.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages