Documentation Index
Fetch the complete documentation index at: https://docs.retellai.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Knowledge base are a collection of sources of information that your agent can access to retrieve relevant information during the call, that can provide additional context to the conversation. It can greatly improve the quality of the responses and the overall experience, especially in cases where there are a lot of information available (too long for putting in prompt), but having the information is essential for the agent to respond correctly. This feature quite useful for use cases like support, helpdesk, FAQ, etc. Supported sources:- Website content (via URLs)
- Documents (supported formats: .bmp, .csv, .doc, .docx, .eml, .epub, .heic, .html, .jpeg, .png, .md, .msg, .odt, .org, .p7s, .pdf, .png, .ppt, .pptx, .rst, .rtf, .tiff, .txt, .tsv, .xls, .xlsx, .xml)
- Custom text snippets
How it works
You can create knowledge bases, and link them to your agents. When a knowledge base is linked to an agent, the agent will always try to retrieve information from the knowledge base before responding. There’s no need to change your prompt for it to trigger, as it will be done automatically, for every response generation. During the creation of knowledge bases, it will chunk the source, embed them and store into a vector database. During the call, when the agent is about to respond, it will use the transcript so far (prompt is not included) to find the most relevant chunks from the knowledge base, and feed them to the LLM as context.Auto-refreshing and auto-crawling
You can enable auto-refreshing and/or auto-crawling for URL sources in your knowledge base.- Auto-refreshing: When enabled, the system re-fetches all URLs in the knowledge base every 24 hours to ensure the latest content is reflected.
- Auto-crawling: You can enable this feature for specific URL paths. The system will automatically crawl all pages under each path every 24 hours, excluding any URLs you’ve added to the exclusion list. All pages found—except those explicitly excluded—will be stored.
Limits
Each knowledge base has the following limits:- URL: at max 500 urls.
- Auto-Crawling URL Paths: at max 200 exclusion urls for each auto-crawling path, and at max 500 exclusion URLs per knowledge base.
- Text: at max 50 text snippets
- File: at max 25 files, with each file at max 50MB. For CSV, TSV, XLS, and XLSX, the row limit is 1000 rows and the column limit is 50 columns.
Best Practices
- Prefer
.md(Markdown) files over.txt. Well-structured Markdown is chunked and retrieved more accurately.- Use clear, descriptive headings and keep each
##section focused and reasonably short. If a##becomes long, split it into multiple##/###sections. - Write short paragraphs and lists to separate concepts; avoid walls of text.
- For tabular or image-heavy content, retrieval may be less reliable; consider adding explanatory text so related information stays in the same chunk.
- Use clear, descriptive headings and keep each
- Group related information within the same section so chunks remain cohesive and relevant.
- Avoid ambiguity and use specificity in references. Include names, dates, units, and avoid ambiguous pronouns like
itorthis, because prior chunks may not be present. - Use more granular paths for auto-crawling instead of broad paths with many exclusion URLs. This improves crawl performance and helps avoid hitting the exclusion URL limits.
- Use the knowledge base to supply supporting information, not agent instructions or prompts. Put instructions in the agent’s prompt.
Use Knowledge Base
Access Knowledge Base Settings
- Navigate to your dashboard
- Select the “Knowledge Base” tab
- Click the “Add” button in the top-right corner

Create Knowledge Base Items
-
URL: Import content from web pages
- Supports single pages or entire websites
- Automatically updates when content changes
-
File: Upload documents
- Supported formats: PDF, TXT, DOCX, etc.
- Maximum file size: 50MB
-
Text: Add custom content
- Paste or type direct information
- Ideal for specific instructions or data

Enable auto-crawling



Verify Added Items
- View all added items
- Edit existing items
- Delete items when no longer needed

Connect to Your Agent
- Open the agent editor
- Locate the “Knowledge Base” section
- Select the knowledge base items you want to use

Configure KB Settings
- Chunks to retrieve: The max number of chunks to retrieve from the KB, range 1-10. Default: 3.
- Similarity Threshold: Adjust how strict the system is when matching chunks to the context. A higher setting gives you fewer, but more similar, matches. Default: 0.6.

Setup Node Level Knowledge Base
- Open the agent editor
- Click the Conversation Node or Subagent Node you want to configure.
- Similar to agent level knowledge base config above, you can select and add the knowledge base items you want to use.

FAQ
Do I need to change my prompt to use knowledge base?
Do I need to change my prompt to use knowledge base?
How can I prevent the LLM from generating information not found in the knowledge base?
How can I prevent the LLM from generating information not found in the knowledge base?
The agent response is not correct, what should I do?
The agent response is not correct, what should I do?
Will this add a long latency to the call?
Will this add a long latency to the call?
Is there a way to check what's getting retrieved from the knowledge base?
Is there a way to check what's getting retrieved from the knowledge base?
Will the knowledge base name influence the retrieval?
Will the knowledge base name influence the retrieval?
Pricing
- Knowledge base creation:
- First 10 knowledge bases are free.
- Additional ones are billed at $8 / month per knowledge base.
- Using knowledge base:
- $0.005 per minute of calls that have knowledge base enabled.
- it does not matter if your agent is using 1 or many knowledge bases, the billing is the same.