Skip to main content
Deep Agents build on LangGraph’s streaming infrastructure with first-class support for subagent streams. When a deep agent delegates work to subagents, you can stream updates from each subagent independently—tracking progress, LLM tokens, and tool calls in real time. What’s possible with deep agent streaming:

Enable subgraph streaming

Deep Agents use LangGraph’s subgraph streaming to surface events from subagent execution. To receive subagent events, enable stream_subgraphs when streaming.

View example trace

Open a public LangSmith run for this example.

Namespaces

When subgraphs is enabled, each streaming event includes a namespace that identifies which agent produced it. The namespace is a path of node names and task IDs that represents the agent hierarchy. Within each update chunk, the dict keys are graph node names such as tools and the model node (model_request). Use namespaces to route events to the correct UI component:

View example trace

Open a public LangSmith run for this example.

Inspect graph nodes

createDeepAgent returns a DeepAgent. Access the compiled LangGraph graph via agent.graph. With streamMode: "updates", each chunk is keyed by node name, so you need those names to filter or render progress. Prefer event streaming when you do not need the raw update keys. To list the nodes for your agent configuration:
Every deep agent includes the core loop nodes model_request and tools. Middleware that implements before_agent, before_model, after_model, or after_agent hooks adds nodes named {MiddlewareName}.{hook}, for example patchToolCallsMiddleware.before_agent. The exact set depends on the middleware the harness and your configuration attach. For LangChain agent progress streaming that filters on these same keys, see Agent progress.

Subagent progress

Use stream_mode="updates" to track subagent progress as each step completes. This is useful for showing which subagents are active and what work they’ve completed.

View example trace

Open a public LangSmith run for this example.
Output

LLM tokens

Use stream_mode="messages" to stream individual tokens from both the main agent and subagents. Each message event includes metadata that identifies the source agent.

View example trace

Open a public LangSmith run for this example.

Tool calls

When subagents use tools, you can stream tool call events to display what each subagent is doing. Tool call chunks appear in the messages stream mode.

View example trace

Open a public LangSmith run for this example.

Custom updates

Use config.writer inside your subagent tools to emit custom progress events:

View example trace

Open a public LangSmith run for this example.
Output

Stream multiple modes

Combine multiple stream modes to get a complete picture of agent execution:

View example trace

Open a public LangSmith run for this example.

Common patterns

Track subagent lifecycle

Monitor when subagents start, run, and complete:

View example trace

Open a public LangSmith run for this example.

Handle human-in-the-loop interrupts

When interrupt_on is configured, the updates stream may contain __interrupt__ entries that pause execution for human approval. Detect them by checking for the __interrupt__ key in update chunks. Resume with the same flat {"decisions": [...]} payload you use with .invoke():
See Human-in-the-loop: Handle interrupts with streaming for the complete stream-resume loop pattern.

Stream chunk shapes

With subgraphs: true, chunk shape depends on whether you pass one stream mode or several: Without subgraphs, a single mode yields data directly, and multiple modes yield [mode, data].