https://retellai.com/?utm_source=discord&utm_medium=seo logo
My agent is missing key information from the knowl...
# ❓・ai-evy-support
a
My agent is missing key information from the knowledge base when being asked various questions. Is there any way to fix it/improve it? @AI Evy
a
Thanks for tagging me @anton333_50203. I'll look through relevant sources and get back to you shortly.
### Answer \There are several ways to improve your agent's knowledge base retrieval: [(1) ]() Adjust Retrieval Settings: You can configure how many chunks are retrieved via "Adjust KB Retrieval Chunks and Similarity" : - **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 (higher = fewer but more similar matches, default: 0.6) Increasing "Chunks to retrieve" gives the LLM more context, but also increases prompt length and can interfere with generation quality . For most cases, the recommended settings are 3 chunks and a 0.60 similarity threshold . Optimize Your Source Format: Prefer
.md
(Markdown) files over
.txt
as well-structured Markdown is chunked and retrieved more accurately : - Use clear, descriptive headings and keep each section focused and reasonably short - Write short paragraphs and lists to separate concepts; avoid walls of text - Group related information within the same section so chunks remain cohesive and relevant - Use specificity in references - include names, dates, units, and avoid ambiguous pronouns like
it
or
this
Ensure Agent is Published: Make sure you've published your agent after making knowledge base changes [(2) ]() . The publish button is in the top right of the agent editor . Add Prompt Instructions: If you want to prevent the LLM from generating information not found in the knowledge base, you can add this to your agent prompt [(1) ]() :
Copy code
Only answer using the information in ## Related Knowledge Base Contexts.
If ## Related Knowledge Base Contexts is missing or does not contain relevant information, respond:
"There is no related information in knowledge base."
**
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[2] Inbound Calls Not Accessing Knowledge Base (Urgent)](https://discord.com/channels/1186424376300679209/1440295109286428713) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
So agent's node and global prompts should also be written in a Markdown style? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer No, the recommendation to use Markdown format applies specifically to knowledge base source files, not to your agent prompts [(1) ]() . For knowledge base files,
.md
(Markdown) files are preferred over
.txt
because well-structured Markdown is chunked and retrieved more accurately . For agent prompts (both global prompts and node instructions) , the Prompt Engineering Guide recommends using a sectional structure with clear delimiters like
///##
to organize different parts of your prompt [(2) ]() . This structured approach helps with organization, reusability, and LLM comprehension . The recommended prompt structure uses sections like : -
///## Identity
-
///## Style Guardrails
-
///## Response Guidelines
-
///## Task Instructions
This sectional format is different from Markdown - it's a way to organize your prompt text for better LLM processing .
​ To learn more, see the sources I considered: [[1] Function Node Overview](https://docs.retellai.com/build/conversation-flow/function-node) [[2] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
I have been using style like this [IDENTYTY], [ROLE] for headings @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer ### Answer Your
[IDENTITY]
,
[ROLE]
heading style can work, but Retell AI's documentation specifically recommends using
///##
as section delimiters for better LLM comprehension [(1) ]() [(2) ]() . The recommended format is :
Copy code
///## Identity
You are a friendly AI assistant for [Company Name].
Your role is to [specific purpose].

///## Style Guardrails
Be concise: Keep responses under 2 sentences unless explaining complex topics.
Be conversational: Use natural language, contractions, and acknowledge what the caller says.

///## Response Guidelines
Return dates in spoken form: Say "January fifteenth" not "1/15".
Ask one question at a time: Avoid overwhelming the caller with multiple questions.

///## Task Instructions
[Specific steps the agent should follow]
This sectional approach with
///##
delimiters offers several benefits [(1) ]() : - **Reusability**: Sections can be adapted across different agents - **Maintainability**: Easy to update specific behaviors without affecting others - **Clarity**: LLMs process structured information more accurately While your
[IDENTITY]
,
[ROLE]
format provides structure, switching to the
///##
delimiter style aligns with Retell AI's tested best practices and may improve your agent's reliability [(1) ]() [(2) ]() . **
​ To learn more, see the sources I considered: [[1] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) [[2] Write a single prompt](https://docs.retellai.com/build/single-multi-prompt/write-single-prompt) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
"///##" + ALL CAPS? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer ### Answer Based on the examples in Retell AI's documentation, the section headings use
///##
followed by a space and then title case (first letter capitalized) , not all caps [(1) ]() [(2) ]() . The documented format shows [(1) ]() :
Copy code
///## Identity
You are a friendly AI assistant for [Company Name].

///## Style Guardrails
Be concise: Keep responses under 2 sentences unless explaining complex topics.

///## Response Guidelines
Return dates in spoken form: Say "January fifteenth" not "1/15".

///## Task Instructions
[Specific steps the agent should follow]
Another example from the documentation uses [(2) ]() :
Copy code
///## Identify
You are a friendly AI assistant for Retell AI. ....

///## Style Guardrails
Be concise: ...

///## Response Guideline
Return dates in their spoken forms: ...

///## Task
1. Greet the user
...
So the format is
///##
+ space + Title Case (like "Identity", "Task", "Style Guardrails") , not all caps [(1) ]() [(2) ]() . ​ Sources: [(1) ]() , [(2) ]()
​ To learn more, see the sources I considered: [[1] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) [[2] Write a single prompt](https://docs.retellai.com/build/single-multi-prompt/write-single-prompt) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
That is for both Global and Node prompts, right? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer Yes, the
///##
section delimiter format applies to both Global Prompts and Node Prompts in conversation flow agents [(1) ]() . The documentation shows that the Global Prompt field is where you "specify the agent's persona, identity, guardrails, etc." and this text "will be available in every node" . The structured format with
///##
delimiters helps organize this information effectively. For node-level prompts (node instructions) , the same structured approach with clear section delimiters is recommended for consistency and LLM comprehension. In conversation flow, each node has an instruction field where you can define specific prompts for that step [(2) ]() . According to a community discussion, when both are present, Node Prompts take precedence over the Global Prompt . The best practice is to use the Global Prompt for tone, identity, and general rules, while using Node Prompts for specific actions or logic per step . So yes, you can use the
///##
Title Case format in both your Global Prompt and individual Node instructions for consistent, well-structured prompts throughout your conversation flow agent. **
​ To learn more, see the sources I considered: [[1] Step 2: Configure the basic settings](https://docs.retellai.com/build/single-multi-prompt/configure-basic-settings) [[2] Which takes precedence: The Global Prompt OR Nodes?](https://discord.com/channels/1186424376300679209/1400673644065325149) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
The agent still stubbornly refuses to see "Pricing Policy" section, even when the node prompt has these instructions: "2. IF "price_mentioned" == "false", you must inform the user about the pricing of the services using " Pricing Policy" section in the Knowledge Base. - Mention evening/weekend rates only if their preferred time falls in those periods; mention VAT only if applicable to this booking." @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer Based on the available sources, here are several approaches to fix the "Pricing Policy" retrieval issue: 1. Use Node-Level Knowledge Base For Conversation Flow agents, you can configure a knowledge base at the node level for more accurate context retrieval [(1) ]() [(2) ]() . This allows the agent to focus on specific information relevant to that conversation step: - Open the agent editor - Click the Conversation Node where pricing should be mentioned - Select and add the knowledge base items containing your "Pricing Policy" section [(1) ]() Node-level knowledge bases are combined with the global knowledge base to provide more accurate context for specific topics [(1) ]() [(2) ]() . 2. Adjust Retrieval Settings Configure the KB retrieval parameters via "Adjust KB Retrieval Chunks and Similarity" [(1) ]() : - **Chunks to retrieve**: Increase from the default of 3 to a higher number (range 1-10) to retrieve more context - **Similarity Threshold**: Lower from the default 0.6 if you're getting too few matches, or raise it if you're getting irrelevant chunks Note that increasing chunks gives the LLM more context but also increases prompt length, which can interfere with generation quality . 3. Add Explicit Prompt Instructions Add this instruction to your agent prompt to force the LLM to only use knowledge base information :
Copy code
Only answer using the information in ## Related Knowledge Base Contexts.
If ## Related Knowledge Base Contexts is missing or does not contain relevant information, respond:
"There is no related information in knowledge base."
4. Optimize Your Knowledge Base Source Format Ensure your "Pricing Policy" section follows best practices : - Use
.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 - Write short paragraphs and lists to separate concepts; avoid walls of text - Group related pricing information within the same section so chunks remain cohesive - Use specificity - include exact prices, dates, and avoid ambiguous pronouns like "it" or "this" 5. Verify Agent is Published Make sure you've published your agent after making knowledge base changes - the publish button is in the top right of the agent editor [(3) ]() . Try implementing node-level KB first (if using Conversation Flow) , as this targets the exact information needed at that specific conversation step [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[2] Node KB, Role-Based Access, Outbound SMS API & More](https://www.retellai.com/changelog/node-kb-role-based-access-outbound-sms-api-more) [[3] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
I am using multi-prompt agent @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer Based on the available sources, for multi-prompt agents, here are the approaches to improve knowledge base retrieval for your "Pricing Policy" section: 1. Adjust Knowledge Base Retrieval Settings Configure the KB retrieval parameters via "Adjust KB Retrieval Chunks and Similarity" [(1) ]() : - **Chunks to retrieve**: Increase from the default of 3 to a higher number (range 1-10) to retrieve more context - **Similarity Threshold**: Lower from the default 0.6 if you're getting too few matches, or raise it if you're getting irrelevant chunks Note that increasing chunks gives the LLM more context but also increases prompt length, which can interfere with generation quality . 2. Add Explicit Prompt Instructions Add this instruction to your state prompt to force the LLM to only use knowledge base information :
Copy code
Only answer using the information in ## Related Knowledge Base Contexts.
If ## Related Knowledge Base Contexts is missing or does not contain relevant information, respond:
"There is no related information in knowledge base."
3. Optimize Your Knowledge Base Source Format Ensure your "Pricing Policy" section follows best practices : - Use
.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 - Write short paragraphs and lists to separate concepts; avoid walls of text - Group related pricing information within the same section so chunks remain cohesive - Use specificity - include exact prices, dates, and avoid ambiguous pronouns like "it" or "this" 4. Strengthen State Transition Logic In your multi-prompt agent, ensure the state transition logic is clear [(2) ]() . You can make the pricing check more explicit:
Copy code
2. IF "price_mentioned" == "false", you MUST inform the user about pricing using the "Pricing Policy" section.
   - This is critical and non-negotiable.
   - Retrieve pricing information from ## Related Knowledge Base Contexts.
   - Mention evening/weekend rates only if their preferred time falls in those periods.
   - Mention VAT only if applicable to this booking.
5. Verify Agent is Published Make sure you've published your agent after making knowledge base changes - the publish button is in the top right of the agent editor [(1) ]() . The combination of adjusting retrieval settings, adding explicit prompt instructions, and optimizing your knowledge base format should significantly improve the agent's ability to retrieve and use your "Pricing Policy" section . **
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[2] Build a multi-prompt agent](https://docs.retellai.com/build/single-multi-prompt/write-multi-prompt) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Why not set everything to max? Why are there no instructions as to how Chunks to retrieve or Similarity Threshold work? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer \### Answer Why Not Set Everything to Max? The documentation explicitly warns against maximizing the "Chunks to retrieve" setting [(1) ]() . Increasing "Chunks to retrieve" gives the LLM more context, but also increases the prompt length and can interfere with generation quality . For most cases, the recommended settings are 3 chunks and a 0.60 similarity threshold . Setting chunks to the maximum (10) can lead to: - Longer prompt lengths that slow down response generation - Information overload that confuses the LLM - Reduced generation quality due to too much context How These Settings Work: Chunks to retrieve: - The max number of chunks to retrieve from the KB, range 1-10 - Default: 3 - Each chunk represents a portion of your knowledge base content that's semantically related to the query Similarity Threshold: - Adjusts how strict the system is when matching chunks to the context - A higher setting gives you fewer, but more similar, matches - Default: 0.6 - Range: typically 0.0 to 1.0, where higher values require closer semantic matches Practical Guidance: From community experience, users have found success by adjusting these settings when facing retrieval issues [(2) ]() . One user reported that increasing chunks slightly and decreasing the similarity threshold helped find correct answers . The key is finding the balance: enough chunks to capture relevant information, but not so many that you overwhelm the LLM with unnecessary context [(1) ]() . Sources: , [(2) ]()
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[2] Agent fails to read the whole database](https://discord.com/channels/1186424376300679209/1435243420053540997) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
so if I set it to 5 and 0.50 ? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer ### Answer Setting Chunks to retrieve to 5 and Similarity Threshold to 0.50 is a reasonable approach to troubleshoot your "Pricing Policy" retrieval issue [(1) ]() . Here's what this configuration does: Chunks to retrieve: 5 - Increases from the default of 3 to 5, giving the LLM more context to work with - This is a moderate increase that provides additional information without overwhelming the system - Stays well below the maximum of 10, which helps avoid the prompt length and generation quality issues mentioned in the documentation Similarity Threshold: 0.50 - Lowers from the default of 0.6 to 0.5, making the matching less strict - A lower threshold means the system will retrieve chunks that are somewhat less similar, potentially capturing your "Pricing Policy" section even if the semantic match isn't perfect - This can help if your pricing section is being filtered out due to strict matching criteria This combination should help retrieve your "Pricing Policy" section more reliably. The slightly increased chunk count gives more context, while the lowered threshold makes it easier for pricing-related content to be included in the retrieval . From community experience, users have found success with similar adjustments when facing retrieval issues [(2) ]() . One user reported that increasing chunks slightly and decreasing the similarity threshold helped find correct answers . After making these changes, remember to publish your agent for the settings to take effect [(1) ]() . **
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[2] Agent fails to read the whole database](https://discord.com/channels/1186424376300679209/1435243420053540997) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
can we include dynamic placeholders in the knowledge base? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer Based on the available sources, there is no documentation stating that dynamic variables/placeholders (
{{variable_name}}
) are supported inside knowledge base content itself
(e.g., inside uploaded files, URLs, or text snippets) . [(1) ]() [(2) ]() [(3) ]() [(4) ]() [(5) ]() Dynamic variables are documented as working in prompts, begin message, tool configurations, call handling, and webhook URL, not in knowledge base entries. [(1) ]() So, from the docs we have, you **should not rely on dynamic placeholders inside KB content**—they are not described as a supported feature there. [(1) ]() [(2) ]() [(3) ]() [(4) ]() [(5) ]()
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[3] Add Knowledge Base Sources](https://docs.retellai.com/api-references/add-knowledge-base-sources) [[4] Empower AI with Dynamic Knowledge Bases | Retell AI](https://www.retellai.com/features/knowledge-base) [[5] Simplify Support with Retell AI’s Knowledge Base | Retell AI](https://www.retellai.com/blog/knowledge-base-feature) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
How effective is "Remove noise + background speech" setting. Will it severly impair agent's "hearing"? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer The “Remove noise + background speech” mode is designed to be more aggressive than the default and has a clear tradeoff you should be aware of. [(1) ]() From the docs: - Effectiveness / purpose - It removes both background noise and background speech (e.g., TV, other people talking, construction) , which the default “Remove noise” mode cannot fully handle. - It’s specifically recommended when your use cases “usually have loud background speech, like a TV in the background or a construction site.” - Impact on “hearing” / accuracy - This mode “might distort the waveform, so it can result in lower speech to text accuracy in certain cases.” - Because of this, the docs recommend using the simpler “Remove noise” mode for regular use cases for optimal STT accuracy, and only switching to “Remove noise + background speech” when you really need that extra suppression of background voices. So: - It won’t arbitrarily cripple the agent, but it can reduce transcription accuracy in some scenarios due to distortion, especially if the environment isn’t actually that noisy. - Treat it as a **situational tool**: - Use it when background speech is a real problem. - Prefer the default “Remove noise” when calls are relatively clean and you care most about precise “hearing.” You can further tune interruption behavior with **Interruption Sensitivity**: setting it lower makes the agent more resilient to background speech and user interruptions, but also makes it harder to interrupt the agent when you actually want to.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Handle background speech & noise](https://docs.retellai.com/build/handle-background-noise) ​
a
I just had a case where a baby was talking in the background -- mother was holding the baby while talking on the phone. Do you think “Remove noise + background speech” would've helped? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer For your baby-in-the-background case, the docs only give scenario-based guidance, not guarantees for specific sounds like a baby’s voice, so this has to stay general. [(1) ]() What is documented: - “Remove noise + background speech” is explicitly recommended when your use cases “usually have loud background speech, like a TV in the background or a construction site.” - It “removes both background noise and background speech,” which is exactly the class of problem a talking baby falls into (another voice overlapping the caller) . [(1) ]() [(2) ]() [(3) ]() - Tradeoff: it “might distort the waveform, so it can result in lower speech to text accuracy in certain cases,” and for regular use cases they recommend staying on “Remove noise” for best STT accuracy. [(1) ]() So: it’s reasonable (and aligned with the docs) to expect that “Remove noise + background speech” could help reduce how much of the baby’s speech gets through, especially if the baby is relatively loud compared to the mother, but there is no explicit guarantee for that exact situation in the documentation. [(1) ]() [(2) ]() [(3) ]() If you try it, you’re basically trading: - *More aggressive suppression of other voices (baby, TV, people nearby) * - For potential STT degradation if the distortion affects the main speaker. [(1) ]()
​ To learn more, see the sources I considered: [[1] Handle background speech & noise](https://docs.retellai.com/build/handle-background-noise) [[2] Pricing Changes, Latency Improvements, One-Time SMS, and More](https://www.retellai.com/changelog/pricing-changes-latency-improvements-one-time-sms-and-more) [[3] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.