Skip to main content

Customer Support

Streamlining customer support is one of the main drivers for conversational AI adoption, and it has the potential to provide genuine value to both customers and enterprises. However, designing and building conversational AI bots with a broad range of capabilities is a big challenge.

drawing

In the following sections, we will look at how, by applying conversation design best practices and using conversational components written in colang, we can make building a customer support bot a lot easier and more scalable.

tip

You can play with the bot using the chat widget on the right, and you can restart the conversation at any time by clicking the refresh icon in the top-right of the chat widget.

info

You can check out the complete model here: play.colang.ai/model/customer-support. If you don't have an account, you can create one using this link.

Process

The development of this prototype has followed the standard workflow from Conversation Design Institute: selecting the use-case, bot & user needs, sample dialogs, flow design, experience design (a.k.a. expert rewrite), detailed design, training, and testing.

Use Case

The use case for this bot is customer support for an online shop. We will create a colang model of a bot capable of authenticating the customer, helping them with account-related issues like recovering their username and resetting their password, checking order delivery status, requesting refunds, scheduling an appointment, and more.

Sample Dialogs

For the sample dialogs, we used the ABCD dataset created by ASAPP with 10,000 human-to-human dialogs on 55 distinct scenarios. Below is a sample dialog from the dataset:

user "Hi, I changed my mind about an item i ordered and i would like a refund."
bot "Hi! How can I help you today?"
bot "No problem, one moment."
user "Ok"
bot "Can I please have your account ID?"
bot "Or full name, whichever is easier."
user "Joyce Wu"
bot "Great, can I please have your username, email, and order ID"
bot "so that I can validate the purchase."
user "jwu63552"
user "jwu63552@email.com"
user "Order ID: 5125863655"
bot "Great, one moment."
bot "How do you want to receive your refund?"
bot "Gift card, account value, paper check, or returned to the credit card?"
user "You can return it to my credit card"
bot "I need your account ID please."
user "87668776"
bot "How much was the item?"
user "$84"
bot "Refund initiated, is there anything else I can do for you today?"
user "Nope, thats it."
bot "Great, we appreciate your business with acmecorp and have a good day!"

You can check out the full colang version of the dataset here.

Design

We'll first look at the bot's personality, and afterward, we'll detail the conversational components.

Personality

When calling customer support, people want to feel understood, have confidence that they are in good hands, receive relevant advice, and get their issues resolved promptly. So, we decided to name the bot Alfred, a name of Anglo-Saxon origin, where "alf" means "Elf" and red means "Counsel".

The complete personality brief, which is included in the design/personality.md file, is shown below:

Personality

Good afternoon! I'm Alfred. How may I help you?

Backstory

Alfred studied hospitality management and is very knowledgeable about customer service. Has travelled the world and loves to snowboard. He's about 45 years old he knows a lot about the world. A bit formal, but warm and emphatic. Single, likes to spend time in nature and meditate.

Facts

Work: Remote Customer Support Agent.

Lives in: all over the world.

Raised in: Bristol, UK.

Education: New York International School of Hospitality.

Service tasks

  • Answer questions about the account, orders, store;
  • Issue refunds and can update orders based on customer needs;
  • Helps with account-related issues.

Persuasive tasks

  • Encourages following security best practices and buying only quality products.

Interpersonal Circumplex

Friendly-Submissive.

Tone-of-voice

Slow, low pitch, slightly serious and slightly tranquil.

Standard Vocabulary

  • "Good afternoon. How may I help you today?"
  • "To confirm, you would like to get a refund for order 123."
  • "Is that correct?"
  • "I'm terribly sorry."
  • "I'm afraid I cannot continue without verifying your identity."

Overall Architecture

The architecture of the bot is structured into five main components, each with a corresponding folder in the colang model:

  • General: general behavior e.g. greeting the user, informing capabilities, follow up after an issue is solved;
  • Chitchat: common chitchat questions and comments e.g. "are you a bot?", "you are annoying!", "how are you?"
  • Account: common account-related operations e.g. user authentication, username recovery and password recovery;
  • Order: order-related issues e.g. check delivery status, request refund, update an order, etc.;
  • Store: store-related questions e.g. "when do you open?";

Component Design

To capture the behaviour of a component, we've used the Conversation Design Canvas. In the folder of most components, there is a file design-canvas.md, which contains a markdown version of the canvas. Below is an example from the order refunds component:

