SlideShare a Scribd company logo
1 of 22
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Ahmad R. Khan
Integrate Your Amazon Lex
Chatbot with Any Messaging
Service
Overview
• “Alexa, What is Amazon Lex?”
• Amazon Lex Built-in Integrations
• Need for Custom Integrations
• Going Serverless (AWS Lambda & Amazon API Gateway)
• Teach Your Bot How to Text with Twilio SMS
• Can we talk? Adding Support for Voice
The Need for Amazon Lex
Amazon Lex
Graphical User
Interface
Conversational
Interface
Text and Speech Language Understanding
Speech
Recognition
Natural Language
Understanding
Powered by the same Deep Learning technology as Alexa
Lex Bot Structure
Utterances
Spoken or typed phrases that invoke
your intent
BookHotel
Intents
An Intent performs an action in
response to natural language user
input
Slots
Slots are input data required to fulfill
the intent
Fulfillment
Fulfillment mechanism for your intent
“Book a Hotel”
Book Hotel
NYC
“Book a Hotel in
NYC”
Automatic Speech
Recognition
Hotel Booking
New York City
Natural Language
Understanding
Intent/Slot
Model
Utterances
Hotel Booking
City New York City
Check In Nov 30th
Check Out Dec 2nd
“Your hotel is booked for
Nov 30th”
Amazon Polly
Confirmation: “Your hotel
is booked for Nov 30th”
a
in
“Can I go ahead
with the booking?
Serverless, event-driven compute service
AWS Lambda = microservice without servers
AWS Lambda
Components of AWS Lambda
• An AWS Lambda function (that you write)
• An event source
• The AWS Lambda service
• The function networking environment
Amazon API Gateway
Create Configure Publish
Maintain Monitor Secure
Fully Managed Service for Your APIs
Integrating Amazon Lex with
Twilio SMS
Amazon LexLambda
Function
Amazon API
Gateway
End User Twilio
Programmable
SMS
Architecture / Message Flow
Multi-Bot Design
“Concierge” Bot
AWS
Lambda
Function
Amazon API
Gateway
End User Multiple
Messaging
Services
Amazon
DynamoDB
“Flight-Booking”
Bot
“Cruise-Booking”
Bot
user-id current-
intent
bot ttl
867-5309 BookCruise Cruise-Booking 1494013599
“I want to book a cruise”
#1: Setting up a Twilio Phone Number
https://www.twilio.com/try-twilio
#2: IAM Policy & the AWS Lambda Function
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": [
"*"
]
},
{
"Effect": "Allow",
"Action": [
"lex:PostText"
],
"Resource": [
"*"
]
}
]
}
AWS.config.region = 'us-east-1';
var lexruntime = new AWS.LexRuntime();
var userNumber = twilioSMS.From.replace('+', '');
var params = {
botAlias: process.env.BOT_ALIAS,
botName: process.env.BOT_NAME,
inputText: twilioSMS.Body,
userId: userNumber,
sessionAttributes: {
}
};
lexruntime.postText(params, function(err, data) {
var twimlResponse = new twilio.TwimlResponse();
if (err) {
console.log(err, err.stack); // an error occurred
twimlResponse.message('Sorry, we ran into a problem at our end.');
callback(err, twimlResponse.toString());
} else {
console.log(data); // got something back from Amazon Lex
twimlResponse.message(data.message);
callback(null, twimlResponse.toString());
}
});
#3: HTTPS Endpoint using Amazon API
Gateway
#4: Configuring the Twilio Webhook
https://www.twilio.com/console
Your bot can now text!
Adding Support for Voice
• Amazon Lex can support both Text and Voice
• Use the Twilio <record> verb to prompt/record user input
• Utilize Amazon Lex’s PostContent API call (instead of
PostText)
• Accept: text/plain
• Convert to TwiML and send back to Twilio
Getting Started
https://console.aws.amazon.com/lex
AWS Chatbot Challenge
• Create a chatbot with
Amazon Lex and
AWS Lambda
• Prizes: $10,000 cash,
$5,000 AWS credits,
re:Invent tickets, more!
• Submissions due
July 18
awschatbot2017.devpost.com
Thank you!
Get Started: https://aws.amazon.com/lex
Sign up: awschatbot2017.devpost.com
Lex Console: https://console.aws.amazon.com/lex

