Trying to determine where or not a Knowledge Base ...
# 🤝help
s
I'm using {{event.state.agentVariables.KnowledgeAgent.turn.responded === true}} to try to determine whether or not the answer was found in the knowledge base. Is this the proper var to be looking at? It seems to always be returning false even when I ask a question specificaly out of the knowledge base
b
Do you have the "answer on start node" parameter checked in the knowledge agent ?
s
I do not, I turned it off
b
That's why, try to turn it on and run your test again
To explain, in your example the KB canno't be triggered when you test it
c
just to ask, when you capture the answer from the kb node how do you get it to be written in chat
do you use an ai task and use the exposed var as an input?
and then put the task as "leave this be" and save it as var @answer?
b
When using manual answering ?
c
Yep
b
I just started experimenting with it today, but you should be able to use a message card with {{turn.KnowledgeAgent.answer}} in it
c
did it work for you>
?
b
Yeah
The only trouble I had was when I wanted to use an AITask to transform the KB answer
s
Thanks for the help! When i have it on it answeres the question before it goes to the next node
c
yeah ive been trying to do that too!
b
Somehow if I gave the AI this same variable it would not process it, in that case I used a code card, and placed the turn.KnowledgeAgent.answer inside a workflow variable, then gave the worklow variable to the AITask, and there it worked
c
basically trying to make stack ai in bot press lol
s
@daniel do you mean like this?
I stored it in a new var called answer and then used it later
c
oh dude i had no idea you could have two variables for the input🤯
game changer
s
Yeah, I wish there were more examples provided! I found that in the docs somewhere
b
Yeah so, the way the knowledge agent works is that if it detects a possible answer regarding the user input, it will instantly put it in the chat. In your case I think you want to use a capture card with the knowledge agent activated on it, and then only after test if the kb found something
I'll make a quick example cause its not so clear throught text lol 1 sec
s
Okay, Im very new so i havent tried the capture cards yet. I will look into those
That would be great if you provide an example! Appreciate it
c
did you have it like this dude?
b
The capture card would have something like "what's your question" inside
and you need to have the knowledge base activated on the node itself like this:
c
ignore my last message
b
That way you can even deactivate the answer on start node, but you will also have to say hello to the bot first because for now the bot needs to "wake up" before answering
s
Works!!! Thank you
b
They also recently added a manual way to use the knowledge base, that's what Daniel and I were talking about above. It is a bit more complicated to use but it can also be more flexible, so you might want to check it out
s
I saw that. I will check that out. I'm questioning if I even need to do this. I'm wanting to make a bot that answers the questions to the rule of a game. My thought process was to pull all of the relevant rules I could find and then pass to Chat gpt
Knowledge base auto answers seem very good though
b
When you say pass them to chatGPT you mean put them inside a knowledge base ?
s
Using an AI Task to pass what was found in hte knowledge base so chat gpt can read through and formulate an answer
b
You can try that, but I think what I would try before it, would be to upload all your rules in a KB. Then add some questioning loop with a capture card waiting for the user's question. The KB answer will depend entirely on the content of it, but I think that game rules should give good answers, you may not even need an AITask for that.
s
THanks for the advice, I will try that. My worry was hallucinations if the rules are too complex but better to keep it simple if it does answer correctly
b
From what I know, the knowledge base only uses NLU. It's a bit like if it were triggered on key words, but better, and its answers will only be what is inside it. As opposed to AITasks that use ChatGPT, here it could hallucinate, but KB don't hallucinate.
s
Interesting! thats very good to know. I am probably over complicating it. KBs sound like the perfect use case for this
197 Views