Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

AWS re:Invent 2016: bots + serverless = ❤ (SVR304)

1,330 views

Published on

Chatbots are the new apps. Businesses of all sizes, from startups to enterprises, are looking for new ways to connect with their users through natural, conversational interfaces. Developers have started using chatbots to improve the productivity and efficiency of their operations. In this session, we show how to use AWS Lambda and other serverless offerings from AWS to build chatbots quickly and efficiently. We share examples from our recently concluded AWS Slack Hackathon with a full walkthrough of building a conversational chatbot in an easy, fast, and fun way, along with helpful tools, tips, and techniques.

Published in: Technology

AWS re:Invent 2016: bots + serverless = ❤ (SVR304)

  1. 1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SVR304 bots + serverless = Vishal Singh, Senior Product Manager, AWS Lambda December 1, 2016
  2. 2. What to Expect from the Session • Introduction to Serverless Chatbots • Frameworks and integrations for serverless chatbots • AWS Slack chatbot hackathon summary • Amazon Lex • Architecture & benefits • Demo – building a Facebook chatbot using Lex + Lambda • Mobile Hub enterprise SaaS connectors
  3. 3. Introduction to Serverless Chatbots
  4. 4. Chatbots Chatbot is a service designed to simulate conversation with human users, accessible from a messaging interface. Key characteristics: On-demand Accessible Efficient Natural
  5. 5. AWS Lambda: Run code in response to events COMPUTE SERVICE EVENT DRIVEN Run arbitrary code without managing servers Code only runs when it needs to run
  6. 6. Code is all you need Event-driven scaling Never pay for idle Availability and fault tolerance built in Benefits of AWS Lambda
  7. 7. Amazon API Gateway: Serverless APIs Internet Mobile apps Websites Services AWS Lambda functions AWS API Gateway cache Endpoints on Amazon EC2 Any other publicly accessible endpointAmazon CloudWatch Amazon CloudFront Amazon API Gateway
  8. 8. Benefits of Amazon API Gateway Create a unified API frontend for multiple microservices DDoS protection and throttling for your back end Authenticate and authorize requests to a back end
  9. 9. Serverless Apps EVENT SOURCE FUNCTION SERVICES (ANYTHING) Changes in data state Requests to endpoints Changes in resource state Node Python Java C# NEW!
  10. 10. The Serverless Chatbot Internet Any Messaging app AWS Lambda functions AWS API Gateway Other AWS services Any other publicly accessible endpoint Webhook using API Gateway & AWS Lambda
  11. 11. Things to Note Intent resolution: Language understanding is handled by the Lambda function using NLP libraries Authentication: API Gateway authenticates the incoming requests before passing to Lambda. Partner integrations: • Slack (blueprints available!) • Twilio • Hipchat
  12. 12. Building Chatbots with Serverless 1.Upload Bot code to AWS Lambda 2.Set code to trigger when user interacts via API Gateway webhook 3.Integrate with Messaging service 4.Test your chatbots
  13. 13. Frameworks and Integrations for Chatbots
  14. 14. Frameworks and Integrations for Serverless Chatbots AWS SAM – AWS Serverless Application Model • Specification to express a serverless chatbot application • Helps in quickly deploying your application via CloudFormation Other community frameworks: • Claudia-bot-builder – Node open source framework • Serverless.com – Serverless framework NEW !
  15. 15. + NEW ! NEW !
  16. 16. AWS Slack Chatbot Hackathon Summary
  17. 17. AWS Slack Chatbot Hackathon Summary • 2 months virtual hackathon (Aug10–Sept29 ‘16) • 650+ registrations • ~70 submissions • Using various frameworks, libraries, open source and more https://awschatbot.devpost.com/submissions
  18. 18. Hackathon Popular Chatbot Use Cases • ChatOps • Education • Social • Translation • Travel • Trivia • Polls/quiz • Knowledge Base • Many more…
  19. 19. AWS Slack Hackathon Winners - Congratulations!
  20. 20. Chatbots Architectural Recommendations • Authentication and authorization • Sigv4, Amazon Cognito, custom authorizers • Lambda execution role • Environment variables • Encrypt your secrets • Persistence of state & sessions • DDB, S3, or any data store • Reuse bot logic across messaging platforms NEW !
  21. 21. Developer Challenges Conversational interfaces need to combine a large number of sophisticated algorithms and technologies Business Logic Disparate Systems AuthenticationSpeech Recognition Language Understanding Messaging Platforms Scale Testing Security Availability Mobile
  22. 22. Amazon Lex
  23. 23. Amazon Lex Features Text and speech language understanding: powered by the same technology as Alexa Enterprise SaaS connectors: connect to enterprise systems Deployment to chat services Designed for builders: efficient and intuitive tools to build conversations; scales automatically Versioning and alias support @
  24. 24. Text and Speech Language Understanding Speech Recognition Natural Language Understanding Powered by the same Deep Learning technology as Alexa
  25. 25. Deployment to Chat Services Facebook Messenger Mobile Card Description Button 1 Button 2 Button 3 Card Description Option 1 Option 2 Authentication Rich FormattingOne-Click Deployment Amazon Lex
  26. 26. Designed for Builders Efficient and intuitive tools to build conversations
  27. 27. Versioning and Alias Support AliasVersioning • Supported for Intents, Slots, and Bots • Enables multi-developer environment • Roll back to previous versions • Deploy different aliases to different platforms • Run different stacks for dev, stage, and prod environments • Target different user groups with different aliases v1 v2 v3 latest v1 Dev v2 Stage v3 Prod
  28. 28. 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
  29. 29. Utterances I’d like to book a hotel I want to make my hotel reservations I want to book a hotel in New York City Can you help me book my hotel?
  30. 30. Slots destination City New York City, Seattle, London, … Slot Type Values Check In Date Valid dates Check Out Date Valid dates
  31. 31. Slot Elicitation I’d like to book a hotel What date do you check in? New York City Sure what city do you want to book? Nov 30th Check In 11/30/2016 City New York City
  32. 32. Fulfillment AWS Lambda Integration Return to Client User input parsed to derive intents and slot values. Output returned to client for further processing. Intents and slots passed to AWS Lambda function for business logic implementation.
  33. 33. “Book a Hotel” Book Hotel NYC “Book a Hotel in NYC” Hotel Booking New York City Natural Language Understanding Intent/Slot Model UtterancesHotel Booking City New York City Check In Nov 30th Check Out Dec 2nd “Your hotel is booked for Nov 30th” Confirmation: “Your hotel is booked for Nov 30th” “Can I go ahead with the booking? a in User interacts with Chabot Confirmation
  34. 34. Save, Build, and Publish Save Build Saving your bot preserves the current state on the server Building your bot creates versions that you can test. Publish Publishing your app will create a version of your bot and provide an alias to your clients Test Test your bot in a chat window on the Console
  35. 35. Monitoring Track your bot Request Latency Missed Utterance Count
  36. 36. Amazon Lex Technology Amazon Lex Automatic Speech Recognition (ASR) Natural Language Understanding (NLU) Same technology that powers Alexa Amazon Cognito CloudTrail CloudWatch AWS Services Action AWS Lambda Authentication & Visibility Speech API Language API Fulfillment End Users Developers Console SDK Intents, Slots, Prompts, Utterances Speech or Text Input Multi-Platform Clients: Mobile, IoT, Web, Chat API
  37. 37. Demo Build a FB “Moviepedia” chatbot using Lex + Lambda
  38. 38. Amazon Lex Use Cases Informational Bots Chatbots for everyday consumer requests Application Bots Build powerful interfaces to mobile applications • News updates • Weather information • Game scores …. • Book tickets • Order food • Manage bank accounts …. Enterprise Productivity Bots Streamline enterprise work activities and improve efficiencies • Check sales numbers • Marketing performance • Inventory status …. Internet of Things (IoT) Bots Enable conversational interfaces for device interactions • Wearables • Appliances • Auto ….
  39. 39. Amazon Lex Benefits High quality text and speech language understanding Built-in integration with the AWS platform Seamlessly deploy and scale Easy to use Cost-effective
  40. 40. Mobile Hub + Enterprise SaaS Connectors
  41. 41. AWS Mobile Hub Integration Authenticate users Analyze user behavior Store and share media Synchronize data More …. Track retention Conversational Bots LexAWS Mobile SDKs AWS Mobile Hub
  42. 42. Enterprise SaaS Connectors with Mobile Hub Mobile Hub SaaS Connector Amazon API Gateway AWS Lambda Amazon API Gateway AWS Lambda Mobile Hub Custom Connector Mobile App Amazon Lex AWS Lambda Business Application Firewall
  43. 43. Enterprise SaaS Connectors with Mobile Hub Amazon Lex Mobile App Mobile Hub SaaS Connector Amazon API Gateway AWS Lambda 1: Understand user intent Amazon API Gateway AWS Lambda 3: Translate REST response into natural language Mobile Hub Custom Connector 2: Invoke a SaaS application or an existing business application Business Application Firewall User Input
  44. 44. Recap • First, we looked into creating chatbots as serverless webhooks using AWS Lambda and API Gateway • Next, we added natural language intelligence to your chatbots using Amazon Lex and AWS Lambda • Finally, we looked at mobile hub integration and enterprise SaaS connectors to enrich your chatbot with enterprise data
  45. 45. Key Takeaway: Register for the Preview @ aws.amazon.com/lex Sign-Up & Whitelist Build your first serverless chatbot using samples in Lex and Lambda blueprints! ✔ ✔ ✔
  46. 46. Thank you!
  47. 47. Remember to complete your evaluations!

×