Agent·

CoReMem paper — Prospective memory valuation — What does it mean?

The news. On November 12, 2026, the CoReMem paper (arXiv 2611.17316) studied coding agents that solve a chain of tasks on one repository, using the ChainSWE benchmark. It values memory by what it saves on the next task, builds a compact memory out of file locations and test commands, and post-trains the agent to act on that memory. On a 27B open-weight model, the resolve rate rises from 21.0% to 25.7%, with 17% fewer steps and 11% fewer total tokens than running without memory. Read the paper →

Picture a repair workshop that runs in shifts. The workbench stays exactly as the last shift left it, but the person who worked it goes home, and their diary of the shift goes with them. The next shift receives only a handover note, and the note is written before anyone knows which job comes in next. CoReMem does not ask "what did this shift learn?" — it asks "which lines of the note make the next shift finish faster?" In agent terms, the workbench is the repository state, the diary is the trajectory, and the note is the memory. An agent's state object normally lives inside one task; here the note is the one piece of text that crosses the boundary, so it is the structured-notes fix applied across tasks instead of within one.

To find out which lines pay, the paper runs a controlled test. It cuts a finished trajectory into seven segments by role: the reasoning text, the commands, the repository content read, the test output, the final diff, the outcome and scratch files. It injects the whole trajectory as memory, removes one segment at a time, and re-runs the next task from the inherited repository state. A segment stays only if removing it makes the next task take more steps. Removing the commands or the repository content read added steps; removing the reasoning text or the body of the diff added no steps and only saved tokens. Shorter forms also worked: test commands with their exit codes saved more steps than the full test output, and the diff's file list came close to the full diff. What the next shift needs is where to look and what to run, not the story of how the last shift got there. The paper calls these references anchors.

A good note saves time only if the next shift reads it at the right moment, so the paper also post-trains the agent with RL. Each training group mixes three kinds of rollouts: some with no memory, some with their own memory, and one with a misplaced memory written for a different repository — right in form, wrong in content — so an agent that follows any note blindly loses reward. The reward ranks every resolved session above every unresolved one and charges steps only inside success, so saving steps can never outweigh solving the task. The gap between the average reward with memory and without it is the memory's value to the current agent. The provenance gate pays that value only to the steps that acted on an anchor the memory supplied, while every step still keeps its normal outcome credit. The paper proves why the gate matters: if the same value were paid to every step, the push toward acting on memory would cancel out, because the training signal could no longer tell the memory-driven steps from the rest.

Where the tokens go (27B model, ChainSWE test set, total cache-aware tokens per session). With no memory, a session averages 32.2K tokens. Mem0 makes its memory module spend 34.5K tokens on top of 34.2K for the agent, so the session costs 68.7K — more than double (+113%) — for a resolve rate of 21.5% against 21.0%. CoReMem's memory module spends 1.9K, and after training the agent spends 26.6K, so the session costs 28.5K, 11% below no memory, while the resolve rate rises to 25.7%. The memory is small for the same reason: on boundaries where the next task touches files earlier tasks changed, it keeps the full median saving of 2 of 2 steps with 6% of the bytes of the trajectory it replaces (1,056 against 17,320 characters). A memory has to be charged for what it costs to write and read; otherwise it looks useful while making every next task more expensive — the same accounting the cost profile of an agent applies to every input token.

Memory layer (27B model)Total tokens per sessionvs no memoryStepsResolve rateSource
No memory32.2K—35.121.0%Table 1
Full history of earlier tasks39.0K+21%32.622.4%Table 1
Mem0 (facts)68.7K+113%35.921.5%Table 1
MemOp (guidebook)50.4K+57%33.523.4%Table 1
ReasoningBank (strategies)67.5K+110%34.325.2%Table 1
CoReMem memory, untrained agent32.4K0%31.823.4%Table 1
CoReMem memory, trained agent28.5K−11%29.225.7%Table 1

Two limits matter before you copy the idea. The valuation needs paired runs of the next task, with and without each segment, so it is something you pay once to design the memory template and to train the agent, not a check you run on every memory in production. And the tested setting is narrow: Python repositories in the mini-swe-agent harness, with post-training on three open-weight models; the paper does not report wall-clock latency, and how memory should be refreshed over long repository histories is left open. The durable lesson is the yardstick, not the template: judge a memory by what it saves the task that comes next. Other designs on this site judge memory differently — offline dreaming checks notes backward against the transcript, and the memory contract separates memory into parts so you can tell which one helped.

Goes deeper in: AI Agents → Context Engineering → The 4 Fixes

Frequently Asked Questions

Check what you knowMap your AI & GPU knowledge across every track — free, role-based