DeepAgent: A General Reasoning Agent with Scalable Toolsets

Xiaoxi Li, Wenxiang Jiao, Jiarui Jin, Guanting Dong, Jiajie Jin, Yinuo Wang, Hao Wang, Yutao Zhu, Ji-Rong Wen, Yuan Lu, Zhicheng Dou

TL;DR

DeepAgent is a novel reasoning framework that unifies autonomous thinking, tool discovery, and execution into a single, continuous process. By implementing a brain-inspired "memory folding" mechanism and a specialized reinforcement learning strategy (ToolPO), it significantly outperforms traditional agent workflows on complex, long-horizon tasks involving thousands of potential tools.

What Problem Does This Paper Address?

Most current LLM agents follow rigid, predefined workflows like ReAct (Reason-Act-Observe) or Plan-and-Solve. While effective for simple tasks, these "loop-based" approaches struggle with real-world complexity for several reasons:

  1. Lack of Autonomy: They follow fixed patterns rather than adapting their reasoning flow dynamically.
  2. Tool Scalability: They often rely on a small, pre-selected set of tools. When faced with "open-set" scenarios (e.g., searching through 16,000+ APIs), they falter.
  3. Memory Bloat: Long-horizon interactions lead to massive context windows filled with redundant information, causing error accumulation and "distraction."
  4. Training Instability: Training agents on real-world APIs is expensive, slow, and prone to failure if an external service goes down.

Methods

The authors introduce DeepAgent, which shifts away from iterative loops toward a unified "stream of thought." Key innovations include:

  • Autonomous Memory Folding: The agent can choose to "take a breath" by generating a <fold_thought> token. An auxiliary LLM then compresses the messy interaction history into a structured JSON schema consisting of Episodic Memory (long-term progress), Working Memory (immediate goals/obstacles), and Tool Memory (lessons learned from tool successes/failures).
  • ToolPO (Tool Policy Optimization): A specialized end-to-end Reinforcement Learning (RL) strategy.
  • LLM-Simulated APIs: To ensure stable training, the authors use an LLM to simulate API responses, avoiding the latency and cost of real-world endpoints.
  • Tool-Call Advantage Attribution: Instead of just rewarding the final answer (sparse reward), ToolPO assigns fine-grained credit to the specific tokens responsible for successful tool invocations.
  • Dynamic Tool Discovery: Unlike agents that have tools "handed" to them, DeepAgent autonomously generates search queries to find relevant tools from a massive index during the reasoning process.

Datasets

The researchers evaluated DeepAgent across eight diverse benchmarks:

  • General Tool-Use: ToolBench (16k+ real-world APIs), API-Bank, TMDB, Spotify, and ToolHop (multi-hop tool use).
  • Downstream Applications: ALFWorld (embodied AI), WebShop (online shopping), GAIA (general assistant tasks), and Humanity’s Last Exam (HLE - a graduate-level reasoning benchmark).
  • Training Data: A curated set of ~3,100 instances across tool-use, real-world interaction, deep research, and mathematical reasoning.

Key Insights and Ideas

  • The Power of the "Reset": Memory folding isn't just about saving tokens; it acts as a cognitive reset. By condensing the past into a structured format, the agent can reconsider its strategy and avoid getting "stuck" in a loop of failed attempts.
  • Process vs. Outcome: The paper highlights that rewarding the process (correct tool calls) is just as vital as rewarding the outcome (correct answer). This "advantage attribution" is what allows the 32B model to compete with much larger closed-source models.
  • Synergy with Dynamic Retrieval: DeepAgent performs best when it is allowed to discover tools on the fly. In open-set scenarios, it achieved a 52.6% average success rate, nearly doubling the performance of the best workflow-based baseline (28.5%).

Key Results

  • Superiority over Baselines: DeepAgent-32B-RL consistently outperformed ReAct, CodeAct, and Plan-and-Solve. On the GAIA benchmark, it scored 53.3 compared to 42.5 for the next best 32B model (HiRA).
  • Scalability: As the "action limit" (the number of steps allowed) increased, the performance gap between DeepAgent and traditional agents widened, suggesting DeepAgent is much more efficient at managing long-term tasks.
  • Backbone Generalization: The framework showed significant gains when applied to different base models, including the newer Qwen3-MoE series, proving the architecture is model-agnostic.

Limitations and Future Work

  • Auxiliary Model Dependency: The system currently relies on an auxiliary LLM to handle the memory folding and API simulation. This adds a layer of complexity and potential overhead.
  • Retrieval Bottlenecks: While it handles 16,000 tools well, the authors note that as toolsets scale toward "infinite" libraries, the initial dense retrieval step remains a critical point of failure.
  • Real-world Latency: Although simulated APIs help training, the paper does not deeply explore the latency implications of performing multiple "thinking" and "folding" steps in a live production environment.

Future work is directed toward making the memory folding even more autonomous and exploring how these agents can better generalize to completely unseen, zero-shot tool environments.

Summary updated

BibTeX
@inproceedings{li2026deepagent,
  author = {Xiaoxi Li and Wenxiang Jiao and Jiarui Jin and Guanting Dong and Jiajie Jin and Yinuo Wang and Hao Wang and Yutao Zhu and Ji-Rong Wen and Yuan Lu and Zhicheng Dou},
  title = {{DeepAgent: A General Reasoning Agent with Scalable Toolsets}},
  booktitle = {The Web Conference},
  year = {2026},
  doi = {10.1145/3774904.3792460},
}

Loading related content...

Figure