Guiding Users
Guiding Users
Implicit Confirmation
Implicit confirmation involves repeating details back to the user to reassure them that they were understood correctly. This also gives the user a chance to intervene if your assistant misunderstood.
Example
User: Can I get a large hawaiian and bbq pizza
Assistant: Sure, that's one large hawaiian and one regular bbq pizza.
User: Anything else?
Assistant: No they should both be large!
Explicit Confirmation
Explicit confirmation means asking the user to clarify how you should help them. An important thing to remember about AI assistants is that the user is never wrong. When a user tells you something like "I just moved," they are being perfectly clear, even if your assistant is not sure how to help them. If the user goal is ambiguous to your assistant, ask for clarification.
Example
User: I just moved
Assistant: I'm not sure I understood you correctly. Do you mean ...
User: I want to cancel my contract
User: I want to update my personal details
Policy Configuration
You can configure the TwoStageFallbackPolicy to ask your user to clarify, and present them with quick replies for the most likely intents. To do this, configure the policy as follows:
policies:
- name: TwoStageFallbackPolicy
nlu_threshold: 0.3
core_threshold: 0.3
fallback_core_action_name: "action_default_fallback"
fallback_nlu_action_name: "action_default_fallback"
deny_suggestion_intent_name: "out_of_scope"
...
Explaining Possibilities
AI assistants have limitations in helping users with specific tasks, and should explain to users what they can do. This includes coherently responding to requests that are out of scope.
Example
User: What can you do?
Assistant: I can help you update your personal details, change your plan, and answer any questions you have about our products.
User: Can you get me a pizza?
Assistant: I'm afraid I can't help with that.
Example Stories
## user asks whats possible
* ask_whatspossible
- utter_explain_whatspossible
## user asks for something out of scope
* out_of_scope
- utter_cannot_help
- utter_explain_whatspossible
Collecting User Feedback
Asking for feedback helps understand users and determine whether you addressed their problem. Storing feedback is a powerful way to improve your assistant.
Example
Assistant: Was that helpful?
User: no.
Assistant: Thanks. Why wasn't I able to help?
User: you didn't understand me correctly
User: you understood me, but your answers weren't very helpful.
Feedback Form
Define a custom form action for feedback collection:
from rasa_sdk.action import FormAction
class FeedbackForm(FormAction):
def name(self):
return "feedback_form"
@staticmethod
def required_slots(tracker):
return ["feedback", "negative_feedback_reason"]
Add the form and slots to your domain:
forms:
- feedback_form
slots:
feedback:
type: bool
feedback_reason:
type: text
requested_slot:
type: text
Ensure the FormPolicy is present in your configuration file:
policies:
- FormPolicy
...
Handing off to a Human
Users will be frustrated if your assistant cannot help them and there is no option to reroute the conversation to a human agent. There should always be a way to break out of a conversation. Multiple reasons may trigger a human handoff:
- User requests to speak to a human.
- The assistant struggles to understand the user.
- The assistant understands what the user wants, but a human is required to resolve the issue.
Example
User: let me speak to a human
Assistant: let me put you in touch with someone.
User: I want to cancel
Assistant: I'm afraid I can't help you with that.
Assistant: let me put you in touch with someone.
Policy Configuration
The direct request to speak with a human can be handled using the mapping policy:
intents:
- request_human: {"triggers": "action_human_handoff"}