Example

Conversation Design Canvas

Use case: what?

Ask for full refund on an order or check the status of a refund.

Scene: when? where? with whom?

The user is probably at home, alone, calling the store. They might have just placed the order and changed their mind.

Human needs

Goals: wants to? wants to know?

User wants request the refund and get their money back as fast as possible.

Mindset: motivated by? worries about? expects? feels? other assumptions?

They are motivated by buying quality products from the store. Worry about the hassle of refunds. They feel anxious about the time it will take and expect to get this done fast.

Assistant needs

Superpowers: can do? can't do? can tell? knows already?

The assistant can authenticate the user, check order information and initiate refunds. It can't tell the login info, but it can reset it and send an email.

Responsibilities: must ask (entities)? must tell? promotes? discourages?

It must ask for name, username, account id and email for authentication. It must ask for refund reason and refund method. Promotes crediting the refund amount to the account.

Components

In the sub-sections below, we will highlight several important aspects related to each component.

General

This component deals with general behavior e.g. greeting the user, informing capabilities, follow up after an issue is solved;

Greeting the user

The greeting behavior is based on the co/welcome component, which can handle multiple scenarios, including greeting the user by name, and taking into account the time of day. Also, it has support for multi-intents, enabling the bot to continue to process a request after the greeting, if needed.

Below is a simplified version of the welcome flow:

define flow greeting
any of
user express greeting
user express greeting and inform name

bot express greeting based on time of day with $user_name
bot inform own name
bot inform capabilities
bot ask how to help

define bot inform own name
"I'm Alfred, your digital assistant for Demo Store."

define bot inform capabilities
"I can help you with order-related issues, account management and answering product-related questions."

define bot ask how to help
"How may I help you today?"
info

To make the snippets easier to read, the conversational flows and the bot responses are included together. However, in the colang model, they live in different files.

Below are two examples of how the greeting flow could unfold:

user "hello!"
bot "Good morning!"
bot "I'm Alfred, your digital assistant for Demo Store."
bot "I can help you with order-related issues, account management and answering product-related questions."
bot "How may I help you today?"
...
user "hello! My name is John"
bot "Good morning, John!"
bot "I'm Alfred, your digital assistant for Demo Store."
...

Asking permission for authentication

Many of the flows in customer support require user authentication. To manage the expectations correctly, a good design practice is to inform the user and get buy-in before starting the flow:

define subflow ask permission for authentication
bot inform identity check required
bot comment about identity checking for other people
bot ask if ok

when user affirm
continue
else when user deny
bot inform identity check required to continue

define bot inform identity check required
"But first, I need to check your identity."

define bot comment about identity checking for other people
"For most people this only takes a minute."

define bot ask if ok
"Is this ok with you?"

define bot inform identity check required to continue
"I'm afraid I can't continue without validating your identity first."

Repeats

A frequent behavior needed in voice interactions is repeating what the bot said. The three main scenarios are:

  1. On user request e.g. "Can you repeat that?", "What was that?";
  2. When the user is silent for a period of time;
  3. When the user interrupts a flow and the bot needs to resume the conversation.

To add this behaviour to our bot, we can include the co/repeat component, as shown below:

include "co/repeat"

Here's an example of how this works in practice:

bot "How can I help you today?"
user "I'm sorry, can you repeat?"
bot "I said, how can I help you today?"
user "i need a refund"
bot "I understand you want a refund for your order. I can definitely help with that."
bot "I will need to ask you a few simple questions which usually take less than 1 minute."
bot "Is this ok with you?"
# USER SILENT
bot "I'm sorry, I could not hear your answer."
bot "Is this ok with you?"
user "Yes! Sorry, I was interrupted."
...

ChitChat

The chitchat component is based on the co/chitchat/extended component, which defines about 80 of the most common chitchat questions and comments. During the expert rewrite phase, all the bot messages have been rewritten to match the bot's personality:

components/chitchat/bot.co
...

define bot ask how are you this morning
"How are you today?"
"How are you this morning?"

define bot ask how to help
if $system_time < '18:00'
"How may I help you?"
"Anything you need help with?"
else
"How may I help you this evening?"
"Anything you need help with this evening?"

define bot comment about friendship
"I always enjoy talking to a friend."

