In the Create an agent for rental car reservations code pattern, we use Watson Assistant as the brains behind a Google Assistant Action. For me, this was a very interesting code pattern to work on for two reasons:
- Google Assistant is everywhere and it just works
- You can build a really nice retail agent by using Watson Assistant’s content catalog and digression feature
First, let’s cover Google Assistant. Sure, it’s already on my phone, and yes, it really is easy to create an Action for it. But, I really didn’t expect it to work on my phone while it was still just a test Action. I didn’t install anything. I just pressed and held the Home Button and talked to it. With the example Node.js server, it is very easy to get up and running. I did add a little code to help smooth the start and end of the conversation. The simulator is pretty good at telling you what you did wrong (for example, after cancel you only get 59 chars and cannot expect a response). The other nice feature is conversationToken. You can use this to stash your Watson Assistant context to pass back and forth without needing a database or tracking user information on your server.
Now let’s talk about how we talk. Chatbots cannot just do the old “press 1 for English” kind of menu. We want to talk to chatbots — especially voice gadgets — like people talk to people. In this example, we have Watson as a retail agent helping us to reserve a rental car. We don’t need to pretend to be human, but we want the conversation to be like a human interaction. Here, I got a lot of help from the Watson Assistant content catalog and its digression feature.
The content catalog provides many prebuilt intents in the following areas:
- Bot Control
- Customer Care
It also has some industry-specific areas (Banking, eCommerce, Insurance, Telco, and Utilities), but I didn’t use those.
I used Bot Control to get examples of confirm, reject, and start over. This is much better than just looking for “yes” or “no” or building my own list of synonyms. Of course, you can easily add to the intent and train it to understand more — “yeppers” and :thumbsdown: replies if you need to. It’ll keep learning.
Customer Care includes many of the intents that you need to interact with customers. I only used the basics — store hours and store locations — but I see many others that I could add to create a more complete customer service bot.
General provides a lot of intents that deal with things people often ask bots, such as:
- General greetings/endings
- Are you human?
- I want to speak to a human
- Know any jokes?
- Positive or negative feedback
- What are my options?
I would never have thought of all of those. So, with all of those intents, how do you build a dialog? I found that many of them work as “digressions,” and Watson Assistant has a digression feature that is exactly what I wanted.
Basically, my bot just wanted to collect a few rental car reservation details and be done. The Watson Assistant Slots feature works for that, so my dialog is simple. But what happens when my bot is just trying to ask for a color preference and the human starts asking questions? If someone says “are you human?” and the bot keeps answering “What color car would you like?” the conversation gets awkward. We need to handle these “digressions” and return to ask “what color…?”
With the Watson Assistant digression feature, it was easy. I took a bunch of those content catalog intents (mentioned earlier), created a folder, and gave them each a node to give a response to those common General or Customer Care intents. I set it to return to the slots node. The slots node (where I’m collecting car reservation details) can be interrupted by those questions, but the user will get a reply and the chatbot will be able to continue prompting for reservation details.
I’m very pleased with how natural the back and forth can be with a human-like interaction and with very little effort put into my small dialog. I know my one rental car joke is bad, but when I keep throwing digressions at Watson and he has a clever (or appropriate) response and also keeps asking me “what color”… well, I start to call it “he,” and I’m kind of proud of the little guy.
Google+Node.js+Watson is a pretty good combination. I hope you give it a try and play around with it. See what you can do. Try out the code pattern with Google Assistant and be sure to check out the Watson Assistant content catalog and digression feature.