Not able to create new knowledge base using API
# support
s
I am unable to create a knowledge base item in VAPI through the API
Copy code
curl --location 'https://api.vapi.ai/knowledge-base' \
--header 'Content-Type: text/plain' \
--header 'Authorization: Bearer redacted' \
--data '{
    "name": "cdede79f-c4c3-4785-924a-fd7412efacd0",
    "provider": "trieve",
    "searchPlan": {
        "searchType": "hybrid"
    },
    "createPlan": {
        "type": "create",
        "chunkPlans": [
            {
                "fileIds": [
                    "0dc2a9df-8300-40fa-a3a7-f0486151ea51"
                ],
                "websites": [],
                "targetSplitsPerChunk": 5,
                "rebalanceChunks": true
            }
        ]
    }
}'
Im receiving this error
Copy code
{
  "message": "Invalid Knowledge Base Details. Failed to create trieve dataset",
  "error": "Bad Request",
  "statusCode": 400
}
@Shubham Bajaj could you support me?
@User
c
I’m having the same problem
Has anyone found a solution
s
same problem
c
ah thanks makes sense
for now if anyone needs a workaround you can import from trieve
here is the code to do it
import requests comment this out Create Knowledge Base (POST /knowledge-base) response = requests.post( "https://api.vapi.ai/knowledge-base", headers={ "Authorization": "Bearer api key here", "Content-Type": "application/json" }, json={ "provider": "trieve", "createPlan": { "type": "import", "providerId": "put the dataset id here" }, "searchPlan": { "searchType": "hybrid", "removeStopWords": true, "topK": 3, "scoreThreshold": 0.7 }, "name": "name of the knowledge base here" }, ) print(response.json())
s
Do you have the data set in trieve?
s
I dont
c
yeah that's the only way I could get it to work
s
okay I gotcha Do you know if VAPI has an estimated time to fix this issue?
c
They haven’t said anything so your guess is as good as mine
s
@Seygi I would expect 7-14 days to have a resolution
s
@Seygi @CTmun @SlaviSavanovic @SteveCachia Apologies for the inconvenience caused by kB. We've noticed that when using our API key for creating a knowledge base, the request sometimes fails with a 403 error. The problem seems to be related to how our system create plan syncs with Trieve, causing issues when the same key is used repeatedly. temporary solution: For now, please use your own Trieve dataset for the knowledge base. This workaround avoids the create plan syncing issue and should let the KB process go through without errors.
s
Do you have an estimate for fixing this issue?
a
@Shubham Bajaj I have a Trieve.ai knowledge base, and adding my Trieve API Key to VAPI. That works, but I get a failure on
"message": "Invalid Knowledge Base Details. Failed to validate trieve dataset: dataset not found",
Seems obvious, wrong Dataset ID in the
providerId
field. Nope, double & triple checked it. Is there a prefix, or other trick here?
As of Feb 25-27 you 1) can't create a Knowledge Base via UX in VAPI (only upload files), 2) cannot create a Trieve Knowledge Base via API because VAPI borked the settings (Trieve support and engineers confirmed as of Feb 26), and 3) cannot import an existing Trieve dataset either (fails to find dataset or organization not found issues). As far as I can tell, there is NO way to create a Knowledge Base, nor any known workaround.
l
@Shubham Bajaj any ETA on KB fix?
r
@Shubham Bajaj The time it's taking to fix this issue is worrying. I'm wanting to sign up new customers but I've been waiting days for this to be fixed. How can I be confident that building my solution on Vapi will be robust?
l
I found that access to existing knowledge bases also was not working, so effectively all our assistants were broken, I don't know if anyone else has tested their existing assistants but if not, I'd take a peek and make sure things are working as expected
We moved everything over to Trieve last night and got things up and running again
n
HI, can you create the KB from trieve and import in VAPI? I am trying to use https://api.vapi.ai/knowledge-base { "name": "unihorizonte", "provider": "trieve", "searchPlan": { "scoreThreshold": 0.2, "searchType": "semantic" }, "createPlan": { "type": "import", "providerId": "c065931e-169e-43ff-8f73-b3705bfe3d77" } } with a KB from trieve, but I got {"message":"Invalid Knowledge Base Details. Failed to validate trieve dataset: dataset not found","error":"Bad Request","statusCode":400} Am I doing something wrong? @CTmun @Shubham Bajaj
s
The providerid must be the trieve dataset id
n
Yes it is
l
Nicolas the only difference in my API call that works is no searchPlan, but as Seygi said the error sounds like it could be a dataset ID issue... sorry thats not more helpful
a
@Nicolas Correa Same issue, and I've triple checked my Trieve DataSet ID, even after adding my Trieve.ai API Key into VAPI.
n
I guess we need to wait to VAPI to fix the main functionality
n
Should be resolved now!
a
Marking this ticket as Solved ✅