DeerFlow 2.0 · engineering source notes

From a prompt to an agent run

Instead of touring folders, we follow one real request through the runtime. The codebase is broad; the path through it is narrow — and we read straight down that path.

9 stops · 9 published

  1. 01 01

    Request entry and run hosting

    Host user input as an observable, controllable run

    Before graph execution, Gateway records the request as a run with lifecycle, context, event stream, and disconnect policy.

    read this stop →
  2. 02 02

    Lead-agent factory

    Assemble config into a runnable agent graph

    The graph factory assembles model, tools, middleware, prompt, and state schema into a runnable graph; reasoning happens during graph execution.

    read this stop →
  3. 03 03

    Tool assembly

    Registered tools are not automatically available to this run

    After tools are registered, config, model, sandbox, skills, and MCP policy still decide what this run may use.

    read this stop →
  4. 04 04

    Middleware pipeline I · preparing the run before model calls

    Before model calls, middleware establishes context, resources, and protocol boundaries

    Before the model is called, DeerFlow shapes directories, sandbox, uploads, memory, and message protocol into model-ready runtime context.

    read this stop →
  5. 05 05

    Middleware pipeline II · adjudication and cleanup after model output

    After model output, middleware adjudicates, gates tools, and cleans up resources

    Model output first passes through safety, loop, subagent fan-out, tool-boundary, and cleanup handling before the run continues.

    read this stop →
  6. 06 06

    Sandbox system

    The execution environment for tools

    The sandbox defines the tool execution environment and the capability boundary for external resources.

    read this stop →
  7. 07 07

    Subagent system

    Delegate complex subtasks to constrained full agents

    A subagent starts another full agent in the shared workspace while narrowing tools, lifecycle, and result flow.

    read this stop →
  8. 08 08

    Skill system

    Turn experience into system-level agent capability

    A skill strengthens the agent system by packaging workflows, references, scripts, and permission boundaries into reusable capability.

    read this stop →
  9. 09 09

    Persistence: store and checkpointer

    Make agent runs resumable, queryable, and auditable

    Agents span turns, call tools, and create side effects. Persistence defines what can resume, what can be queried, and what can be audited.

    read this stop →

■ published · □ planned