More Related Content

What's hot

Chat Bots with Amazon Lex - AWS Summit SG 2017
Chat Bots with Amazon Lex  - AWS Summit SG 2017Chat Bots with Amazon Lex  - AWS Summit SG 2017
Chat Bots with Amazon Lex - AWS Summit SG 2017Amazon Web Services
 
Amazon Polly and Amazon Lex Workshop
Amazon Polly and Amazon Lex WorkshopAmazon Polly and Amazon Lex Workshop
Amazon Polly and Amazon Lex WorkshopAmazon Web Services
 
Introducing Amazon Lex – Service for Building Voice or Text Chatbots
Introducing Amazon Lex – Service for Building Voice or Text ChatbotsIntroducing Amazon Lex – Service for Building Voice or Text Chatbots
Introducing Amazon Lex – Service for Building Voice or Text ChatbotsAmazon Web Services
 
Getting Started with Amazon Lex - AWS Summit Cape Town 2017
Getting Started with Amazon Lex  - AWS Summit Cape Town 2017 Getting Started with Amazon Lex  - AWS Summit Cape Town 2017
Getting Started with Amazon Lex - AWS Summit Cape Town 2017 Amazon Web Services
 
Building a Better Chatbot with Amazon Lex and Polly
Building a Better Chatbot with Amazon Lex and PollyBuilding a Better Chatbot with Amazon Lex and Polly
Building a Better Chatbot with Amazon Lex and PollyAmazon Web Services
 
Introducing Amazon Lex – A Service for Building Voice or Text Chatbots - Marc...
Introducing Amazon Lex – A Service for Building Voice or Text Chatbots - Marc...Introducing Amazon Lex – A Service for Building Voice or Text Chatbots - Marc...
Introducing Amazon Lex – A Service for Building Voice or Text Chatbots - Marc...Amazon Web Services
 
Building a Chatbot with Amazon Lex and AWS Lambda Workshop
Building a Chatbot with Amazon Lex and AWS Lambda WorkshopBuilding a Chatbot with Amazon Lex and AWS Lambda Workshop
Building a Chatbot with Amazon Lex and AWS Lambda WorkshopAmazon Web Services
 
Amazon Rekognition & Amazon Polly
Amazon Rekognition & Amazon PollyAmazon Rekognition & Amazon Polly
Amazon Rekognition & Amazon PollyAmazon Web Services
 
