Skip to main content
For new applications, we recommend event streaming—the typed-projection API introduced in Deep Agents v0.6. Event streaming gives you separate iterators per projection (subagents, messages, tool calls, values) so you can consume them independently instead of branching on stream_mode chunks.
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.

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. Use namespaces to route events to the correct UI component:

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.
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.

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.

Custom updates

Use get_stream_writer inside your subagent tools to emit custom progress events:
Output

Stream multiple modes

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

Common patterns

Track subagent lifecycle

Monitor when subagents start, run, and complete:

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).
LangGraph 1.1 and later also support a unified version="v2" StreamPart dict format. See Stream output format (v2). Deep Agents examples on this page use the tuple format, which matches the LangGraph version Deep Agents currently depends on.