Create Knowledge Base error
# support
f
This API Call is not working: curl -X POST https://api.vapi.ai/knowledge-base \ -H "Authorization: Bearer XY" \ -H "Content-Type: application/json" \ -d '{ "provider": "trieve", "createPlan": { "type": "import", "providerId": "cb6562ab-44db-40b0-a8f5-63a983d98045" }, "name": "B2B-Sales-HPC", "searchPlan": { "searchType": "hybrid" } }' Response: { "message": "Invalid Knowledge Base Details. Failed to validate trieve dataset: dataset not found", "error": "Bad Request", "statusCode": 400 } We have checked the DatasetId many times and the api key is also correct
k
To help track down this issue, could you share one or two: - The org ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!
v
Hi there! I see you're having trouble with the "dataset not found" error when creating a Knowledge Base using the Vapi API. Unfortunately, I can't determine the exact cause of your specific error without more details about your Trieve account settings and permissions. However, I can help you troubleshoot this issue based on similar problems others have encountered. Based on the information I found, here are several potential causes and solutions for the "dataset not found" error: ### API Key Scope and Permissions The error might be related to your API key's permissions. According to [information from Discord discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335371096525897911), you should: - Verify that your API key has the necessary scope for the dataset - Create a new API key with the proper role and scope in Trieve - Ensure the API key has the
READ_DATASET
permission ### Trieve Integration Issues There appears to be a known issue with how Vapi's system syncs with Trieve. According to [multiple user reports](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1344182165990015016), this can cause the "dataset not found" error even when the Dataset ID and API key are correct. ### Request Body Validation Your request body looks correct in structure, but make sure: - The
providerId
is exactly matching your Trieve Dataset ID - The
searchType
value "hybrid" is supported (though this shouldn't cause the specific error you're seeing) ### Workaround Solution A common workaround that has helped others with this exact error is to: 1. Create a dataset directly in Trieve 2. Upload your files to that dataset 3. Generate a new Trieve API key specifically for that dataset 4. Add this API key to Vapi's Provider Credentials 5. Then use the import API to create the Knowledge Base
According to [user discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1343853917322350703), this "Bring Your Own Knowledge" (BYOK) approach helps bypass the syncing issues between Vapi and Trieve. Would you like me to provide more specific details on any of these troubleshooting steps or the workaround solution? Sources: - [Discord discussion about dataset not found error](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1344182165990015016) - [Discord discussion about API key scope](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335371096525897911) - [Discord discussion about BYOK workaround](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1343853917322350703) - [Discord discussion about Vapi-Trieve integration issues](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1344025490989776967)
f
ecbb7425-dcd4-425c-aaed-6a5efd3a873f I wanted to create a knowledge base with my dataset in trieve
Today like exactly 1,5 hours ago
You mean thrieve orgID or vapi?
k
Vapi
f
bbac61f0-f27a-4027-9164-b26c8191a3a9
k
Copy code
{
  "message": "Invalid Knowledge Base Details. Failed to validate trieve dataset: dataset not found",
  "error": "Bad Request",
  "statusCode": 400
}
Recheck your data site ID again..
This is the ID right?
k
Try recreate a new data site ID and give all access to it
f
Copy code
{
  "message": "Invalid Knowledge Base Details. Failed to validate trieve dataset: dataset not found",
  "error": "Bad Request",
  "statusCode": 400
}
Tried it
And I also doublechecked the access
s
Can you send me the latest call_id?