Updated on January 18, 2024

Building a chatbot was a complex process, but that was years ago. With the advent of low-code no-code platforms, you can get up and running with building a bot without any need to know a programming language.

There are a lot of bot platforms out there that help you build a chatbot from scratch, and Amazon Lex is one such platform. Amazon Lex is a part of AWS and is gaining popularity among leading companies throughout the world.

Table of Content

  1. What is Amazon Lex?
  2. Understanding AWS Lex Bot
  3. Steps to Create Amazon Lex
  4. Integrating Amazon Lex bot into a website
  5. Integrate Amazon Lex using Kommunicate

What is Amazon Lex?

Amazon Lex is a service by AWS for building conversational interfaces into any application using voice and text. Lex has quickly become popular among chatbot enthusiasts. Notably, popular Amazon products such as Alexa are powered by the same technology as that of Amazon Lex.

In this blog, I will help you understand the basic concepts of Lex and explain how to create a bot and integrate it into your website.


Bonus: Don’t know to code? Try our codeless bot builder.

Understanding AWS Lex

To understand the Lex platform, let’s consider the conversation below between a flight booking chatbot and a user:

User: Book me a flight to New York from Boston.

Bot: Sure! Which date do you want to fly?

User: I am planning to fly on the 10th of October.

Bot: Ok. Do you want me to book a return ticket as well?

User: Yes.

Bot: Please help me with the date of your return.

User: It is 15th October.

Bot – Alright.  Searching for a flight for the 10th of October and returning on the 15th october. Here are the results.

 In this blog post, we are going to teach you how to build an Amazon Lex chatbot from scratch. I am going to build this bot using an AWS account. Mind you, I am a marketer with little knowledge of programming. 

Conversational CTA

Steps to Create Amazon Lex Chatbot

For building the Amazon Lex chatbot, you will need:

  1. An AWS account, which you can get for free.
  2. 10 minutes of your time.

Let us jump right into the chatbot-building process. In six steps, we will lean how to build Amazon lex chatbot:

Step 1: Log into your AWS account

Once you log into your AWS account, you will have to navigate to the Amazon Lex section.

Just search for Amazon Lex in the top search bar or select one from Services, as shown here:

Select Create bot from the menu and you are ready to get started with building your first bot.

Step 2: Enter Initial bot details

In this next step, you will have to give basic details about the bot. We will create a bot that helps us book movie tickets at a nearby cinema—a simple chatbot use case.

So I have named my chatbot  ”BookMovieTicket,” given a small description about the bot, and given all the requisite information.

Amazon Lex Bot - Configure Bot Settings

On the next page, Amazon Lex asks you to enter the language in which you want your bot to communicate. My choices are “English(US)” and “Matthew” to be the voice of the chatbot.

Amazon Lex Bot - Add language to Bot

Step 3: Create your Intent

We will now come to the Intents page. This is the page where you define the name of your intent and also get the initial input from the user.

  • We have named this intent “BookTicket.”
Amazon Lex Bot - Create Intent
  • In the “ Intent Details” section, name your intent and also the description of your intent so that it is easy for you to remember what that intent does.
Amazon Lex Bot - Enter Intent Details
  • Getting the first user input

Next comes the “Sample utterances” section, where you can specify the probable questions that a customer might ask your bot.

Since this is a movie booking bot, we have created utterances such as “Book  movie tickets,” “Hello,” and “I want to book a movie ticket.”

This is what it looks like.

Amazon Lex Bot - Add Sample Utterance
  • Collecting Username

Next comes the fun part – personalization! This is the part where you collect a detail about the customer, something like a name or an email address.

In this tutorial, I am collecting the name.

Scroll down further on the screen, and give an initial response. Here, I have given “Sure, I can help you book a movie ticket,” as shown.

Amazon Lex Bot - Add message to response

We can then add a “Slot,” which is where Amazon Lex stores the username.

We have to define a prompt here give a name to the Slot and specify a Slot type.

The Slot name is “YourName,” and the Slot type is “AMAZON:FirstName.” There are a variety of Slot types which you can choose from, in the drop-down menu.

Amazon Lex Bot - Add Username

The final part of fetching the Username is to write down the confirmation message in the Confirmation section. 

For this tutorial, I have written “Great to meet you, {YourName}, which is the Slot Name we specified.

Remember to Save Changes to the intent as shown below.

Amazon Lex Bot - Save prompt message

Step 4: Adding Slot Types

