Chat Interface
Building conversational experiences with ragistry's chat system
Dual Interface Architecture
ragistry provides two distinct chat interfaces serving different purposes:
Internal Dashboard
Full-featured chat interface with conversation management, analytics, and advanced controls. Accessible only to authenticated team members through the dashboard at /chat.
- Conversation history and search
- Real-time analytics
- Message rating and feedback
- Export and data management
Customer Widget
Lightweight, embeddable chat widget for your website. Fully white-labeled with no ragistry branding, customizable to match your brand identity.
- Customizable colors and theme
- Minimal bundle size
- Session persistence
- Mobile responsive
Message Flow
Understanding how messages are processed through the system:
1. User Input
Messages are sent via REST API or SSE stream to the backend chat router (/api/chat/message)
2. Authentication & Validation
JWT tokens verify user identity, messages are validated and sanitized, rate limiting is applied
3. Context Retrieval
Search service retrieves relevant document chunks using vector similarity
4. LLM Processing
Chat service constructs prompt with context and conversation history, sends to LLM
5. Response Streaming
Tokens are streamed back to the client in real-time via SSE, stored in database
Session Management
ragistry maintains conversation context across multiple messages using session IDs. Each chat session is stored with its message history, allowing the LLM to reference previous exchanges.
Session ID: UUID format, stored client-side, referenced in all API callsReal-Time Features
Server-Sent Events
Streaming responses provide instant feedback as the LLM generates text, creating a natural conversational feel
Typing Indicators
Visual feedback shows when the system is processing a query or generating a response
Message Status
Track delivery, processing, and completion states for each message in the conversation
Error Handling
Graceful degradation with user-friendly error messages and retry mechanisms
API Endpoints
/api/chat/message - Send a new message
/api/chat/conversation/:id - Retrieve conversation history
/api/chat/conversations - List all user conversations