Bot repeating knowledge base
# 🤝help
b
Hello:-) I am trying to build a bot that interacts with users as a Sheriff from the 1800s. The sheriff was a real person. He's a volunteer project I am doing for a volunteer organization. I would like the bot to: 1.pretend it is the sheriff through all interactions 2.answer questions about the sheriff in the first person 3.be able to answer other random questions that are not related to the sheriff, much like a ChatGPT I've made a rudimentary design of a chatbot in the BotPress studio. I took apart one of the templates. I did keep two components of the original template (which can be seen in a screen shot) because I knew I might need them, but I did 'disconnect' them from my main node. I made the bot a 'knowledge base' based on facts for the sheriff, and put in 'intents'. I enabled 'knowledge answering' on the node. I defined the task of the AI and of the 'personality agent'. The bot also has a 'summary' and 'knowledge agent', of which I've done nothing to. These items are visible in the screen shots. The bot: mimics the sheriff well talks in the first person, mostly seems to access the knowledge base well, in one respect However: 1. It will give me 2 answers for my question, the first being from the knowledge base, and then a repeated version of it, but not verbatim. 2. If the answer can be done with text, both answers will be right. If the answer includes a date, the latter answer will be incorrect. The dates it provides in the latter answer are nowhere in the knowledge base. For instance, the knowledge base answer for the sheriff's death date is correct. The latter answer is completely wrong. It did get its birthday right though. 3. I tried getting it to answer a random question. It couldn't give me a donut recipe, but it could identify a donut, which tells me it is accessing something other than the knowledge base (no donuts mentioned in there). I'm sure this is simple. Does anyone have a suggestion?
a
Hey @bitter-morning-97120, thanks for the well organized post! Looking at your flow, my guess is that the AI Task is taking the conversation history and knowledge results and re-writing them to sound like the sheriff, right? If so, this is redundant with the personality agent. It's also the most likely reason why your bot is repeating itself. Unless you tell it otherwise, the Knowledge Agent will send an answer to the user before anything in the node is executed. So, if the user asks a question that the knowledge agent knows, it'll send the answer, then start the AI task and capture cards. You can disable this behavior by enabling "Answer Manually" on the knowledge agent's settings
Finally, for out-of-scope questions like the donut recipe, you can make a transition that looks at the variable
{{turn.KnowledgeAgent.answer}}
. This variable will be filled if the Knowledge agent has an answer, and empty if not. Then, if the knowledge agent doesn't have an answer, you can move on to a controlled "I don't know" kind of flow.
b
Thank you so much:-) Setting the Knowledge Agent to "answer manually" did work. I'm now trying to create the transition. I'm using an expression transition, and attempting to direct it to an "out of scope" flow. I'll see if my creation works. Thanks again!
21 Views