DeerFlow 2.0 (SuperAgent harness)
Type: full-code · Vendor: ByteDance · Language: Python, TypeScript · License: MIT · Status: active · Status in practice: emerging · First released: 2026-02
Run long-horizon tasks that research, code, and create by giving a single lead agent the ability to dynamically spawn bounded, context-isolated subagents that execute code and tools inside Docker sandboxes and then synthesise their structured results.
Description. DeerFlow 2.0 is a ground-up rewrite of ByteDance's DeerFlow that shares no code with the 1.x deep-research graph and became the active line after its launch around late February 2026. Rather than a fixed LangGraph research workflow, it is a general open-source SuperAgent harness: a lead agent receives the request, decomposes it, and dynamically spawns subagents on the fly, each with its own scoped context, tools, and termination conditions. Subagents run in parallel when possible and report structured results back to the lead agent, which synthesises them into the final deliverable. The roster is not fixed: built-in subagents (a general-purpose agent and a bash agent) sit alongside user-defined custom agents declared in config.yaml, and concurrency is bounded by a SubagentLimitMiddleware. Each subagent executes inside an isolated sandbox — the AioSandboxProvider gives it a real filesystem and bash terminal in a Docker container (local, Docker, or Kubernetes-provisioned), while the LocalSandboxProvider is explicitly gated as not a secure boundary. Capabilities are extended through Agent Skills (SKILL.md capability modules, public or custom, loaded progressively) and through tools that include web search, web fetch, file operations, and bash, plus MCP servers exposed as deferred tools the agent must look up via a tool_search tool before calling. A persistent cross-session memory subsystem accumulates the user's profile and preferences, and a message gateway fronts the harness with LangGraph-compatible HTTP routes. The lead agent itself runs as a LangChain agent wrapped in a middleware chain (loop detection, summarisation, todo tracking, subagent limiting, sandbox auditing, and more). The original deep-research graph is catalogued separately as DeerFlow 1.x and is maintained on the `main-1.x` branch.
Agent loop shape. A lead agent runs a LangChain agent loop wrapped in a middleware chain; on each step it may call the `task` tool to delegate work to subagents (general-purpose, bash, or custom skill-scoped), each of which runs its own bounded ReAct-style loop inside an isolated Docker/AIO sandbox and returns a structured result. Concurrent subagent spawns are truncated to a clamped maximum, skills and deferred MCP tools are loaded lazily, and the lead agent synthesises subagent results into the final output while a cross-session memory subsystem persists profile and preferences across runs.
Primary use cases
- long-horizon tasks (minutes to hours) that mix research, coding, and content creation
- autonomous agents that need a real filesystem, bash terminal, and safe code execution
- dynamic task decomposition where the lead agent spawns parallel subagents on demand
- skill- and MCP-extensible super agents with persistent cross-session memory
Patterns this full-code implements —
- ★★Orchestrator-Workers
A lead agent decomposes the request and dispatches sub-tasks to subagents via a `task` tool, then synthesises their structured results into the finished deliverable — the harness's central orchestrat…
- ★Subagent Isolation
Each subagent is spawned with its own scoped context, tool set, and termination conditions, and cannot see the parent or sibling contexts; the built-in general-purpose agent is recommended precisely…
- ★Parallel Fan-Out / Gather
Subagents run in parallel when possible, report back structured results, and the lead agent gathers and synthesises them; a single model response can emit several parallel `task` calls at once.
- ★Agent Skills
Capabilities are packaged as Agent Skills — SKILL.md modules (public/built-in or user-authored custom) that define a workflow and supporting resources, loaded progressively so only the skills a task…
- ★★Sandbox Isolation
Subagents execute inside isolated sandboxes: the AioSandboxProvider provisions Docker containers (local or Kubernetes-backed) with a real filesystem and bash, while the LocalSandboxProvider is explic…
- ★★Code Execution
The harness is an execution engine, not just a reasoning layer: a dedicated bash subagent and sandbox tools run real bash commands and code inside the sandbox rather than only proposing them.
- ★Tool Search Lazy Loading
Tools (including MCP-provided ones) are exposed as deferred entries the agent can see by name but cannot call until it fetches their full schema through a `tool_search` tool, keeping the active tool…
- ★★Cross-Session Memory
A memory subsystem reads, writes, and updates persistent facts about the user's profile and preferences across sessions, deduplicating entries at apply time.
- ★★Model Context Protocol
External capabilities are added through MCP servers; their tools are tagged as deferred (deerflow_mcp) and merged into the agent's tool surface, discoverable via tool_search.
- ★★Human-in-the-Loop
The agent can pause to ask the user for clarification through a dedicated clarification tool and middleware before proceeding with an ambiguous task.
- ★Agent Middleware Chain
The lead agent is assembled by a factory that wraps the base LangChain agent in a stack of middlewares — loop detection, summarisation, todo tracking, subagent limiting, sandbox auditing, token usage…
Neighbourhood
Click any neighbour to follow the lineage. Scroll to zoom, drag to pan.