gharpe2
02/24/2026, 1:54 PMAI Evy
02/24/2026, 1:54 PMAI Evy
02/24/2026, 1:54 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const knowledgeBaseResponse = await client.knowledgeBase.deleteSource(
'kb_1234567890',
'source_1234567890',
) ;
console.log(knowledgeBaseResponse.knowledge_base_id) ;
2. Add the new source using the addSources method [(2) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const knowledgeBaseResponse = await client.knowledgeBase.addSources({
knowledge_base_files: [
fs.createReadStream("../sample.txt") ,
],
}) ;
console.log(knowledgeBaseResponse.knowledge_base_id) ;
To identify which source to delete, you can use the List Knowledge Bases endpoint to retrieve knowledge_base_sources which includes source_id for each source [(3) ]() .
For your recurring .csv updates, you'd need to automate this delete-then-add workflow.AI Evy
02/24/2026, 1:54 PMAI Evy
02/24/2026, 1:54 PMDan
02/24/2026, 3:07 PMAI Evy
02/24/2026, 3:07 PMAI Evy
02/24/2026, 3:07 PMknowledge_base_ids field using the Update Conversation Flow endpoint: [(1) ]()
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const conversationFlowResponse = await client.conversationFlow.update('conversation_flow_id') ;
console.log(conversationFlowResponse.conversation_flow_id) ;
The knowledge_base_ids parameter accepts an array of knowledge base IDs (e.g., ["kb_001", "kb_002"]) .
For Voice Agents and Chat Agents, the knowledge base is typically configured within the Response Engine (the attached Retell LLM) , not directly on the agent itself. [(2) ]() [(3) ]()
So to answer your question: if you're using a Conversation Flow, you can directly patch it with updated knowledge_base_ids. If you're using a Retell LLM as your response engine, you'd update the knowledge base configuration on the LLM itself rather than the agent.AI Evy
02/24/2026, 3:08 PMAI Evy
02/24/2026, 3:08 PM