yaremass2
12/03/2025, 3:32 PMAI Evy
12/03/2025, 3:32 PMAI Evy
12/03/2025, 3:32 PMjavascript
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%22,>
"<https://docs.retellai.com%22,>
],
knowledge_base_files: [
fs.createReadStream("../sample.txt") ,
],
}) ;
console.log(knowledgeBaseResponse.knowledge_base_id) ;
}
main() ;
Common Issues from Community
Other users have reported similar 500 errors when creating or adding to knowledge bases [(2) ]() . The issues were often resolved by:
1. Using the official Retell SDK instead of direct API calls
2. Ensuring the knowledge_base_name is properly formatted as a string
3. Using FormData with proper headers when making direct API calls
Knowledge Base Limits
Ensure you haven't exceeded the limits: at max 50 text snippets per knowledge base [(3) ]() .
If the issue persists even when using the SDK as shown above, I recommend reaching out to Retell support directly, as the 500 error suggests a backend issue that may need investigation.
**AI Evy
12/03/2025, 3:32 PMAI Evy
12/03/2025, 3:32 PM