Beyond the Context Window: A Cost-Performance Analysis of Fact-Based Memory vs. Long-Context LLMs for Persistent Agents
On the map: LLM agents and tool use → Agent memory systems
Abstract (arXiv)
Persistent conversational AI systems face a choice between passing full conversation histories to a long-context large language model (LLM) and maintaining a dedicated memory system that extracts and retrieves structured facts. We compare a fact-based memory system built on the Mem0 framework against long-context LLM inference on three memory-centric benchmarks - LongMemEval, LoCoMo, and PersonaMemv2 - and evaluate both architectures on accuracy and cumulative API cost. Long-context GPT-5-mini achieves higher factual recall on LongMemEval and LoCoMo, while the memory system is competitive on PersonaMemv2, where persona consistency depends on stable, factual attributes suited to flat-typed extraction. We construct a cost model that incorporates prompt caching and show that the two architectures have structurally different cost profiles: long-context inference incurs a per-turn charge that grows with context length even under caching, while the memory system's per-turn read cost remains roughly fixed after a one-time write phase. At a context length of 100k tokens, the memory system becomes cheaper after approximately ten interaction turns, with the break-even point decreasing as context length grows. These results characterize the accuracy-cost trade-off between the two approaches and provide a concrete criterion for selecting between them in production deployments.
Key facts. Cited by 15 papers in the map (data through 14 Oct 2026). Placed in Agent memory systems, one of 16 directions in LLM agents and tool use. Builds on 21 of its 31 references that are in the map. First posted on arXiv 5 Mar 2026.
Builds on
21 of 31 references.
Closest ancestors · 5
Same direction, newest first
- 2026Beyond Dialogue Time: Temporal Semantic Memory for Personalized LLM Agents12 Jan
- 2025PersonaMem-v2: Towards Personalized Intelligence via Learning Implicit User Personas and Agentic Memory7 Dec
- 2025A-MEM: Agentic Memory for LLM Agents17 Feb
- 2025Zep: A Temporal Knowledge Graph Architecture for Agent Memory20 Jan
- 2024Evaluating Very Long-Term Conversational Memory of LLM Agents27 Feb
Other references · 16
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2025Gemini 2.5: Pushing the Frontier with Advanced Reasoning, Multimodality, Long Context, and Next Generation Agentic Capabilitiescited by 3,796
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
- 2023FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performancecited by 853
- 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 740
- 2024LongMemEval: Benchmarking Chat Assistants on Long-Term Interactive Memorycited by 707
- 2024Justice or Prejudice? Quantifying Biases in LLM-as-a-Judgecited by 368
- 2024∞Bench: Extending Long Context Evaluation Beyond 100K Tokenscited by 367
- 2024Humans or LLMs as the Judge? A Study on Judgement Biasescited by 323
- 2023Prompt Cache: Modular Attention Reuse for Low-Latency Inferencecited by 268
4 more
- 2021LongT5: Efficient Text-To-Text Transformer for Long Sequencescited by 232
- 2026EverMemOS: A Self-Organizing Memory Operating System for Structured Long-Horizon Reasoningcited by 54
- 2024Don't Do RAG: When Cache-Augmented Generation is All You Need for Knowledge Taskscited by 38
- 2025Tail-Optimized Caching for LLM Inferencecited by 2
Built on by
Citing papers per year: 2026: 15.
15 papers.
Sort:
By area:
- 2026User as Code: Executable Memory for Personalized Agentscited by 7
- 2026The Efficiency Frontier: A Unified Framework for Cost-Performance Optimization in LLM Context Managementcited by 6
- 2026Grounded Continuation: A Linear-Time Runtime Verifier for LLM Conversationscited by 3
- 2026PROJECTMEM: A Local-First, Event-Sourced Memory and Judgment Layer for AI Coding Agentscited by 3
- 2026User as Engram: Internalizing Per-User Memory as Local Parametric Editscited by 3
- 2026MemDelta: Controlled Baselines and Hidden Confounds in Agent Memory Evaluationcited by 3
- 2026Fortunate Recall: Ontology-Driven Memory Lifecycle Management for Persistent Coherence in LLMscited by 3
- 2026The Workload-Router-Pool Architecture for LLM Inference Optimization: A Vision Paper from the vLLM Semantic Router Projectcited by 1
- 2026Exploring Cross-Scenario Generality of Agentic Memory Systems: Diagnostics and a Strong Baselinecited by 1
- 2026MemSIF: From Structured Interactions to Dual-Track Fact Memory for LLM Agentscited by 1
- 2026SodaMem: Evidence-Grounded Temporal Graph Memory for LLM Agentscited by 1
- 2026When Stories Evolve: Benchmarking LLM Storytelling Across Agent Architectures in Open-Ended World Simulationscited by 1
- 2026When Evidence Changes: Evaluating Memory Repair and Re-reading in Language-Model Agents2 Oct 2026
- 2026Fortunate Recall: Ontology-Driven Memory Lifecycle Management for Persistent Coherence in LLMs9 Sep 2026
- 2026Unified AI Gateway: A Framework for Joint Model Routing and KV Cache Management7 Sep 2026
- 2026RAG Deserves an Index: Why Ingest-Time Compilation Beats Query-Time Interpretation21 Aug 2026
- 2026When Stories Evolve: Benchmarking LLM Storytelling Across Agent Architectures in Open-Ended World Simulations16 Aug 2026
- 2026SodaMem: Evidence-Grounded Temporal Graph Memory for LLM Agents8 Aug 2026
- 2026MemSIF: From Structured Interactions to Dual-Track Fact Memory for LLM Agents3 Aug 2026
- 2026MemDelta: Controlled Baselines and Hidden Confounds in Agent Memory Evaluation29 Jun 2026
- 2026User as Engram: Internalizing Per-User Memory as Local Parametric Edits17 Jun 2026
- 2026User as Code: Executable Memory for Personalized Agents15 Jun 2026
- 2026PROJECTMEM: A Local-First, Event-Sourced Memory and Judgment Layer for AI Coding Agents10 Jun 2026
- 2026Exploring Cross-Scenario Generality of Agentic Memory Systems: Diagnostics and a Strong Baseline3 Jun 2026
3 more
- 2026The Efficiency Frontier: A Unified Framework for Cost-Performance Optimization in LLM Context Management21 May 2026
- 2026Grounded Continuation: A Linear-Time Runtime Verifier for LLM Conversations13 May 2026
- 2026The Workload-Router-Pool Architecture for LLM Inference Optimization: A Vision Paper from the vLLM Semantic Router Project22 Mar 2026
- 2026PROJECTMEM: A Local-First, Event-Sourced Memory and Judgment Layer for AI Coding Agentscited by 3
- 2026MemDelta: Controlled Baselines and Hidden Confounds in Agent Memory Evaluationcited by 3
- 2026The Workload-Router-Pool Architecture for LLM Inference Optimization: A Vision Paper from the vLLM Semantic Router Projectcited by 1
- 2026Exploring Cross-Scenario Generality of Agentic Memory Systems: Diagnostics and a Strong Baselinecited by 1
- 2026MemSIF: From Structured Interactions to Dual-Track Fact Memory for LLM Agentscited by 1
- 2026SodaMem: Evidence-Grounded Temporal Graph Memory for LLM Agentscited by 1
- 2026When Stories Evolve: Benchmarking LLM Storytelling Across Agent Architectures in Open-Ended World Simulationscited by 1
- 2026When Evidence Changes: Evaluating Memory Repair and Re-reading in Language-Model Agentscited by 0
- 2026When Evidence Changes: Evaluating Memory Repair and Re-reading in Language-Model Agents2 Oct 2026
- 2026When Stories Evolve: Benchmarking LLM Storytelling Across Agent Architectures in Open-Ended World Simulations16 Aug 2026
- 2026SodaMem: Evidence-Grounded Temporal Graph Memory for LLM Agents8 Aug 2026
- 2026MemSIF: From Structured Interactions to Dual-Track Fact Memory for LLM Agents3 Aug 2026
- 2026MemDelta: Controlled Baselines and Hidden Confounds in Agent Memory Evaluation29 Jun 2026
- 2026PROJECTMEM: A Local-First, Event-Sourced Memory and Judgment Layer for AI Coding Agents10 Jun 2026
- 2026Exploring Cross-Scenario Generality of Agentic Memory Systems: Diagnostics and a Strong Baseline3 Jun 2026
- 2026The Workload-Router-Pool Architecture for LLM Inference Optimization: A Vision Paper from the vLLM Semantic Router Project22 Mar 2026
- 2026User as Code: Executable Memory for Personalized Agentscited by 7
- 2026The Efficiency Frontier: A Unified Framework for Cost-Performance Optimization in LLM Context Managementcited by 6
- 2026Grounded Continuation: A Linear-Time Runtime Verifier for LLM Conversationscited by 3
- 2026Fortunate Recall: Ontology-Driven Memory Lifecycle Management for Persistent Coherence in LLMscited by 3
- 2026Fortunate Recall: Ontology-Driven Memory Lifecycle Management for Persistent Coherence in LLMs9 Sep 2026
- 2026User as Code: Executable Memory for Personalized Agents15 Jun 2026
- 2026The Efficiency Frontier: A Unified Framework for Cost-Performance Optimization in LLM Context Management21 May 2026
- 2026Grounded Continuation: A Linear-Time Runtime Verifier for LLM Conversations13 May 2026
Similar, not cited
Close in wording, no citation either way
- 2026MemMachine: A Ground-Truth-Preserving Memory System for Personalized AI Agents
- 2026Supersede: Diagnosing and Training the Memory-Update Gap in LLM Agents
- 2026Memori: A Persistent Memory Layer for Efficient, Context-Aware LLM Agents
- 2026AgentMemBench: A Systematic Benchmark for Evaluating Long-Term Memory Management Strategies in Conversational AI Agents
- 2025Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory
- 2026MemRefine: LLM-Guided Compression for Long-Term Agent Memory
- 2026MemOps: Benchmarking Lifecycle Memory Operations in Long-Horizon Conversations
- 2026CALMem : Application-Layer Dual Memory for Conversational AI ↗