Open-source project
RUC-NLPIR/DeepAgent avatar
RUC-NLPIR/DeepAgent

DeepAgent: A Single-Stream Reasoning Agent That Folds Its Own Memory

[WWW‘26 Oral🔥] DeepAgent: A General Reasoning Agent with Scalable Toolsets

1,137 stars142 forksPythonMIT

At a glance

What is it?
DeepAgent is an MIT-licensed research codebase from RUC-NLPIR and Xiaohongshu that replaces fixed Reason-Act-Observe loops with one continuous reasoning stream, tool discovery over large toolsets, and an autonomous memory-folding step. It is a paper implementation for people who want to train or study tool-using agents, not a drop-in production framework.
Who is it for?
Adopt DeepAgent if you are evaluating or reproducing research on tool-using agents with large toolsets, or if you want a single-stream alternative to ReAct-style scaffolding you can train with RL. Do not adopt it if you need a stable, documented production runtime with versioned releases, or if you cannot supply GPU capacity for the reasoning models and the ToolPO training loop.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 156 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The Problem DeepAgent Targets: Tool Selection at Scale

Most agent frameworks ask you to decide the tool set before the task starts. You wire up a handful of functions, define a loop, and the model picks from that fixed menu. DeepAgent starts from the opposite assumption. The repository describes it as an agent that searches for and uses appropriate tools from over 16,000 RapidAPIs inside one end-to-end reasoning process. The audience is therefore narrow and specific: researchers and engineers who care about what happens when the candidate tool pool is far larger than any prompt can hold, and who are willing to run a reasoning language model against that pool. The README frames the target as general tool-use tasks evaluated on ToolBench, API-Bank, TMDB, Spotify and ToolHop, with toolsets scaling from tens to more than ten thousand distinct tools. A second audience is downstream application work: ALFWorld, WebShop, GAIA and Humanity's Last Exam, where the tools are domain-specific rather than drawn from a public API directory.

One Stream of Thought Instead of a Reason-Act-Observe Cycle

The architectural claim is that reasoning, tool discovery and action execution happen in a single coherent process rather than in alternating phases. The README contrasts this directly with ReAct's Reason-Act-Observe cycle, which it calls a predefined workflow. In DeepAgent the language reasoning model is expected to hold a global view of the task and discover tools as needed, instead of committing to a tool before it has finished thinking about the problem. That distinction matters when the tool space is large: a fixed cycle forces a selection early, and a wrong early selection is expensive to undo. The framework diagram in the repository shows the components, but the README does not spell out the exact prompt format, the tool retrieval index, or how candidate tools are ranked before the model sees them. Those details live in the paper (arXiv 2510.21618), not in the README, so anyone evaluating the mechanism should read the paper rather than infer it from the repository text.

Autonomous Memory Folding and the Three-Part Memory Schema

Long-horizon tool use has a failure mode the README names plainly: getting stuck in incorrect exploration paths. DeepAgent's answer is Autonomous Memory Folding, which the project describes as letting the agent take a breath by compressing its interaction history into a structured memory and restarting reasoning from that condensed state. The memory schema is explicitly brain-inspired and has three parts. Episodic memory is a high-level log of key events, decisions and sub-task completions. Working memory holds the current sub-goal and near-term plans. Tool memory consolidates tool-related interactions so the agent can refine its strategy from prior calls. The trigger is autonomous, meaning the agent decides when to fold rather than a fixed step counter doing it. That is the most interesting design choice in the project and also the hardest to verify without running it: the README does not state what condition causes a fold, how much history is discarded, or what happens when the fold itself loses information the task still needs.

ToolPO: Training the Agent Rather Than Prompting It

DeepAgent is not only an inference-time scaffold. The project introduces ToolPO, described as an end-to-end reinforcement learning method tailored for general tool use, with two named components. The first is an LLM-based tool simulator that mimics real-world APIs to keep training stable and efficient, which addresses the practical problem that live API calls are slow, rate-limited and non-reproducible. The second is Tool-Call Advantage Attribution, which assigns credit to the specific tokens that make up a correct tool invocation rather than to a whole trajectory. That is a meaningful granularity difference: sparse trajectory-level rewards make it hard for a policy to learn which part of a long output was right. The README does not report training compute, dataset sizes or hyperparameters, so the cost of reproducing ToolPO cannot be estimated from the repository alone. Treat the training path as a research commitment, not a configuration toggle.

