e30e75b5d4
Changesets / Create Version PR (push) Waiting to run
Code Quality / Oxlint + Oxfmt (push) Waiting to run
Code Quality / Template Sync (push) Waiting to run
Code Quality / Build Changed Packages (push) Waiting to run
Code Quality / Test Changed Packages (push) Waiting to run
Deploy Expo Example / Deploy Production (push) Waiting to run
Deploy Ink Example / Deploy Production (push) Waiting to run
Python Tests / pytest (assistant-stream, 3.10) (push) Waiting to run
Python Tests / pytest (assistant-stream, 3.12) (push) Waiting to run
Python Tests / pytest (assistant-ui-sync-server-api, 3.10) (push) Waiting to run
Python Tests / pytest (assistant-ui-sync-server-api, 3.12) (push) Waiting to run
Deploy Shadcn Registry / Deploy Production (push) Waiting to run
Template Metrics / LOC + Bundle Size (push) Waiting to run
LangChain useStream Example
Demonstrates @assistant-ui/react-langchain, which wraps useStream from @langchain/react and exposes it as an assistant-ui runtime.
assistant-ui also ships
@assistant-ui/react-langgraph, which integrates with@langchain/langgraph-sdkdirectly and currently has a broader feature set. Pick the adapter that matches your upstream choice. See the comparison.
Quick Start
pnpm install
Environment Variables
Create .env.local:
NEXT_PUBLIC_LANGGRAPH_API_URL=http://localhost:2024
NEXT_PUBLIC_LANGGRAPH_ASSISTANT_ID=your_graph_id
Start a local LangGraph server via LangGraph Studio pointing at your graph, or use LangSmith for a hosted deployment.
Run
pnpm dev
Open http://localhost:3000.
Key Features
useStreamRuntime— thin wrapper arounduseStreamfrom@langchain/react.useLangChainState<T>(key)— reads arbitrary custom state keys (demo usesstate.todosinTodosPanel).- No hand-written stream generator, no
create/load/getCheckpointIdglue.
Files of interest
app/MyRuntimeProvider.tsx— entire runtime setup in ~15 lines.components/TodosPanel.tsx— demonstratesuseLangChainState<Todo[]>("todos", []).