@nexo-labs/chat-agent
v1.15.0
Published
Floating chat agent component for React applications with AI integration
Maintainers
Readme
@nexo-labs/chat-agent
Floating chat agent component for React applications with AI integration. Built on @assistant-ui/react.
Installation
pnpm add @nexo-labs/chat-agentUsage
import { FloatingChatManager, ChatProvider, NexoPayloadChatAdapter } from '@nexo-labs/chat-agent'
import '@nexo-labs/chat-agent/styles.css'
const adapter = new NexoPayloadChatAdapter({ baseUrl: '/api/chat' })
function App() {
return (
<ChatProvider adapter={adapter}>
<FloatingChatManager />
</ChatProvider>
)
}Exports
Main (.)
FloatingChatManager- Floating chat widget componentChatProvider/useChat- React context for chat stateuseAssistantRuntime- Hook for assistant runtime adapterNexoPayloadChatAdapter- Payload CMS adapter with RAG supportMockAdapter- Mock adapter for testingThread,Composer,AssistantMessage,UserMessage,MarkdownText- Pre-built UI components
Styles (./styles.css)
Tailwind CSS stylesheet. Import it in your app's entry point.
Features
- Adapter-based architecture for pluggable chat backends
- Payload CMS integration with RAG-enabled document search
- Pre-built UI components with markdown rendering and source citations
- Floating chat widget with chat history and session management
- Fully typed with TypeScript
Peer Dependencies
react^19.0.0react-dom^19.0.0
License
MIT
