For complete control over retrieval — a proprietary vector database, a hybrid search system, or logic that doesn't fit a standard vector store at all — you can implement your own knowledge base server and register it as a custom-knowledge-base provider.
Step 1: Register Your Server
curl --location 'https://api.sulus.ai/knowledge-base' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"provider": "custom-knowledge-base",
"server": {
"url": "https://your-domain.com/kb/search",
"secret": "your-webhook-secret"
}
}'
Step 2: Attach via knowledgeBaseId
A custom knowledge base can only be attached to an assistant through the API, not the dashboard, and it's attached at the model level via knowledgeBaseId:
curl --location --request PATCH 'https://api.sulus.ai/assistant/YOUR_ASSISTANT_ID' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"model": {
"model": "gpt-4o",
"provider": "openai",
"messages": [
{ "role": "system", "content": "Your existing system prompt..." }
],
"knowledgeBaseId": "YOUR_KNOWLEDGE_BASE_ID"
}
}'
Important: this PATCH request replaces the entire model object. Include every existing field you want to keep, not just knowledgeBaseId, or the rest of the model configuration will be overwritten.
Step 3: Handle the Request Your Server Receives
Whenever the assistant needs to retrieve information, your endpoint receives a POST request shaped like this:
{
"message": {
"type": "knowledge-base-request",
"messages": [
{ "role": "user", "content": "What is your return policy?" }
]
}
}
Step 4: Respond in One of Two Formats
Option 1 — return documents for the assistant's model to reason over and incorporate into its own response:
{
"documents": [
{
"content": "Relevant text chunk...",
"similarity": 0.92,
"uuid": "chunk-id-123"
}
]
}
Option 2 — return a direct, pre-formed message that the assistant speaks verbatim instead of generating its own reply:
{
"message": {
"role": "assistant",
"content": "Based on our knowledge base, here is the answer..."
}
}
Response Time
Your endpoint should respond in roughly 50 milliseconds ideally, with a hard maximum of 10 seconds. Slower responses noticeably degrade conversational flow, since the assistant is waiting mid-call for your server before it can reply to the caller. Always fail gracefully (for example, returning an empty documents array) rather than letting a request time out or error.