AgentFold: Long-Horizon Web Agents with Proactive Context Folding
Rui Ye, Zhongwang Zhang, Kuan Li, Huifeng Yin, Zhengwei Tao, Yida Zhao, Liangcai Su, Liwen Zhang, Zile Qiao, Xinyu Wang, Pengjun Xie, Fei Huang
Abstract
LLM-based web agents show immense promise for information seeking, yet their effectiveness on long-horizon tasks is hindered by a fundamental trade-off in context management. Prevailing ReAct-based agents suffer from context saturation as they accumulate noisy, raw histories, while methods that fixedly summarize the full history at each step risk the irreversible loss of critical details. Addressing these, we introduce AgentFold, a novel agent paradigm centered on proactive context management, inspired by the human cognitive process of retrospective consolidation. AgentFold treats its context as a dynamic cognitive workspace to be actively sculpted, rather than a passive log to be filled. At each step, it learns to execute a 'folding' operation, which manages its historical trajectory at multiple scales: it can perform granular condensations to preserve vital, fine-grained details, or deep consolidations to abstract away entire multistep sub-tasks. The results on prominent benchmarks are striking: with simple supervised fine-tuning (without continual pre-training or RL), our AgentFold-30B-A3B agent achieves 36.2% on BrowseComp and 47.3% on BrowseComp-ZH. Notably, this performance not only surpasses or matches open-source models of a dramatically larger scale, such as the DeepSeek-V3.1-671B-A37B, but also surpasses leading proprietary agents like OpenAI's o4-mini. AgentFold proactively folds its working context during complex task-solving
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 1a289add-bb6a-4e3b-b8b9-8442a56747e4Cited by top-tier papers2
- Mem-T: Densifying Rewards for Long-Horizon Memory AgentsYanwei Yue, Guibin Zhang, Boci Peng, Xuanbo Fan et al.ICML 2026
- ACON: Optimizing Context Compression for Long-horizon LLM AgentsMinki Kang, Wei-Ning Chen, Dongge Han, Huseyin Inan et al.ICML 2026
Builds on6
- A-Mem: Agentic Memory for LLM AgentsWujiang Xu, Zujie Liang, Kai Mei, Hang Gao et al.NeurIPS 2025 · 1,138 citations
- GAIA: a benchmark for General AI AssistantsGrégoire Mialon, Clémentine Fourrier, Thomas Wolf, Yann LeCun et al.ICLR 2024 · 716 citations
- MEM1: Learning to Synergize Memory and Reasoning for Efficient Long-Horizon AgentsZijian Zhou, Ao Qu, Zhaoxuan Wu, Sunghwan Kim et al.ICLR 2026 · 223 citations
- WebSailor-V2: Bridging the Chasm to Proprietary Agents via Synthetic Data and Scalable Reinforcement LearningKuan Li, Zhongwang Zhang, Huifeng Yin, Rui Ye et al.ICLR 2026 · 65 citations
- MAS-GPT: Training LLMs to Build LLM-based Multi-Agent SystemsRui Ye, Shuo Tang, Rui Ge, Yaxin Du et al.ICML 2025
Related papers
- Scaling Long-Horizon Agent via Context FoldingWeiwei Sun, Lu Miao, Zhan Ling, Kang Liu et al.ICML 2026 · 104 citations
- Cognitive Scaffold: From Fluid Context to Crystallized Memory for Long-Horizon DeepResearch AgentsQiuyuan Ai, Zenghuang Fu, Zhaoyang Li, Ping Jiang et al.ACL 2026
- Branch-and-Browse: Efficient and Controllable Web Exploration with Tree-Structured Reasoning and Action MemoryShiqi He, Yue Cui, Xinyu Ma, Yaliang Li et al.ACL 2026 · 5 citations
- RE-TRAC: REcursive TRAjectory Compression for Deep Search Agentsjialiang zhu, Gongrui Zhang, Xiaolong Ma, Lin Xu et al.ICML 2026
- PACE: Predictive Adaptive Context Extraction for Long-Horizon LLM AgentsLei Wei, Xiao Peng, TT, Guannan Zhang et al.ACL 2026
