Build a Bot Tutorial

This page is a tutorial that follows Akela Wolfe, a Bot Builder administrator for Classics, Inc, as she builds a new bot. The goal of this tutorial is to help you:

  • Become comfortable with the Bot Builder user interface.
  • Understand the main configurations that go into a Bot Builder bot and how they work together, such as intents, entities, stories, and rules.
  • Understand the workflow of creating and working with Bot Builder bots.

Before going through this tutorial, read the help page about getting started with Bot Builder. It introduces the essential Conversational AI concepts and relates them to Bot Builder configurations.

You can follow along with Akela if you want. The steps necessary to do each of the tasks are included in drop-downs in each section below.

Tutorial Scope

This tutorial does not result in a full working bot. It guides you through the process of building and managing a single use case. Many bots will handle more than one use case.

This tutorial only covers the steps that happen directly related to the Bot Builder bot. It does not cover the steps required to set up and configure a digital channelClosed A way for contacts to interact with agents or bots. A channel can be voice, email, chat, social media, and so on. or routing queuesClosed The system uses routing queues to determine which agents to route cases to. Your system administrator creates routing queues so that certain cases are routed to agents with expertise in that type of case. in CXone. The bot requires these to function in a production environment. When you're ready to create your own bot, follow the implementation process, which covers all steps required to set up and manage your bot.

Preparation

Akela has been given the task of creating a new bot. Her manager wants the bot to answer basic customer service questions, such as how to change passwords, update account details, and so on. Working with her manager, she identifies the following use cases as the starting place for the bot: 

  • Change password
  • Change address
  • Change phone number
  • Change billing credit card

Akela decides that the first use case she will work on is changing passwords. She talks to the help desk agents in her organization and reviews interactionClosed The full conversation with an agent through a channel. For example, an interaction can be a voice call, email, chat, or social media conversation. recordings and transcripts. Using this input, she builds a file of typical password reset interactions.

She has worked in Bot Builder before, so Akela knows that her CXone employee profile has the permission the required to access Bot Builder: Bot Builder > Launch Bot Builder.

Create a New Bot

Akela logs in to CXone and creates a new employee profile for the bot. This is required because CXone treats Bot Builder bots as user entities. All user entities must have employee profiles in the platform.

After creating the bot's employee profile, Akela creates a new bot in Bot Builder. She gives it the same name that she used in the bot employee profile, John Bot.

Create Intents

After reviewing the real-life interactions she gathered, Akela puts together an example of a typical successful password reset request. This is known as the happy path for this intent. This is her example:

Contact: Hello.

Bot: Hi, how can I help?

Contact: I forgot my password.

Bot: I'm sorry to hear that. You can reset it at our website.

Contact: How do I do that?

Bot: Click Forgot Password in the upper right corner of the landing page. Then enter your email address and the system will send you a link to reset your password.

Contact: Thank you!

Bot: You're welcome. Is there anything else I can do for you?

Contact: No. You've been very helpful. Goodbye.

Bot: Thank you for contacting us. Goodbye.

