Memory · Agents · Training

AutoMem

First page
AutoMem
Paper summary

Memory for LLM agents is usually a fixed module bolted onto the model, but knowing what to encode, when to retrieve, and how to organize notes is itself a skill. AutoMem, from Stanford, treats memory management as a trainable cognitive ability, a capacity cognitive science calls metamemory. ---

Ask this paper

Key points
01

Memory ops in the action space: Read, write, search, and append live in the same action space as task actions, so the model itself decides what to store and when to pull it back rather than following a hand-designed policy.

02

Two meta-learning loops: One loop optimizes the agent scaffold, the memory structure, while a second trains a dedicated memory specialist from the agent’s own traces, separating memory structure from memory proficiency.

03

Large gains without touching task behavior: Optimizing memory alone yields roughly 2x to 4x progression gains and lifts an open-weight 32B model to frontier-level performance on long-horizon tasks like Crafter, MiniHack, and NetHack.

04

Why it matters: Framing memory as a learned skill instead of a frozen component gives agents a path to keep getting better at managing their own knowledge, which is exactly what long-horizon autonomy demands.

Abstract

Memory expertise is a learned skill: knowing what to encode, when to retrieve, and how to organize knowledge--a capacity known in cognitive science as metamemory. We bring this perspective to LLMs by treating memory management as a trainable skill. We promote file-system operations to first-class memory actions alongside task actions, letting the model itself decide how to manage its memory. This memory skill improves along two axes: the structure that supports it (prompts, file schemas, action vocabulary), and the proficiency of the model exercising it. Both axes resist manual optimization: episodes in long-horizon tasks run for thousands of steps, and a single memory mistake can hide long before it surfaces, making human review of full trajectories impractical. We introduce AutoMem, a framework that automates both axes. In the first loop, a strong LLM reviews complete agent trajectories and iteratively revises the memory structure that shapes how the agent interacts with its memory files. In the second loop, the agent's own good memory decisions are identified from many episodes and used as training signal to sharpen the model's memory proficiency directly. Across three procedurally generated long-horizon games (Crafter, MiniHack, and NetHack), optimizing memory alone--without modifying the model's task-action behavior--improved the base agent's performance ~2x-4x, bringing a 32B open-weight model competitive with frontier systems such as Claude Opus 4.5 and Gemini 3.1 Pro Thinking. Our results show that memory management is an independently learnable skill, and a high-leverage objective yielding large gains on long-horizon tasks.

Every Monday
Get next week’s papers.
Subscribe on Substack