# AI interfaces

Render a conversation from your own data or connect the chat SDK you already use.

For a complete conversation UI, see [Build an AI chat interface](/articles/building-ai-chat).

## Render your first message

Install [Ghost UI](/docs/installation#package). MessageParts uses Markdown even when a message is plain text, so add its dependencies.

```bash
npm install react-markdown@10.1.0 remark-gfm@4.0.1 react-syntax-highlighter@16.1.1
```

Load these styles once in your app entry point or root layout.

```tsx
import "@collectivecreation/ghost-ui/styles.css";
import "@collectivecreation/ghost-ui/conversation.css";
```

Render Answer. You should see “The project brief is ready.”

```tsx
import type { ChatMessage } from "@collectivecreation/ghost-ui/chat-model";
import { Message, MessageBody } from "@collectivecreation/ghost-ui/components/message";
import { MessageParts } from "@collectivecreation/ghost-ui/components/message-parts";
const messages: ChatMessage[] = [{ id: "answer-1", actor: "assistant", parts: [
  { type: "text", id: "text-1", text: "The project brief is ready." },
] }];
export function Answer() {
  return <div>{messages.map(message =>
    <Message key={message.id} actor={message.actor} aria-label={message.actor}><MessageBody>
      <MessageParts parts={message.parts} />
    </MessageBody></Message>)}</div>;
}

```

Pass messages from your store or API in display order. Keep message and part IDs stable as streamed content changes. Message passes the actor to its nested views so they render the right presentation.

## Choose the imports you need

Use the React components with messages from your app or an SDK. Your app chooses the model and transport, stores conversations, and runs tools.

| Entry | Use |
| --- | --- |
| @collectivecreation/ghost-ui/chat-runtime | Neutral runtime contracts, guarded commands and external-store bridge. |
| @collectivecreation/ghost-ui/chat-runtime-react | Optional native-hook, context and store bindings. |
| @collectivecreation/ghost-ui/chat-model | Type-only ChatMessage, ChatPart, controllers and related records; no runtime imports. |
| @collectivecreation/ghost-ui/components/message-parts | Render ordered parts, with custom renderer escape routes. |
| @collectivecreation/ghost-ui/components/message | Compose a message surface around caller-owned content. |
| @collectivecreation/ghost-ui/conversation | Broad convenience entry for conversation components, views and types. |
| @collectivecreation/ghost-ui/chat-adapter-tanstack | Normalize TanStack snapshots and bind caller commands. |
| @collectivecreation/ghost-ui/chat-adapter-ai-sdk | Normalize Vercel AI SDK snapshots and bind caller commands. |
| @collectivecreation/ghost-ui/chat-normalizers | Pure native format projections; no React or SDK imports. |
| @collectivecreation/ghost-ui/chat-adapter-langchain / chat-adapter-eve | Optional native React hook bindings. |
| @collectivecreation/ghost-ui/chat-adapter-ag-ui | Subscribe to an existing AG-UI client without another message store. |

## Connect a chat runtime

Use [Choose an AI runtime](/libraries/ai-runtimes) to find the recipe for your SDK or protocol. Keep the SDK’s store and commands, and pass its messages to Ghost. See [Data and commands](/libraries/ai-contracts) for the shared message and tool contracts.

Use [Chat](/ai-elements/chat) for the layout, [Message](/ai-elements/message) for individual turns, and [Composer](/ai-elements/composer) for replies. Add [Activity](/ai-elements/activity#patterns) for progress and [Citation](/ai-elements/citation) for sources.

If you already have a chat interface, [migrate one view](/libraries/ai-migration) while keeping your current message store and transport.

## When to use these views

Use these views when your app already owns the conversation or you want to compose parts of the interface yourself. For an SDK integration, check the [tested versions](/libraries/ai-stability#versions) before upgrading.
