I'm having an issue with query tools. They can't r...
# support
f
I'm having an issue with query tools. They can't retreive data from txt files
v
Try normalizing and chunking your txt files for better retrieval: 1. Before uploading, clean your txt files by removing extra whitespace and formatting artifacts. 2. Upload the file via Trieve's interface, then use the "Edit Chunks" feature to ensure each chunk is between 200-1000 tokens and contains complete thoughts. 3. Example chunking config:
Copy code
json
{
  "chunkSize": 500,
  "splitDelimiters": ".?\n"
}
This helps the query tool retrieve relevant data more effectively. For more details, see the [Trieve integration guide](https://docs.vapi.ai/knowledge-base/integrating-with-trieve). Source: - [Integrating with Trieve](https://docs.vapi.ai/knowledge-base/integrating-with-trieve)
f
@Vapi Support Bot
v
It looks like you might be looking for more help with your txt file retrieval issue. If the previous steps about normalizing and chunking your txt files didn't resolve the problem, could you share a bit more about what happens when you try to retrieve data? For example, are you seeing any error messages, or is the data just missing from your results? Any extra details you provide can help narrow down the cause and find a solution.
f
Ai assistants cannot call the tool and read it.
@Vapi Support Bot
v
To enable your AI assistant to call the query tool and read data from your txt files, add an explicit instruction in your assistant's configuration prompt. For example:
Copy code
text
When users ask about our products or services, use the knowledge base to provide accurate details.
This ensures the assistant knows when to reference the knowledge base for responses. For more details, see the [Vapi knowledge base guide](https://docs.vapi.ai/knowledge-base). Source: - [Vapi Knowledge Base Documentation](https://docs.vapi.ai/knowledge-base)
f
Whenever the ai calls a query tool. It cannot read properties of undefined (reading "messages")
c
Hi Shadow101, If you're encountering the "Cannot read properties of undefined (reading 'messages')" error with your query tool, this issue could stem from a configuration mismatch or a formatting problem in the files used for the knowledge base. Here's a checklist of steps you can take to troubleshoot and resolve the issue: 1. **Ensure Files are Plain Text/Properly Formatted**: Use only plain-text files (.txt) and ensure no extra formatting is causing issues. Remove whitespace and artifacts before uploading. 2. **Review Query Tool Configuration**: - Double-check that your files are correctly uploaded and associated with the query tool. Ensure that file IDs (if using the API) or selections (if using the dashboard) are accurate. - Confirm that the query tool is properly attached to your assistant and that the system prompt instructs the assistant on when to use this tool. 3. **Test Tool Execution in the Dashboard**: - Navigate to
Observe > Call Logs
to see if there are any additional errors or details when the query tool is called. - Use the tool's test feature in the dashboard to simulate sample queries and troubleshoot execution. 4. **Check Assistant Instructions**: - Make sure your assistant's system prompt uses the exact query tool name and provides clear instructions for calling it. Since knowledge bases don't always work smoothly with chat functionality, especially with text files, you might want to consider setting up a workaround as outlined in the [Vapi Knowledge Base Documentation](https://docs.vapi.ai/knowledge-base) and possibly using external integrations if the issue persists. If the error persists across these checks, it might be related to known limitations in using knowledge bases with chat interfaces, as discussed in previous threads. In such cases, monitoring for updates from Vapi regarding tool updates or API changes is advisable.