Why AI agents forget everything
The smartest software ever built has the memory of a goldfish. I spent 20,000 lines of code finding out why that's the real bottleneck — and what fixing it actually takes.
Ask an AI agent to fix a bug today, and it will do a genuinely impressive job. Ask it again tomorrow, and it will re-read your codebase, re-derive your conventions, re-discover the gotcha it hit yesterday, and — with unsettling confidence — walk straight into the same wall it walked into last time. Nothing carried over. The agent that helped you yesterday is, functionally, dead. You're talking to its twin.
This isn't a model problem. The models are remarkable. It's an architecture problem: we've built brilliant reasoners on top of a runtime that wipes itself after every conversation. Statelessness was a fine assumption for chatbots. For agents doing real, multi-day work, it's the bottleneck nobody prices in — every session pays a tax of re-explanation, re-exploration, and repeated mistakes.
Chat logs are not memory
The obvious fix is to store the transcript and stuff it back in next time. Everyone tries this first. I tried this first. It fails for the same reason your bank statement isn't a biography: a transcript records what was said, not what was learned.
Real memory is structured. When you debug something at 3am, what you keep isn't the terminal scrollback — it's the causal chain: I assumed X, tried Y, it failed because Z. The lesson lives in the links between events, not the events themselves. Feed an agent raw transcripts and it drowns in its own history; the context window fills with noise long before it fills with knowledge.
What fixing it took
HCR — the Hybrid Cognitive Runtime — is my answer, and it's built on three primitives that took most of those 20,000 lines to get right.
Cognitive State Objects. Instead of transcripts, HCR snapshots the agent's actual reasoning context — beliefs, goals, active plans, working memory — as a structured, queryable object. When a session resumes, the agent doesn't re-read history. Its state is restored, and it continues mid-thought.
A causal event graph. Every decision links to its outcome. "Why did we choose SQLite?" is a graph traversal, not an archaeology dig. And crucially, failure is first-class: an approach that failed once is recorded as failed, with its reason, so the agent can refuse to repeat it. Never making the same mistake twice stops being a slogan and becomes a query.
Episode boundaries. Memory that never forgets the wrong things is just as useless as memory that forgets everything. HCR uses Bayesian online changepoint detection to notice when the work has shifted — new task, new episode — so context from one problem doesn't bleed into the next.
All of it is exposed through 40+ MCP tools, which means any MCP-compatible agent can borrow this brain. The measurable result: 41% fewer tokens than a stateless baseline doing the same work, because remembering is cheaper than re-deriving. Every time.
The thesis, everywhere
Once you see statelessness as the bottleneck, you see it everywhere, and most of what I build is some version of the same answer. TARS keeps a hash-chained ledger so an agent can't misremember its own actions. Even this website remembers you — visits, the projects you've read, your theme — because a portfolio arguing that intelligence is persistent state should probably practice what it preaches.
The next generation of agents won't win by being smarter per-token. The frontier models are converging; raw reasoning is becoming a commodity. They'll win by accumulating — by being the agent that has already made the mistakes, already learned your codebase, already knows what failed in March. Intelligence compounds only if it persists.
Goldfish don't compound.