Source-linked AI summary

AgentFold: Long-Horizon Web Agents with Proactive Context Management

Rui Ye, Zhongwang Zhang, Kuan Li, Huifeng Yin, Zhengwei Tao, Yida Zhao, Liangcai Su, Liwen Zhang, Zile Qiao, Xinyu Wang, Pengjun Xie, Fei Huang, Siheng Chen, Jingren Zhou, Yong Jiang

arXiv:2510.24699v1cs.CLcs.AIcs.LG

TL;DR

Long-horizon web agents struggle to balance preserving useful history with avoiding context saturation and irreversible information loss. AgentFold proactively folds a dynamic workspace at multiple scales, and its supervised-fine-tuned 30B-A3B model achieves competitive or superior benchmark performance against much larger open-source and leading proprietary agents.

  • Problem

    Long-horizon web agents face a context-management trade-off between noisy, saturating raw histories and fixed summaries that can irreversibly lose critical details.

  • Method

    AgentFold uses proactive folding over a dynamic cognitive workspace, applying granular condensation or deep consolidation to selectively manage multi-scale task history.

  • Results

    AgentFold-30B-A3B achieves 36.2% on BrowseComp and 47.3% on BrowseComp-ZH, surpassing or matching much larger open-source models and surpassing OpenAI’s o4-mini.

  • Takeaways & Limitations

    Adaptive context management enables AgentFold-30B-A3B to establish state-of-the-art open-source performance and compete with substantially larger models and leading proprietary agents.

  • Takeaways & Limitations

    The study uses straightforward supervised fine-tuning without extensive optimization, leaving reinforcement learning as a proposed next step for discovering folding policies.

Abstract

from arXiv · show

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 multi-step 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.

1 Introduction

Long-horizon web agents face a context-management trade-off: retaining raw histories preserves information but accumulates noise, while fixed summarization risks irreversible detail loss. AgentFold addresses this with proactive, multi-scale folding of a dynamic workspace and achieves strong benchmark results with supervised fine-tuning.

  • Motivation: Long-horizon web agents must balance context comprehensiveness against conciseness because both extremes can impair performance.ReAct-style agents retain noisy reasoning-action-observation histories, whereas fixed full-history summarization can prematurely discard critical information.
  • Motivation: AgentFold treats context as an actively managed mental-scratchpad-like workspace rather than a passive log.Its design is motivated by retrospective consolidation, in which irrelevant steps are discarded, findings distilled, and key insights abstracted at critical points.
  • Method: AgentFold represents trajectories with multi-scale state summaries plus the complete latest action-observation interaction.This structure replaces a monolithic history with distilled records and a fully preserved current interaction.
  • Method: Its folding directive either condenses the latest interaction into a new summary or consolidates prior summaries into a coarser abstraction.Deep consolidation can package a completed sub-investigation into its final conclusion while retracting the entries it replaces.
  • Training: Fold-Generator automatically produces structured trajectories for training, followed by rejection sampling and fine-tuning on open-source language models.The pipeline addresses the lack of trajectories combining situational action with strategic context curation.
  • Results: 36.2% on BrowseComp, 47.3% on BrowseComp-ZH, 62.1% on WideSearch, and 67.0% on GAIA were achieved by AgentFold-30B-A3B.The model was implemented through supervised fine-tuning of Qwen3-30B-A3B and surpassed or matched substantially larger open-source models while surpassing OpenAI’s o4-mini.

2 Related Works

Related work largely separates external context augmentation from intra-task context curation. AgentFold belongs to the latter and differs from prior full-history compressors by selectively folding task-generated context through a flexible look-back mechanism.

  • Context Management: Context-management research includes external context augmentation, which injects relevant information from outside the current task trajectory.Examples include user profiles and past conversations used to provide richer or more personalized context.
  • Context Management: AgentFold instead pursues intra-task context curation to maintain relevance and efficiency over long-horizon tasks.Its focus is managing context generated within the task itself.
  • Prior Methods: MEM1 and MemAgent compress the full history at every step using rigid step-wise summarization policies.The passage notes that these methods have primarily been evaluated on simpler, retrieval-focused tasks such as HotpotQA.
  • AgentFold: AgentFold introduces a flexible look-back mechanism that retrospectively evaluates and selectively folds task history.This distinguishes it from methods that mechanically summarize the full history at each step.

3 AgentFold: Web Agent with Proactive Context Folding

