createAgent for single-agent workflows or createDeepAgent for coordinator-worker architectures with subagents. Both stream state to the frontend via the useStream hook.
- LangChain
- Deep agents
Build frontends for agents created with
createAgent. These patterns cover everything from basic message rendering to advanced workflows like human-in-the-loop approval and time travel debugging.Architecture
Every pattern follows the same architecture: acreateAgent backend streams state to a frontend via the useStream hook.On the backend, createAgent produces a compiled LangGraph graph that exposes
a streaming API. On the frontend, the useStream hook connects to that API
and provides reactive state, including messages, tool calls, interrupts, and
history, that you render with any framework.useStream is available for React, Vue, Svelte, and Angular:
Patterns
Render messages and output
Markdown messages
Parse and render streamed markdown with proper formatting and code highlighting.
Structured output
Render typed agent responses as custom UI components instead of plain text.
Reasoning tokens
Display model thinking processes in collapsible blocks.
Generative UI
Render AI-generated user interfaces from natural language prompts using json-render.
Display agent actions
Tool calling
Show tool calls as rich, type-safe UI cards with loading and error states.
Human-in-the-loop
Pause the agent for human review with approve, reject, and edit workflows.
Manage conversations
Branching chat
Edit messages, regenerate responses, and navigate conversation branches.
Message queues
Queue multiple messages while the agent processes them sequentially.
Advanced streaming
Join & rejoin streams
Disconnect from and reconnect to running agent streams without losing progress.
Time travel
Inspect, navigate, and resume from any checkpoint in the conversation history.
Deep agent patterns
Subagent streaming
Display specialist subagents with streaming content, progress tracking, and collapsible cards.
Todo list
Track agent progress with a real-time todo list synced from agent state.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

