https://retellai.com/?utm_source=discord&utm_medium=seo logo
I have a conversational agent with some knowledge ...
# ❓・ai-evy-support
g
@AI Evy I have a conversational agent with some knowledge base attached to it. Say, for example, the knowledge base has to do with ice creams, ice cream manufacture, and ice cream consumption. For the manufacturing, there is a tabular data that outlines the quantity of sugar used in each flavour of ice cream - example, chocolate, mint chocolate, dark chocolate, etc. Now, when I initiate a call with the agent and ask about the sugar content of mint chocolate ice cream, the agent answers correctly. However, when I initiate a call, ask a few questions on another topic, and then ask about the sugar content of mint chocolate, the agent always answers incorrectly. Why is this the case? I have a multiple conversation nodes that are focused on the different parts of the KB.
a
Thanks for tagging me @gitfudge. I'll look through relevant sources and get back to you shortly.
ach the manufacturing/sugar content knowledge base specifically to the nodes where those questions are expected. 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 (Default: 0.6) Increasing "Chunks to retrieve" gives the LLM more context, but also increases the prompt length and can interfere with generation quality .
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) ​
### Answer Based on the available sources, here are some likely reasons why your Conversation Flow agent's Knowledge Base retrieval accuracy degrades as the conversation progresses: Knowledge Base Retrieval Uses Transcript Context When a knowledge base is linked to your agent, the system uses the transcript so far (not including the prompt) to find the most relevant chunks from the knowledge base and feed them to the LLM as context [(1) ]() . As your conversation progresses through multiple nodes and topics, the transcript becomes longer and potentially less focused on the specific query about mint chocolate ice cream's sugar content. Tabular Data Retrieval Challenges The documentation explicitly notes that for tabular or image-heavy content, retrieval may be less reliable . Since your sugar content data is in tabular format, this could explain why accuracy drops when there's more conversational context competing for relevance in the retrieval process. Best Practices to Improve Accuracy To address this issue, consider these recommendations from the documentation: - Prefer
.md
(Markdown) files over other formats, as well-structured Markdown is chunked and retrieved more accurately - Add explanatory text around your tabular data so related information stays in the same chunk - Avoid ambiguity and use specificity in references—include names, dates, units, and avoid ambiguous pronouns like "it" or "this", because prior chunks may not be present Node-Level Knowledge Base Configuration Since you mentioned having multiple conversation nodes focused on different parts of the KB, you can configure knowledge base at the Conversation Node level . Node level knowledge base will be combined with agent global knowledge base to provide more accurate context for a specific topic . This means you could att
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy My understanding is that the transcript context is affecting the chunks being retrieved. How do I ensure that the chunks being retrieved are relevant only to the recent query and not the entire transcript?
a
Thanks for the follow-up, @gitfudge. I'll get back to you soon.
### Answer Based on the available sources, the knowledge base retrieval system uses the transcript so far (not including the prompt) to find the most relevant chunks [(1) ]() . Unfortunately, the documentation doesn't provide a built-in method to limit retrieval to only the most recent query while excluding the rest of the transcript context. However, here are strategies to work around this limitation: Use Node-Level Knowledge Base Configure knowledge base at the Conversation Node level . Node level knowledge base will be combined with agent global knowledge base to provide more accurate context for a specific topic . This means you can attach your manufacturing/sugar content knowledge base specifically to nodes where those questions are expected, which helps focus retrieval. Adjust Retrieval Parameters You can configure retrieval settings 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 (Default: 0.6) Increasing the similarity threshold makes the system more selective, potentially filtering out chunks that match earlier transcript context but not the current query . Optimize Your Knowledge Base Structure Since tabular data retrieval may be less reliable , consider: - Adding explanatory text around your tabular data so related information stays in the same chunk - Using specificity in references—include names, dates, units, and avoid ambiguous pronouns like "it" or "this", because prior chunks may not be present - Preferring
.md
(Markdown) files over other formats, as well-structured Markdown is chunked and retrieved more accurately The system's reliance on full transcript context is a current limi
tation, but these approaches should help improve retrieval accuracy for your specific queries.
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@Omar Ashraf | Community Lead @Colin - Integrations @ Retell AI Any inputs on this is greatly appreciated
a
Appreciate the feedback! Feel free to ask me again with additional guidance or context.
g
@Colin - Integrations @ Retell AI any insights here?