Time is a stream which sweeps me along, but I am the river.
In Christopher Nolan's Memento, Leonard Shelby is set upon a apparently unattainable task. To discover the man who killed his wife, notwithstanding the anterograde amnesia caused by a attack to his head. To keep environment alongside a recollection that resets all so often, he uses polaroids, notes and tattoos.
This reminds me of how we do delegate memory. Models have anterograde amnesia. They can't form lengthy term memories, and their province of the earth is icy to a training cutoff. To keep environment throughout sessions, we engineer recollection systems that encode and recover data from the past.
But how much engineering does a recollection scheme need? Richard Sutton famously stated in The Bitter Lesson that broad methods specified as hunt and learning outperform systems built alongside individual domain knowledge.
We established this to be the case alongside delegate memory.
Allowing an delegate to run SQL queries and hunt complete its own event log strikes or matches specialised recollection systems in all important recollection benchmarks and scales alongside example intelligence.
We contend that recollection systems endure precious task-relevant data during compression. In contrast, agentic hunt complete an event log defers compression until query time. We propose a scheme for recollection systems that aims to maximise the epistemic value of searching former events, using a ranking of derived views complete an immutable event log.
A study of recollection systems
Anthropic lately described memory as cognition an delegate gains from cognition and retains between sessions. Information theory offers us a sharper lens: recollection is data from the former that reduces doubt in the future. A memory system is what encodes, consolidates, and retrieves that information.
Decades of investigation from cognitive neuroscience provision us a systematic framework to comprehend recollection systems: encoding, consolidating, and retrieving experience.
Within all process, we can additional categorize systems in conditions of whether it's done in an open-loop or closed-loop. In control theory, closed-loop systems act, measure their outputs and modify their inputs to decrease errors. Open-loop systems are additional rigid: they act on commands and models without adjusting to feedback.
Encoding experience
The goal of encoding is to extract data from cognition into a depiction that reduces doubt during an unknown forthcoming task. The following diagram shows this in the environment of a representative delegate loop.
The important forms of recollection stores are vector embeddings, graphs and ontologies, or summaries and notes. Open-loop systems use conditions and handcrafted domain models to decide whenever to compose to the recollection store. Mem0, Supermemory, and Mastra are examples.
Supermemory batches multiple turns asynchronously by default, allowing for an optional per rotate extraction. Extracted facts are encoded into temporal graphs. In Mem0, the harness sends all new rotate to an extraction example that distills them into nuclear facts, which are embedded into a vector store.
Compaction could be viewed as a form of recollection encoding too. It triggers at environment opening boundaries and extracts goal-relevant data from one environment opening into the next.
In contrast, closed-loop systems use the delegate to update data in the recollection shop through tool calls. It comes alongside changeable expenses and latency since it adds conclusion compute inside a turn.
In practice, systems akin Claude, Codex and Letta use a hybrid approach. During latency-sensitive tasks, agents use broad casing and document tools to create small closed-loop updates to their recollection stores. In idle period between interactions, deeper consolidation and cleanup cycles run as open-loop backdrop processes.
Consolidating experience
The goal of consolidation is to enhance an existing encoded recollection depiction to optimise retrieval during an unknown forthcoming task. Notice the difference alongside encoding which was focused on extracting information.
As a nod to its parallels in the brain, researchers from Letta introduced the term sleep period compute to depict this process.
Claude, Codex, and Letta use distinct variations of recollection consolidation. For example, Claude managed agents use idle periods between interactions to indicate on the former and update their recollection store, a procedure they described as dreaming. Their blog gives a awesome write-up concerning their method and findings.
Codex asynchronously summarises idle former sessions into markdown records in a /memories directory, connected to their raw transcripts. The directory additionally contains a summary markdown document alongside data concerning the person and a classified indicator to the meeting summaries.
In the environment of consolidation, a closed-loop scheme would actively use feedback from historic events to enhance the recollection store. For example, one method is to create variations of a recollection shop and iteratively test them on distinct checkpoints to mark outcomes. The assortment that produces the smallest error is afterward promoted.
Retrieving experience
The goal of retrieval is to discover task-relevant data from the former to decrease doubt for a known query.
Open-loop systems recover data without responding to feedback. For example, Mem0 searches the shop using the current query and injects top_k matches into context. Mastra's observational recollection and compaction are another examples anywhere the harness summarises former and pushes it into environment without feedback.
In contrast, Tardigrade's log library uses a closed-loop retrieval approach. It lets an delegate query its own event log and run FTS5 hunt on events until adequate task-relevant data is gained. This scheme volition be discussed in greater item in the setup section.
Letta is another awesome example of a closed-loop system. In supplement to getting environment from a git backed recollection shop using casing tools, Letta agents can immediately modify their scheme immediate by editing markdown records inside the designated /system directory.
Summary
| System | Store | Encoding | Consolidation | Retrieval |
|---|---|---|---|---|
| Compaction | Summary checkpoint | Open-loop (context-limit summary) | None | Open-loop (prepended summary) |
| Mastra | Dated summary | Open-loop (observer) | Open-loop (reflector) | Open-loop (prepended summary) |
| Mem0 | Atomic fact vectors | Open-loop (per-turn extraction) | None | Open-loop (top_k search) |
| Supermemory | Facts + temporal graph | Open-loop (batched extraction) | Open-loop (background dreaming) | Open-loop (profile + hybrid search) |
| Codex | Summaries + raw transcripts | Open-loop (idle rollout summaries) | Open-loop (root-session index) | Hybrid (open-loop summary + closed-loop reads) |
| Letta / Claude | Git records or connected wiki | Closed-loop (shell / document tools) | Open-loop (sleep / dreaming) | Closed-loop (pinned records + agentic search) |
| Raw logs | Immutable event log | None (append-only) | None | Closed-loop (agentic FTS5 + SQL) |
Experimental setup
Memory system
For our research, we were curious in finding how much engineering a recollection scheme needs. If the bitter instruction were to clasp true, simpler systems that use additional of example capabilities should outperform hand-crafted ones.
In this direction, we tested a recollection scheme without any encoding or consolidation step. For retrieval, we let the delegate run SQL queries and FTS5 hunt on its own event logs. The complete code for our setup can be established here.
We used two chief variations of the system, depending on the benchmark we tested against. Some of the benches used environment throughout sessions, during others were inside a sole session.
For benchmarks that used environment from throughout sessions, the delegate had a Tardigrade library that gave it admission to all former sessions. It exposed four tools:
| Tool | Description |
|---|---|
| sessions_list | List former sessions alongside IDs, dates, and rotate counts, alongside optional date filtering. |
| sessions_search | Run SQLite FTS5 full-text hunt throughout all former sessions, returning classified snippets alongside meeting IDs and rotate indices. |
| sessions_read | Read a verbatim opening of turns (fromSeq to toSeq) immediately from a sole session's SQLite database. |
| sessions_query | Run read-only SQL queries against the earth sessions indicator (sessions and turns tables). |
For benchmarks that used environment from inside a sole session, the delegate used the log library, which exposes three tools. In the two variations, the hunt tool lets the delegate run FTS5 hunt on the event log and the query tool lets the delegate run SQL queries.
| Tool | Description |
|---|---|
| describe | Inspect event types, site schemas, and example records in the event log. |
| search | Run SQLite FTS5 full-text hunt throughout events in the log, returning classified snippets. |
| query | Run read-only SQL queries immediately against the event log. |
We modelled our dreaming setup following Anthropic's approach: following all task, and before the next task, we ran a consideration iteration to let a dreaming delegate create notes and wiki using the event log and project feedback.
| Tool | Role | Description |
|---|---|---|
| wiki_list | Both | List wiki leaf titles and summaries. |
| wiki_read | Both | Read a markdown wiki leaf alongside alongside its links and diary origin citations. |
| wiki_search | Both | Search wiki pages using SQLite FTS5 full-text search. |
| wiki_links | Both | Browse outgoing links and backlinks for a wiki page. |
| wiki_note | Task agent | Attach a abbreviated note to a diary event for the dreaming delegate to revisit. |
| wiki_notes | Dreamer | Read notes attached to diary events throughout a sequence range. |
| wiki_write | Dreamer | Create or substitute a wiki leaf alongside links and diary origin citations. |
| wiki_set_index | Dreamer | Publish the ordered catalog of top-level topic pages injected into context. |
Benchmarks
Drawing from cognitive science, we categorize recollection tests into recall and transfer. Recall tests whether an delegate can recover data from former events verbatim, during transfer tests whether it can use broad rules or concepts learned from those events to a new situation.
Memory benchmarks typically provision former from user-assistant conversations or delegate project trajectories and measure recall or transfer complete that past. For this research, we chose five benchmarks spanning distinct former types, sizes, and tests:
| Benchmark | History | Size / Scope | Tests | Setup |
|---|---|---|---|---|
| DolphinBench | Conversations | 600 tasks (~500K tokens) | Recall & penchant transfer | log |
| LongMemEval V1 | Multi-session conversations | S (~115K) & M (~1.5M), 500 Qs each | Episodic recall | sessions |
| LongMemEval V2 | Web & endeavor trajectories | Small (451 Qs, alongside screenshots) | Semantic & procedural recall | sessions |
| BEAM | Long conversation threads | 100K, 500K, 1M, 10M tokens | Long-horizon recall | log |
| Continual Learning Bench | Stateful SQL trajectories | 40 episodes (database_exploration) | Cross-session transfer | sessions (+ wiki arm) |
We tuned our prompts for BEAM-100K, 500K, 1M using 20 questions from the BEAM-100K dataset since the grading rubrics are non-obvious from the questions. We established this to be accordant alongside how another systems run their benchmarks.
To difference how scores change alongside example intelligence, we ran this throughout three models inside OpenAI's frontier example family: GPT-6.1 Sol, GPT-6.1 Terra, and GPT-6 Luna. For Continual Learning Bench, we additionally included Anthropic's frontier example family: Opus 5.5, Sonnet 5.5, and Haiku 5.5 to difference our results against Anthropic's.
An example of a project from DolphinBench, which tests recall and transfer of preference, looks akin this:
An example of a project from Continual Learning Bench, which tests transfer of cognition throughout sessions, looks akin this:
Results
Agentic hunt strikes specialised systems
Letting an delegate run SQL queries and FTS5 hunt complete raw event logs sets the Pareto frontier on disbursal and accuracy, beating or matching the two naked in-context learning (ICL) and specialised recollection systems.
On DolphinBench, using the leaderboard's GPT-5.6 Luna model, the raw-log method scores 85.7% at $4.73, beating Graphon (84.0% at $11.84) at small than fractional the disbursal and outperforming recollection stores akin Mem0 (70.7% at $96.21) at a twentieth of the cost. It additionally leads LongMemEval V1 (94.6% on S, 92.2% on M) and all four BEAM environment sizes up to 10M tokens.
On LongMemEval V2, our scheme scores 79.8%, near rearward AgentRunbook-C at 81.2%, which additionally uses agentic hunt complete raw transcripts (grep complete records fairly than SQL complete events).
Agentic hunt scales alongside intelligence
Holding all alternatively constant, scores enhance alongside example capability throughout all benchmark. On DolphinBench, moving from GPT-6 Luna to GPT-6.1 Terra and GPT-6.1 Sol lifts accuracy from 87.2% ($2.47) to 90.5% ($20.32) and 93.8% ($36.38), beating naked 500K in-context learning at all example tier for approximately a tenth of the cost.
Raw logs (Tardigrade)Bare ICL (500K in-context)
The advantage of stronger models increases as environment size grows. Moving from GPT-6 Luna to GPT-6.1 Sol adds +6.4 points on BEAM-100K, +9.9 points on BEAM-1M, and +13.8 points on BEAM-10M (53.2% to 67.0%), and grows from +8.8 points on LongMemEval V1-S to +10.8 points on V1-M. Stronger models are improved at penning SQL queries and this translates immediately into recall scores.
BEAM (100K to 10M)LongMemEval V1 (S to M)DolphinBench (500K)
Dreaming adds no acquire complete logs on powerful models
On Continual Learning Bench's database_exploration suite (40 stateful SQL episodes alongside a mid-run schema migration), raw logs solitary approximately twice the homeless baseline on frontier models, lifting average reward from 0.422 to 0.768 on Opus 5.5 and from 0.282 to 0.727 on GPT-6.1 Terra.
Adding sleep-time wiki consolidation helps smaller and mid-tier models (+0.227 on Sonnet 5.5, +0.134 on Haiku 5.5, and +0.118 on GPT-6 Luna), reduces to +0.039 inside run-to-run dispersed on GPT-6.1 Sol, and disappears on the strongest models (-0.004 on GPT-6.1 Terra and -0.011 on Opus 5.5). Wikis act as a scaffold for weaker models, during stronger models rebuild what they need improved from the raw event log.
Discussion
Deferring compression until query time
Encoding and consolidation in recollection systems compress raw events into a store, aiming to decrease doubt in forthcoming queries during retrieval. However, this method loses precious data by trying to conjecture forthcoming queries.
In contrast, agentic hunt complete an event log defers compression of data until query time. As example capabilities increase, they get improved at finding task-relevant data immediately from the raw logs.
For example, among the tasks in Continual Learning Bench involves searching a repository of a shop inventory to discover the average deviation of electronics price. The trap is that the applicable array has three cost columns following migration: prc, prc_usd, and prc_v2.
Sonnet 5.5, equal alongside logs and dreaming wiki, uses four DB queries and gets the incorrect answer. Its notes hadn't saved the accurate pillar to appearance at post-migration for this particular query and it resorts to guessing a incorrect answer.
Meanwhile Opus 5.5 alongside raw logs gets the answer in a sole query. It searches for "electronics price" in the event log, spots items_g2 and prc_v2 about event positions 67-68. Then it runs a query ("SELECT ... FROM events WHERE stance >= 76 OR document LIKE '%prc_v2%'") to peruse the exact post-migration tail. After that it gets the correct answer in a sole DB query:
SELECT COUNT(*), AVG(prc_v2) / 100.0 AS avg_d, AVG(ABS(prc_v2 - (SELECT AVG(prc_v2) FROM items_g2 WHERE prc_v2 > 0))) / 100.0 AS mad FROM items_g2 WHERE prc_v2 > 0;
Letta's sleep period compute paper noticed akin results. They established that offline pre-computation of a recollection shop helped most whenever queries were predictable from context. When queries are difficult to predict, they decide that test-time compute is preferable. They additionally established that on Stateful GSM-Symbolic and on their agentic SWE-Features benchmark, norm test-time compute complete raw environment outperformed pre-computed stores whenever stated higher test-time budgets.
Maximising the epistemic value of search
Does this average we do not need recollection systems at all? While letting a example hunt the event log for all query power in regulation guide to improved performance, it power not be applicable for all tasks. For user-facing applications anywhere latency matters, we frequently desire small conclusion compute inside turns.
Active inference gives us a helpful example for thinking concerning recollection systems and optimising them. Epistemic foraging refers to the energetic hunt for data in closed-loop systems (like agentic search) to decrease doubt concerning the world. Epistemic value is the expected decrease in task-related doubt afforded by a stated action.
The goal of a recollection shop is to maximise the epistemic value of hunt complete an event log. There are two ways to do this: eliminate hunt hops for frequently accessed data by caching it, and decrease the hops needed for everything alternatively by expanding data scent.
Memory as a cache complete former events
One way to decrease the disbursal of searching events is by caching frequently accessed information. This could be viewed as a materialised perspective of a common hunt that affords zero hops to discover applicable information.
For example, obtain the case of a individual aide that handles a user's day to day tasks. Knowing anywhere the person stays power be helpful data perchance revealed through conversation events.
It is costly to continually hunt the event log for any forthcoming project that requires the user's location (e.g., environment the timezone whenever booking a meeting). In this case, the user's location could be cached alongside citation to the events anywhere this data was derived from and stored inside the environment window.
When a new event contradicts item stored in cache (e.g., person moves to new location), it could be invalidated and connected to the new event. This scheme additionally allows for additional advanced patterns akin invalidating certain data whenever an event happens (e.g., invalidate following a certain period period).
A akin tie is observed in the transformer architecture. Linear notice layers compress former tokens into a fixed-size province matrix before forthcoming queries are known. Full self-attention keeps the complete KV former and waits until a query arrives to act complete it. Hybrid models akin Kimi K3 use linear notice for speed, backed by complete notice layers for exact recall.
Memory as an indicator complete former events
Information scent refers to proximal cues that a searcher can use to discover data they want. High data scent reduces the disbursal of data by reducing the figure of hops it takes to attain it. Information scent additionally prevents the category of issue anywhere an delegate gives up hunt too early.
FTS5 hunt snippets, query results, and array names are examples of data scents. In supplement to these, summaries of logical episodes in the event logs could additionally act as an index. Codex's hierarchical institution of a recollection summary and meeting summaries connected to raw sessions is an example of this approach.
A bitter-lesson affable recollection system
We propose a scheme for a recollection scheme that's built as a ranking of derived views complete an immutable event log. Notice how it mirrors a computer's recollection ranking from fast, small CPU caches downward to RAM and disk.
L0 (Hot Cache): Materialised views, zero hop. Sized by admission frequency.
L1 (Index): High scent pointers into the event log, one hop.
L2 (Event Log): Lossless origin of truth, unlimited capacity.
This composition doesn't go deeper into an implementation of this method and how it performs. That volition be for a forthcoming one.
Conclusion
If Nolan's Shelby had admission to all sole example of his existence recorded and stored as a video, he power have been improved off searching the recordings to accomplish his goals.
In designing recollection systems for agents, we've carried complete several of the implied constraints of biologic systems, which are asset constrained and organised to create the most of accessible space. Raw sensory events are ephemeral and can't be accessed again. Hence, all event have to be encoded in a compressed form, decoded and consolidated later.
The identical constraints don't use to computers, anywhere we have practically unlimited retention area for events inside an agent's lifetime. Memory systems should concentration on reducing the disbursal of hunt complete an immutable event log.
ps: If you're construction or evaluating delegate recollection systems and desire to run tradition benchmarks complete your own tasks and traces, try Hatchery.