AgentFold treats context as a dynamic cognitive workspace and proactively folds history while reasoning and acting. Its multi-scale summaries and latest full interaction balance long-range coherence with fine-grained decision detail.

  • Adaptive Folding: Granular condensation folds a single step to preserve useful detail, whereas deep consolidation merges multi-step sub-tasks into coarse summaries when intermediate details are no longer critical.These two modes provide multi-scale control over how much historical information remains explicit.
  • Operational Process: At each step, the agent jointly produces a folding directive and external action, updating historical summaries before the next reasoning cycle.The iterative loop consists of perceiving, reasoning, folding, and acting.
  • Context as a Dynamic Workspace: AgentFold partitions context into invariant questions and tools, curated Multi-Scale State Summaries, and a complete Latest Interaction.State Summaries provide long-term memory, while the Latest Interaction preserves immediate information.
  • Training Data and Objective: Fold-Generator creates validated structured trajectories through open-source LLM generation, rejection sampling, and conventional supervised fine-tuning.Invalid response formats and trajectories with excessive environmental errors are discarded before training.
  • Adaptive Folding: This adaptive strategy addresses ReAct context saturation and the information loss risk of repeatedly summarizing the full history.AgentFold can preserve vital fine-grained details or prune concluded sub-investigations, and can delay consolidation until outcomes are clear.
  • Discussion: AgentFold learns context curation as a core action, enabling task-specific decisions about what to remember, abstract, or discard.This shifts context management from static predefined policies toward self-aware knowledge management.

4 Experiments

AgentFold is evaluated across information-seeking benchmarks, context dynamics, and long-horizon interaction scaling. Its proactive folding keeps context compact while supporting competitive benchmark performance and extended task execution.

  • Main results: 36.2% on BrowseComp exceeds DeepSeek-V3.1-671B’s 30.0%, while 62.1% on WideSearch is the best overall score and surpasses all proprietary agents evaluated there.The reported comparisons position AgentFold as competitive with substantially larger open-source and leading proprietary systems.
  • Context efficiency: At 100 turns, AgentFold’s average context is over 84k tokens, or 92%, smaller than ReAct’s.The reduction corresponds to an estimated memory saving of nearly 7GB per inference instance at this trajectory length.
  • Case study: In a case study, AgentFold folds an unsuccessful 11-step sequence into one conclusion and then replans toward a new search direction.The example covers steps 6–16 and illustrates deep consolidation of failed attempts before a subsequent tool call.

5 Conclusions

AgentFold presents proactive, multi-scale context folding as an alternative to context saturation and irreversible information loss, with experiments validating its effectiveness. The authors prioritize demonstrating the paradigm with straightforward supervised fine-tuning and identify reinforcement learning as a next step.

  • 5 Conclusions: AgentFold dynamically sculpts context through Granular Condensation and Deep Consolidation, addressing saturation in append-only agents and information loss from uniform summarization.The paradigm treats context as a self-managed workspace and supports both fine-grained preservation and abstraction of irrelevant history.
  • 5 Conclusions: AgentFold-30B-A3B establishes a new state of the art for open-source agents while outperforming models over 20 times its size and competing strongly with proprietary agents.The conclusion specifically names DeepSeek-V3.1-671B and OpenAI’s o4-mini as comparison points.
  • 5 Conclusions: AgentFold supports hundreds of interaction steps within a manageable context, enabling long-horizon problem-solving.Its context efficiency is presented as a consequence of proactive folding.
  • 5 Conclusions: The work uses straightforward supervised fine-tuning without extensive optimization, leaving reinforcement learning as a proposed next step for discovering folding policies.The authors frame RL as future work that could optimize folding policies directly for task success.

A.1 Case Study

The case study documents searches for a cross-border specialty food shop and related location evidence, including Northgate Market as a California candidate. The available trajectory also records unresolved coordinate retrieval and subsequent alternative-search planning.

  • A.1 Case Study: The case study sought a specialty food shop with locations in both Mexico and California, with the Mexican location constrained by a 7.8-kilometer walk from a Polanco McDonald’s.The California location was specified as being within a market associated with the November 2023 event.
  • A.1 Case Study: Northgate Market was identified as the California market that held a Thanksgiving Floral Arrangement Class on November 20, 2023.It was described as a strong candidate for the market in the question.
  • A.1 Case Study: GPS-coordinate retrieval for the Polanco McDonald’s remained unsuccessful because the Infobelpro page was inaccessible or lacked the required data.The failed coordinate lookup hindered defining the requested radius.
  • A.1 Case Study: After the failed coordinate lookup, the trajectory proposed using another map or reliable source and reevaluating candidate markets and specialty shops.The recorded alternatives included checking additional California markets and cross-border presence.
Loading 2510.24699v1…