Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.
Mark Sturdevant edited this page Jul 25, 2018 · 7 revisions

Short Name

Create an agent for rental car reservations

Short Description

Say "Hey Google" and chat with a reservation agent that you built using conversational AI.

Offering Type

AI

Introduction

Built for developers who want to access their chatbots via Google Home, a smart phone, or other devices supported by Google Assistant, this pattern shows how to create a Google Action and a Node.js server to make your Watson Assistant dialogs available when you say "Hey Google...".

Author

By Mark Sturdevant and Vincent Perrin

Code

Demo

  • N/A

Video

  • TODO

Overview

This Code Pattern includes a Watson Assistant workspace to demonstrate an implementation of a retail agent that can ask for reservation schedules and specifics. To demonstrate how to test it with Google Assistant devices, we will setup a Google Action that calls out to our Node.js server which interacts with Watson Assistant.

When the reader has completed this Code Pattern, they will understand how to:

  • Create a Google Assistant Action that calls out to an HTTPS endpoint
  • Launch a Node.js server that can interact with the Google Assistant requests and send responses from Watson Assistant
  • Use Watson Assistant to create a retail agent that can have a conversation to gather the information needed to make a reservation

Flow

  1. User talks or types to Google Assistant.
  2. Google Assistant posts text to an HTTPS endpoint.
  3. Node.js server calls Watson Assistant to get the response.
  4. The response is returned to Google Assistant.
  5. Google Assistant replies to the user.

Included components

  • Google Home: Powered by the Google Assistant, with Google Home you have command of your music, your home, and your curiosity. Start by saying, for example “Ok Google" or "Hey Google” in English.
  • Watson Assistant: Create a chatbot with a program that conducts a conversation via auditory or textual methods.

Featured technologies

  • Node.js: An open-source JavaScript run-time environment for executing server-side JavaScript code.

Blog

Blog Title

Creating a robust retail agent with Google Assistant and Watson Assistant

Blog Author

Mark Sturdevant

Blog Content

In the IBM code pattern "short name"(link), we use Watson Assistant as the brains behind a Google Assistant Action. This was a very interesting code pattern to work on for 2 reasons:

  1. Google Assistant is everywhere and just works
  2. You can build a really nice retail agent by leveraging the Watson Assistant content catalog and the digression feature

Let's cover the first item first. Sure, Google Assistant is already on my phone. Yes, it is really 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 press and hold that Home Button and start talking to it. With this 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 similator is pretty good at telling you what you did wrong (e.g. 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 that back and forth without needing a database or tracking user information on your server. 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.

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 case, we have Watson as a retail agent helping us reserve a rental car. We don't need to pretend to be human, but we want the conversation to be like human interaction. Here I got a lot of help from the Watson Assistant content catalog and the digression feature.

The content catalog provides many prebuilt intents in the following areas:

  • Bot Control
  • Customer Care
  • General

It also has some industry specific areas, but I didn't use those (Banking, eCommerce, Insurance, Telco and Utilities).

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 👎 replies if you need to. It'll keep learning.

Customer Care includes many of the intents you need to interact with customers. I only used the basics -- store hours and store locations -- but I see many others that I should 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. With all those intents, how do you build a dialog? Well 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. Slots 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 above), 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, so the slots node (where I'm collecting car reservation details) can be interrupted by those questions, but will get a reply and 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.

I hope you try out the code pattern with Google Assistant and be sure to checkout the Watson Assistant content catalog and digression feature.

Links