We now have a small, basic working chatbot on Amazon Lex which greets you on your website and asks you your name (and remembers it too.).

It is now time to add options to your chatbot.

Remember, we are creating a movie booking chatbot.

For this tutorial, I am going to air the following movies at my cinema.

  1. Killers of the Flower Moon
  2. Indiana Jones and the Dial of Destiny
  3. Guardians of the Galaxy 3
  4. The Nun Part 2

The show timings are 11 AM, 2 PM, 6 PM, and 9 PM, which I have to input into the bot.

Once you have hit the “Save Intent” button, go back to the Intents List on the top left of the screen.

Select the “Slot types” on the left of the screen and click on the “Add slot type” drop-down menu.

Amazon Lex Bot - Add Slot type

Give the name to your custom-built slot, which, in this case, is MovieName

Amazon Lex Bot - Add Slot Type Name

We now have to add values to this slot, which are the options that a user will have.

Since there are only 4 movies that we will be airing, we will have to choose the “Restrict to Slot Values,” tab.  Amazon Lex also gives you the ability to give approximate names to the movie titles that the audience will be typing out. 

For instance, for “Killers of the Flower Moon,” we have given approximations include “Killers of the,” “Flower moon,” etc.

We have added 4 values for this tutorial, as seen below:

Amazon Lex Bot- Save Slot Value

Click on Save Slot Type and this step is complete!!

Step 5: Adding multiple slots to the Intent

Once you save your slot type, you will have to navigate back to the Intents section on the left-hand side.

Click on the intent you want to add the slot to, which, in our case, is “BookTicket.”

Scroll down to the Slots section, and click on Add Slot.

Amazon Lex Bot- Add more Slots
Amazon Lex Bot - Add Multipe Slot Step 2

In the image above, you can see that we are giving the name of the slot as “MovieName” and the Slot type as the custom-built type “MovieName”, which is now visible on the panel.

In the prompt below, you have to give the options to the customer, about the movies airing at the cinema. We have given all the 4 movies as shown.

We have also followed the same step and added a Slot type called “MovieTimings.”

Once you have added these slots, it is time to modify your confirmation message.

We have made changes to the confirmation message as shown below, adding the Slot types {MovieName} and {MovieTimings}.

Amazon Lex Bot - Prompt message confirmation

Step 6: Build and Test the Bot

It is now time to save your intent and build and test your bot. This is pretty simple on Amazon Lex.

Just click on the “Build” button at the top, and, if there are no errors, the bot is built.

It is now time to Test the bot.

Click on the Test button, and you are ready to roll.

You can see how our bot responds to even the prompt ‘Killers” in the below screenshot:

Amazon Lex Bot- Build and Test chatbot

There you have it.

A chatbot built entirely on Amazon Lex. You can build bots entirely on Amazon Lex, or, to make things simpler, you can use a bot builder such as Kommunicate.

Integrating Amazon Lex Chatbot into a website

Lex has built-in support to integrate bots with some platforms such as Facebook, Kik, Slack, etc.  If you want to integrate your bot with your website or mobile apps, you have two ways:

  1. Using AWS SDK: AWS SDK provides APIs to send queries to the bot. This requires a lot of programming knowledge, development, and maintenance efforts.
  2. Using Kommunicate, which provides a codeless integration with Amazon Lex.

Integrate Amazon Lex Chatbot using Kommunicate

Kommunicate is a bot+human hybrid customer support software that provides code-less integration with chatbot builder platforms such as Amazon Lex, Google Dialogflow, etc. Once integrated, your users can chat with your bot using a beautiful and customizable chat widget.

Your Lex bot can be integrated into your website in a few simple steps:

Here is the quick video.

Step 1: Create a free Kommunicate account

You can create a free account in Kommunicate. Head to the signup section to start.

Step 2: Connect your Amazon Lex Chatbot

Post signup, navigate to the bot integration section, and select the Amazon Lex platform. Kommunicate requires the below detail to query your bot on your behalf. 

Integrating Kommunicate Bot from Amazon Lex Step 2

