AWS re:Invent 2016: All Your Chats are Belong to Bots: Building a Serverless Customer Service Bot...

22
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Olivier Klein, Emerging Technologies Solutions Architect, Asia-Pacific December 1, 2016 All Your Chats Belong to Bots: Building a Serverless Customer Service Bot SVR310

Transcript of AWS re:Invent 2016: All Your Chats are Belong to Bots: Building a Serverless Customer Service Bot...

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Olivier Klein, Emerging Technologies Solutions Architect, Asia-Pacific

December 1, 2016

All Your Chats Belong to Bots: Building

a Serverless Customer Service Bot

SVR310

Hello WildRydes!

Hey there, how can

we help?

Automated/Assisted

Responses via

Chatbot

Data Storage for

message

communication

history

Sentiment Analysis &

Dashboard to

understand customer

satisfaction

What are we building today?

Customer service bot for WildRydes

• Integration with Facebook Messenger and

Facebook Graph API

• Slack App for operations team to use

channel commands and approve answers

AWS Lambda functions that perform

Natural Language Processing (NLP)

with the help of NLTK

Sentiment Analysis with live customer

“satisfaction” dashboard

We Architect to be Serverless

Fully Managed

• No provisioning

• Zero administration

• High availability

Developer Productivity

• Focus on the code

• Innovate rapidly

• Reduce time to market

Scalability

• Automatically

• Scale up and down

Many Serverless Options on AWS

Storage

Database

Compute

Messaging and Queues

Gateways

User Management

Internet of Things

Machine Learning

Streaming Analytics

Search

What AWS services and tools will we use here?

AWS Lambda

Run your code without thinking about

servers. Pay only for compute time

you consume.

Triggered through API calls or state

changes in your AWS environment

Scales automatically to match the

incoming event rate

Charged per 100ms execution time

AWS Lambda

Amazon

S3

Amazon

DynamoDB

Amazon

Kinesis

AWS

CloudFormationAWS

CloudTrailAmazon

CloudWatch

Amazon

SNS

Amazon

SES

Amazon

API Gateway

Amazon

Cognito

AWS

IoT

Amazon

Alexa

Cron events

DATA STORES ENDPOINTS

REPOSITORIES EVENT/MESSAGE SERVICES

Event sources that integrate with AWS Lambda

… and the list continues to grow.

AWS

Config

Amazon API Gateway

Fully managed and scalable RESTful

API gateway service

Powered by our content delivery

network via 68 global edge locations

Provides DDoS protection and

throttling capabilities

Multiple API stages that you define

(e.g., dev, test, prod)

AWS

Lambda

Amazon

API

Gateway

Amazon EC2

AWS API

On-premises

server

Webhooks – Integrate with other platforms

Facebook

AWS Lambda

Slack

Amazon

API

Gateway

NLTK is a toolkit written in Python to

facilitate Natural Language Processing

(NLP)

Provides easy-to-use interfaces for

classification, tokenization, stemming,

tagging, parsing, and semantic reasoning

VADER - Rule-based Model for Sentiment

Analysis of Social Media Text

www.nltk.org

Natural Language Toolkit - NLTK

Elasticsearch & Kibana

Open-source search and

analytics engine

Schema free with a developer

friendly RESTful API

Kibana integrates with

Elasticsearch for in-browser

visualizations

POST /movie_db/_search{"query": {

"match": {"description": "hacking"}},"aggs": {

"genre": {"terms": {"field": "genre“}}}

}

Amazon Elasticsearch Service (ES)

Managed service to deploy, operate and

scale Elasticsearch on AWS

Scales for data size and throughput

Integration with AWS IAM, Cloudtrail, and

CloudWatch access control, auditing,

and monitoring

Integrates Kibana for in-browser

visualizations

Amazon

Elasticsearch

Service

Amazon DynamoDB

Amazon

DynamoDB

table

items

attributes

Fast and flexible NoSQL database

service

No storage or throughput limits

Consistent, single-digit millisecond

latency at any scale

Document and key-value store

models

Replicated across 3 facilities

Let’s get started!

What does it consist of?

1. Integrate with Facebook Messenger via

webhooks

2. Build a serverless Slack app and

integrate with our operations Slack

channel

3. Build and query a knowledge base

4. Create an NLP AWS Lambda function

5. Real-time Sentiment Analysis

Dashboard

Architecture Overview

Facebook

AWS Lambda

Slack

Amazon

API

Gateway

Amazon Elasticsearch

Service

Amazon

DynamoDB

Facebook

Graph API

Slack API

Architecture Overview

Steps to get started

• Break into a group (max. 2 people), or work solo!

• Open GitHub repository and read through the README

• Launch the AWS SAM CloudFormation stack

• Decide on other extensions you want to build!

• Share your designs with fellow WildRyders!

Workshop available at:

https://github.com/awslabs/serverless-chatbots-workshop

Thank you!

Remember to complete

your evaluations!