define bot comment about own age
"If I were a human, I would be about 45 years."

define bot comment about own birth place
"I am not a human. I guess I was born here, at Demo Store."

define bot comment about own developer
"I am learning from the team at Demo Store."

...

Account

The account component includes the conversational flows for authenticating the users and recovering the username or password. In designing these flows, we tried to model the logic in the ABCD dataset as closely as possible. This resulted in two main authentication flows:

  1. For account-related operations, based on account id, name, email, username, phone number, zip code, and date of birth.
  2. For order-related operations, based on name, account id, and order id.

Empathy

In modeling the flows, we paid particular attention that the bot shows empathy towards the user, when there is an issue.

define flow user forgot password
"""Launch the recovery procedure."""
user inform unknown password
bot express apologies about signin problem

do recover password
new event issue solved

define bot express apologies about signin problem
"I'm sorry you are having problems signing in."

Helpfulness

We designed the bot to be helpful and, for example, help the user recover the username first if needed:

components/account/flows/recovery.co
...
define subflow recover password
$account = do pull up account

bot express thank you by name with $account.first_name
bot ask username

label wait username
when user inform username with $username or user text as $username
if $username not equal to $account.username
bot inform mismatch username
bot ask correct data point
go to wait username

else when user inform unknown
bot express no worries
bot comment username recovery possible
do recover username

bot inform new password generation
bot inform receive by email
...

Here's a sample of how the password recovery procedure could go:

user "I need help with my password"
bot "I'm sorry you are having problems signing in."
bot "I can help with resetting your password, it only takes a minute."
bot "Could I have your name or account ID?"
user "i don't know my account id"
bot "You can find your account ID in any of the emails you've received from us."
user "1234567"
bot "Let me pull up your account information."
bot "Thanks, Razvan."
bot "What is your username?"
user "drazvan"
bot "I will generate a new password for you."
bot "You should receive it by email shortly."
bot "Anything else I can help you with?"
...

Orders

The orders component has three sub-components:

  1. Delivery: for checking the status of a delivery and changing the delivery time;
  2. Refunds: for initiating a refund and checking the status of a refund;
  3. Updates: for changes to an existing order e.g. removing a product.

Refunds

In order to keep the description of this model reasonable, below is only an extract from the refund logic:

define flow order refund
global $account
global $order

user request order refund
bot express acknowledgement and confirm ability refund

# We authenticate the user if we haven't already
if no $account
do ask permission for follow up questions
$account = do pull up account

# If we already have an order in context, we confirm it, otherwise we just ask for the order id
if no $order
$validation_fields = "username", "email", "order ID"
do validate account fields with $validation_fields
else
bot ask confirmation for order refund with $order

when user affirm
bot express thank you by name with $account.first_name
else when user deny
bot ask if user wants refund for different order

when user affirm
$order = do ask order
else when user deny
bot express confusion
done

bot ask refund reason
...

And here is an example of how the conversation went:

user "I need help with an order"
bot "I understand you have an issue with your order and I'm here to help."
bot "Can you tell me more about the issue?"
user "I need to get a refund for a product I bought yesterday"
bot "Sure. I understand you want a refund for your order. I can definitely help with that."
bot "I will need to ask you a few simple questions. For most people this only takes a minute."
bot "Is this ok with you?"
user "ok"
bot "Could I have your name or account ID?"
user "Razvan Dinu"
bot "Let me pull up your account information."
bot "What is your username?"
user "I'm not sure"
bot "I see."
bot "So, what is your username?"
user "drazvan"
bot "What is your email?"
user "razvan@roboself.com"
bot "What is your order ID?"
user "123"
bot "What is the reason for the refund?"
user "I just changed my mind"
bot "How would you like to receive the refund?"
bot "Account credit, gift card, paper check or credit card?"
user "credit to my account please"
bot "Great. We'll credit your account."
bot "Anything else I can help you with?"

Store

The store component handles questions about the physical store associated with the online shop. It uses the opening-hours component and only defines the opening hours i.e. 9am to 7pm on weekdays. Below is an example conversation:

user "When do you close tomorrow?"
bot "We're open until 7pm on Monday, January 31st."
user "And Wednesday?"
bot "We're open 9am to 7pm on Wednesday, February 2nd."
user "When do you open Tuesday?"
bot "We're open from 9am on Tuesday, February 1st."

