Custom knowledge base endpoint not called
# support
a
Hey, I'm trying to setup a custom knowledge base endpoint. Here is what I did: - the knowledge base is created by the app through API - When a call is made, I get the assistant Config, then feed in the "assistantOverrides" the knowledgeBaseId to use for this call - the system prompt includes a simple phrase: "Use the knowledge base to answer any users question, you should have tools in order to handle it." but I don't understand: - Do I need to setup a query tool for my custom knowledge base ? I don't add file I'm using my own vector & full text search databases - How to see when a tool call has been made during a call ? I'm using web based calls. Thanks !
v
**You do NOT need a query tool for custom knowledge bases**—these are only for Google knowledge bases. To monitor when your custom endpoint is called during web calls, add logging to your webhook server and listen for
knowledge-base-request
events in your web client. For example:
Copy code
js
vapi.on('message', (message) => {
  if (message.type === 'knowledge-base-request') {
    console.log('Knowledge base called:', message);
  }
});
This will help you confirm your endpoint is being triggered as expected. Make sure your endpoint is publicly accessible and responds quickly for best results. Source: [Vapi documentation](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
a
@Vapi Support Bot do i have set in the prompt the name of the tool "knowledge-base-request" ?
v
No, you do NOT need to mention "knowledge-base-request" in your prompt. That's just the event type for monitoring—your prompt should simply instruct the assistant to use the knowledge base, like:
Copy code
text
Use the knowledge base to provide accurate answers to user questions.
This is only required for Google knowledge bases with query tools, not for custom knowledge bases. Source: [Custom Knowledge Base documentation](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
a
@Vapi Support Bot well the knowledge base is never called, I can show you the "model" object value when i receive the end of call report if you want
v
Thanks for offering to share the "model" object. Could you please provide the full "model" object value from your end-of-call report? This will help identify if the custom knowledge base is correctly attached and configured. Source: - [Vapi documentation: Custom Knowledge Base](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
a
@Vapi Support Bot
Copy code
{
  model: "gpt-4o-mini",
  messages: [
    {
      role: "system",
      content: `You are on the call with: Coline Farmer

Use the knowledge base to provide accurate answers to user questions.

For information, today date is: Wednesday, October 29, 2025`,
    },
  ],
  provider: "openai",
  maxTokens: 1500,
  temperature: 0.2,
  knowledgeBaseId: "54336b30-67a7-407b-bc96-e1f6a83b0c9d",
}
here you go
v
Thank you for sharing your model object. To help pinpoint the issue, could you confirm whether your custom knowledge base configuration (in Vapi) includes the correct, publicly accessible endpoint URL for your server? If possible, please double-check that the endpoint URL is set in the knowledge base settings and that your server is reachable from the public internet. This will help determine if the assistant is able to reach your custom knowledge base during calls. Example: Your knowledge base config should include something like:
Copy code
"server": {
  "url": "https://your-domain.com/kb/search",
  "secret": "your-webhook-secret"
}
Let me know if this matches your setup! Source: - [Vapi documentation: Custom Knowledge Base](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
a
@Vapi Support Bot Sure, here is knowledge base retrieved from the API:
Copy code
{
  id: "adac8398-ef45-40a6-9ef8-08877d34c4ee",
  orgId: "00eaff08-eb2d-4cc0-9d5e-91967eeb47fa",
  provider: "custom-knowledge-base",
  createdAt: "2025-10-29T20:58:04.693Z",
  updatedAt: "2025-10-29T20:58:04.693Z",
  server: {
    url: "https://acouty.ngrok.dev/vapi/webhooks/custom-knowledge-base/search",
  },
}
And the model again:
Copy code
{
  model: "gpt-4o-mini",
  messages: [
    {
      role: "system",
      content: `You are on the call with: Coline Farmer

Use the knowledge base to provide accurate answers to user questions.

For information, today date is: Wednesday, October 29, 2025`,
    },
  ],
  provider: "openai",
  maxTokens: 1500,
  temperature: 0.2,
  knowledgeBaseId: "adac8398-ef45-40a6-9ef8-08877d34c4ee",
}
v
To confirm if your custom knowledge base endpoint is being called, add a simple log statement to your webhook server handler. For example, in Node.js/Express:
Copy code
js
app.post('/vapi/webhooks/custom-knowledge-base/search', (req, res) => {
  console.log('Received knowledge-base-request:', req.body);
  // ...your response logic...
  res.json({ documents: [] });
});
This will let you see immediately in your server logs if Vapi is reaching your endpoint during a call. Source: [Custom Knowledge Base documentation](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
a
@Vapi Support Bot My issue is that the knowledge base is NOT called. I have a breakpoint into this controller. also have front end console logs vapi.on('message', (message) => { if (message.type= 'custom-knowledge-base') { console.log('toto')}}
v
Thanks for the details! To help narrow this down: Can you confirm that your ngrok URL (
https://acouty.ngrok.dev/vapi/webhooks/custom-knowledge-base/search
) is publicly accessible from outside your network (e.g., by sending a test POST request from a service like https://webhook.site or
curl
from a cloud VM) and that your server logs the request? This will help rule out any tunnel or firewall issues blocking Vapi from reaching your endpoint. Source: - [Vapi documentation: Custom Knowledge Base](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
a
@Vapi Support Bot Tried
Copy code
curl -X POST https://acouty.ngrok.dev/vapi/webhooks/custom-knowledge-base/search
which does trigger a log on my server 🙂
v
Thanks for confirming your endpoint is reachable via curl. To help isolate the issue, during a test call, do you see any
knowledge-base-request
events in your Vapi call logs or receive any related messages in your web client (listening for
knowledge-base-request
type, not
custom-knowledge-base
)? This will help determine if the assistant is attempting to trigger the knowledge base at all, or if the issue is before the request is sent. Example event listener:
Copy code
js
vapi.on('message', (message) => {
  if (message.type === 'knowledge-base-request') {
    console.log('Knowledge base called:', message);
  }
});
Source: - [Vapi documentation: Custom Knowledge Base](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
a
@Vapi Support Bot it is not attempting tht i all .. no it's not attempting that at all 🙁
v
Thanks for confirming the endpoint is reachable and sharing your setup. To help narrow this down: Have you checked the Vapi platform logs for any errors or rejected requests related to your assistant or knowledge base during the test call? (You can view these in the Vapi dashboard under "Logs" or via the [API](https://docs.vapi.ai/api-reference/logs/get).) This will help determine if Vapi is attempting to trigger the knowledge base and if any errors are being reported on the platform side. Sources: - [Vapi documentation: Custom Knowledge Base](https://docs.vapi.ai/knowledge-base/custom-knowledge-base) - [Vapi API Reference: Get Logs](https://docs.vapi.ai/api-reference/logs/get)
v
Based on your setup, the most actionable next step is to ensure your assistant's model configuration is being updated as a complete object (not a partial patch), including all required fields. When updating via the API, use a PATCH request like this:
Copy code
bash
curl --location --request PATCH 'https://api.vapi.ai/assistant/YOUR_ASSISTANT_ID' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_VAPI_API_KEY' \
  --data '{
    "model": {
      "model": "gpt-4o-mini",
      "provider": "openai",
      "messages": [ { "role": "system", "content": "Use the knowledge base to provide accurate answers to user questions." } ],
      "knowledgeBaseId": "adac8398-ef45-40a6-9ef8-08877d34c4ee",
      "maxTokens": 1500,
      "temperature": 0.2
    }
  }'
Make sure you are not omitting any fields and that the model object is complete, as partial updates for nested objects are not supported and may prevent the knowledge base from being triggered. [See docs for details](https://docs.vapi.ai/knowledge-base/custom-knowledge-base) Source: - [Custom Knowledge Base documentation](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
a
@Vapi Support Bot I'm not omitting any fields since oin the end of call report i can see the model with the knowledgebaseId
v
Thanks for confirming that your model object includes the
knowledgeBaseId
and that you can see it in the end-of-call report. Since your endpoint is publicly accessible and your configuration appears complete, but the knowledge base is still not being called during calls, it looks like all the standard setup steps have been covered. Based on the information provided, there isn't any additional troubleshooting step in the found information or documentation that directly addresses this scenario. If the model object is correct and the endpoint is reachable, but the knowledge base is not triggered, there may be an issue outside the scope of the configuration steps discussed so far. If you have any other details or changes in behavior, feel free to share them!
a
@Vapi Support Bot Thanks, so what are the next steps to fix this ? what am I missing ? i need to move forward
v
Thank you for your detailed troubleshooting so far. Since your endpoint is reachable and your model config includes the correct
knowledgeBaseId
, one possible edge case is if the assistant is being invoked with any additional overrides (such as
assistantOverrides
or workflow-specific settings) that might unintentionally bypass or override the knowledge base integration. Could you confirm if you are invoking the assistant with any extra overrides or through a workflow that might affect the model configuration at runtime? Even a small override (like a different
messages
array or missing field) could prevent the knowledge base from being triggered, according to the documentation. This detail will help determine if the issue is with the invocation context rather than the static configuration. [See docs for reference](https://docs.vapi.ai/knowledge-base/custom-knowledge-base) Source: - [Vapi documentation: Custom Knowledge Base](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
a
@Vapi Support Bot we are doing overrides yes, we overrides the mesage and provide the knowledgeBaseId at this moment, they are not set statically on each assitant but rather dynamically when a call is made we provide a custom assitatn conf
v
Thanks for clarifying that you use dynamic assistant configuration with overrides. To help pinpoint the issue: Could you share the exact JSON payload (or code snippet) you send when invoking the assistant at call time—including all fields in your override? This will help verify if the full
model
object (with
knowledgeBaseId
,
messages
,
provider
, etc.) is always present, as missing or partial fields can prevent the knowledge base from being triggered according to the documentation. If you can, please redact any sensitive info before sharing. Source: - [Vapi documentation: Custom Knowledge Base](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
a
@Vapi Support Bot
Copy code
{
  "assistantId": "13038bda-f6bf-4f25-a8dd-0035d965057a",
  "assistantOverrides": {
    "variableValues": {
      "systemPrompt": "You are on the call with: Coline Farmer\n\nUse the knowledge base to provide accurate answers to user questions.\n\nFor information, today date is: Wednesday, October 29, 2025",
      "firstMessage": "Hi Coline, this is Tellia. I'm ready to record your work!",
      "workerPhone": "+33652648779",
      "conversationId": "68a7f1b61d46d3a1f3ab6a8d"
    },
    "server": {
      "url": "https://acouty.ngrok.dev/vapi/server-setting?workerPhone=%2B33652648779&conversationId=68a7f1b61d46d3a1f3ab6a8d&language=en&workerId=6842c195e5eb4d342bcdb444&companyId=6841d78ae5eb4d342bcd93bc"
    },
    "model": {
      "model": "gpt-4o-mini",
      "messages": [
        {
          "role": "system",
          "content": "{{systemPrompt}}"
        }
      ],
      "provider": "openai",
      "maxTokens": 1500,
      "temperature": 0.2,
      "knowledgeBaseId": "adac8398-ef45-40a6-9ef8-08877d34c4ee"
    }
  }
}
v
Try sending a minimal, hardcoded assistant override to rule out any issues with variable interpolation or dynamic fields. For example:
Copy code
json
{
  "assistantId": "YOUR_ASSISTANT_ID",
  "assistantOverrides": {
    "model": {
      "model": "gpt-4o-mini",
      "provider": "openai",
      "messages": [
        { "role": "system", "content": "Use the knowledge base to answer user questions." }
      ],
      "knowledgeBaseId": "YOUR_KNOWLEDGE_BASE_ID",
      "maxTokens": 1500,
      "temperature": 0.2
    }
  }
}
If this triggers the knowledge base, the issue may be with how variables are interpolated or with extra fields in your dynamic payload. If not, please contact Vapi support with your payload and logs for further investigation. [Reference: Custom Knowledge Base docs](https://docs.vapi.ai/knowledge-base/custom-knowledge-base) Source: - [Vapi documentation: Custom Knowledge Base](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
a
@Vapi Support Bot What i've given you is actually a copy paste from my browser's request, so it's what is actually sent to vapi
v
Try this next: Send a minimal, hardcoded assistant override payload (no variable interpolation, no extra fields) to Vapi, as shown below. This will help determine if the issue is caused by dynamic fields or variable substitution:
Copy code
json
{
  "assistantId": "YOUR_ASSISTANT_ID",
  "assistantOverrides": {
    "model": {
      "model": "gpt-4o-mini",
      "provider": "openai",
      "messages": [
        { "role": "system", "content": "Use the knowledge base to answer user questions." }
      ],
      "knowledgeBaseId": "YOUR_KNOWLEDGE_BASE_ID",
      "maxTokens": 1500,
      "temperature": 0.2
    }
  }
}
If this triggers the knowledge base, the problem is likely with variable interpolation or extra fields in your dynamic payload. If not, please contact Vapi support with your exact payload and logs for further help. [Reference: Custom Knowledge Base docs](https://docs.vapi.ai/knowledge-base/custom-knowledge-base) Source: - [Vapi documentation: Custom Knowledge Base](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
a
@Vapi Support Bot i just told you what i send t oVAPI is what I pasted you. hardcoding won't change a thing.
v
Since your payload and configuration are correct and the knowledge base is still not triggered, the next step is to escalate this to Vapi support. Please send your exact payload, call logs, and a summary of your troubleshooting to the Vapi support team for deeper investigation—they can review backend logs and identify any platform-side issues. This ensures your case is handled directly by the engineering team, as all standard troubleshooting steps have been exhausted. Source: - [Custom Knowledge Base documentation](https://docs.vapi.ai/knowledge-base/custom-knowledge-base)
a
@Vapi Support Bot how do i send that to the support team ? Can't they read this thread ?
v
To contact Vapi support, send an email to [support@vapi.ai](support@vapi.ai) with your payload, call logs, and a summary of your troubleshooting steps. You can use the following template:
Copy code
text
Subject: Custom Knowledge Base Not Triggering – Troubleshooting Details

Hi Vapi Support Team,

I'm experiencing an issue where my custom knowledge base endpoint is not being called. Please find attached my payload, call logs, and a summary of the steps I've taken so far.

Thank you!
Support cannot access this chat thread directly, so please include all relevant details in your email for fastest resolution. For more info, see the [Vapi Support documentation](https://docs.vapi.ai/support). Source: - [Vapi Support documentation](https://docs.vapi.ai/support)
a
@Vapi Support Bot This is now resolved: Knowledge base ids needs to be attached to assistant globally. The knowledge base id cannot be part of the fed assistantOverrides when doing a call to vapi.play() I now create assistants and feed it the knowledge base, now it is correctly called 🙂
c
Glad you were able to get this resolved. If anything else comes up or you need further assistance, we’re here to help.
4 Views