Why Assistant not accessing it's associated Knowle...
# support
b
Adding my Knowledge Base to my assistant in the Vapi platform does not seem to work. The assistant does not seem to access the data. knowledgeBaseId: 87adc953-56df-47a7-a415-71120725ba9d Here is the assistant: 2e982ae4-5d47-4041-a4fe-6a3567a32384 I have confirmed the assistant contains the parameter: "knowledgeBaseId": "87adc953-56df-47a7-a415-71120725ba9d" But it doesn't seem to query the knowledge base when I ask it a relevant question. Here is an example call log: 860fc115-e2a5-43bd-ba99-df1549e868d3 Why might this be happening and how can I fix it? Thank you!
This particular Knowledge Base is Trieve
v
Hi there! 👋 I understand your frustration with your assistant not accessing its associated Knowledge Base. I'm unable to analyze your specific call log (860fc115-e2a5-43bd-ba99-df1549e868d3) in detail, but I can definitely help with common issues and troubleshooting steps for Knowledge Base integration problems. Based on the information I found, here are several potential reasons why your assistant might not be accessing its Knowledge Base: ## Possible Causes & Solutions ### 1. Recent Migration from Canonical to Trieve Vapi recently migrated from Canonical to Trieve for knowledge base services, which requires users to attach Knowledge Bases using the API rather than just the dashboard. According to [documentation and user reports](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336582704082325535), this migration might be affecting your setup. You may need to re-attach the Knowledge Base using the API. ### 2. Knowledge Base Configuration Issues Your Knowledge Base might have configuration issues. Check these settings: - **Search Type Configuration**: Verify that the
searchType
parameter is correctly set (options include
fulltext
,
semantic
,
hybrid
, or
bm25
) [according to the documentation](https://docs.vapi.ai/knowledge-base) - **Score Threshold**: Consider adjusting the
scoreThreshold
to 0.6 or 0.7 if it's set too high [as suggested in troubleshooting guides](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1338541335870836736) - **Top K Value**: Check if the
topK
parameter (number of chunks to return) is properly configured ### 3. System Prompt Configuration
3. **Update System Prompt**: Ensure your assistant is explicitly instructed to use the Knowledge Base as the primary source of information. 4. **Allow for Indexing Time**: According to [user experiences](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1331706030672969799), if you recently created the KB, wait a few minutes before making calls to allow for proper indexing. Is there anything specific about your setup or the questions you're asking that might help narrow down the issue further? Sources: - [Discord discussion about KB migration](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336582704082325535) - [Vapi Knowledge Base documentation](https://docs.vapi.ai/knowledge-base) - [Troubleshooting KB threshold settings](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1338541335870836736) - [Discussion about system prompt configuration](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335953119275782144) - [API key troubleshooting guide](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335371096525897911) - [UI vs API workarounds](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342881292630360104) - [KB indexing time discussion](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1331706030672969799)
The assistant might not be explicitly instructed to use the Knowledge Base. According to [user discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335953119275782144), you should customize your assistant's system prompt to explicitly instruct it to utilize the Knowledge Base for responding to queries. ### 4. API Key Issues There might be issues with API key scope or permissions. A 401 error in the call log would indicate an unauthorized API key [as noted in troubleshooting guides](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335371096525897911). ### 5. UI vs API Discrepancies The Knowledge Base UI for the new provider might not be fully updated. According to [user reports](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342881292630360104), it's recommended to use the API for performing CRUD operations with the KB and Assistant as a workaround. ## Recommended Troubleshooting Steps 1. **Analyze Your Call Log**: Review your call log (860fc115-e2a5-43bd-ba99-df1549e868d3) for any error messages or indications of why the assistant isn't retrieving information from the Knowledge Base. 2. **Re-attach the Knowledge Base via API**: Use the PATCH endpoint to update your assistant with the Knowledge Base ID:
Copy code
curl --location --request PATCH 'https://api.vapi.ai/assistant/<ASSISTANT_ID>' \
   --header 'Content-Type: text/plain' \
   --header 'Authorization: Bearer <YOUR_API_KEY>' \
   --data '{
     "model": {
       "knowledgeBaseId": "<KNOWLEDGE_BASE_ID>",
       "temperature": 0.2,
       "provider": "openai",
       "model": "gpt-4o",
       "messages": [
         {
           "content": "You are a smart assistant who responds to user queries using the information you know, or information supplied by outside context.",
           "role": "system"
         }
       ]
     }
   }'
k
Hey Bilbo, You have to switch over to the query-based tool KB. This will help you resolve all of your KB issue, such as tools are not triggering. Here is a documentation link to it , and it also contains a video which will fast-forward your process to set up the query-based tool.