Essay · Agent Memory · Interactive

Your Agent Has a Filing Cabinet. It Needs a Hippocampus.

We gave agents one flat memory store. Cognition runs four — working, episodic, semantic, procedural — wired together by a consolidation cycle that runs while you sleep. The architecture agents are missing, and a live lab where you can switch it on.

Series: Building agents that finish (part 3 of 6)
Also in this series: The Marathon · Agent Memory · Memory Needs Forgetting · No Undo Button · Loop Infrastructure
The short version

Most agent memory is one undifferentiated store — a MEMORY.md, a vector index, a transcript log — doing four jobs at once and doing each badly. Cognitive science solved this architecture problem a long time ago: different kinds of remembering need different stores, different write policies, and a consolidation process that moves knowledge between them.

Here’s a strange fact about the most capable agents being built right now: they remember everything and learn almost nothing. Every trace is logged, every conversation stored, every fact appended to a growing file — and next Tuesday the agent solves the same class of problem from scratch, at full price, repeating a mistake it made forty times in the logs it technically possesses. The information is all there. What’s missing is the machinery that turns records into knowledge — and that machinery has a well-studied reference implementation running in your head.

Human memory isn’t a store; it’s a system. A tiny working memory holds the current task. An episodic memory records experiences — specific, contextual, time-stamped. A semantic memory holds distilled facts stripped of their origin story. A procedural memory holds skills you execute without recalling how you learned them. And crucially, these aren’t silos: consolidation — much of it during sleep — replays episodes, extracts the general from the specific, and migrates knowledge from the hippocampus’s fast episodic buffer into the cortex’s slow semantic and procedural stores. You remember the rule long after you’ve forgotten the lessons that taught it. That’s not an accident of biology; it’s a solution to exactly the problem agents have.

01The four memories, mapped

Cognitive system → agent equivalent → what breaks without it
MemoryHoldsAgent equivalentMissing it looks like
WorkingThe current task, a few items, seconds–minutesThe context window(You have this one — it’s the only one everyone has)
EpisodicWhat happened, when, in what contextTraces, transcripts, progress files — indexed by time and taskCan’t answer “have I tried this before?” — the doom loop’s root cause
SemanticFacts, freed from their source episodeDistilled knowledge files: “staging DB resets Sundays”, “this API paginates at 100”Re-derives the same fact every session, at token cost, forever
ProceduralHow to do things — compiled, cheap to executeSkills: procedure + pitfalls + verification steps, loaded on demandEvery task reasoned from first principles; competence never compounds

The taxonomy matters because each store wants different engineering. Episodic memory should be append-only, cheap, and indexed by time — never loaded wholesale into context. Semantic memory should be small, curated, deduplicated, and versioned, because facts go stale. Procedural memory should be structured (the skill format from the memory post) and loaded by task-type match. Collapse them into one file and you get the standard failure: episodic noise drowning semantic signal, retrieval pulling last month’s stack trace when the task needed this month’s rule. MemGPT saw this early and framed the fix in OS terms — memory tiers with paging between them; the cognitive framing tells you what belongs in each tier.

02Consolidation: give the agent a night’s sleep

The four stores are just buckets without the process that moves knowledge between them. In brains, that’s consolidation — sharp-wave ripples replaying the day’s episodes during sleep, strengthening what mattered, generalizing across repetitions, migrating stable knowledge to cortex. The agent translation is almost embarrassingly literal: a nightly batch job.

the consolidation loop — runs off-peak, no user waiting replay   → read the day's episodic traces (successes AND failures) distill  → extract semantic facts ("API X rate-limits at 60/min — verified twice") compile  → upgrade repeated successful procedures into skills; append new pitfalls to existing ones prune    → drop raw episodes past their horizon — the distillate stays, the noise goes verify   → nothing is promoted to semantic/procedural without meeting an evidence bar

The pieces of this loop already exist in the wild, unassembled: Stanford’s Generative Agents run periodic reflection that synthesizes observations into higher-level insights; Voyager compiles successful Minecraft episodes into a growing, reusable skill library; Reflexion turns failures into verbal lessons for the next attempt; Hermes’s periodic nudge asks the agent what’s worth keeping. What none of them quite say out loud is that these are all fragments of one architecture: fast episodic capture during the day, slow structured integration at night. Run consolidation while your fleet idles and the expensive reflection happens off the critical path — the agent literally gets smarter overnight.

