Memory in the Loop: In-Process Retrieval as Extended Working Memory for Language Agents
On the map: LLM agents and tool use → Agent memory systems
Abstract (arXiv)
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 obstacle has always been latency: networked stores answer in tens to hundreds of milliseconds, and in-loop retrieval can inflate end-to-end latency by up to 83x when retrieval is expensive. Prior work manages that cost rather than questioning it: serving-layer scheduling hides it, "memory-first" designs ration retrieval to once per turn. We argue latency is a property of where the store lives, not the in-loop pattern: an in-process store answers in ~100us, three orders of magnitude below the network regime, and at that speed the per-step tax collapses. By the extended-mind thesis's parity principle, a store fast enough to be constantly and directly available becomes extended working memory, not a tool the agent merely consults. The premise is causal: holding a fixed per-turn memory-latency budget and varying only the store's answer speed, redundant actions rise monotonically with latency - 0.0 of 12 at in-process speed, 7.2 of 12 at a 110ms cloud round trip (gpt-5-nano, gpt-5-mini; exact permutation p=0.0079). We demonstrate the regime end-to-end: across four GPT-5-class models under a bounded window, recall improves from 0/5 to 3.6-4.8/5 with in-loop memory, store ops at p50 80-165us - though an instructed restate-every-reply baseline also solves it perfectly, at a token cost that grows with the working set. The store never lost a fact in any run (244 of 244 writes kept); every miss traces to the agent's read policy, not the store. Our measurements also relocate the bottleneck: the dominant per-step cost is embedding (~200-400ms over the network); pairing the in-process store with a small local embedder returns the complete operation to a measured ~40us.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Agent memory systems, one of 16 directions in LLM agents and tool use. Builds on 27 of its 38 references that are in the map. First posted on arXiv 6 Jul 2026.
Builds on
27 of 38 references.
Closest ancestors · 9
Same direction, newest first
- 2026Agent Memory: Characterization and System Implications of Stateful Long-Horizon Workloads4 Jun
- 2026The Library Theorem: How External Organization Governs Agentic Reasoning Capacity22 Mar
- 2026Memory for Autonomous LLM Agents:Mechanisms, Evaluation, and Emerging Frontiers8 Mar
- 2026AMV-L: Lifecycle-Managed Agent Memory for Tail-Latency Control in Long-Running LLM Systems22 Feb
- 2026Beyond RAG for Agent Memory: Retrieval by Decoupling and Aggregation2 Feb
- 2025Memory in the Age of AI Agents15 Dec
- 2025Evaluating Memory in LLM Agents via Incremental Multi-Turn Interactions7 Jul
- 2025MemBench: Towards More Comprehensive Evaluation on the Memory of LLM-based Agents20 Jun
- 2023Empowering Working Memory for Large Language Model Agents22 Dec
Other references · 18
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
- 2023Generative Agents: Interactive Simulacra of Human Behaviorcited by 3,500
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2023Voyager: An Open-Ended Embodied Agent with Large Language Modelscited by 2,081
- 2023MemGPT: Towards LLMs as Operating Systemscited by 1,295
- 2024A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Modelscited by 450
- 2023Cognitive Architectures for Language Agentscited by 422
- 2025From Human Memory to AI Memory: A Survey on Memory Mechanisms in the Era of LLMscited by 119
- 2026Externalization in LLM Agents: A Unified Review of Memory, Skills, Protocols and Harness Engineeringcited by 68
- 2025Win Fast or Lose Slow: Balancing Speed and Accuracy in Latency-Sensitive Decisions of LLMscited by 9
- 2025Demystifying and Enhancing the Efficiency of Large Language Model Based Search Agentscited by 5
6 more
- 2026Governed Memory: A Production Architecture for Multi-Agent Workflowscited by 4
- 2026Ask Only When Needed: Proactive Retrieval from Memory and Skills for Experience-Driven Lifelong Agentscited by 4
- 2025Toward a New Science of AI as Cognitive Infrastructurecited by 2
- 2026AgentIR: A Workload-Adaptive Cascade Retrieval Substrate for Long-Term Conversational Memorycited by 2
- 2025Operationalising Extended Cognition: Formal Metrics for Corporate Knowledge and Legal Accountabilitycited by 1
- 2026Entity-Collision: A Stratified Protocol for Attributing Retrieval Lift in Agent Memorycited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026What to Keep, What to Forget: A Rate--Distortion View of Memory Compaction in LLMs and Agents
- 2026Memory Depth, Not Memory Access: Selective Parametric Consolidation for Long-Running Language Agents
- 2026Memory as a Controlled Process: Learned Adaptive Memory Management for LLM Agents
- 2026Track, Rank, Crack: Epistemic Working Memory Scales Multi-Hop Reasoning in Language Agents
- 2026Measure Before You Manage: Evaluating Agent Working Memory in Coding Agents
- 2026Diagnosing Retrieval vs. Utilization Bottlenecks in LLM Agent Memory
- 2026Toward a Theory of Hierarchical Memory for Language Agents
- 2025Beyond Heuristics: A Decision-Theoretic Framework for Agent Memory Management