Create your first chat bot

From Genesys Documentation
Jump to: navigation, search
This topic is part of the manual Genesys Dialog Engine User Guide for version 9.0 of Genesys Dialog Engine.
Read this topic for other versions:

This section will walk you through the process of creating and running your first chat bot.

Ensure that you are logged in to Dialog Engine. Contact your administrator if you do not have your user credentials.

Create a domain

Create a new NLU domain and call it Travel and click Save.

We’ve created a domain that will help us manage the bots. It is preferable to have a domain per scenario. For example, you might require a domain that can handle travel-related activities and hotel room booking.

Next, we’ll teach our domain to identify what the user wants by creating an intent.

Create an intent

Let’s add an intent by clicking Add Intent and call it BookFlight.

Next, we’ll create a few phrases called utterances that a customer might use to describe what they want to do.

Create an utterance

Let us add a few sample phrases that someone talking to our flight-booking bot might use and save them. For example:

  • I want to book a flight from Madrid to New York.
  • Book me a flight to San Fransisco.
  • I want to fly to Frankfurt.

Since we’re creating a travel bot, let’s include an utterance that has airport codes.

  • I would like a flight to LHR from SAN.
Next up, let’s start creating a bot that will use this domain model.

Create an entity

We’ve added some sample utterances that use city names and airport codes, so we have to teach our bot that certain words or phrases are actionable items. These items are called entities and in this case, will stand in for actual city names. Let’s add a City Name entity.

  1. Click Custom Entity Types in the left panel and click Add Custom Entity Type.
  2. Enter City Name and click Save.

Now, we’ll add some names of cities as entities.For each entity you can add synonyms for different ways a user might provide information. In this case, we’ll add NYC and NY (abbreviations) as synonyms for New York area. We could also add JFK and LGA (airport codes) as synonyms for New York. You can add as many synonyms as you like.

  1. Select the Allow synonyms option, add synonyms to each entity, and click Save.
Let's save and publish our domain and then proceed to create a bot.

Publish the domain

  • Click Save and then click Publish.

This step will publish the domain and bots can use this domain.

Now that we have our NLU domain in place, let's create a bot that will use this domain.

Create a bot

  1. From the home page, click Create a new Bot.
  2. Choose Travel from the Choose a NLU Domain option.
  3. Add a welcome message that he bot will display to the user.
  4. Click Save.
Now your first bot, FlightBot is ready. Now let’s teach our bot to identify the entities from utterances.

Create a slot

  1. Go to the Utterances tab of the BookFlight intent from the Intents option in the left panel.
  2. Double-click the word Madrid in the utterance, I want to book a flight from Madrid to New York .
  3. As we do not have any slot entity defined, let’s add a new entity by clicking Add new entity.
  4. In the Add Entity dialog, name it as Origin as we’re trying to capture where the user is flying from.
  5. Select City Name in the Entity Type option to tell the bot that this entity will use values from the City Name custom entity we created earlier.
  6. Save the new entity and select it from the Select Entity option.
  7. Similarly, tag the starting locations in the other utterances also. You can also create a new entity for the destination city and tag the destinations with the same City Name custom entity type.

Let's switch to our FlightBot to use the updated model.

Improve the bot

As we had updated our domain model, we have to update our bot to use the newer model.

  • Switch to the Flightbot from the Bot drop-down at the top.
  • Click Update in the Domain updated notification.
  • Click the BookFlight intent and switch to the Slots tab.
  • Click the Edit button for the origin slot.
  • As the origin location is required for our bot to book tickets, select the Slot required option.
  • To let the users know that they have to enter something, let us add a message in the Prompts field asking to enter some information:Where are you flying from? Press Enter to save the prompt.
    You can add more prompts which the bot will display to the user.
  • Similarly, mark the destination slot as required and add prompts to the slot.

Now that we have some basic rules set up for our bot to identify travel information, let’s see how well our bot understands the user input and identifies the slots.

  • Remember to click Save to save the bot and then Publish the bot.

Test the bot

Now that we have some basic rules set up for our bot to identify travel information, let’s see how well our bot understands the user input and identifies the slots.

  1. Click Test Bot in the top-right corner.
  2. Start a conversation with your bot by typing an utterance that mimics the sample utterances that you provided.
That's it!!! You have created a domain and a bot. Go ahead and add more bots and improve your domain.