Completing Tasks
Completing Tasks
Simple Questions
Simple questions, or FAQs, should receive the same answer no matter what happened previously in the conversation. Users will often ask a basic set of questions and your assistant should answer them reliably.
Example Questions:
- what's your email address?
it's contact@example.com - do you have a loyalty program?
unfortunately we don't
Just like greetings and goodbyes, you can use the mapping policy to achieve this. See Greetings.
Business Logic
Note: There is an in-depth tutorial here about how to use Rasa Forms for slot filling and business logic.
Your AI assistant will often have to follow some pre-defined business logic. To help users, your assistant may need to ask a few questions. The answers you get will impact the rest of the conversation. For example, some products might be limited to users in a certain country or above a certain age. It's good practice to implement that logic inside a form, separating it from the learned behavior.
Example Conversation:
- I'd like to apply for a loan
I'd love to help. Which state are you in? - Alaska
Unfortunately, we only operate in the continental U.S. - I'd like to apply for a loan
I'd love to help. Which state are you in? - California
Thanks. Do you know what your credit score is?
See Handling conditional slot logic for details on how to use forms to implement business logic.
Contextual Questions
Unlike answers to FAQs, correct responses to contextual questions depend on the conversation history. These include questions that refer to something earlier in the conversation and are ambiguous on their own.
Example Questions:
- what's your email address?
why do you need to know that? - are you currently a premium customer?
what do you mean?
Understanding contextual questions enhances the assistant's capability to engage effectively.
Unhappy Paths
When your assistant asks a user for information, responses might not always be what you expect. The user might refuse to provide information or change their mind.
Example Conversations:
- what's your email address?
no.
I will need your email address in order to create an account. - what's your email address?
what's your email address? - work@example.com
thanks, and your phone number? - no wait, please use personal@example.com
ok, I'll use that email.
This is a key reason for building an assistant that can learn from real data. The best way to collect training data for unhappy paths is to use Interactive Learning.