/assistant-ui:assistant-uifrom assistant-ui
Overview and router for assistant-ui, a React library for building AI chat interfaces from composable primitives and a styled elements catalog. Use for architecture questions, package selection, and understanding layers.
Ships in assistant-ui. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Always consult assistant-ui.com/llms.txt for the latest API.
React library for AI chat interfaces: unstyled primitives, a styled elements catalog, a runtime that adapts any backend, and optional cloud persistence. Current line is @assistant-ui/react 0.15.x on AI SDK v7 through @assistant-ui/ai-sdk.
| Use Case | Reach for |
|---|---|
| Chat UI in an afternoon | npx assistant-ui@latest create, then the thread element |
| Full control over markup | Primitives (ThreadPrimitive, ComposerPrimitive, MessagePrimitive) |
| Existing AI backend | A runtime adapter (AI SDK, LangGraph, LangChain, ADK, A2A, AG-UI, Eve, OpenCode) or useLocalRuntime |
| Tools with UI | "use generative" toolkits, tool UI, generative UI |
| Multi-thread apps | Thread list elements plus Assistant Cloud or your own adapter |
| Copilots in an app | Instructions, context, visible components, interactables |
| Mobile or terminal | @assistant-ui/react-native, @assistant-ui/react-ink |
┌──────────────────────────────────────────────────────────────┐
│ Elements (styled, copied into components/assistant-ui/) │
│ Primitives (unstyled, @assistant-ui/react) │
└───────────────────────────┬──────────────────────────────────┘
│ read state, call actions
┌───────────────────────────▼──────────────────────────────────┐
│ aui client: useAui, useAuiState, useAuiEvent, AuiIf │
│ scopes provided by AuiConfig through AssistantRuntimeProvider│
│ or AuiProvider (@assistant-ui/store on @assistant-ui/tap) │
└───────────────────────────┬──────────────────────────────────┘
│
┌───────────────────────────▼──────────────────────────────────┐
│ Runtime: AssistantRuntime → ThreadRuntime → MessageRuntime │
│ (@assistant-ui/core, framework neutral) │
└───────────────────────────┬──────────────────────────────────┘
│
┌───────────────────────────▼──────────────────────────────────┐
│ Adapters and backends: AI SDK · LangGraph · LangChain · ADK │
│ A2A · AG-UI · Eve · OpenCode · custom · Assistant Cloud │
└──────────────────────────────────────────────────────────────┘
Vercel AI SDK?
├─ Yes → useChatRuntime from @assistant-ui/ai-sdk (recommended)
└─ No
├─ LangGraph server → useLangGraphRuntime (@assistant-ui/react-langgraph)
├─ LangChain / LangGraph useStream → useStreamRuntime (@assistant-ui/react-langchain)
├─ Google ADK → useAdkRuntime (@assistant-ui/react-google-adk)
├─ A2A protocol → useA2ARuntime (@assistant-ui/react-a2a)
├─ AG-UI protocol → useAgUiRuntime (@assistant-ui/react-ag-ui)
├─ Eve agents → useEveAgentRuntime (@assistant-ui/eve)
├─ OpenCode → useOpenCodeRuntime (@assistant-ui/react-opencode)
├─ Claude Managed Agents → useExternalStoreRuntime + useRemoteThreadListRuntime
├─ State already in Redux/Zustand/your store → useExternalStoreRuntime
├─ Custom endpoint speaking Assistant Transport → useAssistantTransportRuntime
└─ Any other custom API → useLocalRuntime with a ChatModelAdapter
| Package | Purpose |
|---|---|
@assistant-ui/react | Primitives, hooks, runtimes, provider |
@assistant-ui/ai-sdk | AI SDK v7 integration (useChatRuntime, AssistantChatTransport, AISDKToolkit, frontendTools) |
@assistant-ui/core | Framework-neutral runtime shared by React, React Native, Ink |
@assistant-ui/store | AuiConfig, AuiProvider, useAui state layer |
@assistant-ui/react-markdown | Markdown rendering (MarkdownTextPrimitive) |
assistant-stream | Streaming protocol, encoders, resumable streams |
assistant-cloud | Assistant Cloud client |
assistant-ui | The CLI (create, init, add, update, upgrade, doctor, mcp, agent) |
@assistant-ui/react-ai-sdk re-exports @assistant-ui/ai-sdk for older installs; new code imports from @assistant-ui/ai-sdk. Styled components are not a package: npx assistant-ui@latest add thread copies them into components/assistant-ui/elements/. See ./references/packages.md for the full inventory.
"use client";
import { AssistantRuntimeProvider } from "@assistant-ui/react";
import { useChatRuntime } from "@assistant-ui/ai-sdk";
import { Thread } from "@/components/assistant-ui/elements/thread.aui";
export default function Chat() {
const runtime = useChatRuntime();
return (
<AssistantRuntimeProvider runtime={runtime}>
<Thread />
</AssistantRuntimeProvider>
);
}
useChatRuntime() posts to /api/chat through AssistantChatTransport, which also forwards frontend tools and system instructions. Pass new AssistantChatTransport({ api }) to change the endpoint.
Scope accessors on aui are properties; methods on a scope keep their parentheses. Selectors return one primitive or stable reference each.
import { useAui, useAuiState, useAuiEvent } from "@assistant-ui/react";
const aui = useAui();
aui.thread.append({ role: "user", content: [{ type: "text", text: "Hi" }] });
aui.thread.cancelRun();
aui.thread.composer().send();
aui.threads.switchToNewThread();
const messages = useAuiState((s) => s.thread.messages);
const isRunning = useAuiState((s) => s.thread.isRunning);
useAuiEvent("threads.selectionChanged", ({ threadId, previousThreadId }) => {});
Tools, suggestions, interactables, MCP managers, and other scopes are declared with AuiConfig and handed to the provider; useAui() takes no arguments.
import { AssistantRuntimeProvider, AuiConfig, Suggestions, Tools } from "@assistant-ui/react";
import { useChatRuntime } from "@assistant-ui/ai-sdk";
import toolkit from "./toolkit";
const runtime = useChatRuntime();
const config = AuiConfig({
tools: Tools({ toolkit }),
suggestions: Suggestions(["What can you do?", "Summarize this page"]),
});
<AssistantRuntimeProvider runtime={runtime} config={config}>{children}</AssistantRuntimeProvider>;
Nested scopes use <AuiProvider extends={useAui()} config={config}>; an isolated root uses extends={null}.
present tool and component vocabulariesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub assistant-ui/skills --plugin assistant-ui17 skills in this plugin
/cloudAdds AssistantCloud backed persistence, authorization, and telemetry to assistant-ui apps. Use when wiring cross-session thread and message history, multi-device chat, message feedback, file uploads, or auth: passing `cloud` to `useChatRuntime` from `@assistant-ui/ai-sdk`, `AISDKThreads({ cloud })` for `AuiConfig` hosts, or `cloud` on `useLangGraphRuntime`. Covers constructing `AssistantCloud` with `authToken` (JWT), `apiKey` plus `userId`/`workspaceId` (server-side only), or `anonymous`; Clerk, Auth0, Supabase, and Firebase integrations and a backend token endpoint; the `cloud.threads`, `cloud.files`, `cloud.runs`, and `cloud.telemetry` client surface; and a custom `ThreadHistoryAdapter` on `CloudMessagePersistence`. Route here for threads that do not persist, 401s against the cloud API, or feedback buttons that do not save. For the `<ThreadList />` sidebar UI use thread-list; for the general adapter contracts use runtime./copilotsGrounds an assistant in your app with assistant-ui copilots. Use when steering behavior with useAssistantInstructions, feeding send-time app state through useAssistantContext({ getContext }), exposing components with makeAssistantVisible(Component, { clickable, editable }), giving the model two-way component state through interactables (unstable_useInteractable for app-scoped panels, unstable_interactableTool inside defineToolkit for thread-scoped artifacts, mounted via AuiConfig({ unstable_interactables: unstable_Interactables() })), registering instructions and tools with aui.modelContext.register, or bridging model context across an iframe with AssistantFrameProvider and useAssistantFrameHost. Legacy Interactables(), useAssistantInteractable, and useInteractableState are deprecated in favor of the unstable_ API. Reach for this when the assistant should read the page, click or edit UI, or update component state. For LLM tools use tools; for runtime and thread state use runtime.Other plugins' skills for the same job