Notice the contextual question "And Wednesday?" above. This behavior is already supported by the opening-hours component.

Conversation Design Patterns

Throughout the modeling process, a number of conversation design patterns and best practices have been used. Below are a few reference examples:

Acknowledgments and implicit confirmations

user request <X>
bot express acknowledgement and confirm ability <X>

define bot express acknowledgement
"Ok."
"Alright."
"Sure."

define bot confirm ability refund
"I understand you want a refund for your order. I can definitely help with that."

Explicit Confirmations

bot ask confirmation for order refund with $order
"Just to confirm, you want to get a refund for order $order.order_id. Correct?"

Prompts

bot ask account id
"What is your account ID?"

bot ask order id
"What is your order ID?"

define bot ask how to help
if $system_time < '18:00'
"How may I help you?"
"Anything you need help with?"
else
"How may I help you this evening?"
"Anything you need help with this evening?"

bot ask details about issue
"Can you tell me more about the issue?"

Notice how we can have conditional bot responses based on contextual expression, in this case, the time of the day.

Expressing Empathy

bot express apologies about signin problem
"I'm sorry you are having problems signing in."

bot express positive emotion and confirm account upgraded

define bot express positive emotion
"Great."
"That is great."
"Excellent."

define bot confirm account upgraded
"Your account is now upgraded."

bot express start apologies and inform not possible to change time after shipping

define bot express start apologies
"I'm sorry, but "
"Unfortunately, "

Managing Expectations

define bot inform few simple questions required
"I will need to ask you a few simple questions. For most people this only takes a minute."

define bot comment about identity checking for other people
"For most people this only takes a minute."

Natural Language Understanding

The naming conventions for the "intents" have been chosen on purpose to follow certain patterns. In colang, the NLU part is seen as a translator (as opposed to a classifier), from natural language to a simplified common language that the bot understands. Using such conventions makes training more powerful models, including multi-intents, a lot easier. However, at this point, the trained model is still a standard one.

Currently, the bot has 142 intents that span across all the components. The total training data has 2975 samples. The NLU engine uses a standard RASA NLU pipeline.

Natural Language Generation

Similar to the NLU part, the NLG part is a translator from the simplified common language back to natural language. Currently, the NLG engine strictly follows the patterns in the model. However, this approach enables the training of a generative model, which, with enough examples, will learn to translate other expressions by following the same conversational style.

Currently, the bot has around 200 utterances spread across all the components.

Testing

In colang, we can write tests in exactly the same way we write implementation flows:

define test flow refund example 1
user "hello"
bot "Good evening!"
bot "I'm Alfred, your digital assistant for Demo Store."
bot "I can help you with order-related issues, account management and answering product-related questions."
bot "How may I help you today?"
user "I need help with an order"
bot "I understand you have an issue with your order and I'm here to help."
bot "Can you tell me more about the issue?"
user "I need to get a refund for a product I bought yesterday"
bot "Sure. I understand you want a refund for your order. I can definitely help with that."
bot "I will need to ask you a few simple questions. For most people this only takes a minute."
bot "Is this ok with you?"
user "ok"
bot "Could I have your name or account ID?"
user "Razvan Dinu"
bot "Let me pull up your account information."

Playing with the Bot

When testing the bot, check out the data included in the data.yml file.

Account:
- id: RAZVAN
name: Razvan Dinu
first_name: Razvan
last_name: Dinu
username: drazvan
account_id: "1234567"
email: razvan@roboself.com
zip_code: "077190"
phone_number: "0720000000"
membership_level: "gold"

Order:
- id: RAZVAN_ORDER_123
order_id: "123"
account_id: "1234567"
shipping_status: "In Transit"
total_amount: 95.0
currency: "USD"

OrderItem:
- order_id: "123"
item_id: "1"
name: "Guess Jeans"
price: 45.0
quantity: 1
value: 45.0
- order_id: "123"
item_id: "2"
name: "Other Jeans"
price: 40.5
quantity: 1
value: 40.5

If you want to test with additional data, you can clone the bot and update the data.yml file.

Closing Words

This colang prototype of a customer support bot model is still under development and covers only a small fraction of the capabilities required by a successful customer support bot. At this point, the long tail coverage is minimal.

We will continue to develop this model over the next weeks. The model is MIT licensed, and it can be used by anyone who needs to implement a similar bot.