Major Issue with KB

Hi,

We’re currently blocked from launching multiple upcoming Voice AI deployments due to a Knowledge Base (KB) issue and were hoping you could help investigate. I spoke to a Evy AI agent and it suggested this is a bug on the retell side. It asked me to reach out

There appears to be a backend issue with the /create-knowledge-base endpoint.

The endpoint is reachable and authentication is working — when no body is sent, a proper validation error is returned. Requests are being sent as multipart/form-data, exactly as documented.

However, any request that includes a valid knowledge_base_name results in a 500 Internal Server Error, even with the simplest possible payload and a single HTTPS URL. We’ve also seen reports from other users encountering the same 500 error when creating knowledge bases via the API.

Here is the exact cURL being used (API key redacted):

curl -X POST "https://api.retellai.com/create-knowledge-base" \
  -H "Authorization: Bearer key_********" \
  -F "knowledge_base_name=debug-link-test" \
  -F "enable_auto_refresh=true" \
  -F "knowledge_base_urls=https://www.askarthur.ai"

Response:

{ "status": "error", "message": "Internal Server Error" }

Could you check server logs for this request pattern and confirm whether there’s an issue with the KB creation endpoint? Happy to provide timestamps or workspace details if needed.

Additionally, it’s not only /create-knowledge-base that’s failing — the /add-knowledge-base-sources/{knowledge_base_id} endpoint also returns 500 Internal Server Error under the same conditions.

The KB listing endpoint does work:

curl -X GET "https://api.retellai.com/list-knowledge-bases" \
  -H "Authorization: Bearer key_********"

This successfully returns existing knowledge bases. However, when attempting to add a single URL source to one of those KBs, the server again returns a 500 error, even with the simplest possible multipart/form-data payload:

curl -X POST "https://api.retellai.com/add-knowledge-base-sources/knowledge_base_1259274fcd46a788" \
  -H "Authorization: Bearer key_********" \
  -F "knowledge_base_urls=https://www.google.com"

Response:

{ "status": "error", "message": "Internal Server Error" }

When an empty body is sent, a normal validation error is returned:

{ "status": "error", "message": "no knowledge base sources provided" }

So the endpoint is reachable, authentication works, and input validation is happening — the 500 error only occurs once a valid source field is included. This mirrors the failure pattern seen in /create-knowledge-base once knowledge_base_name is provided.

Given that both KB creation and KB source addition fail in the same way, this appears to be a deeper backend issue with KB source ingestion.

Based on the available sources, you’re encountering a known issue with the Knowledge Base API endpoints(1)(2)(3). Multiple users have reported the same 500 Internal Server Error when creating knowledge bases or adding sources via the API(2)(3).

The documented approach for creating a knowledge base uses the Retell SDK rather than direct cURL requests(4). Here’s the correct implementation:

import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
});
async function main() {
 const knowledgeBaseResponse = await client.knowledgeBase.addSources({
 knowledge_base_texts: [
 {
 text: "Hello, how are you?",
 title: "Sample Question",
 },
 ],
 knowledge_base_urls: [
 "https://www.retellai.com",
 "https://docs.retellai.com",
 ],
 knowledge_base_files: [
 fs.createReadStream("../sample.txt"),
 ],
 });
 console.log(knowledgeBaseResponse.knowledge_base_id);
}
main();

(4)

One community member shared a working approach using FormData with the SDK(2):

import Retell from 'retell-sdk';
import fs from 'fs';

const client = new Retell({
    apiKey: 'Key',
});

async function main() {
    try {
        const formData = new FormData();

        const fileContent = fs.readFileSync('./test.txt');
        const fileBlob = new Blob([fileContent], { type: 'text/plain' });

        formData.append('knowledge_base_name', 'KB_Name');
        formData.append('knowledge_base_files', fileBlob, 'FILE_NAME.txt');

        const response = await fetch('https://api.retellai.com/create-knowledge-base', {
            method: 'POST',
            headers: {
                'Authorization': `Bearer ${client.apiKey}`,
            },
            body: formData,
        });

        if (!response.ok) {
            const errorText = await response.text();
            console.error('Error creating knowledge base:', errorText);
            return;
        }

        const result = await response.json();
        console.log('Knowledge base created successfully:', result);

    } catch (error) {
        console.error('Error:', error);
    }
}

main();

(2)

However, the support team has acknowledged this is an ongoing backend issue(2)(3). For immediate assistance with this blocking issue, I recommend:

Hello Shival
Currently, creating Knowladge base is only possible through the SDK and the dashboard.