better way to add knowledge base?
# support
s
To your experience, which has been the better method to add a knowledge base to your agent? Adding it as a file? Or a Tool?
v
Both methods—adding a knowledge base as a file or as a tool—are supported in Vapi. - File method: Simple, quick setup via the dashboard; best for straightforward use cases. - Tool/API method: Offers advanced configuration, custom retrieval logic, and integration flexibility; recommended for complex or programmatic needs ([Vapi documentation](https://docs.vapi.ai/knowledge-base/using-query-tool)). To help you further: Are you looking for a quick setup, or do you need advanced customization and integration with external systems? Sources: - [Vapi Knowledge Base Documentation](https://docs.vapi.ai/knowledge-base) - [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)
c
Hi Shivansh, Adding as Files (Dashboard Method) : Pros: - Simpler setup through UI - Automatic knowledge base creation - Good for basic use cases - Easier maintenance and updates Tool Method (Query Tool) : Pros: - More customizable configuration - Better control over search parameters - Can combine multiple knowledge bases - More advanced retrieval options - Can customize response formats Example Tool configuration:
Copy code
{
  "type": "query",
  "knowledgeBases": [
    {
      "provider": "google",
      "model": "gemini-1.5-flash",
      "files": [
        "file-id-1",
        "file-id-2"
      ]
    }
  ]
}
Recommendation: - Use Files method for simple, straightforward knowledge base needs - Use Tool method when you need: - Advanced configuration - Multiple knowledge bases - Custom search behavior - More control over retrieval
2 Views