stream_events(..., version="v3"). Event Streaming returns a run object with typed projections, so each projection can be consumed independently instead of parsing stream-mode tuples.
What you can stream
stream.messages yields message streams. Each message stream exposes .text, .reasoning, .toolCalls, .output, and .usage. Async projections can be iterated for live deltas or awaited for final values.
Agent messages
Usestream.messages when you want model output from each LLM call.
message.output gives you the finalized AI message, including provider-specific content blocks. In TypeScript, use message.usage when you only need token counts or other usage metadata; in Python, read usage from message.output.usage_metadata.
Reasoning content
Reasoning content uses the same shape as text content, but it is available only when the selected model emits reasoning blocks.Tool calls
There are two useful tool-call projections:message.tool_callsstreams tool-call argument chunks while the model is producing the tool call.stream.tool_callsstreams the lifecycle of tool execution after the tool call starts.
Streaming sub-agents
When acreateAgent call invokes another named createAgent (via a wrapping tool, typically), the inner agent’s events flow at a nested namespace. The name you pass to createAgent identifies that inner agent in the stream, so you can filter and label per agent.
Named sub-agents surface on the dedicated stream.subagents projection. Each handle exposes the inner agent’s own .messages, .toolCalls, and .output, plus .name (the name= you passed), .cause (the tool call that dispatched the sub-agent), and nested .subagents. Because only named createAgent runs appear here, you don’t need to filter plain subgraphs out.
StateGraph subgraphs invoked from a tool also surface on stream.subgraphs — set name= on .compile(name=...) to get a label in subagent.graph_name.
stream.subagents is the focused view of named createAgent sub-agents, while stream.subgraphs covers every nested graph. Use whichever matches your UI.
State and final output
Usestream.values for state snapshots and stream.output for the final agent state.
Multiple projections
Use concurrent consumers when you want multiple projections in JavaScript:Custom updates
Use custom stream transformers when your application needs a projection that is not built in, such as retrieval progress, artifacts, or domain-specific events.Register transformers on middleware
Middleware-registered transformers require
langchain@1.4.3 or later.streamTransformers to createMiddleware as a tuple of factories. Each factory has the shape () => StreamTransformer<any> (zero arguments) and is invoked once per scope. Returning a fresh transformer per call keeps each subgraph isolated.
createAgent merges middleware-registered factories with anything passed to its own streamTransformers option. The final order on the compiled graph is:
- The built-in
ToolCallTransformer. - Middleware-registered factories, in middleware order.
- Caller-supplied
streamTransformersfromcreateAgent.
Related
- Streaming covers low-level Pregel stream modes.
- Build your own projection covers writing application-specific projections.
- Frontend streaming patterns shows UI use cases built on streamed state.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