You just need to fill in a few details to connect your Lex bot. You can get these details in your AWS Management Console -> Security credentials section.

  1. Access key ID & Secret access key: Access key ID and secret access key are required to sign requests sent to your Lex bot. To get your access key, sign into your AWS console as an IAM user having permission to access Lex API. Locate your user name in the upper-right section of the navigation bar. From the drop-down menu, select My Security Credentials. Then create an access key in the Access keys for CLI, SDK, & API access sections. You can find more details in this blog.
  2. Bot name in Lex platform: This is the same name you entered while creating the bot in the Lex platform. If you are not aware of it, you can also get it from the bot list on the Lex home page.
  3. Bot alias: A bot alias is a pointer to a specific bot version. The alias is exposed to client applications instead of the version.  If you publish a new version of the bot and want kommunicate to connect to the new version, you can simply point the alias to the new version from the Lex console without changing anything on Kommunicate Dashboard. 
  4. Region: AWS region where your Lex service is running. You can find your region in the top-right corner, following the user name in the AWS console.

Once you have the above information follow the below steps, click Save and Proceed.

Step 3: Give your bot an identity

You can give your bot a name and a profile picture. The name and the profile picture will be visible to your users while interacting with your bot. Give your bot a name. This name will be visible to your users who interact with your bot. Click Save and Proceed.

Step 4: Enable/Disable human handoff

Your bot is as smart as you can make it. But at times, it may fail to understand a user’s questions. In that case, you can trigger a chatbot to human handoff. This helps you make the overall user experience better and handle edge cases.

Choose whether to enable or disable this feature and click on Finish bot integration setup.

Step 5: Assign all the incoming conversations to your Lex Chatbot

To let your user chat with the new bot, you need to assign all the conversations to the bot. After finishing the bot setup, click on Let this bot handle all the incoming conversations. Now, all new conversations initiated after the integration will be assigned to this bot, and your bot will start answering them.

You can also enable conversation assignments from the Conversation Rules section.

Step 6: Install the Kommunicate chat widget on your website

The final step is installing the Kommunicate chat widget on your website so your website user can chat with your bot. Copy the installation script from the Install section and paste it into your website. Here are the detailed instructions to install the same.  This is how the chat widget looks on a website

Install Kommunicate chat widget to website

Publish your website, and your bot will be ready to chat with your users. Hurray! That was easy, isn’t it?

Suggested Reads: Add Rich Message Button Response in Amazon Lex

CTA banner

Amazon Lex Chatbot Use Cases

Here are a couple of organizations that have successfully implemented Lex into their business processes to yield significant results.


TransUnion is a worldwide information and insights enterprise that helps businesses transact with their customers using data such as credit scores, credit checks, and credit reports. 

Before Amazon Lex, this was handled by TransUnion’s contact center, which was high in cost, and also inefficient. TransUnion customers’ time went into navigating the IVR system before they could talk to an agent. By implementing Amazon Lex which is a part of Amazon Connect, to automate the IVR. This change has significantly reduced customer wait times in the contact queue. The customer spends 18 seconds in the IVR as opposed to the previous 2 minutes, with a transfer rate cut by half. This has led to a 40% reduction in the annual costs of the contact center. 


ROYBI Inc. is an enterprise that has its objectives in changing early-childhood education for the better. They mix robotics with AI to make a fun, interactive learning experience that offers more benefits than traditional teaching methods. 

This formative period in a child’s life is where they absorb the most information and build a foundation that will carry them through life.” AWS and ROYBI have built a customized platform using the computer vision product Amazon Rekognition to enable learning between children and ROYBI robots. This is where Amazon Lex is the conversational interface that comprehends and engages the child to deliver a better multi-modal learning experience.

Wrapping up the Amazon Lex Chatbot tutorial

Amazon Lex is a great tool that can be used in conjunction with other suites in AWS to create unique products and services that meet customer needs. You can use Kommunicate to integrate your Amazon Lex chatbot (through this Amazon Lex tutorial) to serve your unique business objectives and serve your customers well. We explained how you can build an Amazon Lex bot using Kommunicate in this post.

Deploy the bot on a website or mobile app, and push it to its limit. Remember, building a bot is not just a technical challenge, it is an opportunity to enhance user experience.

Happy building.

Suggested Reads: Integrate Dialogflow Chatbot in Your Website

At Kommunicate, we envision a world-beating customer support solution to empower the new era of customer support. We would love to have you on board to have a first-hand experience of Kommunicate. You can signup here and start delighting your customers right away.

Write A Comment


Devashish Mamgain

I hope you enjoyed reading this blog post.

If you want the Kommunicate team to help you automate your customer support, just book a demo.

Book a Demo

You’ve unlocked 30 days for $0
Kommunicate Offer

Upcoming Webinar: Conversational AI in Fintech with Srinivas Reddy, Co-founder & CTO of TaxBuddy.