AWS re:Invent 2016: Workshop: Building Serverless Bots on AWS - Botathon (DCS...
AWS re:Invent 2016: Workshop: Building Serverless Bots on AWS - Botathon (DCS...AWS re:Invent 2016: Workshop: Building Serverless Bots on AWS - Botathon (DCS...
AWS re:Invent 2016: Workshop: Building Serverless Bots on AWS - Botathon (DCS...Amazon Web Services
 
Building Speech Enabled Products with Amazon Polly & Amazon Lex
Building Speech Enabled Products with Amazon Polly & Amazon LexBuilding Speech Enabled Products with Amazon Polly & Amazon Lex
Building Speech Enabled Products with Amazon Polly & Amazon LexAmazon Web Services
 
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017Amazon Web Services
 
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API GatewayBuild a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API GatewayDanilo Poccia
 
Building Event-driven Serverless Apps
Building Event-driven Serverless AppsBuilding Event-driven Serverless Apps
Building Event-driven Serverless AppsDanilo Poccia
 
Event-driven (serverless) Applications
Event-driven (serverless) ApplicationsEvent-driven (serverless) Applications
Event-driven (serverless) ApplicationsDanilo Poccia
 
Building Event-Driven Serverless Applications
Building Event-Driven Serverless ApplicationsBuilding Event-Driven Serverless Applications
Building Event-Driven Serverless ApplicationsDanilo Poccia
 
Connecting the Unconnected: IoT Made Simple
Connecting the Unconnected: IoT Made SimpleConnecting the Unconnected: IoT Made Simple
Connecting the Unconnected: IoT Made SimpleDanilo Poccia
 
Building your own chat bot with Amazon Lex - Hebrew Webinar
Building your own chat bot with Amazon Lex - Hebrew WebinarBuilding your own chat bot with Amazon Lex - Hebrew Webinar
Building your own chat bot with Amazon Lex - Hebrew WebinarBoaz Ziniman
 
Empowering Customer Service with Cloud Telephony & AI
Empowering Customer Service with Cloud Telephony & AIEmpowering Customer Service with Cloud Telephony & AI
Empowering Customer Service with Cloud Telephony & AIAmazon Web Services
 

What's hot (20)

Chat Bots with Amazon Lex - AWS Summit SG 2017
Chat Bots with Amazon Lex  - AWS Summit SG 2017Chat Bots with Amazon Lex  - AWS Summit SG 2017
Chat Bots with Amazon Lex - AWS Summit SG 2017
 
Amazon Polly and Amazon Lex Workshop
Amazon Polly and Amazon Lex WorkshopAmazon Polly and Amazon Lex Workshop
Amazon Polly and Amazon Lex Workshop
 
Introducing Amazon Lex – Service for Building Voice or Text Chatbots
Introducing Amazon Lex – Service for Building Voice or Text ChatbotsIntroducing Amazon Lex – Service for Building Voice or Text Chatbots
Introducing Amazon Lex – Service for Building Voice or Text Chatbots
 
Getting Started with Amazon Lex - AWS Summit Cape Town 2017
Getting Started with Amazon Lex  - AWS Summit Cape Town 2017 Getting Started with Amazon Lex  - AWS Summit Cape Town 2017
Getting Started with Amazon Lex - AWS Summit Cape Town 2017
 
Building a Better Chatbot with Amazon Lex and Polly
Building a Better Chatbot with Amazon Lex and PollyBuilding a Better Chatbot with Amazon Lex and Polly
Building a Better Chatbot with Amazon Lex and Polly
 
Introducing Amazon Lex – A Service for Building Voice or Text Chatbots - Marc...
Introducing Amazon Lex – A Service for Building Voice or Text Chatbots - Marc...Introducing Amazon Lex – A Service for Building Voice or Text Chatbots - Marc...
Introducing Amazon Lex – A Service for Building Voice or Text Chatbots - Marc...
 
Building a Chatbot with Amazon Lex and AWS Lambda Workshop
Building a Chatbot with Amazon Lex and AWS Lambda WorkshopBuilding a Chatbot with Amazon Lex and AWS Lambda Workshop
Building a Chatbot with Amazon Lex and AWS Lambda Workshop
 
Amazon Rekognition & Amazon Polly
Amazon Rekognition & Amazon PollyAmazon Rekognition & Amazon Polly
Amazon Rekognition & Amazon Polly
 
AWS re:Invent 2016: Workshop: Building Serverless Bots on AWS - Botathon (DCS...
AWS re:Invent 2016: Workshop: Building Serverless Bots on AWS - Botathon (DCS...AWS re:Invent 2016: Workshop: Building Serverless Bots on AWS - Botathon (DCS...
AWS re:Invent 2016: Workshop: Building Serverless Bots on AWS - Botathon (DCS...
 
Building Speech Enabled Products with Amazon Polly & Amazon Lex
Building Speech Enabled Products with Amazon Polly & Amazon LexBuilding Speech Enabled Products with Amazon Polly & Amazon Lex
Building Speech Enabled Products with Amazon Polly & Amazon Lex
 
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
 
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API GatewayBuild a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
 
Building Event-driven Serverless Apps
Building Event-driven Serverless AppsBuilding Event-driven Serverless Apps
Building Event-driven Serverless Apps
 
Event-driven (serverless) Applications
Event-driven (serverless) ApplicationsEvent-driven (serverless) Applications
Event-driven (serverless) Applications
 
Building Event-Driven Serverless Applications
Building Event-Driven Serverless ApplicationsBuilding Event-Driven Serverless Applications
Building Event-Driven Serverless Applications
 
Introduzione ad Amazon Lex
Introduzione ad Amazon LexIntroduzione ad Amazon Lex
Introduzione ad Amazon Lex
 
Connecting the Unconnected: IoT Made Simple
Connecting the Unconnected: IoT Made SimpleConnecting the Unconnected: IoT Made Simple
Connecting the Unconnected: IoT Made Simple
 
Building your own chat bot with Amazon Lex - Hebrew Webinar
Building your own chat bot with Amazon Lex - Hebrew WebinarBuilding your own chat bot with Amazon Lex - Hebrew Webinar
Building your own chat bot with Amazon Lex - Hebrew Webinar
 
Chatbot
ChatbotChatbot
Chatbot
 
Empowering Customer Service with Cloud Telephony & AI
Empowering Customer Service with Cloud Telephony & AIEmpowering Customer Service with Cloud Telephony & AI
Empowering Customer Service with Cloud Telephony & AI
 

Similar to Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tech Talks

把您的 Amazon Lex Chatbot 與訊息服務集成
把您的 Amazon Lex Chatbot 與訊息服務集成把您的 Amazon Lex Chatbot 與訊息服務集成
把您的 Amazon Lex Chatbot 與訊息服務集成Amazon Web Services
 
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017Amazon Web Services
 
WIN205-Building a Better .NET Bot with AWS Services
WIN205-Building a Better .NET Bot with AWS ServicesWIN205-Building a Better .NET Bot with AWS Services
WIN205-Building a Better .NET Bot with AWS ServicesAmazon Web Services
 
Building Chatbots with Amazon Lex I AWS Dev Day 2018
Building Chatbots with Amazon Lex I AWS Dev Day 2018Building Chatbots with Amazon Lex I AWS Dev Day 2018
Building Chatbots with Amazon Lex I AWS Dev Day 2018AWS Germany
 
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...Amazon Web Services
 
使用 Amazon Lex 在應用程式中建立對話式機器人
使用 Amazon Lex 在應用程式中建立對話式機器人 使用 Amazon Lex 在應用程式中建立對話式機器人
使用 Amazon Lex 在應用程式中建立對話式機器人 Amazon Web Services
 
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...Amazon Web Services
 
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...Amazon Web Services
 
Learn How to Build a Bot for Voice and Text with Amazon Lex and Amazon Polly
Learn How to Build a Bot for Voice and Text with Amazon Lex and Amazon PollyLearn How to Build a Bot for Voice and Text with Amazon Lex and Amazon Polly
Learn How to Build a Bot for Voice and Text with Amazon Lex and Amazon PollyAmazon Web Services
 
Building voice enabled Apps with Alexa voice service and Amazon Lex.
Building voice enabled Apps with Alexa voice service and Amazon Lex.     Building voice enabled Apps with Alexa voice service and Amazon Lex.
Building voice enabled Apps with Alexa voice service and Amazon Lex. Amazon Web Services
 
Amazon Lex Chatbot Tutorial | Amazon Lex Chatbot Demo | AWS Certification Tra...
Amazon Lex Chatbot Tutorial | Amazon Lex Chatbot Demo | AWS Certification Tra...Amazon Lex Chatbot Tutorial | Amazon Lex Chatbot Demo | AWS Certification Tra...
Amazon Lex Chatbot Tutorial | Amazon Lex Chatbot Demo | AWS Certification Tra...Edureka!
 
Amazon Connect & Amazon Lex Demo
Amazon Connect & Amazon Lex DemoAmazon Connect & Amazon Lex Demo
Amazon Connect & Amazon Lex DemoAmazon Web Services
 
AWS re:Invent 2016: NEW LAUNCH! Workshop: Hands on with Amazon Lex, Amazon Po...
AWS re:Invent 2016: NEW LAUNCH! Workshop: Hands on with Amazon Lex, Amazon Po...AWS re:Invent 2016: NEW LAUNCH! Workshop: Hands on with Amazon Lex, Amazon Po...
AWS re:Invent 2016: NEW LAUNCH! Workshop: Hands on with Amazon Lex, Amazon Po...Amazon Web Services
 
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)Amazon Web Services
 
Enriching Customer Experience using a Serverless Voice Chatbot
Enriching Customer Experience using a Serverless Voice ChatbotEnriching Customer Experience using a Serverless Voice Chatbot
Enriching Customer Experience using a Serverless Voice ChatbotInjae Kwak
 
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...Amazon Web Services
 
Reimagining your user experience with Amazon Lex, Amazon Polly and Alexa Ski...
 Reimagining your user experience with Amazon Lex, Amazon Polly and Alexa Ski... Reimagining your user experience with Amazon Lex, Amazon Polly and Alexa Ski...
Reimagining your user experience with Amazon Lex, Amazon Polly and Alexa Ski...Amazon Web Services
 
Getting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingGetting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingAmazon Web Services
 

Similar to Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tech Talks (20)

把您的 Amazon Lex Chatbot 與訊息服務集成
把您的 Amazon Lex Chatbot 與訊息服務集成把您的 Amazon Lex Chatbot 與訊息服務集成
把您的 Amazon Lex Chatbot 與訊息服務集成
 
Introducing Amazon Lex
Introducing Amazon Lex Introducing Amazon Lex
Introducing Amazon Lex
 
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
 
WIN205-Building a Better .NET Bot with AWS Services
WIN205-Building a Better .NET Bot with AWS ServicesWIN205-Building a Better .NET Bot with AWS Services
WIN205-Building a Better .NET Bot with AWS Services
 
Building Chatbots with Amazon Lex I AWS Dev Day 2018
Building Chatbots with Amazon Lex I AWS Dev Day 2018Building Chatbots with Amazon Lex I AWS Dev Day 2018
Building Chatbots with Amazon Lex I AWS Dev Day 2018
 
Deep Dive: Amazon Lex
Deep Dive: Amazon LexDeep Dive: Amazon Lex
Deep Dive: Amazon Lex
 
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
 
使用 Amazon Lex 在應用程式中建立對話式機器人
使用 Amazon Lex 在應用程式中建立對話式機器人 使用 Amazon Lex 在應用程式中建立對話式機器人
使用 Amazon Lex 在應用程式中建立對話式機器人
 
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
 
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
 
Learn How to Build a Bot for Voice and Text with Amazon Lex and Amazon Polly
Learn How to Build a Bot for Voice and Text with Amazon Lex and Amazon PollyLearn How to Build a Bot for Voice and Text with Amazon Lex and Amazon Polly
Learn How to Build a Bot for Voice and Text with Amazon Lex and Amazon Polly
 
Building voice enabled Apps with Alexa voice service and Amazon Lex.
Building voice enabled Apps with Alexa voice service and Amazon Lex.     Building voice enabled Apps with Alexa voice service and Amazon Lex.
Building voice enabled Apps with Alexa voice service and Amazon Lex.
 
Amazon Lex Chatbot Tutorial | Amazon Lex Chatbot Demo | AWS Certification Tra...
Amazon Lex Chatbot Tutorial | Amazon Lex Chatbot Demo | AWS Certification Tra...Amazon Lex Chatbot Tutorial | Amazon Lex Chatbot Demo | AWS Certification Tra...
Amazon Lex Chatbot Tutorial | Amazon Lex Chatbot Demo | AWS Certification Tra...
 
Amazon Connect & Amazon Lex Demo
Amazon Connect & Amazon Lex DemoAmazon Connect & Amazon Lex Demo
Amazon Connect & Amazon Lex Demo
 
AWS re:Invent 2016: NEW LAUNCH! Workshop: Hands on with Amazon Lex, Amazon Po...
AWS re:Invent 2016: NEW LAUNCH! Workshop: Hands on with Amazon Lex, Amazon Po...AWS re:Invent 2016: NEW LAUNCH! Workshop: Hands on with Amazon Lex, Amazon Po...
AWS re:Invent 2016: NEW LAUNCH! Workshop: Hands on with Amazon Lex, Amazon Po...
 
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
 
Enriching Customer Experience using a Serverless Voice Chatbot
Enriching Customer Experience using a Serverless Voice ChatbotEnriching Customer Experience using a Serverless Voice Chatbot
Enriching Customer Experience using a Serverless Voice Chatbot
 
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
 
Reimagining your user experience with Amazon Lex, Amazon Polly and Alexa Ski...
 Reimagining your user experience with Amazon Lex, Amazon Polly and Alexa Ski... Reimagining your user experience with Amazon Lex, Amazon Polly and Alexa Ski...
Reimagining your user experience with Amazon Lex, Amazon Polly and Alexa Ski...
 
Getting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingGetting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless Computing
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tech Talks

  • 1. © 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Ahmad R. Khan Integrate Your Amazon Lex Chatbot with Any Messaging Service
  • 2. Overview • “Alexa, What is Amazon Lex?” • Amazon Lex Built-in Integrations • Need for Custom Integrations • Going Serverless (AWS Lambda & Amazon API Gateway) • Teach Your Bot How to Text with Twilio SMS • Can we talk? Adding Support for Voice
  • 3. The Need for Amazon Lex Amazon Lex Graphical User Interface Conversational Interface
  • 4. Text and Speech Language Understanding Speech Recognition Natural Language Understanding Powered by the same Deep Learning technology as Alexa
  • 5. Lex Bot Structure Utterances Spoken or typed phrases that invoke your intent BookHotel Intents An Intent performs an action in response to natural language user input Slots Slots are input data required to fulfill the intent Fulfillment Fulfillment mechanism for your intent
  • 6. “Book a Hotel” Book Hotel NYC “Book a Hotel in NYC” Automatic Speech Recognition Hotel Booking New York City Natural Language Understanding Intent/Slot Model Utterances Hotel Booking City New York City Check In Nov 30th Check Out Dec 2nd “Your hotel is booked for Nov 30th” Amazon Polly Confirmation: “Your hotel is booked for Nov 30th” a in “Can I go ahead with the booking?
  • 7. Serverless, event-driven compute service AWS Lambda = microservice without servers AWS Lambda
  • 8. Components of AWS Lambda • An AWS Lambda function (that you write) • An event source • The AWS Lambda service • The function networking environment
  • 9. Amazon API Gateway Create Configure Publish Maintain Monitor Secure Fully Managed Service for Your APIs
  • 10.
  • 11. Integrating Amazon Lex with Twilio SMS
  • 12. Amazon LexLambda Function Amazon API Gateway End User Twilio Programmable SMS Architecture / Message Flow
  • 13. Multi-Bot Design “Concierge” Bot AWS Lambda Function Amazon API Gateway End User Multiple Messaging Services Amazon DynamoDB “Flight-Booking” Bot “Cruise-Booking” Bot user-id current- intent bot ttl 867-5309 BookCruise Cruise-Booking 1494013599 “I want to book a cruise”
  • 14. #1: Setting up a Twilio Phone Number https://www.twilio.com/try-twilio
  • 15. #2: IAM Policy & the AWS Lambda Function { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "lex:PostText" ], "Resource": [ "*" ] } ] } AWS.config.region = 'us-east-1'; var lexruntime = new AWS.LexRuntime(); var userNumber = twilioSMS.From.replace('+', ''); var params = { botAlias: process.env.BOT_ALIAS, botName: process.env.BOT_NAME, inputText: twilioSMS.Body, userId: userNumber, sessionAttributes: { } }; lexruntime.postText(params, function(err, data) { var twimlResponse = new twilio.TwimlResponse(); if (err) { console.log(err, err.stack); // an error occurred twimlResponse.message('Sorry, we ran into a problem at our end.'); callback(err, twimlResponse.toString()); } else { console.log(data); // got something back from Amazon Lex twimlResponse.message(data.message); callback(null, twimlResponse.toString()); } });
  • 16. #3: HTTPS Endpoint using Amazon API Gateway
  • 17. #4: Configuring the Twilio Webhook https://www.twilio.com/console
  • 18. Your bot can now text!
  • 19. Adding Support for Voice • Amazon Lex can support both Text and Voice • Use the Twilio <record> verb to prompt/record user input • Utilize Amazon Lex’s PostContent API call (instead of PostText) • Accept: text/plain • Convert to TwiML and send back to Twilio
  • 21. AWS Chatbot Challenge • Create a chatbot with Amazon Lex and AWS Lambda • Prizes: $10,000 cash, $5,000 AWS credits, re:Invent tickets, more! • Submissions due July 18 awschatbot2017.devpost.com
  • 22. Thank you! Get Started: https://aws.amazon.com/lex Sign up: awschatbot2017.devpost.com Lex Console: https://console.aws.amazon.com/lex