https://retellai.com/?utm_source=discord&utm_medium=seo logo
how does token usage work with knowledge bases
# ask-retell-partners
e
@AI Evy how does token usage work with knowledge bases?
a
Thanks for tagging me @evan_60110. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, yes, knowledge base tokens are counted in token usage [(1) ]() . When a knowledge base is linked to an agent, the system retrieves relevant chunks from the knowledge base and feeds them to the LLM as context during response generation [(2) ]() . These additional tokens sent to the LLM are included in your token count [(1) ]() . The knowledge base works by using the transcript so far to find the most relevant chunks from the knowledge base and providing them as context to the LLM [(2) ]() . This happens automatically for every response generation when a knowledge base is linked to an agent . Additionally, there's a usage-based charge of $0.005 per minute for calls that have knowledge base enabled, regardless of whether you're using one or multiple knowledge bases .
​ To learn more, see the sources I considered: [[1] Will knowledge base use tokens?](https://discord.com/channels/1186424376300679209/1375421036291428452) [[2] Knowledge Base](https://docs.retellai.com/build/knowledge-base) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
e
but does it incur token usage if the knowledge base isn't called?
@AI Evy but does it incur token usage if the knowledge base isn't called?
a
Thanks for the follow-up, @evan_60110. I'll get back to you soon.
### Answer Based on the available sources, I don't have specific documentation about token usage when the knowledge base isn't actively called or retrieved during a conversation [(1) ]() . The sources confirm that when knowledge base content is retrieved and sent to the LLM, those tokens are counted [(2) ]() , but they don't explicitly address scenarios where the knowledge base is linked to an agent but no relevant chunks are retrieved for a particular response. The knowledge base system works by using the conversation transcript to find relevant chunks and providing them as context to the LLM [(1) ]() . However, the sources don't specify whether token usage occurs only when chunks are actually retrieved or if there's overhead even when no relevant content is found. For the most accurate information about token usage in scenarios where the knowledge base doesn't retrieve relevant content, I'd recommend checking with Retell AI support directly. **
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[2] Will knowledge base use tokens?](https://discord.com/channels/1186424376300679209/1375421036291428452) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.