Hi Retell Support Team,
I'm experiencing consistent failures when using the addSources API endpoint to add documents to existing knowledge bases.
Issue Summary:
The knowledgeBase.addSources() method fails with 400 or 500 errors when attempting to add knowledge_base_texts to an existing knowledge base.
SDK Version: retell-sdk v4.59.0
What Works:
Creating a NEW knowledge base with knowledge_base_texts using knowledgeBase.create() works perfectly
What Fails:
Adding texts to an EXISTING knowledge base using knowledgeBase.addSources() consistently returns errors
Code Example:
// This FAILS with 400/500 errors:
await client.knowledgeBase.addSources(existingKbId, {
knowledge_base_texts: [{
title: "document_name",
text: "Document content here...",
}],
});
// This WORKS fine:
await client.knowledgeBase.create({
knowledge_base_name: "New KB",
knowledge_base_texts: [{
title: "document_name",
text: "Document content here...",
}],
});
Error Response:
Status: 400 Bad Request or 500 Internal Server Error
No specific error message provided
Workaround:
Currently creating a new KB per document, which works but is less cost-efficient (uses more KBs than necessary).
Request:
Could you please investigate the addSources endpoint for text-based additions? This would allow us to group multiple documents into shared knowledge bases as intended.