Akela determines there are five intents in the happy path:

  • Greeting (Hello)
  • Reset_password (I forgot my password)
  • Explain (How do I do that?)
  • Thanks (Thank you and You've been very helpful)
  • Goodbye (Goodbye)

Akela creates these intents:

  1. In Bot Builder, Akela goes to the Intents tab in the NLU section.
  2. She creates a folder called Conversation_defaults.
  3. In it, she creates an intent called greetings.
  4. Akela goes through the interaction examples she gathered and adds all the different greetings contacts used as examples for the greetings intent. She adds hello, hi, howdy, yo, and so on.
  5. Then she adds two more intents, thanks and goodbyes. She adds examples for each of them, including thank you, thanks very much, and thank you so much for the thanks intent. For the goodbyes intent, she adds bye, so long, and ok goodbye.
  6. Next, Akela creates a folder called password_reset.
  7. She adds intents called Reset_password and explain, then adds examples for each one from her interaction examples:
    • For Reset_password she adds examples such as I need to change my password, my password is wrong, my password needs updated, and how do I change my password.
    • For explain, she adds examples such as how do I do that, I don't see that option, and where is it.
  8. Akela continues adding examples to her intents as she finds them in her interaction examples. All the intents have a medium number of examples. She knows that more examples help her bot will learn. However, she also knows that making up examples isn't recommended. She doesn't have more to add right now, but can add more as she works on her bot.

Create Rules

Akela decides that rules are the right way to teach her bot some of the intents she created. Rules teach the bot to give the same response to an intent every time the intent is recognized. This is ideal for things such as greetings, goodbyes, and thank-yous; these are the intents she wants to use rules for.

This is what Akela does:

  1. She creates a folder on the Rules tab in the Dialogues section of Bot Builder called Conversation_defaults.
  2. In the new folder, Akela adds a rule called Greeting.
  3. Akela uses Hello as the example contact message A square with rounded corners with a face in it. to trigger the Greetings rule. When she presses Enter, her bot correctly predicts the greetings intent, so she confirms the result.
  4. Next, Akela adds the bot response A square with rounded corners and a robot head inside.. She wants the bot to respond with its own greeting, so she adds a Message bot action and enters Hi, how can I help today? as the message she wants the bot to send to the contact.
  5. Finally, she decides that if contacts use the bot often they might notice that it always responds the same. To make the experience more like talking to a human, Akela adds some variations icon, represented by two crossing arrows to the bot's response. The bot will randomly use one of the messages. In addition to the first message, the bot can now say Hi and thanks for contacting us. What can I do for you? and Hello, what can I assist you with today?.
  6. Akela repeats this process and creates a Goodbyes rule. She uses Bye as the triggering contact message A square with rounded corners with a face in it..
  7. The bot correctly predicts the goodbye intent, so Akela confirms the result.
  8. Next, she adds the bot's responses. She adds Goodbye! as a Message action with Have a nice day., and Have a great rest of your day! as the variations icon, represented by two crossing arrows.
  9. The last rule Akela adds is Thanks. For this rule, she uses Thank you as the triggering contact message A square with rounded corners with a face in it.. The bot predicts the correct intent and Akela confirms the result.
  10. Then she adds the bot's responses. She adds You're welcome! as a Message action with I'm happy to help., and Of course, I'm here to help. as the variations icon, represented by two crossing arrows.

Create Stories

Akela is going to create stories for the two remaining intents , Reset_password and Explain. She refers to her planned happy path story for a forgotten password. After thinking about it, she decides to combine the Explain intent with the Reset_password intent. This will shorten the conversation and improve customer experience.

In Bot Builder, creates her story:

  1. First, she hides An eye with a diagonal line crossing it out. the Explain intent on the NLU > Intent tab. This will exclude it from the bot. She wants to keep it for now, but doesn't want to add the intent examples to the Reset_password intent. She hopes that providing the information as a response to requests about passwords will mean no one asks "how do I do that" questions.
  2. On the Stories tab in the Dialogues section, Akela creates a folder called Password.
  3. In the new folder, she creates a Reset_password story.
  4. She starts the story with a contact message of I need to change my password.
  5. She adds a bot response with two parts: 
    • First is a Message action with the text I'm sorry to hear that. I can help! You can do that on our website:
    • Second is a Rich Link action, to which she adds a link to the Jungle website page about resetting passwords: www.jungle.com/passwordreset. She includes an image of the Jungle logo, which will appear in the message with the link.

The story Akela creates includes only the part of the conversation that is relevant to the context of the Reset_password intent. This is important to note, because adding more content to a story than is relevant to its intent can confuse the bot.

Train and Test the Bot

After creating each the intents, rules, and stories for her first use case, Akela clicked Train and Stage. This creates a new bot model that includes these configurations. However, this is only the first step in training. After she finishes adding the rules and story for the password reset use case, Akela needs to test the bot's ability to predict and respond to the intents in the use case.

To do this, she starts testing and training in Bot Builder:

  1. The first thing Akela does is click Train and Stage to ensure that her bot is up to date with all the changes she's made.
  2. While the training is in progress, Akela finds her real-world conversation examples for the password reset use case.
  3. She clicks Talk to your bot icon, represented by a conversation bubble, which is next to the Train and Stage button.
  4. Akela chooses one of the conversation examples and plays the role of the contact. She follows the example like a script and starts the conversation with Hello.
  5. The bot performs flawlessly. Akela clicks Reset in the chat window and starts the next conversation example.
  6. This conversation doesn't go so well. The bot correctly predicts the Reset_password intent, but after it responded with the URL, the contact replied Oh that's easy. Not sure why I didn't see that.
  7. Akela makes a note of the unrecognized message so she can address it later.
  8. She continues testing. She finds that two other contacts responded with unexpected messages after the bot sends the URL message: 
    • One said DUH haha! That was obvious! and the other said How'd I miss that before? Thanks.
    • The second response includes the word thanks, so the bot predicted the Thanks intent. However, Akela knows that without that, the bot would have failed to respond appropriately.
  9. When testing a different conversation example, the bot doesn't predict the right intent for I'm locked out of my account. Akela adds this example to the Reset_password intent.
  10. She resets the chat window and repeats the example conversation. This time, the bot correctly predicts the intent.
  11. Akela notices that although I'm locked out of my account triggered the Reset_password intent, the bot's response of I'm sorry to hear that! You can do that on our website. isn't an appropriate response.
  12. Akela now has two tasks to do to refine her bot's responses to this intent:
    • Create fallback for any unexpected message.
    • Create an intent for contacts' expressions of relief that the solution was easy.

Create Fallback

Through her testing, Akela discovered that if the contact said something unexpected, the bot didn't know how to respond. She decides to create fallback to address the situation. There are three kinds of fallback: action, NLU, and rich messaging. Akela determines that for the current case, NLU fallback is the kind she needs.

  1. On the Dialogues > Fallback tab, she clicks NLU in the list on the left side of the page.
  2. She looks at the Basic and Advanced options and chooses Advanced.
  3. On the Advanced page, she decides not to change the default bot message for step 1.
  4. For step 2, Akela adds a Message action followed by a Handover action, as shown in the following image.

Refine Intents, Rules, and Stories

Akela works on the other issue found during testing, fixing contacts' expressions of relief that the solution was easy:

  1. Akela goes to the NLU > Intents tab and creates a relief intent in the Conversation_defaults folder. The intent she's making is generic and not specifically related to any situation. This means anytime a contact expresses relief, the bot can respond.
  2. She adds the examples she found already, including well DUH that was obvious, how'd I miss that, and oh that's easy.
  3. Next, she creates a story using one of her examples as the contact message. She has the bot respond with a Message action that says I'm glad to I could help! Is there anything else I can do for you?

Repeat Testing

After fixing the issues she found during her initial testing, Akela repeats the testing. When she doesn't find any additional issues, she decides to deploy her bot to production.

Deploy and Go Online

Akela's new bot is going to use a digital Live ChatClosed Agents and contacts interact on a real-time basis channel. The channel has been tested in her organization's test environment, so she knows that it works. Before deploying her bot, she has the channel set up in the production environment and verifies that the updated page for the website where the new chat window will be located is ready to deploy.

Next, Akela deploys her bot to production in CXone Bot Builder and goes into the preference settings to switch to Online. Then she notifies that team responsible for the website that they can update the page with the new version.

Review Conversation Data

After her bot has been live for a few days, Akela reviews the conversation data on the Insights > Conversation tab in CXone Bot Builder. It soon becomes clear that many users combine thanks and goodbye in the same message. She decides that the conversation will have a better flow if she creates a multi-intent so the bot can respond to these intents together. A multi-intent covers situations when the contact has two intents in a single message. She starts to work:

  1. In the Conversation_defaults folder, she creates an intent called thanks + goodbye. The plus sign ( + ) makes this a multi-intent.
  2. Aklea adds examples for these intents, taken from the example interactions she gathered. She adds examples such as That works. Bye, Thanks talk to you later, I appreciate your help, goodbye, and thanks, see ya.
  3. Next, she creates a rule that uses the thanks + goodbye intent. The bot response is a Message action that says You're welcome. Have a great day.