Not getting or not using info from the knowledge b...
# support
s
Hi VAPI Team, Im trying to understand the problem i am having crating a multilingual agent. Dutch/English. When asking a basic question like what products are offered, the agent seems to run the query tool and the correct knowledge base but makes up products in stead of using the info from the knowledge base. Chat ID: 690fb8e4-eff5-46bc-997c-8c4b33c00f41 Tried the following - Transcriber: Dutch, Multilingual - Increased token rate to 500 - Communicated in both languages - Added the products in both markdown as in a table in the knowledge base. - In the system prompt there are multiple mentions of usage of the query tool e.g.: - if response indicates **general question about Room of Riddles Antwerpen**: → Use query_tool_Room_of_Riddles_Antwerp to search knowledge base` and reply based on in this information. - Use internal knowledge base for FAQs.- Ensure a seamless transition without disruption Any advice on what could be wrong? Many thanks in advance.🙂
v
Thank you for the detailed info! To help pinpoint the issue, could you please check the Call Logs in your [Vapi dashboard](https://dashboard.vapi.ai/) and confirm whether the query tool is actually returning the correct product data from your knowledge base, or if the agent is generating responses without using the tool output? This will help determine if the problem is with tool execution or response handling. If you can share a sample log snippet (with sensitive info removed), that would be very helpful. Sources: - [Debugging voice agents](https://docs.vapi.ai/debugging) - [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)
s
In the image it says tool response success, however no other info is mentioned. I am not sure if returned information should be visible in the response data message. https://cdn.discordapp.com/attachments/1425841835196285089/1425844461404950538/image.png?ex=68e910a2&is=68e7bf22&hm=ad942789dac37a094b3fcf41456ab02cbc33a5e71fa4d60750ba04b462128141&
@Vapi Support Bot In the image it says tool response success, however no other info is mentioned. I am not sure if returned information should be visible in the response data message. https://cdn.discordapp.com/attachments/1425841835196285089/1425850022188154980/image.png?ex=68e915d0&is=68e7c450&hm=8fb9448f7d97604d59f78daa380926c42d020bbebf176a52e57936c20f1ef594&
v
It looks like your tool response is returning only a generic "Success" message instead of the actual product data. To fix this, ensure your tool's server returns a response in the following format, including the relevant documents:
Copy code
json
{
  "documents": [
    {
      "content": "The Laboratory, The Art Collector, The Harbour Master",
      "similarity": 0.95
    }
  ]
}
Update your tool endpoint to return the actual product list in the
documents
array so the assistant can use this information in its reply. [See example in documentation](https://docs.vapi.ai/knowledge-base/custom-knowledge-base). Source: - [Custom Knowledge Base](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
s
@Vapi Support Bot I am not using a custom function im using a query tool with a .docx file uploaded in the knowledge base.
v
Suggestion: Double-check that your uploaded
.docx
file is under 300KB and contains clearly structured, well-labeled sections (e.g., headings for each product or FAQ). The query tool relies on well-organized content to extract relevant answers—try reformatting your file with clear headings and bullet points for each product. After updating, re-upload the file and test again. Tip: Use simple, direct language and avoid embedding tables or complex formatting in the .docx file for best results. [See best practices in documentation](https://docs.vapi.ai/knowledge-base/using-query-tool) Source: - [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)
s
@Vapi Support Bot The file is 15KB, the info is both structured in markdown and also in a table. but success
*no success
v
Try this: Reformat your
.docx
file so that each product is listed as a simple bullet point under a clear heading, and remove any tables or markdown formatting. For example:
Copy code
Products Offered:
- The Laboratory
- The Art Collector
- The Harbour Master
After saving and re-uploading the file, test your agent again to see if the query tool now returns the correct product names in responses. [See best practices in documentation](https://docs.vapi.ai/knowledge-base/using-query-tool) Source: - [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)
s
@Vapi Support Bot @User tried even txt file with markdown instead of docx but it is not working. made a second query tool to test, but same results. Only tool success message no further info. this is with different files and KBs as well.
o
Instead of telling it in the prompt to use the query tool or knowledge base try adding the product into the prompt to be better
s
Hello @Omatsola , When testing in chat, the query tool did not return any data from any of the KBs. Even basic questions. However when using the web call, the query tool works perfectly. Why is that?
o
Ohhhhh
The query tool works for web call because those actions are basically for calls not chat
What you have to do for it to work for both chat and calls is that you have to add the product information into the prompt
And also make sure that the file you upload is under 300kb
c
Hi Samkus, To integrate a custom knowledge base into your voice AI assistant with Vapi, you have two main methods: using the dashboard or the API. Dashboard Method 1. Upload Files: - Go to
Build > Files
in the Vapi dashboard. - Click "Upload" and select files (supported formats:
.txt
,
.pdf
,
.docx
, etc.). 2. Configure Assistant: - Navigate to
Build > Assistant
, select your assistant. - In the configuration, find "Files" or "Knowledge Base" and associate the uploaded files with the assistant. 3. Publish: - Add prompts to guide your assistant on when to use the knowledge base. - Review configurations and click "Publish" to make changes live. For more details, you can refer to the [Vapi Knowledge Base Guide](https://docs.vapi.ai/knowledge-base). Advanced Configuration with API For greater flexibility, use the API to configure your knowledge base setup. This includes handling multiple bases, uploading files, and custom query tools. For comprehensive steps, see the [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool.mdx). This should help you get started or refine your setup.
2 Views