Skip to content
Code and walkthrough labs to create a customer service chatbot using Amazon Lex (and integrations with Amazon Connect, Twilio SMS, etc.)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Creating initial file from template Oct 27, 2017
01_LexBotInformational Update link to cloudformation to node8 version Feb 11, 2019
02_LexBotSubscribeService Update Aug 26, 2018
04_TwilioSMSIntegration Update Aug 26, 2018
10_ExtraCredit Integrate with any messaging service Nov 27, 2017
11_Cleanup rename readme for cleanup page Nov 25, 2017
99_resources Enhanced Connect instructions to reflect changes with Amazon Connect … Nov 17, 2017
lambda-functions connect uses text for outputmode, so need to check that case Nov 27, 2017
.gitignore gitignore Oct 30, 2017
NOTICE Creating initial file from template Oct 27, 2017
lex-bot-schema.json Add the finished bot schema to the repo Mar 29, 2019

Build a customer service chatbot with Amazon Lex

Amazon Lex allows you to quickly and easily build sophisticated, natural language, customer service chatbots.

In this workshop, you will build a customer service chatbot for a fictitious telco company. They want to make it really easy for their customers to add an international plan to their existing phone account when their customers travel abroad for business and vacation.

The application architecture uses Amazon Lex, AWS Lambda and Amazon DynamoDB. You will build an Amazon Lex chatbot that understands customers' speech or text inputs. Data about available plans and user's chosen plans are persisted in DynamoDB. AWS lambda functions get triggered by Amazon Lex to execute business logic and interact with the DB layer. You can then connect the Lex chatbot with twilio SMS, which allows users to access your bot over SMS text messages; or Amazon Connect, which allows users to call your customer service number and interact with AI through voice.

See the diagram below for a depiction of the complete architecture.


AWS Account

In order to complete this workshop you'll need an AWS Account with sufficient permission to create AWS IAM, Amazon Lex, Amazon Connect, Lambda, DynamoDB and CloudFormation resources. The code and instructions in this workshop assume only one student is using a given AWS account at a time. If you try sharing an account with another student, you'll run into naming conflicts for certain resources. You can work around these by appending a unique suffix to the resources that fail to create due to conflicts, but the instructions do not provide details on the changes required to make this work.


This workshop is broken up into multiple modules. For building out your Lex chatbot, you must complete the following module in order before proceeding to the next:

  1. Build a Lex chatbot and handle informational queries
  2. Handle customer requests to subscribe to services

Once you have a working Lex chatbot, you can choose to complete one or more of the following modules to integrate your Lex chatbot to different channels to interface with your customer:

Extra credit ideas:

Resource cleanup:

You can’t perform that action at this time.