Chat is not using query tool knowledge base
# support
u
I've create a knowledge base using query tool method https://docs.vapi.ai/knowledge-base/using-query-tool. When I call the assistant and ask knowledge base relate questions it leverages the knowledge base query tool and answers accordingly. But when I use chat through dashboard of API: https://api.vapi.ai/chat the knowledge base query tool is not used and assistant hallucinates. I'm using the chat API: https://api.vapi.ai/chat to run evals on the assistant. Therefor my evals will not work if I use the knowledge base.
v
Hi there! 👋 I understand you're having an issue with the knowledge base query tool not being used when interacting with the chat API. I don't have specific information about why your particular setup isn't working, but I can help with some troubleshooting steps based on information I've found. According to the information I found, Vapi has migrated from Canonical to Trieve for knowledge bases, which requires users to attach the Knowledge Base using the API. This might be why your knowledge base works when calling the assistant directly but not through the chat API. Here are some troubleshooting steps you can try: 1. **Ensure the Knowledge Base is attached using the API**: After the migration to Trieve, it's necessary to attach the Knowledge Base using the API. According to [several sources](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336727607533899786), you need to explicitly attach the knowledge base through the API. 2. **Check your Trieve API key**: A missing Trieve API key in the VAPI provider credentials can prevent the knowledge base from working. According to [this source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1338536777719484426), you should create a Trieve account, add the file to create a Dataset (or just generate an API key), and then paste the API key into VAPI. 3. **Review your configuration settings**: Make sure your knowledge base configuration includes the correct search plan options. According to [the documentation](https://docs.vapi.ai/knowledgebase), you can configure parameters such as: - **searchType**: Options include
fulltext
,
semantic
,
hybrid
,
bm25
- **topK**: Number of top chunks to return - **removeStopWords**: When true, removes common stop words - **scoreThreshold**: Filters out chunks based on similarity score
4. **Explicitly instruct the assistant**: According to [this source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335953119275782144), you should explicitly instruct the assistant to use the knowledge base as the primary source of information and to respond with "I do not know" if the information is not in the knowledge base. Is there any specific part of the configuration you'd like me to elaborate on further? Sources: - [Discord Thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336727607533899786) - [Discord Thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1338536777719484426) - [Vapi Documentation](https://docs.vapi.ai/knowledgebase) - [Discord Thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335953119275782144)
u
@User @Shubham Bajaj Please take a look, when you get chance.
k
As of now, the Knowledge Base support for chat API has not been added. But you can raise any feature request for it.
any\* -> an
You can raise an feature request for it over here: https://roadmap.vapi.ai
u
k
Marking this ticket as Solved ✅
3 Views