Skip to main content
This page covers streaming concerns specific to Deep Agents—most importantly, streaming from delegated subagents via stream.subagents. For general agent streaming (stream.messages, stream.values, tool calls, custom updates), see LangChain Event Streaming.

Stream subagents

Deep Agents add a subagent projection on top of LangGraph streaming. Use stream.subagents when you want one stream handle per delegated task call. The projection is lightweight: it discovers subagent tasks first, and message, tool-call, and value streams are opened only when you access them on a subagent handle. Each handle’s name is the sub-agent’s configured name: the subagent_type the coordinator passes when it calls the task tool. Deep Agents binds that name to the delegated run, so the same label you defined in your subagent specs is what you filter and route on in the stream.

Subagent stream fields

Each subagent stream exposes the same kinds of projections as the parent run, such as messages, tool calls, nested subagents, and final output. For the general parent-run streaming model, see LangChain Event Streaming. Python uses snake_case projection names such as tool_calls. Each subagent stream can expose .messages, .tool_calls, .values, .subagents, and .output.

Track subagent lifecycle

Use stream.subagents when you only need to show which subagents started and finished. You do not need to subscribe to message or value streams unless you access those projections on an individual subagent.

Stream messages

Deep Agents can emit messages from the coordinator agent and from delegated subagents. Use stream.messages for top-level messages and subagent.messages for each delegated subagent.

Stream tool calls

Deep Agents expose tool calls at each level of the agent tree. Use the top-level stream.tool_calls for coordinator tools and each subagent.tool_calls for delegated work.

Stream nested work

You can recurse into a subagent stream to observe nested subagents, messages, and tool calls.

Consume concurrently

Coordinator and subagent output often interleave. Consume projections concurrently when you need live UI updates. For concurrent consumption in async code, use astream_events with asyncio.gather:
For synchronous code, use stream.interleave(...) instead:
When you need exact arrival order across the coordinator and all subagents, iterate raw protocol events and use namespace to identify the source:

Subagents versus subgraphs

stream.subgraphs shows graph execution structure. stream.subagents shows product-level Deep Agents task delegations. Use stream.subagents for user-facing UI because it hides internal graph nodes and exposes the subagent concept directly.