03Retrieval is a ranking problem (and interference is the enemy)

A memory system is only as good as what it surfaces at the decision moment — and surfacing is retrieval-and-ranking, a problem with known machinery. Generative Agents’ scoring function is the right starting point: rank candidate memories by recency × relevance × importance, load the top few, progressive-disclose the rest. The killer is interference: as the store grows, near-miss memories crowd the cues — the trace from a similar-but-different incident retrieves confidently and misleads completely. Consolidation is the anti-interference mechanism: distilling ten similar episodes into one verified rule removes nine wrong things to retrieve. And forgetting — as the amnesia post showed with 20,000 trials — isn’t data loss; it’s precision engineering for the retrieval layer.

04The lab: fourteen days, with and without sleep

The same agent, the same daily task mix, 14 simulated days. Every day it accumulates episodic traces; tasks succeed more often when the right memory surfaces and less often as interference grows. Two switches: consolidation (the nightly distill-and-compile job) and pruning (episodic decay after distillation). Watch the two charts together — what the store is, and what the agent can do:

Memory store composition — entries by type

Task success rate per day

day-14 success rate
store size (entries) at day 14
skills + verified facts compiled

The instructive configs: both off = append-everything (success degrades after day ~5 as interference wins — the amnesia result). Consolidation without pruning helps but the episodic pile still drags. Both on: the store stays small, the green procedural layer grows, and success compounds — the agent that sleeps ends the fortnight nearly 50 points ahead of the one that hoards (85% vs 37% in the seeded runs), with a store one-sixth the size.

05Where the analogy doesn’t save you

· Consolidation is lossy compression, and bad summaries compound. A wrong distilled “fact” is worse than the ten noisy episodes it replaced, because it retrieves with the confidence of curation. The evidence bar before promotion — verified twice, or verified once against ground truth — is the load-bearing detail, not a nicety.

· Importance scoring is Goodhart bait. Let the agent rate its own memories’ importance and it will learn what gets kept, not what’s true — the same failure mode as every self-graded metric (watched it happen). Anchor importance to outcomes: memories that changed a decision that verified earn their keep.

· Brains are an existence proof, not a spec. The four-store map and the consolidation cycle transfer because they solve an information problem agents share. Sharp-wave ripples don’t. Take the architecture, skip the neuroscience cosplay — the test of every borrowed mechanism is the eval delta, nothing else.

Takeaways

  1. Split the store. Episodic, semantic, procedural — different write policies, different indexes, different decay. One file doing four jobs does each badly.
  2. Schedule sleep. A nightly replay → distill → compile → prune job, off the critical path. Reflection you pay for once, at 3am, instead of every task.
  3. Promote on evidence. Nothing enters semantic or procedural memory without verification — a confident false memory outlives a hundred noisy true ones.
  4. Rank retrieval by recency × relevance × importance, and treat interference as the metric that tells you consolidation is overdue.
  5. Prune the episodes after distilling them. Forgetting is the retrieval layer’s precision knob, not data loss — keep raw traces in cold storage for audit, out of the retrieval path.
  6. Measure learning, not storage. The KPI isn’t entries retained; it’s day-14 success versus day-1 — is experience compounding, or just accumulating?

The gap between an agent that stores and an agent that learns is one batch job. Give your agent a hippocampus — and a bedtime.

Read next: We Gave Agents Memory but No Way to Forget · Six Agents Finish the Same Task. The Trace Knows Who's Better.

Cite this post
@misc{murugesan2026agent,
  author = {Murugesan, Sugeerth},
  title  = {Your Agent Has a Filing Cabinet. It Needs a Hippocampus.},
  year   = {2026},
  month  = {aug},
  url    = {https://sugeerth.github.io/blog/agent-hippocampus/},
  note   = {Accessed: [date]}
}
SM
Sugeerth Murugesan Staff ML Engineer / Scientist · Intel / Intuit