Preventing a Knowledge Based node from answering g...
# 🤝help
e
Hello, I am trying to find a way to prevent the bot from answering general question when giving the option to ask an open question. CONTEXT: I am building a lead generation bot for a B2B company and in the tree structure I have designed some parts of the flow where the user can ask general questions regarding the company and its services. However, once on this node, a user could potentially ask for something unrelated (like "how do you cook an egg") and the bot will still attempt to API call GPT 3.5 and answer the question. How can I return a message such as " I don't know, I am here to help with Company XYZ, my answers are limited" ? Thank you in advacne for you rhelp
a
Hey @early-truck-36933, knowledge bases are great for this because they let you explicitly write which facts and bit of information the bot should know about, and anything outside of that domain the bot won't answer. You can learn more about knowledge bases in our documentation here https://botpress.com/docs/cloud/studio/knowledge-base/
e
Hello @acceptable-kangaroo-64719 thank you! It makes sense, however if the question asked is outside of the knowledge base, how can I return a piecof text that says "This is outside of the knowledge base, please ask a related question?" ? Thank you!
b
You can use {{!turn.KnowledgeAgent.answer}} so that if there is no answer, you redirect it to a node where it says what you want and return it to "listen" for another question 🙂
e
Hello @bumpy-addition-21507 - will try right away!
Works - Confirmed. Thank you again!

https://cdn.discordapp.com/attachments/1145742561324060765/1145763403219083325/Screenshot_2023-08-28_at_17.54.26.png

10 Views