What this thread does
The problem
You want a production-feeling chat (streaming, retries, attachments, tool calls, approvals) wired to a backend such as the Vercel AI SDK or LangGraph, and you would rather not assemble every behaviour from scratch.
What the source says
The assistant-ui README (MIT) calls it a React/TypeScript library for AI chat. Setup: npx assistant-ui@latest create for a new Next.js app or npx assistant-ui@latest init to add it to an existing project, or install @assistant-ui/react @assistant-ui/ai-sdk ai yourself. The usage example wraps a Thread in AssistantRuntimeProvider with useChatRuntime(); swapping the runtime (useLangGraphRuntime, useDataStreamRuntime, or a custom one) changes the backend. The README lists streaming, auto-scroll, retries, attachments, markdown, code highlighting, voice dictation, keyboard shortcuts, accessibility, and generative UI where tool calls render as React components with inline approval.
The repo also serves a docs skill and llms-full.txt from its docs site so agents can read the current API, per its file tree.
How to describe it to the agent
Add a chat to this Next.js app using assistant-ui. Run its init command, then create a Chat component with AssistantRuntimeProvider and useChatRuntime pointing at my /api/chat route (AI SDK). Use the generated Thread component and restyle it with my existing tokens instead of rewriting it. Render theget_weathertool call as a card and require approval before thesend_emailtool runs. Read the assistant-ui docs before using its API.
Mistakes to check
- The agent rebuilds
Threadby hand instead of using the generated component and primitives. - Runtime and backend mismatch (AI SDK route with a LangGraph runtime).
- Tool UI that shows output but has no approval path.
Limits
I read the README and file list but did not run it. It is a larger dependency than a shadcn-only chat; compare it with the AI Elements and shadcn chat-rule threads.
Sources
Checked against primary sources:
- assistant-ui README and repo metadata: MIT;
npx assistant-ui@latest createandinit;useChatRuntimefrom@assistant-ui/ai-sdkwith the Vercel AI SDK; swap foruseLangGraphRuntime,useDataStreamRuntimeor a custom runtime; the feature list (streaming, auto-scroll, retries, attachments, markdown, code highlighting, voice dictation, keyboard shortcuts, accessibility) and generative UI with inline human approvals all match.
Not checked here: the docs skill and llms-full.txt claim (file tree not re-read), the manual three-package install line, and the sample prompt (our own). Nothing was run.
Started from a post by @assistant-ui maintainers, packaged by the editor. Original post