# Repository Briefing: assistant-ui/assistant-ui
> Source: https://repoforai.com/repo/assistant-ui/assistant-ui (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/assistant-ui/assistant-ui
- **Official Docs / Website**: https://www.assistant-ui.com
- **Category**: Chat UI & AI Apps (聊天界面与 AI 应用)
- **Primary Language**: TypeScript
- **License**: MIT
- **Engineering Health**: A+ (96/100 · Maintenance 35/35 · Adoption 21/25 · Releases 20/20 · License 20/20)
- **Deployment / Stack Signals**: CLI
- **Momentum**: 13,498 ★ total (+9 24h / +102 7d) · 1,386 forks
- **Topics**: `ai-chatbot`, `base-ui`, `chatbot`, `conversational-ai`, `copilot`, `radix-ui`, `react-chatbot`, `shadcn`, `ui-components`, `vercel-ai-sdk`
- **When to Use**: Best for: React teams building a branded assistant or copilot that needs streaming, custom message rendering, or tool approvals and already has a backend or a plan to build one. Skip if: You need a turnkey chat service that includes model execution and persistence, or your existing UI can handle a simple prompt-and-response flow without another abstraction.

## Overview
```text
### Architecture & Core Mechanics
assistant-ui is a TypeScript/React chat SDK that separates the component tree from the backend runtime. In the Vercel AI SDK integration, `useChatRuntime()` from `@assistant-ui/ai-sdk` supplies the runtime to `AssistantRuntimeProvider` from `@assistant-ui/react`, with `Thread` rendered beneath it. Applications compose `Thread`, `Message`, `Composer`, `ThreadList`, and `ActionBar` rather than adopting a fixed chat screen.

The monorepo uses a pnpm workspace, with packages under `packages/` and examples under `examples/`. Backend integrations are packaged separately: `@assistant-ui/react-langgraph` and `@assistant-ui/react-langchain` connect to their respective frameworks, `@assistant-ui/react-ag-ui` and `@assistant-ui/react-a2a` handle those protocols, and `@assistant-ui/react-data-stream` serves custom data-stream backends. A custom runtime is another option when an existing adapter does not fit.

### Key Capabilities & Differentiators
The library covers streamed messages, auto-scroll, retries, attachments, Markdown, code highlighting, voice dictation, and keyboard shortcuts, with accessibility support. Typed runtime APIs, tool schemas, and message parts provide explicit contracts for integration. Applications can render tool calls and JSON as React components, collect human approvals inline, and expose selected frontend actions to the model. The application still needs to enforce authorization wherever those actions execute.

Backend options also include Google ADK and OpenCode. Through the AI SDK, teams can access providers including OpenAI, Anthropic, Gemini, Mistral, AWS Bedrock, and Ollama; model execution is separate from the React layer. For teams that want managed thread history, telemetry, and file storage, `assistant-cloud` is a separate integration. Check which streaming, attachment, and tool behaviors the chosen backend supports before committing to a UI design.

### Trade-offs & Limitations
Compared with using the Vercel AI SDK directly, assistant-ui adds reusable chat components and an explicit runtime boundary. That pays off when a product needs thread navigation, message actions, or tool approvals. For a single, simple chat surface, a small component stack built directly on the AI SDK may be easier to maintain. Compared with a hosted widget, editable components give the team more control over interaction and styling but leave more integration work in the application.

Because the CLI copies components into the project, teams own their local edits and must review upstream component changes rather than expecting every UI fix to arrive with a package update. For each backend adapter, test stream interruption, cancellation, and tool-call handling before rollout. The MIT license permits commercial use and self-hosting subject to its notice requirements; review managed-service terms and data handling separately.

### Hardware & Deployment Guide
Use `npx assistant-ui@latest create` to scaffold a Next.js app or `npx assistant-ui@latest init` to add styled components to an existing project. For a direct Vercel AI SDK integration, install `@assistant-ui/react`, `@assistant-ui/ai-sdk`, and `ai`. The monorepo declares Node.js >=24.11; treat that as a source-workspace requirement, not an established minimum for every consuming app.

Deploy the UI as part of the React application and connect it to a reachable chat backend. Operating without external services requires local choices for inference and any storage, file, or telemetry features in use; installing the SDK alone does not provide an offline stack. The `@assistant-ui/react-opencode@0.2.37` patch makes user stops end as cancellations rather than errors. That is a useful integration test case: verify that stopping a run produces the intended state in both your backend and UI.
```

## Key Capabilities
```text
- Runtime boundary: `AssistantRuntimeProvider` passes the selected runtime to React chat components such as `Thread`.
- UI ownership: The CLI copies editable components into the application, with Base UI as the default and Radix UI as an alternative.
- Backend coverage: Dedicated adapters cover the Vercel AI SDK, LangGraph, LangChain, AG-UI, A2A, and custom data streams.
- Generative UI: Tool calls and JSON can render as React components, with inline human approval for tool actions.
- Managed services: The `assistant-cloud` integration covers thread history, telemetry, and file storage.
- Cancellation: `@assistant-ui/react-opencode@0.2.37` marks a user-stopped assistant message as cancelled rather than showing an aborted error.
```

## Quick Start / Clone
```bash
npx assistant-ui@latest create   # new project
npx assistant-ui@latest init     # add to existing project
```
