https://retellai.com/?utm_source=discord&utm_medium=seo logo
Does adding a knowledgebase to an agent increases ...
# ❓・ai-evy-support
k
@AI Evy Does adding a knowledgebase to an agent increases token usage?
a
Thanks for tagging me @K Rudy. I'll look through relevant sources and get back to you shortly.
### Answer Yes, adding a knowledge base to an agent increases token usage. [(1) ]() When a knowledge base is linked to an agent, the agent retrieves information from the knowledge base before responding. [(2) ]() The retrieved knowledge base content is appended to the LLM prompt under the header "## Related Knowledge Base Contexts". These additional tokens sent to the LLM are counted toward your token usage. [(1) ]() **
​ 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.
k
@AI Evy so, if token usage is the same, whats the purpose of the knowledgebase?
a
Thanks for the follow-up, @K Rudy. I'll get back to you soon.
### Answer --- The knowledge base is designed to handle situations where you have too much information to fit in your prompt. [(1) ]() When you link a knowledge base to an agent, the agent automatically retrieves only the most relevant chunks from the knowledge base before responding, using the transcript so far to find what's needed. This means instead of putting all your company information directly in the prompt (which would be impossible for large amounts of data) , the knowledge base dynamically pulls in just the relevant context for each response. The knowledge base is particularly useful for use cases like support, helpdesk, and FAQ where there's a lot of available information, but having that information is essential for the agent to respond correctly. **Pricing note**: Using a knowledge base adds $0.005 per minute to your call costs.
​ To learn more, see the sources I considered: [[1] 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.
k
@AI Evy But in terms of having the information stored, every word inside a knowledge base costs the same amount of tokes as if it was written in the prompt?
a
Thanks for the follow-up, @K Rudy. I'll get back to you soon.
### Answer No, not every word in your knowledge base costs the same as if it was in the prompt. That's the key advantage. The knowledge base only retrieves and sends relevant chunks to the LLM during each response. [(1) ]() You can configure how many chunks are retrieved (1-10, default is 3) and the similarity threshold (default 0.60) . So if you have 100 pages of documentation in your knowledge base, only the 3 most relevant chunks get added to the prompt for each response—not all 100 pages. This is much more token-efficient than trying to put everything in your prompt. However, once those chunks are retrieved and added to the prompt, yes, those specific tokens do count toward your LLM usage. The retrieved content is appended under the header "## Related Knowledge Base Contexts". **In summary**: Storage in the knowledge base itself doesn't cost tokens. Only the retrieved relevant chunks that get sent to the LLM for each specific response count as tokens.
​ To learn more, see the sources I considered: [[1] 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.