wreox
05/24/2025, 12:53 PMVapi Support Bot
05/24/2025, 12:54 PMbash
curl --location --request PATCH 'https://api.vapi.ai/assistant/ASSISTANT_ID' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": {
"provider": "openai",
"model": "gpt-4o",
"toolIds": ["<QUERY_TOOL_ID>"]
}
}'
After this, use the assistantId in your call creation API request.
Note: The knowledge base must be set at the assistant level before making the call; it cannot be set directly in the call creation request.
Sources:
- [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)
- [API Reference: Update Assistant](https://docs.vapi.ai/api-reference/assistants/update)Kings_big💫
05/24/2025, 12:56 PMVapi Support Bot
05/24/2025, 12:57 PMbash
curl --location --request PATCH 'https://api.vapi.ai/assistant/ASSISTANT_ID' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": {
"provider": "openai",
"model": "gpt-4o",
"toolIds": ["<QUERY_TOOL_ID>"]
}
}'
After this, use the updated assistantId in your call creation API request. The knowledge base cannot be set directly in the call creation request.
Reference: [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)
Sources:
- [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)
- [API Reference: Update Assistant](https://docs.vapi.ai/api-reference/assistants/update)wreox
05/24/2025, 1:03 PM"type": "query",
"function": {
"name": "query_tool",
"description": "This tool is used to retrieve information. Including information, general or frequently asked questions.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
Vapi Support Bot
05/24/2025, 1:05 PMjson
{
"type": "query",
"function": {
"name": "query_tool",
"description": "This tool is used to retrieve information. Including information, general or frequently asked questions.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
}
Be sure to reference your knowledge base files and attach the tool to your assistant using the tool ID for it to work.
[See full guide](https://docs.vapi.ai/knowledge-base/using-query-tool)
Source:
- [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)Kings_big💫
05/24/2025, 1:06 PMwreox
05/24/2025, 1:08 PM"knowledgeBases": [
{
"name": "general_questions",
"provider": "google",
"model": "gemini-1.5-flash",
"description": "Use this knowledge base when a user requests information.",
"fileIds": [
"-----------------------------"
]
}
]
Vapi Support Bot
05/24/2025, 1:08 PMbash
curl --location --request PATCH 'https://api.vapi.ai/assistant/ASSISTANT_ID' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": {
"provider": "openai",
"model": "gpt-4o",
"toolIds": ["<QUERY_TOOL_ID>"]
}
}'
After this, use the updated assistantId in your call creation API request. The knowledge base cannot be set directly in the call creation request.
[Full guide here](https://docs.vapi.ai/knowledge-base/using-query-tool)
Sources:
- [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)
- [API Reference: Update Assistant](https://docs.vapi.ai/api-reference/assistants/update)Kings_big💫
05/24/2025, 1:09 PMVapi Support Bot
05/24/2025, 1:09 PMknowledgeBases
array in your Query Tool definition. Here’s a sample structure:
json
{
"type": "query",
"function": {
"name": "query_tool",
"description": "This tool is used to retrieve information, including general or frequently asked questions.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
},
"knowledgeBases": [
{
"name": "general_questions",
"provider": "google",
"model": "gemini-1.5-flash",
"description": "Use this knowledge base when a user requests information.",
"fileIds": ["<YOUR_FILE_ID>"]
}
]
}
After creating the tool, attach it to your assistant using the tool ID.
See the [Vapi Query Tool guide](https://docs.vapi.ai/knowledge-base/using-query-tool) for full details.
Source:
- [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)wreox
05/24/2025, 1:10 PMVapi Support Bot
05/24/2025, 1:11 PMknowledgeBases
array in your tool definition and then attach the tool to your assistant. Update your assistant like this:
bash
curl --location --request PATCH 'https://api.vapi.ai/assistant/ASSISTANT_ID' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": {
"provider": "openai",
"model": "gpt-4o",
"toolIds": ["<QUERY_TOOL_ID>"]
}
}'
After this, use the updated assistantId in your call creation API request.
The knowledge base must be attached to the assistant before making the call—this cannot be set directly in the call creation request.
[Full guide here](https://docs.vapi.ai/knowledge-base/using-query-tool)
Source:
- [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)Vapi Support Bot
05/24/2025, 1:11 PMknowledgeBases
array is included in your Query Tool definition, and that you attach the tool to your assistant using its tool ID. Here’s a quick checklist:
- Define your Query Tool with the knowledgeBases
array.
- Attach the tool to your assistant.
- Use the updated assistant in your call creation.
Test your assistant to ensure it retrieves knowledge base info as expected.
[See full guide](https://docs.vapi.ai/knowledge-base/using-query-tool)
Source:
- [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)KINGS BIG
05/24/2025, 9:05 PM