This is the assistant-ui starter project for LangGraph. It ships a minimal Claude-backed agent (backend/agent.ts) plus a Next.js chat UI that streams from it.
Getting Started#
-
Copy env template and fill in secrets:
cp .env.example .env.localRequired:
ANTHROPIC_API_KEY— used bybackend/agent.ts
Optional:
ANTHROPIC_MODEL— override the default model idLANGSMITH_TRACING/LANGSMITH_API_KEY/LANGSMITH_PROJECT— tracingLANGCHAIN_API_KEY— only needed when pointingLANGGRAPH_API_URLat LangGraph Platform (cloud)
-
Install deps and run both the LangGraph backend and the Next.js frontend:
pnpm install pnpm devlocalhost:2024— LangGraph dev server (serves theagentgraph)localhost:3000— Next.js app (proxies/api/*→LANGGRAPH_API_URL)
Run them individually with
pnpm dev:backendandpnpm dev:frontend.
Project layout#
app/ Next.js App Router pages + /api proxy
backend/agent.ts LangGraph graph exported as `graph`
lib/chatApi.ts LangGraph SDK client factory
langgraph.json LangGraph CLI config (graph id, node version, env file)
app/assistant.tsx builds the runtime with unstable_createLangGraphStream({ client, assistantId }) from @assistant-ui/react-langgraph.