When the problem isn't the brain, it's the memory
AI agents have an old and very mundane problem: they forget fast. Not in the sense that the context window runs out — everyone knows that one. The worse version is this: give a model external memory and it often keeps that memory like a bad set of student notes. Writes down the wrong things. Searches in the wrong place. Duplicates the obvious. Then it wanders the map, repeats useless actions, and dies in the first hard game it plays.
A Stanford paper called AutoMem proposes a different view. Memory for an LLM, the authors argue, is not just a module or a store. It is a skill in its own right, and it can be improved on purpose. A model can be taught not only to act but to remember well: what to write down, when to search, how to organize its notes, and how to keep from cluttering its own head.
And this is not philosophy for its own sake. In the experiments, upgrading memory alone produced a gain of roughly 2–4× on long game tasks — without touching the underlying model that picks the game actions. It sounds almost like a cheat code: no bigger model, no architectural magic, just teaching it to keep better records.
What they actually did
AutoMem's central idea is very simple, and that is its strength. The authors turn file operations into first-class agent actions. Not helper machinery running somewhere under the hood, but behavior on par with moving, attacking or crafting.
The agent can:
In other words, memory here is an ordinary file system. The agent has a folder of files and decides for itself how to work with it. It can keep a map, log its inventory, store goals, strategy notes and observations about the world.
That sounds almost primitive. Which is exactly the advantage. File memory is easy to observe: every decision the model makes shows up in the trace. You can literally look at where the agent wrote down garbage, where it dropped an important fact, and where it went searching for something that was never there.
The AutoMem setup: one loop improves the structure of memory, the other trains the model to use that memory better.
This is where it gets interesting. AutoMem improves memory along two axes.
The first is structure — how memory itself is laid out: which files exist, what format the map is stored in, what prompts the agent gets, which operations are available to it.
The second is skill at handling memory — how well the model itself decides when to write, when to search first, how to avoid breeding duplicates, and how to pull up the right thing at the right moment.
And the authors automate both of these with two outer loops.
Two loops: fix the shelves first, then learn to use the library
The first loop works like this: a strong LLM reads the full episode logs and rewrites the agent's memory design. It sees the entire run across thousands of steps and tries to work out where the failures were about memory organization rather than intelligence.
This matters because a memory error rarely surfaces right away. The agent may record a coordinate badly on step 50 and only suffer for it on step 800, when it returns to the same spot and doesn't realize it has already been there. You cannot find that kind of failure in the final reward. You have to read the long trace end to end.
The second loop does something else: it collects good memory decisions from many episodes and uses them for fine-tuning. But not the whole model. The authors carve out a separate "memory specialist" responsible for the file operations, while the model that makes the game moves stays frozen.
That is a clean engineering move. It lets you improve memory without risking what the base model already does well in the environment itself.
Where it was tested, and why the test is a good one
Memory was not evaluated on question answering or toy tasks, but on three long games:
That is a good choice. These environments are procedurally generated, so the model cannot simply lean on what it absorbed in pretraining. Every episode is new. It has to actually build a map, track resources, remember where it has been, and keep hold of the goal.
Three game environments for testing memory, from survival and crafting to the extremely long and difficult dungeons of NetHack.
This is where memory stops being decoration and becomes a condition for survival. A short task you can improvise your way through. NetHack you cannot.
Results: memory turned out to be a bigger lever than model size
The paper's strongest result sounds almost provocative: organizing memory properly bought more than moving to a bigger model.
The base was Qwen2.5-32B-Instruct. Hand it file memory in its initial form and the results are modest. After automatic optimization of the memory structure, quality climbs sharply:
After additional training of the "memory specialist" it got better still:
Quality rises as memory improves: first from structure, then from training the skill of working with memory.
At first glance the NetHack numbers look modest. That is deceptive. NetHack is one of the hardest environments of its kind, and even a small gain there is already a visible change in behavior. And the authors show that their 32B model with good memory becomes comparable to markedly stronger closed systems such as Claude Opus 4.5 and Gemini 3.1 Pro.
The practical conclusion matters most here: on long tasks the bottleneck is often not how smart the model is, but how well it can store and retrieve information.
What actually changed in the memory
The most vivid part of the paper is not the tables but the concrete examples of how the agent's memory changed.
In NetHack, for instance, the original agent kept its map file as an endless log: see a tile, append a line. See the same tile again, append again. Thousands of times over. The useful information drowned in duplicates.
After optimization the scheme was different: every map coordinate got its own key, and new observations updated the entry instead of spawning copies. On top of that came automatically synchronized inventory and status files, so the model no longer had to parse and reconcile that data itself every time.
How memory changed in NetHack: instead of an endless map log, updatable entries with no duplicates, plus separate state and inventory files.
This looks like a small thing, and the effect is enormous. The authors report that memory growth per step fell from 138 characters to 6 — roughly 95%. Less junk in memory means a smaller context, fewer empty reads, and less chance of getting lost in your own notes.
Across all three environments after optimization:
That is an important point. The authors did not simply "move a metric." They showed which behavior produced the gain. The agent spins in place less, writes less garbage, and searches more precisely.
What the memory specialist learned
Once the memory structure was already sensible, the authors fine-tuned a separate model specifically on memory. And an interesting behavioral shift surfaced.
After training, the agent followed one principle far more often: look first, write second.
It blindly appended new entries less often and checked first whether the information was already in the files more often. It is a very human pattern. A good secretary does not write the same fact down ten times; they check the archive first.
The paper measures this as the ratio of writes to searches. After training it drops noticeably in every environment. So the model really does absorb a more disciplined style of working with memory rather than just fitting the metric.
Why this matters beyond games
The paper's most valuable conclusion is a fairly broad one. Memory can be treated as a distinct capability of an AI agent, not as a secondary interface.
That changes the lens. Usually, when an agent handles a long task badly, the first instinct is to reach for a bigger model, add more elaborate planning, bolt on another retrieval layer or a new tool. AutoMem shows that it is sometimes more useful to ask whether the agent can keep decent records at all.
For real systems this is especially relevant. A coding agent, a research assistant, an operations agent, a robotics system — all of them live in long-running scenarios. They need to remember intermediate decisions, statuses, dependency maps, previous attempts, errors, environment constraints. If memory is badly organized, the model will not merely "forget." It will get in its own way.
Another strong signal is the value of automated analysis of long traces. People struggle to read episodes tens of thousands of steps long by hand. A strong LLM acting as an external reviewer already handles it well enough to improve the system iteratively. That is a very practical idea: using a model not only as an executor but as an inspector of another agent's behavior.
What is unconvincing, and where the limits are
The work has its limits. First, memory here is episodic: it is wiped at the start of every new run. So this is not yet long-term memory in the full sense.
Second, the authors tuned separate variants for each game environment. It is still unclear how easily the same "memory specialist" transfers between very different tasks.
Third, games are still games. They are good for testing a long horizon, yes, but the transfer to real working scenarios has yet to be shown.
Even so, these limits do not devalue the result. If anything, the opposite: if memory buys this much even in such a narrow setting, the effect in applied systems could be more interesting still.
The takeaway
AutoMem is not a paper about yet another "magic architecture." It is common sense carried through into solid engineering. The authors take a simple thought — the ability to remember has to be trained too — and turn it into a working system.
The main result is this: on long tasks, memory is not an appendage to the model but one of the main levers on quality. And a very cheap lever at that. Sometimes it is cheaper and more useful to teach a 32B model to keep its files properly than to reach for a 72B and hope for a miracle.
For the industry this is an important signal. The next jump in AI agents may come not only from more powerful models but from a more grown-up handling of memory: careful, trainable, observable. AutoMem makes a convincing case that this is no longer an abstract idea but a genuinely workable path.
AI papers in plain words
Every day we read the new AI papers and retell what matters in plain language — no hype, no filler. If you want to see where AI agents are heading before everyone else, subscribe.
New breakdowns every day
On Telegram