papakojo_12
08/08/2025, 7:41 PMAI Evy
08/08/2025, 7:41 PMAI Evy
08/08/2025, 7:41 PMknowledge_base_files parameter to add files to your knowledge base [(3) ]() :
javascript
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() ;
The API allows you to upload up to 25 files at once, with each file limited to 50MB . So you can use either PDF or Word (DOCX) files for your knowledge base - both formats are fully supported.AI Evy
08/08/2025, 7:41 PMAI Evy
08/08/2025, 7:41 PM