adverse-sapphire•4mo ago
How can I implement knowledge base in API call for create call?
I want to implement it in my API request because all my settings of the assistant are there.
13 Replies
To use a knowledge base in your API call for creating a call, first update your assistant to include the knowledge base via the Query Tool. Then, reference this assistant in your call creation request. Here’s how to attach a knowledge base to your assistant using the API:
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 - API Reference: Update Assistant
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 - API Reference: Update Assistant
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
sensitive-blue•4mo ago
Use the assistantOverrides field to customize the system prompt, model, voice, transcriber, and dynamic variables directly within the API call.
To use a knowledge base in your API call for creating a call, you must first attach the knowledge base to your assistant. Here’s how to do it:
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 Sources: - Using the Query Tool for Knowledge Bases - API Reference: Update Assistant
Reference: Using the Query Tool for Knowledge Bases Sources: - Using the Query Tool for Knowledge Bases - API Reference: Update Assistant
adverse-sapphireOP•4mo ago
will this work for a tool part?
Yes, your tool definition is in the correct format for a Query Tool, but you must also link it to your knowledge base files and attach it to your assistant. Here’s a sample structure:
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 Source: - Using the Query Tool for Knowledge Bases
See full guide Source: - Using the Query Tool for Knowledge Bases
sensitive-blue•4mo ago
Yes, just ensure the "type" is appropriate "function" if it’s executing an action and define a server if it’s calling an external API.
adverse-sapphireOP•4mo ago
i have to connect the knowledge base with this. do i just implement this into the tool?
@Kings_big💫
To use a knowledge base in your API call for creating a call, you must first attach the knowledge base to your assistant.
Update your assistant with the Query Tool ID like this: 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 Sources: - Using the Query Tool for Knowledge Bases - API Reference: Update Assistant
Update your assistant with the Query Tool ID like this: 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 Sources: - Using the Query Tool for Knowledge Bases - API Reference: Update Assistant
sensitive-blue•4mo ago
Yes
Yes, you should include the
See the Vapi Query Tool guide for full details. Source: - Using the Query Tool for Knowledge Bases
knowledgeBases
array in your Query Tool definition. Here’s a sample structure:
After creating the tool, attach it to your assistant using the tool ID.See the Vapi Query Tool guide for full details. Source: - Using the Query Tool for Knowledge Bases
adverse-sapphireOP•4mo ago
so this is good enough to work?
To connect your knowledge base to your tool, include the
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 Source: - Using the Query Tool for Knowledge Bases Yes, your setup is good enough to work.
Just make sure your
See full guide Source: - Using the Query Tool for Knowledge Bases
knowledgeBases
array in your tool definition and then attach the tool to your assistant. Update your assistant like this:
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 Source: - Using the Query Tool for Knowledge Bases Yes, your setup is good enough to work.
Just make sure your
knowledgeBases
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 Source: - Using the Query Tool for Knowledge Bases
Please try it and let us know if you have any issues