In-Process Retrieval Boosts Language Agent Working Memory

Yusuf Khan, Carlo Lipizzi· July 8, 2026 View original

Summary

Researchers propose "Memory in the Loop," an approach where language agents use in-process retrieval as extended working memory, reading and writing memory on every step of their observe-reason-act loop. This method drastically reduces latency compared to networked stores, improving recall and reducing redundant actions by making memory access three orders of magnitude faster.

A new research paper introduces "Memory in the Loop," a paradigm shift for language agents where memory is integrated directly into the agent's observe-reason-act cycle, allowing for reading and writing at every step. Traditionally, memory stores are external and queried infrequently due to high latency, which can significantly slow down agent operations. The core insight is that latency is primarily determined by the memory's physical location. By moving the memory store in-process, response times drop from hundreds of milliseconds to approximately 100 microseconds, a three-order-of-magnitude improvement. This speed enables memory to function as "extended working memory," constantly available to the agent. Experiments with GPT-5-class models demonstrated that in-loop memory dramatically improves recall (from 0/5 to 3.6-4.8/5) and reduces redundant actions, with memory operations completing in 80-165 microseconds. The study also identifies embedding as the new bottleneck and suggests pairing in-process stores with small local embedders to achieve overall operation times of around 40 microseconds.

Why it matters

This research offers a fundamental improvement in how AI agents manage information, leading to more efficient, less redundant, and more capable agents, which is crucial for complex, multi-step tasks in various applications.

How to implement this in your domain

  1. 1Design AI agent architectures to incorporate in-process memory retrieval for faster information access.
  2. 2Prioritize local or in-process embedding solutions to minimize latency in agent memory operations.
  3. 3Evaluate the impact of high-frequency memory access on agent performance, particularly for complex reasoning tasks.
  4. 4Develop custom memory management strategies that allow agents to read and write memory on every step of their operational loop.

Who benefits

AI/MLRoboticsSoftware DevelopmentCustomer ServiceGaming

Key takeaways

  • In-process memory retrieval significantly reduces latency for language agents.
  • Memory can function as "extended working memory" when fast enough.
  • This approach improves agent recall and reduces redundant actions.
  • Embedding is the new bottleneck, suggesting local embedders for optimal speed.

Original post by Yusuf Khan, Carlo Lipizzi

"arXiv:2607.05690v1 Announce Type: new Abstract: Language agents run a loop - observe, reason, act - but the memory they reason over sits outside it: a store queried at most once per turn. We study the regime where memory moves inside the loop, read and written on every step. The…"

View on X

Originally posted by Yusuf Khan, Carlo Lipizzi on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses