Agent Memory: Let the Agent Query Its Own Logs

Agent memory benchmark results comparing event log search with memory systems

Agent memory may not need much engineering at all. Hatchery reports that letting an agent run SQL queries and full-text search over its own event log matches or beats specialised memory systems on all the major memory benchmarks it tested, and the results improve as models get smarter.

The team frames it as Richard Sutton’s “bitter lesson” applied to memory: general methods such as search and learning tend to outperform hand-built systems.

The design they tested

Most memory tools encode past interactions into a store, such as vector embeddings, graphs or summaries, and retrieve from it later. Mem0, Supermemory and Mastra are open-loop examples that decide on their own when to write. Claude, Codex and Letta mix approaches: small closed-loop updates during a task and deeper consolidation during idle time.

Hatchery removed encoding and consolidation entirely. Its agent gets tools to run SQL queries and FTS5 search over an immutable event log. For cross-session benchmarks it uses a library called Tardigrade with four tools, and for single-session ones a log library with three. The argument is that compression loses information because it guesses future questions. Searching the raw log defers compression until query time.

The team ran five benchmarks that test recall and transfer. It used three OpenAI models (Luna, Terra and Sol, from the GPT-6 family) and, for Continual Learning Bench only, Anthropic’s Opus, Sonnet and Haiku 5.5 models. It also built a “dreaming” setup modeled on Anthropic’s approach, where a reflection agent writes notes and a wiki between tasks.

Cost and accuracy

On DolphinBench with GPT-5.6 Luna, the raw-log approach scored 85.7% at $4.73. Graphon scored 84.0% at $11.84, and Mem0 scored 70.7% at $96.21, so the log method cost about a twentieth of Mem0. It also topped LongMemEval V1, with 94.6% on the S set and 92.2% on M, and every BEAM context size up to 10M tokens. LongMemEval V2 gave 79.8%, a little under AgentRunbook-C’s 81.2%. That system also searches raw transcripts, using grep in place of SQL.

Smarter models help more

Scores rose with model capability on every benchmark. On DolphinBench, accuracy climbed from 87.2% at $2.47 with Luna to 90.5% at $20.32 with Terra and 93.8% at $36.38 with Sol. Each tier beat plain 500K in-context learning for about a tenth of the cost.

The gap widens with context size. Going from Luna to Sol gains 6.4 points on BEAM-100K and 9.9 on BEAM-1M. On BEAM-10M the gain is 13.8 points, from 53.2% to 67.0%. Hatchery says stronger models write better SQL, and that carries straight through to recall.

When dreaming helps

On the database_exploration suite of Continual Learning Bench, 40 stateful SQL episodes with a schema change mid-run, raw logs roughly doubled the stateless baseline. Mean reward went from 0.422 to 0.768 for Opus and from 0.282 to 0.727 for Terra.

Wiki consolidation helped weaker models, adding 0.227 for Sonnet, 0.134 for Haiku and 0.118 for Luna. For Sol the 0.039 gain sat inside run-to-run noise, and it disappeared on the strongest models, at -0.004 for Terra and -0.011 for Opus. The wiki works as a crutch for weaker models. Stronger ones rebuild what they need from raw logs.

One task shows why. After a migration, one table held three price columns named prc, prc_usd and prc_v2. Sonnet, even with logs and a wiki, took four queries and still guessed wrong. Opus with raw logs searched the log for “electronics price”, spotted prc_v2 and answered in a single query.

Limits of the result

The authors don’t claim memory systems are obsolete. Searching the log on every query costs inference compute, and apps where latency matters, such as those facing end users, may not afford that. Letta’s sleep-time compute research found something similar: precomputing helps most when queries are predictable, and test-time compute wins when they aren’t. These numbers are Hatchery’s own, and the prompts for BEAM were tuned on 20 questions from the BEAM-100K set. Readers should also note that the DolphinBench comparison used the leaderboard’s model, so its dollar figures can’t be compared directly with the tier-by-tier runs above.

Source: Hatchery

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.