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.
Render your first message
Install Ghost UI. MessageParts uses Markdown even when a message is plain text, so add its dependencies.
Load these styles once in your app entry point or root layout.
Render Answer. You should see “The project brief is ready.”
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 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 for the shared message and tool contracts.
Use Chat for the layout, Message for individual turns, and Composer for replies. Add Activity for progress and Citation for sources.
If you already have a chat interface, migrate one view 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 before upgrading.