https://discord.gg/botpress logo
Reduce token usage by Autonomous Node
# 🤝help
m
So I inspected some logs and saw that botpress includes a very long and thorough prompt of their own with every single AN call. This causes a huge surge in the token usage, while making the bot smart. Is there any way to get rid of that prompt or reduce it in some way? 5000+ tokens for a single reply is too much.
@prehistoric-airplane-85682 would love your input here.
Also, I tried checking per message cost. I asked the bot a question, the answer to which was present in the AN instructions. The bot still executed a knowledgebase hook (saw in the logs).
l
To reduce token usage, try to lessen the characters used in the instruction of your autonomous node and disable agents you are not totally using.
m
I've only left KB agent enabled. Still about 7000 tokens per turn for even the first message.
w
indeed that's not possible to change/modify the "system" prompt (which could be a great thing i agree - some unchangeable rules are needed though to make the system work)
m
Yeah for example the system prompt encourages the bot to write its own code and execute it, which we have little to no control over.
p
You cannot get rid of the system prompt but it should only be around 3500-4000 tokens. To avoid the Autonomous node using the knowledge agent if it's supposed to have the information in the prompt I would suggest removing the search Kb card. Otherwise you can see if changing the model impacts the token count but it definitely impacts the price. Hope this helps!
4 Views