Many KB Retrievals
# support
l
Hi @Shubham Bajaj , Can you please confirm if this many KB retrievals is normal in a call? and does it increase the change of hallucinations? Call ID: 1d881bf2-b84f-4cb3-9de4-c5462ad9d6b1 The log seems to show alot of KB retrievals that don't seem relevant.
v
Hi there! 👋 I don't have specific information about what's considered a "normal" number of KB retrievals for your particular call ID. However, I can help with the relationship between KB retrievals and hallucinations, as well as what might cause irrelevant retrievals. Based on the information I found, it appears that a high number of KB retrievals, especially irrelevant ones, can potentially increase the chance of hallucinations in Vapi. According to [Discord conversations](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335953119275782144), retrieving irrelevant chunks from the knowledge base is a known issue that could lead to hallucinations if the system relies on incorrect information. There are several potential causes for irrelevant KB retrievals: 1. **Configuration issues**: Incorrect settings in your KnowledgeBase configuration, particularly the
searchType
and
scoreThreshold
parameters can lead to irrelevant retrievals ([Discord thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336306333661663243)). 2. **Threshold settings**: A low KB threshold could be causing irrelevant retrievals ([Discord thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1338541335870836736)). 3. **Indexing problems**: Using the KB immediately after creation before indexing is complete can cause issues ([Discord thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1331706030672969799)). 4. **Routing issues**: If all user messages are being routed to the KB, it may cause the model to retrieve irrelevant information ([Discord thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342355912576471112)). To improve the situation, you might want to adjust the
scoreThreshold
and
targetSplitsPerChunk
to improve the relevance of retrieved chunks.
Is there anything specific about your KB configuration that you'd like me to help with? Sources: - [Discord thread about irrelevant KB retrievals](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335953119275782144) - [Discord thread about KB configuration issues](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336306333661663243) - [Discord thread about KB threshold settings](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1338541335870836736) - [Discord thread about indexing problems](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1331706030672969799) - [Discord thread about routing issues](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342355912576471112)
k
Hey Lydo, you have set your search threshold by default to 0.0, which is why you're seeing lots of content being pulled out. You need to update your KB threshold from search threshold from 0.0 to a slightly higher value (e.g., 0.5) so that only relevant content is being pulled out when requests are being sent to the KB.
l
Thanks @Shubham Bajaj . You are right. So some reason I thought the Score Threshold defaulted to 0.2
k
Marking this ticket as Solved ✅