arXiv:2607.23809cs.AI2026-07

让智能体自主管理长期任务中的上下文,避免信息丢失。

ACM: Agentic Context Management for Long Horizon Tasks

论文配图:ACM: Agentic Context Management for Long Horizon Tasks
图 1 · 摘自论文原文
  • 模拟人脑记忆机制,自动决定何时压缩与调用上下文。
  • 减少峰值令牌压力,提升任务探索深度与结果一致性。
  • 适合需要长期推理的智能体任务,如编程和搜索。

智能体任务本质上具有长周期和多轮交互特征,需持续积累环境交互的上下文。现有上下文压缩方法不可避免地造成信息损失,且触发依赖僵硬启发式规则,与智能体不断演变的推理重点不匹配。我们提出一种名为 Agentic Context Management (ACM) 的框架,赋予智能体专用的上下文编辑工具,实现无损上下文管理。受短期与长期人类记忆交互的启发,智能体可自主决定何时压缩上下文,将丢弃内容外置于外部记忆系统,并按需查询检索。基于此框架,我们进一步开发了一套后训练流程,构建高质量的上下文管理示范数据,显著提升模型在智能体搜索与编程任务上的表现。分析表明,有效的上下文管理能降低峰值令牌压力,支持更长时间的探索,且在独立实验中生成更一致的解。代码、数据及模型检查点见 https://github.com/lixiaochuan2020/agentic-context-management。

原文摘要 · Abstract (English)

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.

智能体上下文管理长序列

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。