This cookbook collects runnable examples for the new streaming features across LangGraph, LangChain agents, Deep Agents, and framework-specific frontend packages.
The new streaming work moves LangGraph and LangChain from low-level stream-mode tuples toward a protocol and SDK layer designed for large, interactive agent applications.
messages, values, updates, tools, lifecycle, input, and custom:* describe reusable streaming concerns. LangChain agents, Deep Agents, framework hooks, and custom projections all build on the same event model.The cookbook tracks these preview docs pages. These APIs and docs are still in preview and may change:
TypeScript
StreamChannel, and custom transformers.Python
astream_events(..., version="v3").Client and framework SDK docs:
Streaming protocol and generated bindings:
Create one root env file for every example:
cp .env.example .env
Then fill in the provider keys listed in .env. The real .env file is ignored by git; keep .env.example as the documented template.
Each concept below has a TypeScript and/or Python package. Several UI
examples pair a Python langgraph dev backend with a TypeScript frontend,
while typescript/a2ui, typescript/openui, and the custom-backend examples
also demonstrate self-contained full-stack variants.
| Concept | TypeScript | Python |
|---|---|---|
| Terminal streaming scripts | typescript/streaming | python/streaming |
| Multimodal storybook | typescript/multimodal | python/multimodal (backend) |
| A2UI generative UI | typescript/a2ui | python/a2ui (backend) |
| OpenUI parallel dashboard | typescript/openui | — |
| React reconnect | typescript/ui-react | python/ui-react (backend) |
| Custom React backend | typescript/react-custom-backend | python/react-custom-backend (full stack) |
| Angular chat | typescript/ui-angular | python/ui-angular (backend) |
| Svelte chat | typescript/ui-svelte | python/ui-svelte (backend) |
| Vue chat | typescript/ui-vue | python/ui-vue (backend) |
| shadcn code review crew | typescript/shadcn | — |
typescript/README.mdpython/README.mdSee typescript/README.md for the workspace overview and package-by-package commands.
typescript/streaming is the fastest way to inspect the streaming primitives without a browser. It includes in-process and remote examples for protocol events, message projections, state values, custom transformers, subgraphs, interrupts, Deep Agents subagents, and A2A projections.
typescript/multimodal is a React storybook demo that turns a prompt into a three-page bedtime story. It streams story text, generated images, audio narration, and a video page from scoped graph nodes so the UI can render each page as soon as its media arrives.

typescript/a2ui demonstrates generative UI where a ReAct Agent produces A2UI v0.9 declarative interface descriptions from natural language prompts. The agent streams messages through a custom:a2ui channel; the React frontend consumes them via @langchain/react, processes them with @a2ui/web_core/MessageProcessor, and renders live surfaces with @a2ui/react.
Key concepts shown:
StreamTransformer that parses A2UI: prefixed JSON lines from LLM outputuseExtension(stream, "a2ui") hook for subscribing to custom projectionscreateSurface, updateComponents, and updateDataModel messages arriveExample prompt: "Build a team directory with contact cards" produces a complete UI with headers, stat cards, scrollable lists, and detailed profile views without writing any React component code.
See typescript/a2ui/README.md for full architecture details, system prompt explanation, and customization ideas.
typescript/openui demonstrates a Deep Agents coordinator that delegates
Stripe, PostHog, GitHub, and Calendar panels in one parallel task turn. The
React client discovers those subagents through stream.subagents, scopes
each panel with useMessages(stream, snapshot), and feeds each independent
OpenUI Lang stream into its own OpenUI renderer. This shows dynamic panel
discovery and render isolation without a custom stream transformer or manual
event demultiplexing.

The example runs with deterministic mock business data by default and supports explicitly configured live provider adapters.
typescript/ui-react shows browser reconnect and replay with the standard LangGraph dev server. Start a streamed run, refresh the page while it is still loading, and the React UI reattaches to the same thread so buffered messages catch up before live events continue.
typescript/react-custom-backend shows how to connect @langchain/react to your own Agent Protocol backend instead of langgraph dev. It serves commands, filtered SSE streams, and checkpointed thread state through a local Hono server, then renders token-by-token messages and tool lifecycle events in the React UI.

