This video answers the common question of how to give a voice agent business-specific knowledge in Vapi. It explores three methods for integrating a knowledge base into an AI assistant, explaining the pros and cons of each to help users choose the best approach for their needs.
The three methods covered are:
- Method 1: Directly in the Prompt: This approach involves pasting the knowledge base directly into the system prompt. The video explains that this method works for smaller knowledge bases but can be difficult to control, potentially leading to irrelevant information being used.
- Method 2: File Integration: Vapi's built-in file integration allows you to upload a file (e.g., a text document) and connect it to the assistant. While this is easy to set up, the video warns against it, noting that it can lead to higher costs, slower response times, and more frequent hallucinations because the entire knowledge base is injected into every message.
- Method 3: The Knowledge Tool (Recommended): The video recommends using a knowledge tool, which allows the AI to decide when to retrieve information from a connected file. This method is shown to be the most efficient and cost-effective, resulting in less hallucination and better overall performance.
The video also touches on a fourth, more advanced method—using a Function Tool to connect to external services like a vector database—for cases that require more granular filtering.
Timestamps:
- 0:00 - Introduction to the Problem and Methods
- 0:27 - Method 1: Adding Knowledge Directly to the Prompt
- 2:09 - Method 2: Vapi's Built-in File Integration
- 4:56 - Method 3 (Recommended): Using a Knowledge Tool
- 8:47 - Live Demo of the Knowledge Tool in Action
- 9:58 - Advanced Method: Using a Function Tool
- 11:22 - Which Method is Best and Why