Last updated: April 2026 — The Paradigm API evolves fast. Always check the latest API reference and prefer more recent cookbook entries when available.
Overview
The Chatbot module provides a Q&A interface that answers user questions using documents stored in a dedicated workspace. It combines conversational AI with RAG (Retrieval-Augmented Generation) to provide accurate, document-based answers. Use Case: Build a chatbot that answers questions based on your company’s knowledge base (policies, FAQs, product documentation, etc.)How It Works
- User sends a message
- System builds context from conversation history
- Query is sent to the Document Search API targeting the chatbot workspace
- LLM generates answer based on relevant document content
- Conversation is stored for context in future messages
API Endpoints Used
Step-by-Step Implementation
Step 1: Initialize the Service
Step 2: Build Conversation Context
Step 3: Send Chat Message
Step 4: Manage Conversation History
Complete Usage Example
Flask Route Integration
Prerequisites
Before using this module:- Create a workspace for your chatbot documents
- Upload documents to the workspace using the Upload Session API
- Wait for embedding - documents must be fully embedded before querying
- Note the workspace_id - you’ll need it for the service configuration
Configuration
Best Practices
- Use system prompts to define the chatbot’s personality and behavior
- Store conversations persistently in production (database, Redis, etc.)
- Limit conversation history to avoid token limits (keep last 10-20 messages)
- Handle errors gracefully with user-friendly messages
- Keep documents updated in the workspace for accurate answers