Query tool using Google Knowledge Base
# support
s
Hey VAPI team, I’m in the process of migrating our knowledge base from Trieve and testing the Google Knowledge Base option. I’ve set up the tool and attached it to my assistant, but I’m noticing the AI is taking a bit longer (around 2 seconds) to respond back. Right now, I have only added 2 short txt files with some instructions. Do you have any recommendations to make it faster and better? Here’s the tool structure I’m using:
Copy code
json
{
    "type": "query",
    "async": false,
    "function": {
        "name": "knowledge-search"
    },
    "knowledgeBases": [
        {
            "name": "assistant-kb",
            "model": "gemini-2.5-flash-lite",
            "fileIds": [
                "bf40ee4a-87f7-44f9-a2f1-102101c9fa49",
                "cad40fc4-a12e-4d18-bd01-4d356ade0e76"
            ],
            "provider": "google",
            "description": "Contains comprehensive information about the company, its products, services, policies, and procedures. Use this knowledge base to provide accurate and relevant information to customers."
        }
    ]
}
OrgId: 07e7bc0b-76ea-4a0f-97c8-9157ff11d5d8 AssistantId: 9ac31c91-3d6f-4963-9517-8756834c94ce CallId: db9aae4c-eacd-4db2-ada9-aad297228bb8 Tool duration: 1.2sec https://cdn.discordapp.com/attachments/1420096695173386260/1420096695403806851/image.png?ex=68d4279c&is=68d2d61c&hm=a626de72b15c4ba89fdda5d5ef0b1043d5ddf34959cebefa50b173e51bf0f752&
v
Thanks for sharing your setup and tool structure! To help pinpoint the cause of the ~2 second response time, could you let me know the approximate size (in KB) and structure (e.g., number of sections or headings) of each .txt file you’ve added? This will help determine if file formatting or size is impacting performance. Sources: - [Migrating from Trieve](https://docs.vapi.ai/knowledge-base/migrating-from-trieve) - [Best Practices for Knowledge Base Creation](https://docs.vapi.ai/knowledge-base) - [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)
s
file size is less than 100kb
This is the file content
Copy code
We are a pizzeria

we have 3 kinds of pizza

cheese
bacon with cheese
bacon

the customer can order just 1 pizza at order
@Lordvickthor As I sent in my message above, my file is super short. Do you have a JSON tool example to compare with mine? Which Google model is faster?
@Shubham Bajaj could you support me>
c
Hi Seygi, Here are recommendations to optimize your Google Knowledge Base performance: 1. File Optimization: - Keep individual files under 300KB to ensure faster processing - Use clear, well-structured file formats - Consider splitting larger files into smaller, focused documents 2. Knowledge Base Configuration: - Use the recommended model configuration (
gemini-2.5-flash-lite
appears to be your current choice) - Consider organizing content into separate knowledge bases by topic for better retrieval accuracy - Ensure files are well-structured with clear headings and sections 3. Recommended Timeout Values: For 2-second response times, consider implementing these optimizations: - Use clear and concise language in your files - Structure content logically with clear headings and sections - Consider caching frequently searched content 4. Advanced Implementation: - Implement hybrid search if available - Consider using more focused file content instead of broad documents - Monitor and track search result relevance metrics Note that some latency is expected when using external knowledge bases, but 1.2 seconds is actually within reasonable bounds for knowledge retrieval. However, if you need faster responses, consider further optimizing your file structure and content organization. Let us know if this helped.
s
my file content is super small I dont think this is the root cause
c
there are several factors that can affect Google Knowledge Base performance: 1. Response Time: - Google knowledge bases inherently have higher latency compared to custom knowledge bases due to Google Gemini model processing [1](https://docs.vapi.ai/knowledge-base/migrating-from-trieve) 2. Optimization Tips: - Keep individual files under 300KB for optimal processing - Use clear, well-structured file formats - Minimize the number of files per knowledge base where possible 3. Consider Alternative: If response speed is critical, you might want to consider using a Custom Knowledge Base instead because: - It has lower latency (direct database query) - Allows complete control over search logic - Can be optimized with caching and custom indexing The 2-second response time you're experiencing is expected with the Google Knowledge Base option. If faster response times are crucial for your use case, migrating to a Custom Knowledge Base would be recommended, as it typically provides sub-50ms response times when properly optimized.
3 Views