arXiv:2607.21503cs.AIcs.IR2026-07

解决AI代理记忆与成本难题,通过管理上下文生命周期和架构设计。

Agentic Context Management: Solving Agent Memory and Cost by Treating Them as Lifecycle and Architecture Problems

  • 将上下文管理视为生命周期问题,分五步实现智能记忆与遗忘。
  • 实测在长对话与低延迟场景下准确率达92%以上,成本线性增长。
  • 适合大规模生产级AI系统开发者与企业级部署团队使用。

生产级AI代理的失败往往并非因推理能力不足,而是无法有效管理推理上下文:对话历史、大提示词、工具定义及不断膨胀的输出。代理在自身积累的历史中迷失,每轮消耗的令牌成本持续上升,导致跨轮次召回缺失。现有方法将其视为存储与检索问题,但视角过于狭窄。我们提出将主动管理上下文视为一个生命周期过程,涵盖决定保留内容、提取结构化信息、按数据类型选择存储方式、合并与遗忘同时保留溯源、判断当前相关性、预判未来需求,并在不丢失关键信息的前提下压缩上下文至预算。在组织级应用中,该机制需跨越用户层级。我们定义此为代理上下文管理(ACM),分解为五大原语:架构设计、摄入、作用域、预判与压缩整合。经济分析表明:原始积累使成本随对话长度呈平方增长;粗略摘要虽将成本线性化但引发精度断崖;唯有经验证的压缩才能实现线性成本与保真度并存。我们介绍了参考实现Maximem Synap,作为多租户服务实现五大原语,在第6节配置下于LongMemEval达92%,LoCoMo达93.2%。最后指出当前基准未覆盖的维度:延迟、令牌效率与上下文漂移抵抗能力,以及决策级与组织级上下文管理的新前沿。

原文摘要 · Abstract (English)

Production AI agents' failures are less often due to an inability to reason well and more often because they cannot manage what is in their reasoning context: conversation histories, large prompts, large tool definitions, and ballooning tool outputs. Agents drown in their own accumulating history while paying a token cost that grows every turn, producing missing recalls within and across conversations. The incumbent response treats this as a storage-and-retrieval problem. We argue that framing is too narrow. Actively managing what an agent holds in mind is a lifecycle, not merely a store: it spans deciding what to remember, extracting and structuring it, choosing the right store per data type, consolidating and forgetting while preserving provenance, deciding what is relevant now, anticipating what is needed next, and compacting context to a budget without losing what matters. In serious production this operates not over a single user but across an organizational scope hierarchy. We name this discipline Agentic Context Management (ACM) and decompose it into five primitives: architecting, ingesting, scoping, anticipating, and compacting & consolidation. We then make the economic case: naive context accumulation grows token cost quadratically in conversation length, crude summarization buys linear cost at the price of an accuracy cliff, and only validated compaction achieves linear cost with preserved fidelity. We describe a reference implementation, Maximem Synap, that realizes the five primitives as a multi-tenant service and reports 92% on LongMemEval and 93.2% on LoCoMo under the configuration detailed in Section 6. We close with dimensions existing benchmarks do not yet capture, latency, token efficiency, and context-rot resistance, and the frontier of decision-level and organization-level context the category points toward.

上下文管理成本优化多轮对话代理系统

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