AI Task Input?
# 🤝help
a
what should i fill the AI Task Input, this is my AI Instruction : You are a master at analyzing user intention. Analyze precisely what the user intention is based on their last message, and then take them to their respective nodes.
e
Hey @adamant-agent-88924, maybe you don't need the AI Task after all, since that processing is done by the intents
The intent transition already checks the last message (which you can read manually with
event.preview
in a code or expression)
a
Yea, but I typed so many sentence on the book an appointment intent, like : "appointment pls", "Book an appointment?" Basically all possibilities j have included there, yet when I type "book an appointment pls? " It says doesn't find anything on knowledge when it is supposed to go to the Book An Appointment Node where it captures their data to book appointment.
m
I have the same problem I hope someone knows any way to make it
b
Hey. @adamant-agent-88924 @mammoth-hydrogen-6089 Try to do it this way and let me know if that helped. 1. create variable userIntent. It will be used to store the result of AI processing. 2. Create AI Task block. In task instruction give it something like that:
Copy code
I want you to classify input into one of 3 categories, like in examples:
GREETING or APPOINTMENT_REQUEST or OFFENSIVE_CLIENT.
- if client's message is a greeting (for example - 'hey', 'hello'), then return GREETING
- if client's message is a request to book appointment (for example - , 'hello I want to book an appointment', 'appointment pls', 'book appointment'), then return APPOINTMENT_REQUEST
- if client's message is something offensive, then return OFFENSIVE_CLIENT
and store return result in @userIntent variable
3. Add Transition blocks for each type of returned value. Example:
Copy code
workflow.userIntent === "GREETING"
workflow.userIntent === "APPOINTMENT_REQUEST"
And then you can procceed to next nodes, knowing what your client intent was. Hope that's clear enough. If any questions, drop me a message
e
@busy-printer-481 that is a great suggestion, thanks for that! But an even easier way to achieve that is by using intent transitions!
@adamant-agent-88924, you are getting the Knowledge Base answer because you have enable the "Answer on Start Node" option of the Knowledge Agent. Please disable and it will start working
You can then remove the AI Task altogether! And for the last intent, turn it into an "always" expression, and transition to another node with a text card saying: i didn't get that, could you repeat? You could show the options too, will be useful for the user to know what they can do
s
Is there a way to run a knowledge check immediately after the intent has sent the user to a new work flow? For example, I want to store the KB outside of the root folders. But if the user asks in start of conversation, I can push them to the correct workflow using intent, but I can't then immediately read the previous message to do a knowledge check.
e
There is no way to trigger the Knowledge Bases at will right now. @acceptable-kangaroo-64719 do you see any workarounds?
a
This is actually something I'm working on figuring out right now for a different project 😅. So far I've not found anything though
s
Thanks for the reply! Would love to have as a feature one day. I think there could be some very common use cases! If I figure out a work around I'll share
b
@early-train-33247 do you mind sharing a quick example on how to rework the flow I presented to intents ? Thank you 🙂
e
Please make a post on #1111026806254993459 with your use case, so other people can update and join the discussion!
Hey @busy-printer-481. Here are the steps: 1. Go to the library tab (book icon) and create one intent for each action the user might take (add several example messages so that the bot can generalize better) 2. Go to the first node after the Start, and add a Intent card for each intent 3. Add the transitions for each intent that go to the desired nodes or workflows
a
Thanksss for the help !! i will try it and tell you how it goess.
Thanksss for the help aswell, i will also try this.
ok so this is my workflow currently, i fixed the book an appointment problems, unchecked the start on node options, but now the problem is ask questions intent, its supposed to go to a nodes where an AI assistant will answer their question based on knowledge base, but the AI didnt generate any responses when i type "can i ask"
a
Knowledge base answers are not automatically shared with the AI Task. If you want the AI Task to include info from the knowledge base, you need to add
{{turn.KnowledgeBase.answer}}
as an input to the task.
a
Thankss so muchh @acceptable-kangaroo-64719 , it seems like the problem is fixed, i will get back when i find any confusion again !!
@acceptable-kangaroo-64719 just a quick question, {{turn.KnowledgeAgent.citations}} where should i put this?
is it in the AI Task Input together with {{turn.KnowledgeBase.answer}} or somewhere else?
a
Put it in the box labeled "AI Task Input" with the other stuff. You can label them, too, like:
Copy code
History: {{event.state.session.fullHistory}},
Knowledge: {{turn.KnowledgeAgent.answer}}
a
ok, i did it, and the bot seems fine when chatting on the workspace, but when i test it on the field it generate 2 answers, like for example : Cost of Acne Treatment? and then the bot generate 2 answer like this, : "The cost of acne treatment is a whopping $2000". and the 2nd answer : "Hey!! The cost of acne treatment in here is $2000, pretty cheap rightt?? or the bot just completely says something irrelevant.
but the bot is fine in workspace testing
a
Check if your knowledge agent is set to answer questions on the start node? If it is, that could be the cause of the double answers
a
i turned it off...
a
did that solve the problem?
a
Its solved when I test it in workspace, the problem is when I test it in the "Chat" section on the front page
s
I think I have found a way of doing this but it depends on what value KB is reading when doing its lookup. I have the user answer whether or not they want to ask the forums. I have a Before Incoming Message hook to change the option of "Yes, ask the forums" to the original question asked (right now im just hard coding it). Ive changed the event.preview, event.payload.text, and event.payload.payload. I see that: - event.payload.text will change the text on the message screen. I assumed the event.payload.payload is what is actually being read internally but when I changed this it seems to do nothing with KB. I've confirmed that the values of the event are being changed BEFORE the hook for the KB starts. So my only guess is KB is reading something else. What is it? If we can change that value then we can effectivly have more control over the KB

https://cdn.discordapp.com/attachments/1124736429050826762/1129811725756145794/image.png

https://cdn.discordapp.com/attachments/1124736429050826762/1129811726012002485/image.png

https://cdn.discordapp.com/attachments/1124736429050826762/1129811726288814170/image.png

https://cdn.discordapp.com/attachments/1124736429050826762/1129811726544674867/image.png

a
Yep, I went down the same path and made progress by changing
event.preview
. I made a post about it here https://discord.com/channels/1108396290624213082/1128625552354455562/1128657522258087976
68 Views