Skip to main content
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.
You can also send context to the chatbot using a backend prompt. For example adding variables from your datalake to add context about the user using the chatbot.
Use Case: Build a chatbot that answers questions based on your company’s knowledge base (policies, FAQs, product documentation, etc.)
Note: The examples in this documentation use a local Flask web server. Be aware of this if you want to deploy to production. This example was created using an HTML frontend that sends the variables to the backend.

How It Works

  1. User sends a message
  2. System builds context from conversation history
  3. Query is sent to the Document Search API targeting the chatbot workspace
  4. LLM generates answer based on relevant document content
  5. 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:
  1. Create a workspace for your chatbot documents
  2. Upload documents to the workspace using the Upload Session API
  3. Wait for embedding - documents must be fully embedded before querying
  4. Note the workspace_id - you’ll need it for the service configuration

Configuration

Best Practices

  1. Use system prompts to define the chatbot’s personality and behavior
  2. Store conversations persistently in production (database, Redis, etc.)
  3. Limit conversation history to avoid token limits (keep last 10-20 messages)
  4. Handle errors gracefully with user-friendly messages
  5. Keep documents updated in the workspace for accurate answers