Issue with Assistant Response in Knowledge Base Us...
# support
m
We wanted to test the knowledge setup and performed the following steps: 1. Created a Dataset - Uploaded files to Trieve with the following payload:
Copy code
javascript
   const payload = {
      file_name: fileName,
      base64_file: base64File,
      metadata,
      create_chunks: createChunks,
      group_tracking_id: groupTrackingId,
      tag_set: [''],
      split_delimiters: ['.', '?', '\n'],
      target_splits_per_chunk: 20,
      rebalance_chunks: false,
      split_avg: false,
      pdf2md_options: {
        use_pdf2md_ocr: false,
        split_headings: false,
        system_prompt: '',
      },
    };
2. Created a Knowledge Base - Used the following payload:
Copy code
javascript
   const knowledgeBasePayload = {
      name,
      provider: 'trieve',
      searchPlan: {
        searchType,
        topK,
        removeStopWords: true,
        scoreThreshold,
      },
      createPlan: {
        type: 'import',
        providerId: datasetId, // Dataset ID from Step 1
      },
    };
Default Values:
Copy code
javascript
   searchType = 'semantic';
   topK = 3;
   scoreThreshold = 0.7;
3. Issue Faced: - When searching on Trieve, we are retrieving the correct data. - However, the assistant does not return that data. Instead, it provides random or unrelated information. We are attaching a screenshot that contains the expected search terms and results from Trieve. Please investigate why the assistant is not retrieving the correct data despite the setup being correct. Looking forward to your assistance in resolving this issue. https://cdn.discordapp.com/attachments/1347496932750266419/1347496933119496253/image.png?ex=67cc09d0&is=67cab850&hm=7bf2169d93846979f65a6682092294e8ff3608da9c543777ee12007f81ecb4e3&
v
Hi there! I see you're having trouble with your assistant not retrieving the correct data from Trieve despite your setup looking good. Let me help you troubleshoot this! 🔍 Based on the information you've provided, here are some common issues and solutions to try: ### 1. Check Your Configuration Settings - **Score Threshold**: Your current threshold is set to 0.7, which might be too high. Try lowering it to 0.2-0.3 to allow more results to be returned to the assistant [source](https://docs.vapi.ai/knowledge-base/integrating-with-trieve). - **Search Type**: You're using 'semantic' search. Consider trying a mixed approach by adjusting BM25 vs semantic weights with a recommended ratio of 0.3:0.7 [source](https://docs.vapi.ai/knowledge-base/integrating-with-trieve). ### 2. Assistant Configuration - **Temperature Setting**: Set the model temperature to 0 to reduce creativity and encourage the model to rely solely on the knowledge base [source](https://discord.com/channels/1211482211119796234/1211483291191083018/1342028540085932102). - **System Prompt**: Modify your system prompt to explicitly instruct the assistant to cite the knowledge base and say "I don't know" when information isn't in the KB [source](https://discord.com/channels/1211482211119796234/1211483291191083018/1335953119275782144). ### 3. API and Parameters - **Verify Knowledge Base ID**: Double-check that the knowledge base ID is properly linked to your assistant [source](https://discord.com/channels/1211482211119796234/1211483291191083018/1336051824402239579). - **API Key**: Ensure you're using the correct Trieve API key, as issues with keys often result in improper KB integration [source](https://discord.com/channels/1211482211119796234/1211483291191083018/1344392819065749608). ### 4. Chunking Strategy - Your current setup uses split delimiters ['.', '?', '\n'] with target_splits_per_chunk: 20
- Consider normalizing chunk sizes with a maximum variance of 20% and implementing a 15-20% chunk boundary overlap for better performance [source](https://docs.vapi.ai/knowledge-base/integrating-with-trieve). Let me know if any of these suggestions help or if you need more specific guidance! 👍 Sources: - [Integrating with Trieve](https://docs.vapi.ai/knowledge-base/integrating-with-trieve) - [Discord Channel Troubleshooting Steps](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342028540085932102) - [Discord Channel System Prompt Adjustment](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335953119275782144) - [Discord Channel Knowledge Base ID Verification](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336051824402239579) - [Discord Channel API Key Issues](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1344392819065749608)
Message marked as helpful by @mauryasumit! 🎉
m
@Shubham Bajaj it's still usages the same
@Vapi Support Bot can you send a mail to all the higher authority for the same ?
k
Hey! To help track down this issue, could you share: - The call ID This would really help us figure out what went wrong!
m
here are the vapi call ID, dc572b9d-42d8-4279-9fd5-18c3b429e595 4fd8ad77-29c6-45c5-a23a-579d66b485b7 23400216-5a71-4012-8e43-d39494505612 none of them work correctly
@Shubham Bajaj
n
Are you sure that you want the score threshold that high?
I suspect that you aren't getting search results back during the call since that value is cutting off results
m
I have already changed the scoreThreshold to
0.2
then tried it gives same error everytime
@Nick K - CEO @ Trieve
n
Hmm, do you see analytics coming from the Voice agent in your Trieve dashboard?
Like any at all?
m
yes
is there any issue on vapi side ? i have set this prompt tell all the data from knowledge base and say "I don't know" when information isn't in the KB so on any question it always says I don't know
@Nick K - CEO @ Trieve
n
I doubt it's an issue on the Vapi side
Likely the issue is moreso the context isn't sufficient for the AI to answer the question or the prompt is too restrictive
m
@Shubham Bajaj or anyone from @Vapi can you guys look at it, I have tried so many prompts but it does not respond as per KB, can you guys suggest what might be wrong, may be any thing I am doing wrong, @Nick K - CEO @ Trieve ref pic for searh https://cdn.discordapp.com/attachments/1347496932750266419/1348531701843755008/image.png?ex=67cfcd84&is=67ce7c04&hm=285051c9673ac23ef86fe6482c0ed9d098b414aeb692c025d5ef00e2a6a5833d&
n
Search does seem correct. I'll let someone from the Vapi team take it from here
m
call id for refrence
370cc900-3bf8-40b3-99da-fd7af743249f
@Shubham Bajaj We need this to work correctly. We are going live by the 18th, so this needs to be sorted as soon as possible.
@Shubham Bajaj please let's connect please can you see this issue ?
4 Views