typescript/shadcn is a self-contained chat app built on the new shadcn/ui chat components and @langchain/react, backed by a createDeepAgent orchestrator. It frames a real-world workflow — automated code review: the deep agent checks a small todo-api project into a per-thread filesystem sandbox, counts the files, and fans out one specialist reviewer subagent per file so the whole codebase is reviewed in parallel. The lead engineer then writes a final overview.
Key concepts shown:
createDeepAgent that lists project files and dispatches one file-reviewer subagent per file in a single turn@langchain/react API (stream.subagents, useMessages, useToolCalls) to render a live card per reviewer and drill into each one's transcriptMessageScroller, Message, Bubble, Marker) with shimmer and scroll-fade utilities for live status
It requires ANTHROPIC_API_KEY and a running LangGraph server exposing the deep_agent_code_review assistant. See typescript/shadcn/README.md for the full component map, layout, and Vite alias details.
typescript/ui-angular, typescript/ui-svelte, and typescript/ui-vue are compact chat apps for the framework SDKs. They share the same shape: a simple LangGraph chat agent, streamed message state, loading/error handling, and optimistic user-message updates through @langchain/angular, @langchain/svelte, and @langchain/vue.

Start from the TypeScript workspace root:
cd typescript
pnpm install
Then run individual examples:
pnpm --filter @examples/streaming basic:in-process
pnpm --filter @examples/streaming subagents:remote
pnpm dev:a2ui
pnpm dev:multimodal
pnpm dev:react
pnpm dev:react-custom-backend
pnpm dev:angular
pnpm dev:svelte
pnpm dev:vue
pnpm dev:openui
pnpm dev:shadcn
See python/README.md for the package overview, uv setup, and per-example commands.
Python examples use uv per package (cd python/<example> && uv sync). They load the same root .env as the TypeScript workspace.
python/streaming mirrors typescript/streaming: in-process and remote scripts for protocol events, message projections, custom transformers, subgraphs, interrupts, Deep Agents subagents, and A2A projections.
cd python/streaming
uv sync
uv run python -m basic.in_process
uv run python -m messages.remote
python/multimodal serves the same graph wire-shape as typescript/multimodal on port 2024. Run the Python backend, then the unchanged React frontend from typescript/multimodal.
cd python/multimodal && uv sync && uv run langgraph dev --port 2024
# other terminal:
cd typescript && pnpm install && pnpm dev:multimodal
python/a2ui exposes the same custom:a2ui projection as typescript/a2ui. Point the existing React app at the Python dev server with no frontend changes.
cd python/a2ui && uv sync && uv run langgraph dev --port 2024
# other terminal:
cd typescript && pnpm install && pnpm dev:a2ui
python/ui-react serves the same reconnect demo graph as typescript/ui-react on port 2024.
cd python/ui-react && uv sync && uv run langgraph dev --port 2024
# other terminal:
cd typescript && pnpm install && pnpm dev:react
python/react-custom-backend is a self-contained Python stack: LocalThreadSession on port 9123, per-thread checkpoints and history, tool-calling agent streams, and a bundled React UI via HttpAgentServerAdapter.
cd python/react-custom-backend && uv sync && uv run python src/main.py
# other terminal:
cd python/react-custom-backend/frontend && npm install && npm run dev
See python/react-custom-backend/README.md for the Agent Protocol routes and thread model.
python/ui-angular, python/ui-svelte, and python/ui-vue each serve a minimal chat agent on port 2024. Pair them with the matching frontend in typescript/ui-*.
# Example: Svelte
cd python/ui-svelte && uv sync && uv run langgraph dev
# other terminal:
cd typescript/ui-svelte && pnpm install && pnpm dev
streamEvents(..., { version: "v3" }).client.threads.stream(...).values and output.StreamTransformer, StreamChannel, and extensions.TypeScript
64.8%
Python
21.4%
CSS
10.0%
Svelte
1.5%
Vue
1.2%
This cookbook collects runnable examples for the new streaming features across LangGraph, LangChain agents, Deep Agents, and framework-specific frontend packages.
The new streaming work moves LangGraph and LangChain from low-level stream-mode tuples toward a protocol and SDK layer designed for large, interactive agent applications.
messages, values, updates, tools, lifecycle, input, and custom:* describe reusable streaming concerns. LangChain agents, Deep Agents, framework hooks, and custom projections all build on the same event model.The cookbook tracks these preview docs pages. These APIs and docs are still in preview and may change:
TypeScript
StreamChannel, and custom transformers.Python
astream_events(..., version="v3").Client and framework SDK docs:
Streaming protocol and generated bindings:
Create one root env file for every example:
cp .env.example .env
Then fill in the provider keys listed in .env. The real .env file is ignored by git; keep .env.example as the documented template.
Each concept below has a TypeScript and/or Python package. Several UI
examples pair a Python langgraph dev backend with a TypeScript frontend,
while typescript/a2ui, typescript/openui, and the custom-backend examples
also demonstrate self-contained full-stack variants.
| Concept | TypeScript | Python |
|---|---|---|
| Terminal streaming scripts | typescript/streaming | python/streaming |
| Multimodal storybook | typescript/multimodal | python/multimodal (backend) |
| A2UI generative UI | typescript/a2ui | python/a2ui (backend) |
| OpenUI parallel dashboard | typescript/openui | — |
| React reconnect | typescript/ui-react | python/ui-react (backend) |
| Custom React backend | typescript/react-custom-backend | python/react-custom-backend (full stack) |
| Angular chat | typescript/ui-angular | python/ui-angular (backend) |
| Svelte chat | typescript/ui-svelte | python/ui-svelte (backend) |
| Vue chat | typescript/ui-vue | python/ui-vue (backend) |
| shadcn code review crew | typescript/shadcn | — |
typescript/README.mdpython/README.mdSee typescript/README.md for the workspace overview and package-by-package commands.
typescript/streaming is the fastest way to inspect the streaming primitives without a browser. It includes in-process and remote examples for protocol events, message projections, state values, custom transformers, subgraphs, interrupts, Deep Agents subagents, and A2A projections.
typescript/multimodal is a React storybook demo that turns a prompt into a three-page bedtime story. It streams story text, generated images, audio narration, and a video page from scoped graph nodes so the UI can render each page as soon as its media arrives.

