https://discord.gg/botpress logo
AI Token Usage Clarification for Custom Skills & R...
# 🤝help
f
I’m building a chatbot with the following capabilities: 1. Custom skills like: * Fetching latest notes * Searching notes by term * Showing platform stats (These call a secured API route in my nextjs app.) 2. RAG-based answers from a knowledge base. I wanted to clarify a few things: * Do custom skills that call my own secured API consume AI tokens? * Does RAG (knowledge base Q&A) consume AI tokens every time a user asks something? * If I launch this for around ~500 users, how will token usage scale? I’m a student building this as a side project and I want to avoid unexpected AI credit usage. Could someone guide me on how token consumption works in these cases and how I can minimize costs? Thanks in advance 🙏 https://cdn.discordapp.com/attachments/1477631746743992450/1477633406136221838/image.png?ex=69a578d9&is=69a42759&hm=83e09c3ede19903fdba5d48b583d87210f6a574b1af1515626115a8a6e0add21&
also, sometimes - the bot doesn't show platform stats even though it receives the data from the api I dry ran the api and it's working fine I also checked the logs of the bot and it is indeed receiving the data but 60-70% of time it doesn't reply when I type "show platform stats" or just "platform stats" one thing I noticed was whenever I clicked on the predefined button it gave me "show platform stats" it almost always reply with the stats How do I solve this? Other features work fine.
l
- Code you write in Actions runs as ordinary server‑side code. It does not invoke the LLM, so it does not consume AI tokens. - KB Q&A does consue ai tokens - For your 500 users, the Token usage is proportional to the number of AI calls, not the number of users. - My #1 tip t minize costs would be to choose a cost effective LLM. You can review the different options in the bot settings: https://cdn.discordapp.com/attachments/1477631746743992450/1478113398746255400/image.png?ex=69a737e0&is=69a5e660&hm=00fd6750b2bb11c4ebe56ce422d91784e309540e26685cd35a909a5eb4352dea&
f
Does knowing the intent like "What are the stats of the platform?" which triggers the api call also consume ai tokens? so like, knowing which skill to execute based on user's input and giving the appropriate formatted output (eg. in tabular form, or in points format)
@loud-crowd-60573
l
If it's just different forms of generated responses it won't have much of an effect. The real cost comes from how hard the LLM needs to work. You can always: - test different replies in the emulator - check the logs on the studio page to check the AI costs per message and compare!