Logo
Search
API Docs

Knowledge Base

Knowledge Base

Knowledge Base: Setup and Configuration

Overview

Sulus's Knowledge Base feature allows you to integrate custom information into your AI assistants, enabling them to provide more accurate and domain-specific responses based on your own data.


What is a Knowledge Base?

A Knowledge Base is a collection of custom files containing information on specific topics or domains. By attaching a Knowledge Base to your assistant, you gain several benefits:

  • Improved accuracy: Responses are based on your verified information rather than general knowledge
  • Enhanced capabilities: Enables answers to complex domain-specific queries
  • Customization: Tailor responses to specific domains or use cases
  • Up-to-date information: You control the content and can update it anytime

How to Create a Knowledge Base

There are two main approaches:

Method 1: Using the Dashboard

  1. Navigate to Build > Files in your Sulus dashboard and upload your files (.txt, .pdf, .docx, .csv, .md, .json, .xml, and more are supported)
  2. Navigate to Build > Assistant, select your assistant, and associate the uploaded files in the "Files" or "Knowledge Base" section
  3. Add a system prompt instructing the assistant when to use the knowledge base, then click Publish

When you publish an assistant with selected files, Sulus automatically creates a query tool with those files configured as a knowledge base.

Method 2: Using the Query Tool API

For more advanced configurations, you can use the API to create a Query Tool:

Step 1: Upload your files

curl --location 'https://api.sulus.ai/file' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--form 'file=@"<PATH_TO_YOUR_FILE>"'

Step 2: Create a query tool with your file IDs

curl --location 'https://api.sulus.ai/tool/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data '{
    "type": "query",
    "function": {
        "name": "product-query"
    },
    "knowledgeBases": [
        {
            "provider": "google",
            "name": "product-kb",
            "description": "Contains comprehensive product information, service details, and company offerings",
            "fileIds": ["<FILE_ID_1>", "<FILE_ID_2>"]
        }
    ]
}'

Step 3: Attach the tool to your assistant and update the system prompt to explicitly instruct when to use the tool by name.

Method 3: Custom Knowledge Base

For full control over document retrieval, you can implement your own knowledge base server. Sulus forwards search requests to your custom endpoint via a webhook-style integration.

curl --location 'https://api.sulus.ai/knowledge-base' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_CORE_SYSTEM_API_KEY' \
--data '{
    "provider": "custom-knowledge-base",
    "server": {
        "url": "https://your-domain.com/kb/search",
        "secret": "your-webhook-secret"
    }
}'

Custom knowledge bases can only be attached to assistants via the API, not through the dashboard.


Best Practices

  • Optimize file size: Keep individual files smaller than 300KB for quick processing
  • Structure content logically: Use clear headings and organize by topic
  • Use clear language: Plain language with well-defined terminology improves retrieval accuracy
  • Update regularly: Refresh files whenever information changes
  • Test thoroughly: Test with various queries after configuration
  • Include system prompt instructions: Always explicitly instruct your assistant when to use the query tool by name

In summary, Sulus's Knowledge Base supports both a simple dashboard-based setup and advanced API-driven configurations, including fully custom retrieval servers. Choose the approach that best fits your use case and level of control needed.