typescript/a2ui demonstrates generative UI where a ReAct Agent produces A2UI v0.9 declarative interface descriptions from natural language prompts. The agent streams messages through a custom:a2ui channel; the React frontend consumes them via @langchain/react, processes them with @a2ui/web_core/MessageProcessor, and renders live surfaces with @a2ui/react.
Key concepts shown:
StreamTransformer that parses A2UI: prefixed JSON lines from LLM outputuseExtension(stream, "a2ui") hook for subscribing to custom projectionscreateSurface, updateComponents, and updateDataModel messages arriveExample prompt: "Build a team directory with contact cards" produces a complete UI with headers, stat cards, scrollable lists, and detailed profile views without writing any React component code.
See typescript/a2ui/README.md for full architecture details, system prompt explanation, and customization ideas.
typescript/openui demonstrates a Deep Agents coordinator that delegates
Stripe, PostHog, GitHub, and Calendar panels in one parallel task turn. The
React client discovers those subagents through stream.subagents, scopes
each panel with useMessages(stream, snapshot), and feeds each independent
OpenUI Lang stream into its own OpenUI renderer. This shows dynamic panel
discovery and render isolation without a custom stream transformer or manual
event demultiplexing.

The example runs with deterministic mock business data by default and supports explicitly configured live provider adapters.
typescript/ui-react shows browser reconnect and replay with the standard LangGraph dev server. Start a streamed run, refresh the page while it is still loading, and the React UI reattaches to the same thread so buffered messages catch up before live events continue.
typescript/react-custom-backend shows how to connect @langchain/react to your own Agent Protocol backend instead of langgraph dev. It serves commands, filtered SSE streams, and checkpointed thread state through a local Hono server, then renders token-by-token messages and tool lifecycle events in the React UI.

