Cache Engineering for Agents
On the map: LLM agents and tool use → Agent memory systems
Abstract (arXiv)
Large Language Model (LLM) agents can handle increasingly complex tasks, navigating long trajectories of observations and actions. As these trajectories grow, key-value (KV) cache I/O and storage become the dominant cost. Trajectories can also exceed the LLM's maximum context length, requiring control over active cache growth. Prior work uses context engineering to reduce cache size by trimming or summarizing history. However, modifying the trajectory prefix invalidates subsequent cached states and triggers costly re-prefilling of retained context. Task accuracy can also suffer when too little context is retained to limit re-prefill costs. We propose cache engineering as a new scheme. It allows agents to directly control their active KV cache without modifying the trajectory or re-prefilling retained context. Specifically, agents can proactively use drop to exclude selected cache from future attention and repos to adjust retained keys' position encodings. We formalize these cache operations and identify history dependence as a serving challenge: identical token sequences can yield different cache states under different cache operation sequences, making prefix matching insufficient for correct cache reuse. Thus, we co-design the AKV serving engine. It provides a stateless interface compatible with existing serving APIs, while internally managing stateful cache reuse, eviction, and restoration. Experiments show that a tool-response rolling-drop cache policy improves average benchmark scores by 1.7 points and reduces average cost by 27.7%, compared with conventional threshold-triggered summarization. With AKV, it achieves up to 1.2x the output throughput and a 1.5x speedup in P95 request latency. Recursive self-improvement of cache policies further reduces cost by 7.1% over expert design. Our code is at https://github.com/thu-nics/AKV.
Key facts. Cited by 3 papers in the map (data through 24 Nov 2026). Placed in Agent memory systems, one of 16 directions in LLM agents and tool use. Builds on 45 of its 57 references that are in the map. Submitted 20 Oct 2026.
Builds on
45 of 57 references.
Closest ancestors · 5
Same direction, newest first
- 2025AgentFold: Long-Horizon Web Agents with Proactive Context Management28 Oct
- 2025Scaling Long-Horizon LLM Agent via Context-Folding13 Oct
- 2025ACON: Optimizing Context Compression for Long-horizon LLM Agents1 Oct
- 2025ReSum: Unlocking Long-Horizon Search Intelligence via Context Summarization16 Sep
- 2025MEM1: Learning to Synergize Memory and Reasoning for Efficient Long-Horizon Agents18 Jun
Other references · 40
- 2025Qwen3 Technical Reportcited by 9,994
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 6,685
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 5,132
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,444
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 2,069
- 2025gpt-oss-120b & gpt-oss-20b Model Cardcited by 1,638
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,559
- 2025Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Modelscited by 1,507
- 2023SGLang: Efficient Execution of Structured Language Model Programscited by 1,372
- 2024DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Modelcited by 1,241
- 2024SnapKV: LLM Knows What You are Looking for Before Generationcited by 1,003
- 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 892
28 more
- 2024KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cachecited by 747
- 2025BrowseComp-Plus: A More Fair and Transparent Evaluation Benchmark of Deep-Research Agentcited by 226
- 2024Cost-Efficient Large Language Model Serving for Multi-turn Conversations with CachedAttentioncited by 184
- 2024Model Tells You Where to Merge: Adaptive KV Cache Merging for LLMs on Long-Context Taskscited by 106
- 2025WebExplorer: Explore and Evolve for Training Long-Horizon Web Agentscited by 105
- 2025Latent Collaboration in Multi-Agent Systemscited by 93
- 2024ChunkAttention: Efficient Self-Attention with Prefix-Aware KV Cache and Two-Phase Partitioncited by 88
- 2025Cache-to-Cache: Direct Semantic Communication Between Large Language Modelscited by 83
- 2025The Complexity Trap: Simple Observation Masking Is as Efficient as LLM Summarization for Agent Context Managementcited by 73
- 2026The MiniMax-M2 Series: Mini Activations Unleashing Max Real-World Intelligencecited by 73
- 2024FrameFusion: Combining Similarity and Importance for Video Token Reduction on Large Vision Language Modelscited by 63
- 2025Scaling LLM Multi-turn RL with End-to-end Summarization-based Context Managementcited by 60
- 2025Context as a Tool: Context Management for Long-Horizon SWE-Agentscited by 56
- 2026MiroThinker-1.7 & H1: Towards Heavy-Duty Research Agents via Verificationcited by 38
- 2025PM-KVQ: Progressive Mixed-precision KV Cache Quantization for Long-CoT LLMscited by 26
- 2026DualPath: Breaking the Storage Bandwidth Bottleneck in Agentic LLM Inferencecited by 17
- 2026SideQuest: Model-Driven KV Cache Management for Long-Horizon Agentic Reasoningcited by 16
- 2025MEPIC: Memory Efficient Position Independent Caching for LLM Servingcited by 12
- 2026Context Language Modelscited by 12
- 2026IndexMem: Learned KV-Cache Eviction with Latent Memory for Long-Context LLM Inferencecited by 10
- 2026IntentKV: Cross-Turn Intent-Aware KV Cache Pruning for Agent Inferencecited by 9
- 2026Masking Stale Observations Helps Search Agents -- Until It Doesn't: A Regime Map and Its Mechanismcited by 8
- 2026TokenPilot: Cache-Efficient Context Management for LLM Agentscited by 7
- 2024CSKV: Training-Efficient Channel Shrinking for KV Cache in Long-Context Scenarioscited by 5
- 2026Irminsul: MLA-Native Position-Independent Caching for Agentic LLM Servingcited by 4
- 2026MiniPIC: Flexible Position-Independent Caching in <100LOCcited by 4
- 2026SmoothAgent: Efficient Long-Horizon LLM-Based Agent Serving with Lookahead Context Engineeringcited by 2
- 2026AgentKV: Phase-Aware KV Eviction for Agentic LLMscited by 1
Built on by
Citing papers per year: 2026: 3.
3 papers.
Similar, not cited
Close in wording, no citation either way
- 2026KVCMAS: Efficient KV cache Correction for Shared Context in Multi-Agent Systems
- 2026Learning Agent Execution for KV-Cache Management in Agentic Serving
- 2026ContextPipe: Database-Inspired Context Assembly for Long-Horizon Agents
- 2026MemDecay: Region-Aware KV Cache Eviction for Efficient LLM Agent Inference
- 2026Persistent Context Graphs for Efficient Memory Compaction in LLM Agents
- 2026DMC-5: Dual-Model Collaboration with Cache-aware Context Compression for Long-horizon Agents
- 2025KVCOMM: Online Cross-context KV-cache Communication for Efficient LLM-based Multi-agent Systems
- 2026Context Has a Price: Adding and Removing Context for LLM Coding Agents under Prefix Caching