WhoBuilt

Memory Harnesses for Long-Running Research Agents

Aug 12, 2026· 13 min· 31K views·Watch on YouTube

Speaker

Stefania Druga, a research scientist at Sakana AI in Tokyo, presents her experiments with memory harnesses for long-running research agents at AI Engineer.

Why long-running agents need memory

Druga describes context bloat: agents can contradict themselves, repeat completed work, or lose track of the original question. As tasks grow longer, she argues, keeping context usable becomes more important.

A harness as a memory control loop

Druga frames memory as a write-manage-read loop around the model, not just a database. Her harness keeps core traces visible, tests different recall modes, and archives information across sessions. She compares no recall, vector RAG, a decisions ledger, and an oracle that supplies the ground-truth memory.

Memory helps when context runs out

In a literature review task where all the papers fit in context, memory did not improve performance and added cost. On XBench questions whose answers were far outside the context window, ranked recall performed better than no memory; the rank-only ledger also outperformed a gate that first asks whether memory is needed. The oracle supplied the correct memory but did not guarantee the model would use it correctly.

Recall policy affects cost and results

Druga reports that ranked recall remained the strongest condition across ablations, including tests with arbitrary examples, the wrong step, or the most recent step. The approach also worked with Qwen 27B and DeepSeek V4 Flash, and on Spider V2. She says a poor memory policy can spend more tokens and misdirect the agent.

Local experiments and open research

Druga points to more than 30 runnable cookbooks in a Sakana AI open-source repository and describes a broad range of memory approaches, from file retrieval to trained memory models. Her experiments ran on an M3 Ultra with 96 GB of memory, using Qwen 27B quantized to 4-bit and DeepSeek V4 Flash. She values local control over data and evaluations, while noting that serial querying made the runs slow.

Takeaways

  • Treat recall policy as a design and evaluation metric: decide what to store, how to rank it, and what to retrieve across sessions.
  • Test whether a task actually exceeds the context window; memory can add cost without improving results when the needed material already fits.
  • Evaluate whether retrieved memories change the model’s answer, since supplying the right memory alone does not ensure the model uses it.
  • Measure token cost alongside answer quality: poor recall can waste budget and steer an agent away from the task.
  • Local models can support controlled memory experiments, but hardware limits and serial inference can make evaluations slow.

Mentioned in this talk

Search inside this talk

What was claimed 8

  • works at
    research scientist
    “I'm a research scientist at Sakana AI in Tokyo.”
    YouTube
    Verified2 sources· Talk, Web· archived
  • feature
    DeepSeek-V4-Flash: Can run locally on an M3 Ultra
    “DeepSeek V4 Flash can now be run on an M3 Ultra.”
    YouTube
    Unverified1 source· Talk
  • uses
    quantized at 4-bit
    “On this M3 Ultra ... I'm using two models: Qwen 27B quantized at 4-bit.”
    YouTube
    Unverified1 source· Talk
  • feature
    Memory harness: Write-manage-read control loop around the model
    “It's actually a control loop around the model.”
    YouTube
    Unverified1 source· Talk
  • metric
    Memory harness: Ranked recall improved answer frequency over no memory and reduced token cost
    “With ranked recall, the model gets the right answer more frequently than without.”
    YouTube
    Unverified1 source· Talk
  • feature
    Memory harness: Ranked decisions ledger recall performed best on the XBench tasks
    “The rank-only ledger performed the best.”
    YouTube
    Unverified1 source· Talk
  • feature
    Sakana AI: Open-source repository with over 30 runnable memory cookbooks
    “There are over 30 runnable cookbooks shared in this open-source repository from Sakana AI.”
    YouTube
    Unverified1 source· Talk
  • metric
    DeepSeek-V4-Flash: Does not support batch querying in the local setup
    “They don't support batch querying for DeepSeek V4 Flash.”
    YouTube
    Unverified1 source· Talk

Related talks