# AI Message Branches

Chat message with a '2 / 3' version switcher after regenerating a response.

- id: `ai-message-branches`
- Page: https://agentic-ui-kit.com/components/ai-message-branches
- Live preview: https://agentic-ui-kit.com/live/component/ai-message-branches?piece=ai-message-branches

## Install

```bash
agentic-ui add ai-message-branches
npx shadcn@4.17.0 add @agentic-ui/ai-message-branches
```

## Metadata

- **Level:** block
- **Category:** block
- **Installable in:** Radix UI (registry variant new-york), Base UI (registry variant base-vega)
- **Capabilities:** message-versions, version-switcher, regenerate-response, edit-to-branch, keep-original, version-announcement, busy-state, error-state, dark-mode
- **Intents:** converse, create-edit
- **Suits domains:** ai-workspace, ai-agents, ai-content, support, saas
- **Interaction:** click, keyboard-navigation, edit-in-place
- **Screen role:** communication
- **Density:** comfortable
- **Dark mode:** yes
- **Use it for:** chat message with a '2 / 3' version switcher after regenerating a response, edit a user message and branch the conversation while keeping the original, regenerate button on an assistant answer that keeps previous answers reachable, response variants navigator with previous and next arrows
- **Avoid when:** like, dislike and copy actions on a message (use ai-feedback-actions), version history of a document or workflow (use ai-workflow-versioning or docs-version-history), comparing two answers side by side
- **Preserve when adapting:** original-stays-reachable, version-announcement, edit-focus-return
- **Replace when adapting:** regenerate-handler, author-label, versions
- **Adaptation effort:** low
- **Coupling:** low
- **Quality breakdown:** visual 9/10, responsive 9/10, accessibility 9/10, code 9/10
- **Uses primitives:** button
- **npm dependencies:** lucide-react
- **npm dependencies (registry):** lucide-react@0.577.0
- **Registry dependencies:** lib-primitives
