f
Hold on let me give you a quick example. So you want to keep your flow as simple as possible.
One of my first recommendations would be to have a greet node message. This will say hello to the user at the start of conversation and give quick intro to your bot. Then they can be prompted for input
w
let me quickly try that
so the greet node should just be a text node, and the other one should be the raw input right?
so now how do i proceed?
f
Yes sort of, but lets add some logic so if they come in and out of this flow (you add more flows, bot expands) then they are not greeted again https://cdn.discordapp.com/attachments/1222221267466190908/1222235603307991040/image.png?ex=66157a9b&is=6603059b&hm=31dccb63ceccb5d6165dd3fe578aa1d398581ded4aa1aad62be04841106c6d6f&
I have a lame Hello in my example... I would recommend something like "Hello, I am sam. I am a virtual assistant that can help you get answers about X"
(Help set expectations from the start for a better user experience
For the isGreeted Variable I used a user variable (will stick with the user and not expire. This allows it to stay in play through the duration fo the conversation with the bot) However, on the timeout flow I do reset the variable back to false. With the idea if the user's session times out (let's say the talk to the bot and then come back 1 week later they will again get the greet message)
w
okay so
f
That can work
w
let me quickly try it oyt
f
I would adjust the hello message to not prompt for question but introduce the bot and real quick explanation of its scope
w
okay done
so my issue now is that the conversation is ending, still, so how do i make sure it keeps looping until the user closes the bot or says bye
Okay enter your prompt question here.. You can hard code it with "What can I assist you with?
OR You can use a AI generate text (will cost you each time it runs) to generate a new variation and save it in a variable
If you want it to loop back through change that transition t
go back to the standard 1 node. However for the best user experience
I would recommend switching up things a little bit
w
okay how do i proceed now
f
I would turn off the knowledge base answer on the capture informatin
I would store the user question in a variable. Let's name it userQuery
w
my workflow should be, greeting, then user input, should search knowledge base, if it doesnt find go to an ai generated, then loop back again and the user can ask more questions without the conversation ending
this should be done in the standard1? where the user is inputing his query?
f
in standarad one.. if you use the raw input capture card then it will let the user respond to the question
w
okay, so ive used a raw input, store it in a variable called userQuery and disabled the knowledge base
f
Then you can store the answer in a variable
w
okay
let me quickly do that
i dont know where to find the Query Knowledge agent
no i found it
Nice
f
So here is my flow (I added the greet to my main flow as I created a subflow for this demo so when I answer a similar question I can refer to it in the future 😉
there is a transition I added to handle things if there is no answer in the KB
w
so i can add if answer not in knowledge base, the ai generate text flow which ive put as standard2 and 3 right?
f
You can do that
I don't know what you are doing with your generate text, but usually if the bot is just answering FAQs and its a no answer it is better to use a hard coded text to re inform the user of hte bot's knowledge scope and then move on... it doesn't cost as much as you are not doing any AI calls by using the hard text
w
so my bot has to answer questions which have been given to it by the user, for now ive added only certain data, and want it to use chatgpt to answer certain other questions as a sort of proof of concept
f
you can use an AI task after getting the users query to check to ensure it is is not out of scope... I have seen people add counters that if more than X out of scope questions are being asked they end the conversation.
I can appreciate leveraging the GPT functionality, but I always caution bot builders to remember that good conversation design happens with clear expectations being set for a user, and a business use chat bot needs to have boundaries of what it can and cannot do.
So if this were to be used by a universtity you want the capabilities to be limited to what the university needs, wants, has requested and limit anything outside that scope.
w
okay i understand
f
perfect
w
so i'll just add the university website and rich text data
let me quickly do all of that and get back to you also in the final part where it says i was not able to find anything regarding your query, can we make it such that it stores the question asked, and i can access the query and add the data to the bot as it goes on?
f
Yes you can store that via tables
I have seen bot builders store questions and answers for FAQs to review later.
w
got it, let me try that and get back
f
Here are the docs
w
how do i get an exit node?
im not getting the option for that
f
Because you are in the Main flow it is your End node
exit shows on my since I built this in a subflow of one of my demo bots
w
got it, so the end flow will be the same as the exit node in your flow right?
f
Yes
The official difference is the end node ends the conversation... the exit node exits the subflow and returns to the flow that called the subflow and transitions to where I want to go after the flow is completed https://cdn.discordapp.com/attachments/1222221267466190908/1222251604640796824/image.png?ex=66158982&is=66031482&hm=cc4313fd8aec2f6676d793d277aca5de570a6fe8dfcf17eb4e188cbd25f7a795&
w
got it thank youu
f
No worries
w
also the execute code, what should i put over there?
f
w
i get that, so that will only reset after the conversation has ended right?
f
if you are doing a table you will want to add data before clearing the variables
w
i shall do that
f
Also add the info in the redefine node and transition that through the variable reset as well
I think you have a good grasp now. Enjoy exploring and experimenting. We are happy to point you in the right direction if you get really stuck.
w
okay thank youu
f
My pleasure
w
but here, one last thing why didnt it look into the knowledge base
f
Ah you may need to tweak the AI transition
If the AI transition is acting finnicky you can use a AI task or AI generate text card to set a variable and transition off that variable instead
w
okay done, i'll figure it out from now
thank you so muchh
f
Always happy to help. You've got this!