Homepage > Design > Chatbot design using Amazon Lex

Chatbot design using Amazon Lex

How you like that:

We've been using AWS (Amazon Web Services) cloud services for several years. For a long time, however, we’d never had the opportunity to check the text interface of Amazon Lex, until a client asked us: "Test the concept of chatbot for a medical startup."

We're getting to work

First, I’d like to highlight some important issues. If you’re a designer, to be able to design and implement the chatbot in Amazon Lex, you need:

Chatbot - a computer program that interacts with the user using a natural (human) language or a text interface.

Amazon Lex - one of the services included in Amazon Web Services. Amazon Lex lets you build conversational interfaces (using both text and voice) for any application.

Download the Amazon Lex Developer Guide documentation.

  1. An experienced developer will help you with this; a little experience will be useless. AWS documentation is almost always timely. In the case of Lex, "almost" makes a big difference.
  2. The PHP language is not natively supported by AWS Lambda (which is an integral part of Amazon Lex), so you need a developer with knowledge of Python, Java, C #, or Node.js.
  3. When trying to understand the AWS logic, obtaining a Cloud Practitioner certificate helped me a lot, which will be useful to you. Why? You will understand this by logging into the AWS panels, the so-called console. You will see more than 1,400 solutions with names that say nothing. It’s impossible to comprehend without preparation. Each solution depends on another, so working in the Lex panel will also require it.
  4. AWS Lex documentation that the designer should read.

I have read the most popular Polish articles about chatbot design. Their authors write that when designing a chatbot you need a brief, UX / UI, storytelling, etc.

Meanwhile, in my opinion, to start chatbot design you must:

  1. Determine who the user is and what he wants to achieve when using chatbot.
  2. Understand the logic of a particular technology on which you will base your project. Importantly, you need to learn the nuances. Why? None of the agencies work on their own technology. It can afford either technology giants or small teams with a gigantic budget and even more knowledge. Therefore, the designer must adapt to what is available in the market, and not vice versa. In this case, we chose Amazon Lex.
  3. Understanding the technology’s logic will allow you to understand the way you think about designing the chatbot text interface.

Who is the chatbot user and what does he want to achieve?

The above question is a very important aspect of every chatbot. Chatbot as a human-machine communication channel (brand, product, service) can only be used in certain cases.

At the current stage of Amazon technology development, Lex chatbot is used to settle a specific matter. Hiring a car, booking a hotel, ordering coffee. Chatbot, however, will not calm an angry person or replace a form in which the precision of the user's response is the most important thing, e.g. applying for e-proof.

The Amazon Lex chatbot can be a reseller or provide customer service. It can ask qualifying questions and give the user several options. What's more, it allows you to complete a query or order by collecting relevant data, including personal data.

The big advantage of the Amazon Lex chatbot over a regular website form is the ability to learn about the user's natural responses. This means when you chat with a chatbot, you formulate sentences yourself. For comparison, in a regular form the user follows a predetermined path.

Machine learning - technological memory of certain patterns and behaviors that the machine has "experienced" before. Machine learning also enables the analysis of new data and searching for solutions that have worked in other previously known machine situations.

This allows us, as chatbot developers, to learn the style of communication (words used, how to describe the problem) of the user. Thanks to this, we can improve the chatbot and apply machine learning. The process of collecting data in Amazon Lex does not happen automatically, it needs additional programming.

Chatbot essentially appears as an effect of the designer’s creativity. Using the available tools, we will manage to determine the user's role based on the answers given. At the beginning of the conversation, our chatbot concludes whether he is talking to a pharmaceutical company representative, doctor or patient. After determining who the interlocutor is, chatbot launches the appropriate conversation scenarios. All this helps to bring a doctor or patient with specific needs to the designated goal.

robot pencil sharpener on the desk
Chatbot is an increasingly standard solution for companies. | Fig. Matthew Hurst / Flickr.com / Bit.ly/2CRvN09 / CC BY-SA 2.0

 Differences between website UI and chatbot text interface

Website form button:

example of a form button on a website

Text chat with chatbot:
Do you want me to place your order? Yes / No

Chatbot design vs Amazon Lex operation logic

Chatbot consists of conversation components. The two basic components of Amazon Lex logic are intent and slot. Understanding them is key to the design process.

Intent represents the goal that the user wants to achieve. For example, make an appointment with a doctor, make a hotel reservation, buy a flight ticket etc. Intents are made up of slots.

A slot is part of the data that the user must provide to achieve his goal (intent). Such data can be a meeting place, date or city. You can create slots yourself. Amazon Lex also has its own slot library that simplifies the chatbot creation process. Lex recognizes countries, numbers, data types, and programming technologies.

For chatbot to start an intent, it is necessary for the user to be specific: "I want to make a hotel reservation", "My flight was delayed", "I am looking for a gynecologist in this area". This is called utterance.

Each chatbot can have several intentions, i.e. it can achieve several users' goals. Chatbot can make both hotel reservations and buy a flight ticket.

By asking the user for the data needed to fill the slots, chatbot can give prompts using the prompt. These are the questions: "What day do you want to make a reservation?", "How many hours delay was your flight?", "What's wrong?", "In what area are you looking for a gynecologist?".

Fulfillment is a process started by chatbot after filling the Intent with all data, i.e. slots. During it, we decide whether the collected data is to be saved to the database and where they are to be sent (e.g. for analysis by the image recognition algorithm or for translation).

Amazon Lex - Quickly Build Conversational Interfaces

Amazon Lex chatbot vs a website form

Chatbot language with the user

Amazon Lex currently speaks and recognizes just US English. With additional effort and integration of several other services, such as Amazon Translate or Google Translate, you can enter machine translation into the chatbot. However, this will not be the native AWS Lex mechanism. For a standard form on a website, you aren’t limiting yourself and can implement it in any language.

Knowledge about the user

In the case of the form, the user knowledge we receive is very limited. We find out whether the user reached the end of the form and sent his application, or (and at what point) abandoned the form. Meanwhile, chatbot knows what phrases a customer uses, how he formulates thoughts, what mistakes he makes. It gives valuable information about the user. This allows the improvement of the chatbot by expanding its dictionary. It also allows you to increase conversion, improve product presentation, enter expressions (triggers) into descriptions. Triggers will increase interest in the product or service.

a man at the table using a chatbot on the phone
Chatbot is useful when improving the process of communication with the client on a website or in a mobile application. | Fig. Pexels.com

What should you remember when designing a chatbot?

Essential things to remember:

  1. You need to determine who the user is and what goal he wants to achieve.
  2. Remember the language of conversations and the limitations of multilingualism.
  3. Divide user goals into intents. One goal equals one intent.
  4. Determine what data is necessary for chatbot to achieve the target.
  5. Evaluate what should happen to the data that chatbot collects: whether they are to be forwarded for the purpose of the contract, and whether they are to be analyzed.
  6. Design chatbot conversations so the user submits relevant data to achieve the goal.
  7. Analyze user queries to improve chatbot conversations and improve product and sales presentation.
  8. Conversations can be designed so the chatbot recognizes the persona of the user (target group). When talking to the chatbot the user can go back to another conversation thread.
  9. The distribution of the Amazon Lex chatbot can be done using Facebook Messenger, Slack, Kik, Twilio SMS, as well as any website and mobile application.

Main photo: Michele M. F. / Flickr.com / Bit.ly/2XBFuJt / CC BY-SA 2.0 

How you like that:
Journal / JPG / Dymitr Romanowski - avatar
Author: Dymitr Romanowski
Product Designer, Head of Design