The Shapes of Agent Memory – Files, Stores, and Experience

sebg1 pts0 comments

The Shapes of Agent Memory – Files, Stores, and Experience

English 繁體中文

Toggle theme

The Shapes of Agent Memory – Files, Stores, and Experience<br>August 12, 2026<br>An agent that remembers across sessions can keep its memory as curated markdown files, as an auto-mined structured store, or as trained experience. I measured all of them: files against a structured store under one fixed model, a store-only head-to-head across the structured lineages, and an experience bank on the agentic benchmarks where the state of the art trains memory into the weights.

Three side-by-side memory shapes: a file-based index of markdown lines, a structured store of embedded units linked by a graph, and trajectories of agent experience with one successful episode ringed.

An agent that only remembers within one conversation is a stranger with excellent manners: it greets you warmly every single day, and it has no idea<br>who you are. The moment you want it to know your projects, your preferences, and the thing you told it last Tuesday, you need memory that outlives the<br>context window. There are three common shapes a modern agent memory system takes (Fig. 1). Two are stores that sit beside a frozen model,<br>and they anchor opposite ends of a design axis; the third moves the memory behavior into the model itself.

The first keeps memory as files the model curates : a short index plus topic files, written in plain markdown, read back by searching and reading<br>them like any other file. It is what a coding agent reaches for when it has a filesystem and no database, and it is what<br>Claude Code, Cline,<br>Cursor, and Windsurf ship today.<br>OpenClaw is the most thoroughly worked-out version of it: its default memory-core plugin keeps a curated<br>MEMORY.md beside dated session logs, and it adds a background consolidation pass that the other file-based products do not have. The second keeps<br>memory as a structured store : every turn is mined into small atomic facts, embedded into a vector index, threaded into a temporal graph, and read<br>back by ranked retrieval. It is what you build when memory is the product, and it is what the dedicated memory startups<br>mem0, Letta, and Zep sell. The third keeps<br>memory as experience the model is trained to use : episodes still land in a bank, but everything that makes them memory, what to retrieve, whether<br>to trust it, how to turn it into action, is trained into the acting policy by reinforcement learning. It is the agentic state of the art<br>(MemHarness), the shape the field reaches for when retrieval stops paying, and it is where this post<br>ends.

In this post, I measure which shape is better rather than argue it, which meant building the first two. The structured arm is a hybrid of<br>the two structured lineages, plus a layer neither has: an associative graph learned from which places<br>actually get retrieved together, so recall can reach an item the query never ranked. The file-based arm is a reconstruction of a<br>shipping coding agent’s auto-memory, traced claim by claim to public documentation and<br>published with its spec, not a strawman written to lose. Both run behind the same<br>agent loop, on the same local open-weight model, scored by the same judge on the same public benchmark, so only the memory layer can move the<br>number, and the per-question rows, with the scripts that recompute each figure and an explicit ledger of the few published scores whose rows could not<br>be released, are in a40-labs/memory. Hosted models come in where fairness demands: the<br>head-to-head reads every store through one shared reader and judge, gpt-4o-mini, the same model the graph vendor’s own<br>numbers were scored with; the agentic experiment fields a frontier actor, claude-sonnet-5. The trained shape cannot join<br>the controlled comparison at all, because the training is the method: unplug its bank and you have a different policy, not a baseline. The<br>last section meets it on its home ground instead.

TL;DR The structured store beats files on accuracy and on token cost at once; files win where memory stays small, or where the right answer is “I<br>don’t know”. Against my own interest, the hybrid is statistically indistinguishable from a plain vector index on LoCoMo; paired on long-haystack<br>LongMemEval-M the same two stores separate by 15 significant points in the hybrid’s favour, which is consistent with structure paying as histories<br>grow (the arms differ in more than structure, so the bundle is what is measured), and no single benchmark ranks memory systems. Swapping the model<br>stack that reads and judges the memory moves the score further than swapping between any two of the stores that work, which is why numbers do not<br>travel between protocols. On the agentic benchmarks, retrieved experience paid only where the actor was weak with headroom left; where the task yields<br>to reasoning, a frontier actor reaches the trained system’s bar with no memory at all, and where the reward has a shape only practice teaches, the<br>trained policy stands alone.

Figure 1....

memory agent files experience structured model

Related Articles