typescript/shadcn is a self-contained chat app built on the new shadcn/ui chat components and @langchain/react, backed by a createDeepAgent orchestrator. It frames a real-world workflow — automated code review: the deep agent checks a small todo-api project into a per-thread filesystem sandbox, counts the files, and fans out one specialist reviewer subagent per file so the whole codebase is reviewed in parallel. The lead engineer then writes a final overview.
Key concepts shown:
createDeepAgent that lists project files and dispatches one file-reviewer subagent per file in a single turn@langchain/react API (stream.subagents, useMessages, useToolCalls) to render a live card per reviewer and drill into each one's transcriptMessageScroller, Message, Bubble, Marker) with shimmer and scroll-fade utilities for live status
It requires ANTHROPIC_API_KEY and a running LangGraph server exposing the deep_agent_code_review assistant. See typescript/shadcn/README.md for the full component map, layout, and Vite alias details.
typescript/ui-angular, typescript/ui-svelte, and typescript/ui-vue are compact chat apps for the framework SDKs. They share the same shape: a simple LangGraph chat agent, streamed message state, loading/error handling, and optimistic user-message updates through @langchain/angular, @langchain/svelte, and @langchain/vue.

Start from the TypeScript workspace root:
cd typescript
pnpm install
Then run individual examples:
pnpm --filter @examples/streaming basic:in-process
pnpm --filter @examples/streaming subagents:remote
pnpm dev:a2ui
pnpm dev:multimodal
pnpm dev:react
pnpm dev:react-custom-backend
pnpm dev:angular
pnpm dev:svelte
pnpm dev:vue
pnpm dev:openui
pnpm dev:shadcn
See python/README.md for the package overview, uv setup, and per-example commands.
Python examples use uv per package (cd python/<example> && uv sync). They load the same root .env as the TypeScript workspace.
python/streaming mirrors typescript/streaming: in-process and remote scripts for protocol events, message projections, custom transformers, subgraphs, interrupts, Deep Agents subagents, and A2A projections.
cd python/streaming
uv sync
uv run python -m basic.in_process
uv run python -m messages.remote
python/multimodal serves the same graph wire-shape as typescript/multimodal on port 2024. Run the Python backend, then the unchanged React frontend from typescript/multimodal.
cd python/multimodal && uv sync && uv run langgraph dev --port 2024
# other terminal:
cd typescript && pnpm install && pnpm dev:multimodal
python/a2ui exposes the same custom:a2ui projection as typescript/a2ui. Point the existing React app at the Python dev server with no frontend changes.
cd python/a2ui && uv sync && uv run langgraph dev --port 2024
# other terminal:
cd typescript && pnpm install && pnpm dev:a2ui
python/ui-react serves the same reconnect demo graph as typescript/ui-react on port 2024.
cd python/ui-react && uv sync && uv run langgraph dev --port 2024
# other terminal:
cd typescript && pnpm install && pnpm dev:react
python/react-custom-backend is a self-contained Python stack: LocalThreadSession on port 9123, per-thread checkpoints and history, tool-calling agent streams, and a bundled React UI via HttpAgentServerAdapter.
cd python/react-custom-backend && uv sync && uv run python src/main.py
# other terminal:
cd python/react-custom-backend/frontend && npm install && npm run dev
See python/react-custom-backend/README.md for the Agent Protocol routes and thread model.
python/ui-angular, python/ui-svelte, and python/ui-vue each serve a minimal chat agent on port 2024. Pair them with the matching frontend in typescript/ui-*.
# Example: Svelte
cd python/ui-svelte && uv sync && uv run langgraph dev
# other terminal:
cd typescript/ui-svelte && pnpm install && pnpm dev
streamEvents(..., { version: "v3" }).client.threads.stream(...).values and output.StreamTransformer, StreamChannel, and extensions.TypeScript
64.8%
Python
21.4%
CSS
10.0%
Svelte
1.5%
Vue
1.2%