Memory in the Loop: In-Process Retrieval as ExtendedWorking Memory for Language Agents
Summary
The paper "Memory in the Loop: In-Process Retrieval as Extended Working Memory for Language Agents" investigates how memory latency impacts language agents. It argues that moving memory *inside* the agent's reasoning loop, making it in-process, drastically reduces latency from ~100ms (networked) to ~100µs. This three-order-of-magnitude speedup makes per-step memory access feasible, collapsing the "latency tax" that previously forced agents to ration retrieval. The authors demonstrate that store latency is causal to task outcomes: under a fixed 100ms per-turn memory budget, redundant actions rise monotonically with increased store latency, from 0.0 at in-process speed to 7.2 of 12 at 110ms cloud round trip. End-to-end recall improves from 0/5 to 3.6–4.8/5 for GPT-5 class models with in-loop memory, with live store operations at p50 80–165µs. The bottleneck shifts to embedding, which can be resolved with a local embedder for a complete ~40µs operation.
Key takeaway
For AI Architects designing agent systems, you should prioritize in-process memory solutions over networked vector stores. This shift enables per-step retrieval, making capabilities like real-time deduplication and grounding feasible within a 100ms per-turn budget. Implement local embedders to overcome the remaining bottleneck, achieving ~40µs complete operations. This approach allows you to engineer reliable scaffolds around models, improving task outcomes where within-turn state changes are critical.
Key insights
In-process, low-latency memory enables per-step retrieval, transforming external stores into constitutive working memory for language agents.
Principles
- Store latency gates the frequency of memory retrieval.
- The parity principle implies a latency budget for cognitive integration.
- In-process speed enables external memory to function as constitutive working memory.
Method
The study instantiates in-loop memory as an ephemeral, in-process semantic store, measuring its effect on multi-turn agents under bounded context using GPT-5 class models and a loop-guard task.
In practice
- Use in-process stores for per-step memory access in agent designs.
- Pair in-process stores with local embedders for ~40µs complete operations.
- Implement loop guards for within-turn deduplication and action verification.
Topics
- Language Agents
- In-Process Retrieval
- Memory Architectures
- Latency Optimization
- Extended Mind Thesis
- Vector Databases
- Local Embedders
Code references
Best for: Research Scientist, AI Engineer, NLP Engineer, AI Scientist, Machine Learning Engineer, AI Architect
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by cs.CL updates on arXiv.org.