🤖 AI Summary
This work addresses the limitations of existing context compression methods in long-horizon agent tasks, which suffer from information loss and rigid triggering mechanisms that hinder adaptive reasoning. To overcome these challenges, the authors propose the Agentic Context Management (ACM) framework, which introduces a novel mechanism inspired by human short-term and long-term memory interactions. ACM equips agents with dedicated context-editing tools to achieve lossless compression, autonomously decide when to compress, and leverage an external memory system for on-demand retrieval. By incorporating a post-training pipeline to generate high-quality demonstration data, ACM significantly enhances performance in search and programming tasks, reduces peak token consumption, enables extended exploration horizons, and yields more consistent solutions.
📝 Abstract
Agentic tasks are inherently long-horizon and multi-turn, constantly accumulating context through interactions with the environment. Existing context compression methods inevitably incur information loss and are triggered by rigid heuristic rules, leaving them misaligned with the agent's evolving reasoning focus. We propose Agentic Context Management (ACM), a framework that equips agents with purpose-built context editing tools for lossless context management. Inspired by the interaction between short-term and long-term human memory, the agent autonomously decides when to compress its context, offloads discarded content to an external memory system, and queries it on demand for later retrieval. Building on this framework, we further develop a post-training pipeline that constructs high-quality demonstrations of context management and improves model performance on both agentic search and coding tasks. Further analysis reveals that effective context management reduces peak token pressure, enables extended explorations, and yields more consistent solutions across independent trials. Code, data, and model checkpoints are available at https://github.com/lixiaochuan2020/agentic-context-management.