Build rich, interactive frontends for agents created withDocumentation Index
Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-nhuses-1778700384-2b3c094.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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 — messages, tool calls, interrupts, history, and more — that you render with any framework.
useStream is available for React, Vue, Svelte, and Angular in v1 of each package:
@langchain/react, @langchain/vue, @langchain/svelte, and @langchain/angular v1 is a breaking release. The new useStream hook ships a v2-native streaming protocol that requires langgraph-api>=0.9.0rc1 on the LangGraph Agent Server. Upgrade with pip install -U "langgraph-api>=0.9.0rc1", or run a recent langgraph dev from langgraph-cli.If you’d rather not upgrade the server yet, pin your frontend package to the pre-v1 release—@langchain/react@0.3, @langchain/vue@0.4, @langchain/svelte@0.4, or @langchain/angular@0.4—which talk to the legacy streaming protocol.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.
Integrations
useStream is UI-agnostic. Use it to any component library or generative UI framework.
AI Elements
Composable shadcn/ui components for AI chat:
Conversation, Message, Tool, Reasoning.assistant-ui
Headless React framework with built-in thread management, branching, and attachment support.
OpenUI
Generative UI library for data-rich reports and dashboards using the openui-lang component DSL.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

