ContextPilot: Teaching Agents for Proactive Context Management via Fine-grained RL
On the map: LLM agents and tool use → Agent memory systems
Abstract (arXiv)
Long-horizon agentic tasks require large language models (LLMs) to iteratively retrieve, integrate, and maintain dispersed information across multi-turn interactions, but preserving all interaction histories leads to a continuously growing working context. Recent proactive context management methods allow models to edit their own working context with specialized tools, yet they still face three key limitations: (1) a limited toolset restricted to search, deletion, and summarization, with no support for global planning, long-term memory, and adaptive compression; (2) inefficient exploration that treats context management actions uniformly despite their heterogeneous impacts on final outcomes; and (3) coarse-grained credit assignment that assigns the final trajectory-level reward to all intermediate context editing actions during RL. To bridge these gaps, we introduce ContextPilot, a proactive context management framework for long-horizon agentic reasoning. Our approach systematically augments the toolset with planning, long-term memory, and soft context offloading tools. We further propose an RL method tailored for context management, which uses context and entropy variation to identify critical editing decisions for branch sampling and estimates action-level advantages from all branched trajectories that pass through the corresponding context editing action. Experiments on long-context QA and deep search tasks show that ContextPilot achieves stronger performance with a more compact working context, consistently outperforming existing baselines across various base models and benchmarks. Code is available at https://github.com/Tencent/ContextPilot.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Placed in Agent memory systems, one of 16 directions in LLM agents and tool use. Builds on 38 of its 48 references that are in the map. First posted on arXiv 28 Aug 2026.
Builds on
38 of 48 references.
Closest ancestors · 8
Same direction, newest first
- 2026Agentic Memory: Learning Unified Long-Term and Short-Term Memory Management for Large Language Model Agents5 Jan
- 2025FoldAct: Efficient and Stable Context Folding for Long-Horizon Search Agents28 Dec
- 2025AgentFold: Long-Horizon Web Agents with Proactive Context Management28 Oct
- 2025Memory as Action: Autonomous Context Curation for Long-Horizon Agentic Tasks14 Oct
- 2025ReSum: Unlocking Long-Horizon Search Intelligence via Context Summarization16 Sep
- 2025Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory28 Apr
- 2025A-MEM: Agentic Memory for LLM Agents17 Feb
- 2024A Human-Inspired Reading Agent with Gist Memory of Very Long Contexts15 Feb
Other references · 30
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
- 2025Qwen3 Technical Reportcited by 8,820
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2024HybridFlow: A Flexible and Efficient RLHF Frameworkcited by 2,057
- 2023MemGPT: Towards LLMs as Operating Systemscited by 1,389
- 2023GAIA: a benchmark for General AI Assistantscited by 1,128
- 2024LongMemEval: Benchmarking Chat Assistants on Long-Term Interactive Memorycited by 707
- 2025BrowseComp: A Simple Yet Challenging Benchmark for Browsing Agentscited by 647
- 2017The NarrativeQA Reading Comprehension Challengecited by 597
- 2025ReTool: Reinforcement Learning for Strategic Tool Use in LLMscited by 392
- 2024LongBench v2: Towards Deeper Understanding and Reasoning on Realistic Long-context Multitaskscited by 379
- 2024∞Bench: Extending Long Context Evaluation Beyond 100K Tokenscited by 367
18 more
- 2024LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compressioncited by 348
- 2025MemAgent: Reshaping Long-Context LLM with Multi-Conv RL-based Memory Agentcited by 246
- 2025WebSailor: Navigating Super-human Reasoning for Web Agentcited by 229
- 2025BrowseComp-Plus: A More Fair and Transparent Evaluation Benchmark of Deep-Research Agentcited by 200
- 2025Agentic Reinforced Policy Optimizationcited by 172
- 2025BrowseComp-ZH: Benchmarking Web Browsing Ability of Large Language Models in Chinesecited by 145
- 2025On Memory Construction and Retrieval for Personalized Conversational Agentscited by 105
- 2023MemoChat: Tuning LLMs to Use Memos for Consistent Long-Range Open-Domain Conversationcited by 97
- 2025WebExplorer: Explore and Evolve for Training Long-Horizon Web Agentscited by 92
- 2025Scaling LLM Multi-turn RL with End-to-end Summarization-based Context Managementcited by 51
- 2026OpenSeeker: Democratizing Frontier Search Agents by Fully Open-Sourcing Training Datacited by 39
- 2024NovelQA: Benchmarking Question Answering on Documents Exceeding 200K Tokenscited by 32
- 2025SALT: Step-level Advantage Assignment for Long-horizon Agents via Trajectory Graphcited by 28
- 2025Sculptor: Empowering LLMs with Cognitive Agency via Active Context Managementcited by 18
- 2026The Pensieve Paradigm: Stateful Language Models Mastering Their Own Contextcited by 9
- 2026U-Fold: Dynamic Intent-Aware Context Folding for User-Centric Agentscited by 8
- 2026From Plan to Action: How Well Do Agents Follow the Plan?cited by 4
- 2026Structured Episodic Event Memorycited by 2
Built on by
Citing papers per year: 2026: 2.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2026ACM: Agentic Context Management for Long Horizon Tasks
- 2026ContextWeaver: Selective and Dependency-Structured Memory Construction for LLM Agents
- 2026PRO-LONG: Programmatic Memory Enables Long-Horizon Reasoning
- 2026HyMem: Hierarchical Context Management for Long-Horizon Agents via Information Isolation
- 2025Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models
- 2025PAACE: A Plan-Aware Automated Agent Context Engineering Framework
- 2025ContextPilot: Fast Long-Context Inference via Context Reuse
- 2026ContextBudget: Budget-Aware Context Management for Long-Horizon Search Agents