Blog Article

How to build an AWS chatbot with AWS Lex?

Abhinav Girdhar
By Abhinav Girdhar | Last Updated on March 4th, 2023 10:09 am | 5-min read

“Alexa, what’s the weather like today?” “Alexa set a reminder for the next Packers game.” “Alexa, suggest a healthy chicken recipe.” Alexa, the friendly assistant, has wormed its way into our lives by making our tasks simpler. We all know about Alexa. How many of you have heard about Lex the AWS conversational AI? Amazon Lex bot is the virtual brain behind Alexa.


Amazon Lex works on the same basic chatbot architecture followed by the other big cloud-based conversational AI providers. To create an Amazon Lex chatbot, you will need intents, entities, chatbot scripts, and the dialog flow. Most chatbot development environments are pretty similar in approach and basic architecture. However, there is an easier way to build a chatbot - Appy Pie Chatbot. The platform is entirely no-code and can help you build your own chatbot in minutes.

How does Amazon Lex work?

The basic process in carrying out any task using a chatbot begins with you initiating a query. As a response to that, the bot then gathers all the necessary information from you, processes it, and then displays the relevant responses. Now, when you are planning to create a conversational chatbot flow using Lex, you must first understand the terminology you will encounter in the Lex console.


An intent is essentially an action that the user wants to perform. Whenever a user initiates a query with the AWS chatbot, it is matched with the best available intent within the bot. Each intent has multiple sample utterances associated with it. The Sample Utterance is used to match the user’s query with an intent. You can configure a bot to support multiple intents, which can then come together to help the bot carry out complete conversations.

Sample utterance

Sample utterance is a massive collection of all the possible types of queries or expressions that a user might enter. This collection of expressions all mean the same as the intent defined for the chatbot. Various expressions can even be used to build a model to categorize all the queries generated by the users. As soon as the user enters any one of these expressions, the model identifies the intent. In case multiple intents are matched to the expression, the model identifies the best match and triggers it. In case none of the intents matches, you can set an error message to be displayed to the user. Once an intent is matched, Lex moves on to the intent fulfillment phase.

Fulfilling intents

To put it simply, fulfillment is the response that a chatbot sends when an intent is triggered. There are two different ways how this happens:
  • In the first method, you will create a Lambda function that will be called whenever an intent is triggered. Here, Lex sends all the details while the Lambda function performs the action and decides the response to be sent to the user.
  • In the second method, Lex returns the relevant information to the client application to perform the necessary fulfillment.


These are the parameters defined as part of the intent configuration. Its value is extracted dynamically at runtime from the query generated by the user. The slots contain structured data that can be used to perform a specific logic or even generate responses. Each slot is assigned a type that determines the kind of value it would contain. Amazon Lex has some built-in intents and slot types to get the relevant information like measurement units, dates, times, country or city names, etc.

Configuring Lambda functions as fulfillment

This part is for the developers who are using the first fulfillment method. As soon as the user has filled in all the relevant data, the Lambda function will be invoked. Lex sends all this information to the Lambda function in a specific format, and the Lambda function then performs the business logic. The Lambda function now calls the relevant API to find the results for the user’s query and returns the result to Lex in the same format. Lex then forwards the results to the user.

Build, test, and publish the bot

Now that you have configured your AWS chatbot, it is time to build your bot and start the testing process. Testing how your bot works is of great importance before you decide to publish it or integrate it on your website. By testing your bot, you winnow out multiple possible errors and inconveniences that you definitely do not want your users to experience. Lex has a testing window to test your Amazon AI chatbot to see how it responds to the user’s queries.

Disadvantages of AWS Chatbot

Though AWS chatbots let you communicate and monitor your AWS resources efficiently, AWS chatbots have some distinct disadvantages.
  • An AWS bot supports only two channels, viz. Slack channels and Chime chat rooms
  • In the case of multiple AWS accounts, where you need to configure a single AWS chatbot to them all, the configurations are mapped independently.
  • AWS chatbot notifications do not support custom formatting

Disadvantages of Amazon Lex

Amazon Lex is quite a useful service but has a number of disadvantages for the users.
  • Amazon Lex currently supports US English, Spanish, French, German, Italian, Australian English, British English, Canadian French, Latin American Spanish, and US Spanish.
  • The maximum duration of speech input is only 15 seconds.
  • Amazon Lex bots require an internet connection and cannot be accessed locally.

Appy Pie Chatbot - the Best Alternative to AWS chatbots

AWS chatbots have their charm but are definitely not for everyone. Business users, in particular, may struggle to get it right. For this reason, Appy Pie Chatbot has appeared as the most popular alternative to AWS chatbot. The platform does not need you to spend weeks on training. You can build any type of chatbot you want in mere minutes. The best part is that it suits all pocket sizes. Hence, whether you are an individual professional or a full-scale business, Appy Pie Chatbot is the perfect customer support solution for you! Let’s learn a little more about the platform.

Top features of Appy Pie Chatbot

Appy Pie Chatbot is a no-code platform that lets you create your own chatbot in minutes. You can build different types of chatbots on the platform in minutes. Here are the top features of the platform that set it apart from the rest.
  1. Needs no coding
  2. Building a chatbot on the Appy Pie platform requires no coding. The platform is equally useful for amateurs and professionals. This means you can create a strong customer support system in minutes!
  3. Multi-lingual support
  4. Why limit yourself to just the one language when you can serve customers from all over the world in their own language. Expand your audience by reaching out to them in a relatable way.
  5. Multiple chatbots, single account
  6. Multiple chatbot templates allow you to create different types of chatbots with the same account and meet various business needs. You make an unlimited number of chatbots and integrate them into different web pages and mobile apps.
  7. Contacts and lead management
  8. The chatbots built with Appy Pie Chatbot automatically work as an efficient contact and lead management system, particularly for entrepreneurs and small businesses. This way, the customer support teams can track leads, nurture them and eventually close more deals.
  9. Email tracking
  10. You can use your chatbot to keep track of user emails as soon as they reach your inbox. This helps your customer support team personalize their interactions and make sure that you do not miss out on any lead that could be converted.
  11. Analytics
  12. Unless you evaluate your performance, you can never improve. Look into chatbot analytics and study how the users interact with them, how comfortable they are in posing their queries, and how successful your chatbots are in satisfying them.
  13. App integrations
  14. Appy Pie Chatbot lets you integrate different apps with your chatbot so that you can scale up your customer experience. One of the most popular chatbot integrations on the platform is with Google Sheets.

How to make a chatbot with Appy Pie Chatbot?

Making an AWS chatbot has many detailed steps and requires an understanding of the basic architecture of AWS bots and Amazon Lex. However, you don’t have to go down that road. Appy Pie Chatbot makes the entire process simple and wraps up your chatbot development project into three simple steps.Step 1: Enter the bot name. Enter the name of your bot and select the type of bot that meets your business needs in the best possible way. Step 2: Customize your bot. Customize the design of your chatbot and add details like logo, avatar, and the company.Step 3: Add a chatbot to your website. Add the widget to your website and respond to your customers in real-time.
Have you tried using Appy Pie Chatbot? Let us know how it helped you with your business. I’d love to hear from you!

You May Also Like:

Take a deeper dive into the digital ecosystem and start expanding your business with these helpful resources:

Related Articles

Abhinav Girdhar

Founder and CEO of Appy Pie