Hybrid Bot - Bot to Human Transfer - When things cannot be handled by a bot , they can be handled by a human agent - How to do ?

Business Case : In the middle of a conversation , the customer/user types a question that is not understandable by the bot and you want to connect them to a real agent.

The best option is to transfer to to a human agent, reason being the maturing of machine learning and bots learning will not be there on Day1 or very soon in your production/live environment

POC ( we used FB and Front as CSR Tool) for this POC.

Please check the video to make sure, this is the kind of behavior you are looking for.
Here  when the user says "I want something else" or anything out of context or not understood by the bot, the bot will stop replying to the messages from that point onward, instead of replying something silly
.

How to do it? 
There are two ways, in which we did it. There might be several options, but we did which were simple and easy to do.
1. Generic approach ( can be used with any platform, not only Facebook ), this approach has to be implemented on the AI platform , rather than the client side (e.g. FB, Viber etc.)
2. Facebook message thread control transfer/handover protocol ( is valid only for FB )

Generic Approach

This approach needs an understanding of Input Context, Output Context and Default Intents.
These are basic concepts in AI, so I assume, that you have an understanding of these terms.

Now, assume that the user says something that is out of context that is set by your bot, or does not match any of the intents that you have in your AI platform.

It should ideally be handled in the  "default intent".
This is simple.

The catch lies in the fact, that from this point onward, everything user will type, might fall in default intent or not. But you need to make the bot as "pass through " after this.

So how to do it?
Answer is playing with output contexts.
- When once the default intent is reached, send an action, lets say "connectliveagent" to the webhook.
- In your web-hook, set an output context via code with a lifespan of 2 (or more, as per your data) . If this context is not present already ,send a message to the customer using send API of the client side e.g. FB Graph Send or Viber Send message  e.g. "We will connect you to a real agent", 
- From this point onward when user starts talking to the real agent, most of the conversation will fall into default intent, so keep on adding the lifespan automatically.

Thats it ! Your bot will become pass through from this point.


Facebook Message Transfer Protocol

Facebook has provided a very nice architecture, but you might not find a good documentation to understand it.
I will elaborate the point for you to begin and then you can refer to the FB docs to proceed.
Lets say your CSR tool has a pipe for messages from FB and for that they have an FB App subscribed to the page where they are getting the messages from.
  • Lets say this app name is "CsrFBApp" and is connected to Zendesk, Front or any other platform.
  • Lets say the FB App for your bot is "MyBotApp".
  • Now, your bot is the first receiver of messages.
  • So you need to configure the App roles for the bot app ancd configure the  "CsrFBApp" as the second receiver. You can do that using.







  • Go to App Settings > Messenger
      • In the 'Webhooks' section, subscribe your app to the Page you want to use the handover protocol for.
      • Go to Page Settings > Messenger Platform > Subscribed Apps > Role.
      • Select a role for each app. Only one app may be assigned the Primary Receiver role.
    • Please check for configuration steps on : https://developers.facebook.com/docs/messenger-platform/handover-protocol
    • As soon as you catch a conversation in default intent, you can pass the parameter for thread control to the secondary receiver (please check the documentation link above)

    Thats it ! Enjoy making your hybrid.








    Comments

    1. I didn't understand...
      Need a complete video tutorial for setting up messenger handover protocol....

      ReplyDelete

    Post a Comment