Persistent Context Graphs for Efficient Memory Compaction in LLM Agents
On the map: LLM agents and tool use → Agent memory systems
Abstract (arXiv)
As LLM capabilities advance, agents are tackling increasingly complex tasks over longer horizons. Their growing interaction histories make memory compaction essential for staying within context windows and reducing prefill cost. Existing methods summarize the history or compress its KV cache, often adding model computation to preserve information for future requests. A new user request can change which history matters, but reassessing that history with the model requires re-encoding it if the KV cache has expired. Past attention provides signals of historical importance and dependencies between messages, while relevance to the current task must be assessed using the new user request. We introduce ReCAP, a memory compaction method that stores attention-derived importance scores and dependency links in a lightweight, persistent context graph. For each new request, ReCAP combines stored importance with relevance cues from the request and follows dependency links to select messages and their supporting context, without additional model calls for selection. Compared with Codex's default summarization-based compaction, ReCAP reduces estimated latency for compaction and cold restoration by approximately 95% on both Qwen3-Coder and gpt-oss. It also roughly halves the historical context per call on SWE-Together at comparable task quality and improves accuracy on the code tasks of Lost-in-Conversation over full history by 19.8 and 41.2 points.
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 28 references that are in the map. First posted on arXiv 30 Sep 2026.
Builds on
27 of 28 references.
Closest ancestors · 5
Same direction, newest first
- 2026ContextWeaver: Selective and Dependency-Structured Memory Construction for LLM Agents24 Apr
- 2025Scaling Long-Horizon LLM Agent via Context-Folding13 Oct
- 2025ACON: Optimizing Context Compression for Long-horizon LLM Agents1 Oct
- 2025MEM1: Learning to Synergize Memory and Reasoning for Efficient Long-Horizon Agents18 Jun
- 2024InfLLM: Training-Free Long-Context Extrapolation for LLMs with an Efficient Context Memory7 Feb
Other references · 22
- 2025Qwen3 Technical Reportcited by 8,195
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
- 2023SGLang: Efficient Execution of Structured Language Model Programscited by 1,107
- 2024SnapKV: LLM Knows What You are Looking for Before Generationcited by 848
- 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 805
- 2024Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inferencecited by 487
- 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compressioncited by 443
- 2025LLMs Get Lost In Multi-Turn Conversationcited by 400
- 2024LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compressioncited by 343
- 2024Ada-KV: Optimizing KV Cache Eviction by Adaptive Budget Allocation for Efficient LLM Inferencecited by 230
- 2024Cost-Efficient Large Language Model Serving for Multi-turn Conversations with CachedAttentioncited by 159
- 2025KVzip: Query-Agnostic KV Cache Compression with Context Reconstructioncited by 89
10 more
- 2024SCBench: A KV Cache-Centric Analysis of Long-Context Methodscited by 59
- 2025The Complexity Trap: Simple Observation Masking Is as Efficient as LLM Summarization for Agent Context Managementcited by 40
- 2024Fast State Restoration in LLM Serving with HCachecited by 32
- 2026Fast KV Compaction via Attention Matchingcited by 28
- 2026SWE-Together: Evaluating Coding Agents in Interactive User Sessionscited by 14
- 2026TraceLab: Characterizing Coding Agent Workloads for LLM Servingcited by 14
- 2026IntentKV: Cross-Turn Intent-Aware KV Cache Pruning for Agent Inferencecited by 6
- 2026Mix-Quant: Quantized Prefilling, Precise Decoding for Agentic LLMscited by 3
- 2026Practical Online KV Cache Compaction for LLM Agents: An Empirical Studycited by 2
- 2026AttnCompress: Dynamic Attention-Guided Trajectory Compression for Software Engineering Agentscited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026LLM Agents Are Latent Context Managers: Eliciting Self-Managed Context via State Proprioception
- 2026ContextRender: From Execution Dependencies to Agent Context
- 2026Continuous Context Management
- 2026RecMem: Recurrence-based Memory Consolidation for Efficient and Effective Long-Running LLM Agents
- 2026PACMS: Submodular Context Selection as a Pluggable Engine for LLM Agents
- 2026TokenPilot: Cache-Efficient Context Management for LLM Agents
- 2026PEEK: Context Map as an Orientation Cache for Long-Context LLM Agents
- 2026Addressable Recall Compaction for Long Context-Window Control in AI Agents