Call dropped because KB is too big?
# support
m
@Shubham Bajaj @Sahil Not sure what's happening, on the same topic as call latency where I mentioned the KB was getting pulled at the beginning of the call right after the user speaks. I have thise one where the call drops because it says the prompt is too big? here's the call id: 3f79dfa8-cb68-4cc4-8812-e89f9526112d First I didn't modify the prompt. I have my KB setup in Trieve, I did index 21 pages of a website using the crawl functionality they have. Uploaded 1 file too. Why would it drop the call and say the prompt is too big? Seems like it's passing all of the KB to the VAPI prompt somehow? That would explain the slow latency...
v
Hi there! 👋 I can help explain what might be happening with your call drops. The issue is likely related to token limits. The 4o-mini model used by VAPI has a maximum context window of 128k tokens. When your knowledge base content is being retrieved and added to the prompt, it might be exceeding this limit. Here's what's happening: - When your KB is too large, all that content gets pulled into the prompt - While VAPI does implement prompt trimming when exceeding the 128k token limit, this might still cause issues with call performance To fix this, I'd recommend: 1. Content chunking - Break your knowledge base into smaller, more digestible pieces that can be processed more efficiently [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/1336243643043938395) 2. Optimize your search configuration - Adjust parameters like topK and scoreThreshold in your search plan to limit how much content is retrieved [(source)](https://docs.vapi.ai/knowledge-base) 3. Consider token limits - It's advised to limit prompt lengths to around 2500 tokens for optimal performance [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/1305065394662408192) The fact that you indexed 21 pages plus an additional file might be creating a very large knowledge base that's being pulled in its entirety into your prompts. Sources: - [Knowledge Base Documentation](https://docs.vapi.ai/knowledge-base) - [Discord Channel Token Limits](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1305065394662408192) - [Discord Channel Content Structuring](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336243643043938395) - [Discord Channel Prompt Trimming](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333543668463698032)
m
Not helpful, changing the KB configuration is not the fix. I think the problem is because your system sends request to the KB for every word that's spoken...
I have my score set at 0.4 for BM25. Here was what I said on the phone "I'm just testing" and somehow VAPI sends that to the KB and the KB responds with a giant chunk back. Not sure why... It seems like one of the main issue is that you send a request to the kb after every pause of the user speach. Can't you detect when the user asks a question and only pull from the KB when the prompt instructs the AI to do so? https://cdn.discordapp.com/attachments/1349430102563487796/1349438241950142631/image.png?ex=67d319cc&is=67d1c84c&hm=fc041dd7cd5227f2f384a8d568502a902d4f61b38cb6d6f79082b37610ac3d8f&
n
Just following up that we were able to connect through DM 👍
2 Views