Getting It Running: Environment and Model Choices

The installation section is short. The README gives one command block for environment setup, starting with conda create -n deepagent python=3.10. The badge at the top of the repository says Python 3.9+ while the conda command pins 3.10, a small inconsistency worth resolving before you build anything on top of it. The news entry from October 27, 2025 states that the codebase can be deployed with reasoning models such as QwQ and Qwen3, and with your own toolsets. No pip install line, no requirements file listing, no configuration key names and no CLI entry point appear in the supplied README text, so the exact invocation for a run cannot be reproduced from this material. The repository does link a Hugging Face dataset at lixiaoxi45/DeepAgent-Datasets for the evaluation data. If you need the precise commands, read the repository files directly; the README as provided stops at the conda step.

The Demo Caveat and Other Limits You Should Weigh

The most important limitation is stated by the project itself. In the general agent demo with 16,000+ RapidAPIs, the README notes that some APIs in ToolBench are unavailable and that API responses are LLM-simulated to show normal system functionality. A simulated API response is not evidence that the agent handles real latency, authentication failures, malformed payloads or rate limits. If your interest is production tool calling, the demo does not answer your question. A second limitation is release hygiene: no releases were retrieved for this repository, so there is no versioned artifact to pin and no changelog to read before upgrading. A third is scope. The benchmarks listed are research benchmarks, and the repository is a paper implementation first. Teams that need a supported runtime with deprecation policy and long-term maintenance have no signal here about how the project will be maintained after the conference cycle.

How It Differs from ReAct-Style Scaffolding

The honest comparison is with ReAct, because DeepAgent defines itself against it. ReAct interleaves a thought, an action and an observation in a tight loop, and the tool set is fixed by the developer before the run. It is simple to debug: every step is a discrete, inspectable unit, and you can replay a trajectory action by action. DeepAgent trades that inspectability for a single reasoning stream with dynamic tool discovery and a memory fold that rewrites the history. The benefit is that the model is not forced into an early tool commitment and can maintain a global view of a long task. The cost is that the trajectory is harder to audit, because the folded memory is a summary rather than a verbatim log. If your task uses five well-known tools and you need step-level traceability for compliance or debugging, ReAct-style scaffolding is the better fit and DeepAgent's machinery is overhead. If your task requires choosing among thousands of candidate tools over dozens of steps, the fixed-menu approach is the thing that breaks first.

Licence, Maintenance and What to Check Before Adopting

DeepAgent is released under the MIT licence, which permits commercial use, modification and redistribution provided the copyright notice and permission notice are retained. That is permissive and low-friction for a research codebase, but the licence covers the code in this repository only. The RapidAPIs used in the demo, the ToolBench data and the Hugging Face dataset each carry their own terms, and MIT on the agent does not grant you rights to those. On maintenance: the last push recorded is 2026-04-13, the repository is not archived, and the news section shows activity from the October 2025 code release through the January 2026 WWW 2026 acceptance. There are no retrieved releases, so upgrades mean tracking the main branch. Verify the licence terms of any dataset or API you connect before you ship anything built on this, and check the repository directly for a requirements file and run scripts that the README excerpt does not include.

Editorial conclusion

Adopt DeepAgent if you are evaluating or reproducing research on tool-using agents with large toolsets, or if you want a single-stream alternative to ReAct-style scaffolding you can train with RL. Do not adopt it if you need a stable, documented production runtime with versioned releases, or if you cannot supply GPU capacity for the reasoning models and the ToolPO training loop. Before committing, verify three things: that the conda environment in the README resolves on your Python version, that the toolset you intend to use has working API endpoints rather than the LLM-simulated responses used in the demo, and that the Hugging Face dataset matches the benchmark split you plan to evaluate on.

Official sources

  1. Issues
  2. License: MIT
  3. README
  4. RUC-NLPIR/DeepAgent on GitHub
Community notes

Community notes