deadlybadd
08/11/2025, 4:40 PMAI Evy
08/11/2025, 4:40 PMAI Evy
08/11/2025, 4:41 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
async function main() {
const knowledgeBaseResponse = await client.knowledgeBase.create({
knowledge_base_name: "Sample KB",
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() ;AI Evy
08/11/2025, 4:41 PMAI Evy
08/11/2025, 4:41 PMAI Evy
08/11/2025, 4:41 PMAI Evy
08/11/2025, 4:41 PMdeadlybadd
08/11/2025, 4:56 PMdeadlybadd
08/11/2025, 4:56 PMAI Evy
08/11/2025, 4:56 PMAI Evy
08/11/2025, 4:58 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const knowledgeBaseResponse = await client.knowledgeBase.retrieve('kb_1234567890') ;
console.log(knowledgeBaseResponse.knowledge_base_id) ;
[(1) ]()
### Knowledge Base Structure Examples
The knowledge base supports multiple input types [(2) ]() :
**URL Sources**: Import content from web pages, either single pages or entire sites
**File Uploads**: Upload documents in supported formats, such as PDFs, TXT, or DOCX
**Text Input**: Add custom content directly to the Knowledge Base
### Sample Knowledge Base Response Structure
Here's what a knowledge base looks like when retrieved:
json
{
"knowledge_base_id": "knowledge_base_a456426614174000",
"knowledge_base_name": "Sample KB",
"status": "in_progress",
"knowledge_base_sources": [
{
"type": "document",
"source_id": "<string>",
"filename": "<string>",
"file_url": "<string>"
}
],
"enable_auto_refresh": true,
"last_refreshed_timestamp": 1703413636133
}AI Evy
08/11/2025, 4:58 PMAI Evy
08/11/2025, 4:58 PMAI Evy
08/11/2025, 4:58 PMdeadlybadd
08/11/2025, 4:59 PMAI Evy
08/11/2025, 4:59 PMAI Evy
08/11/2025, 4:59 PMjson
{
"global_prompt": "You are a helpful customer service agent."
}
### Configuration Location
In the conversation flow setup, you write the global prompt in Step 4 of the global settings configuration [(1) ]() . This is where you specify the agent's persona, identity, guardrails, etc .
### Example from Community Discussion
One community member mentioned using 17 pages of instructions in a single prompt agent, demonstrating that global prompts can be quite comprehensive when needed [(4) ]() .
The global prompt serves as the foundational instruction set that guides your agent's behavior across all interactions, while node-specific prompts handle particular conversation states or actions.AI Evy
08/11/2025, 4:59 PMAI Evy
08/11/2025, 4:59 PM