SlideShare a Scribd company logo
3-in-1 Talk on
Serverless Chatbots,
Alexa Skills, and
Voice UI Best Practices
(The Amazon way)
Author: Daniel Zivkovic, Cloud Solutions Architect, TriNimbus
Date: July 2018
SERVERLESS TORONTO USER GROUP 2
Introductions
SERVERLESS TORONTO USER GROUP 3
About this Meetup
SERVERLESS TORONTO USER GROUP 4
About my company, role… sponsors
SERVERLESS TORONTO USER GROUP 5
Around the room
SERVERLESS TORONTO USER GROUP 6
Serverless – Where we left off
Event driven compute as a Glue
SERVERLESS TORONTO USER GROUP 7
Chatbots are one of the Use Cases
1. RESTful Microservices
2. Web Applications
3. Mobile Backends
4. IoT
5. Data Processing – Batch / Streaming / Big Data
6. IT Automation – DevOps
7. Chatbots & Amazon Alexa
Refresher Serverless course at: https://youtu.be/O5mNoT3vb3Q or
https://www.slideshare.net/dzivkovi/lets-go-serverless
And again, since the only cloud I know is AWS – I’m limiting presentation to this brand,
but most concepts are portable to other clouds & other AI-assisted services/devices.
Let’s dive in…
SERVERLESS TORONTO USER GROUP 8
Bots, Chatbots, Virtual Assistants, Voice Assistants are cool
buzzwords!
They are everywhere, and it’s getting harder and harder to understand what they really
are and what they are not. The lines are getting blurry as the media uses this word to
describe simple scripts, intelligent and conversational versions; even “messaging” and
“chatbot” are intertwined for some.
That’s why it’s difficult to explain the actual differences between a bot, chatbot, virtual
assistant, and messaging and to understand what customers really want.
SERVERLESS TORONTO USER GROUP 9
Do all these terms mean the same thing?
• A bot (short for “robot”) is an automated program that runs over the Internet.
Some bots run automatically, while others only execute commands when they
receive specific input. Chat bots were one of the first types of automated programs
to be called “bots” and became popular in the 1990s, with the rise of online
chatrooms.
• Chatbots have evolved since then. Some say that “virtual assistant” and “chatbot”
are the same; some disagree.
• Both chatbots and virtual assistants are more intelligent than a simple bot. When a
bot only follows the script, the chatbot and virtual assistant have more options to
interpret the command. Supported by artificial intelligence (AI) they understand
the meaning of what was said or typed. They can look at the phrases but also
understand what specific words mean in a certain context.
Why Voice Assistants are in the same category as Chatbots
Voice assistants are chatbots, it’s just that instead of written text we use voice.
One difference is that they have to have “wake word” to know you are
addressing them (like a person’s name). That’s why common joint name for voice
assistants & text assistants is Virtual Assistants.
SERVERLESS TORONTO USER GROUP 10
Products Landscape
Conversational Systems
SERVERLESS TORONTO USER GROUP 11
Messaging Platforms
Used for/by chatbots
1. Facebook
2. Slack
3. Skype
4. Viber
5. WhatsApp
6. Telegram
7. Twilio (Phone call & SMS)
8. Amazon Connect (cloud-based Contact Centre)
…
SERVERLESS TORONTO USER GROUP 12
Evolution of Interaction with Technology
SERVERLESS TORONTO USER GROUP 13
The De-evolution of Mankind
SERVERLESS TORONTO USER GROUP 14
New Evolutionary Leap for Mankind
Notice how all the time throughout the mankind history “the tools” were
within hand's reach.
SERVERLESS TORONTO USER GROUP 15
• With voice, for the first-time in human evolution ever – we can operate
machines out of your hand's reach!
• That explains why setting the timer to N-minutes is “the killer voice app” 😊
SERVERLESS TORONTO USER GROUP 16
I gave up on speech recognition over a decade ago (blaming my tick accent,
hoarseness & pace of speech) … so
How is this possible?
Enabled by the advances in Artificial Intelligence (AI) technologies
Recent developments in machine learning (ML) algorithms have improved the
performance of AI tasks such as:
• Automatic Speech Recognition (ASR),
• Natural Language Understanding (NLU),
• Text to Speech Synthesis (TTS), and
• Image Recognition.
SERVERLESS TORONTO USER GROUP 17
Voce Dialogue System Architecture
1. Noise to words
2. Words to meaning
3. Meaning to task (command/intent/function) and/or send
4. Responses and/or current dialogue context/state back to user, using
5. Text-to-Speech (TTS)
SERVERLESS TORONTO USER GROUP 18
Technology is moving toward Intelligent AI-based Conversations
… that was until recently seen only in Sci-Fi movies like:
Hall from “2001: A Space Odyssey” https://www.imdb.com/title/tt0062622/
Samantha from the movie “Her” https://www.imdb.com/title/tt1798709/
SERVERLESS TORONTO USER GROUP 19
Ava from “Ex Machina” https://www.imdb.com/title/tt0470752/
SERVERLESS TORONTO USER GROUP 20
or Teddy and Dolores from “Westworld”
https://www.imdb.com/title/tt0475784/
SERVERLESS TORONTO USER GROUP 21
When machines will pass the Turing Test:
https://en.wikipedia.org/wiki/Turing_test
SERVERLESS TORONTO USER GROUP 22
Is Artificial Intelligence threat to Mankind?
• Elon Musk thinks AI is our biggest existential threat
SERVERLESS TORONTO USER GROUP 23
• I believe that AI & ML are just threat for the white-collar workers: AI will be
for us what Machines were for blue-collar workers.
But this falls into Sci-Fi like Jules Verne’s Nautilus submarine was in “Twenty
Thousand Leagues Under the Sea” back in 1870… computers still need us 😊
SERVERLESS TORONTO USER GROUP 24
2018 Reality Check
Our users started to expect intelligence, and if the voice experience does not
go well, 97% will not come back to our app… Let’s round it down to 9 out of 10.
So, we have to create really good voice experience…. Voice first design
differs…. And we have to fake intelligence by coding intelligent-sounding
responses - mimicking what humans would do.
SERVERLESS TORONTO USER GROUP 25
We’re still faking it
With Chatbots we're faking lots of intelligences, much like that short-statured chess
player in the Mechanical Turk from 18th
century – You are now “developer in a box”:
Mechanical Turk (https://en.wikipedia.org/wiki/The_Turk)
An 18th Century automaton that could beat human chess opponents seemingly
marked the arrival of artificial intelligence.
SERVERLESS TORONTO USER GROUP 26
Fiction vs. Reality – Confusion or Marketing Opportunity
Everybody uses the word chatbot, so it allows vendors to sell something very
simple and narrow in function. The one buying into the vendor’s claims,
expects something more sophisticated and, when everything is deployed, is
often disappointed in what they get.
The explosion of new buzzwords: AI, Machine Learning (ML), Automatic Speech
Recognition (ASR), Natural Language Understanding (NLU) as a subset of the
wider world of Natural Language Processing (NLP) – especially
• when mixed with Bot, Chatbot, VA, CUI, VUI terms, and
• multiplied by numerous Messaging Platforms,
enables creative/pretentious marketing, and becomes the source of good PR:
SERVERLESS TORONTO USER GROUP 27
From Big banks
Like Wells Fargo that “received industrywide attention as the first U.S. bank to pilot an
artificial intelligence chatbot on Facebook Messenger”
https://stories.wf.com/helpful-banking-assistanton-facebook/
or TD – promoting info about Alexa App availability to death with ~245,000 results for
search https://www.google.ca/search?q=td+bank+chatbot+alexa
SERVERLESS TORONTO USER GROUP 28
and Non-profits
E.g. WordPress community at recent AWS Launchpad event titled “Boost Your
WordPress Website with AI & ML” https://www.youtube.com/watch?v=7edDZ6OKh7Q
SERVERLESS TORONTO USER GROUP 29
to Personal Branding
“Building a Twitter art bot with Python, AWS, and socialist realism art” is to me the best
Blog title ever! http://veekaybee.github.io/2018/02/19/creating-a-twitter-art-bot/
SERVERLESS TORONTO USER GROUP 30
Will it Really Work?
AI Industry is still young & error-prone – e.g. Microsoft Tay shutdown after “Twitter
taught Microsoft’s AI chatbot to be a racist asshole in less than a day” back in 2016.
https://www.theverge.com/2016/3/24/11297050/tay-microsoft-chatbot-racist
SERVERLESS TORONTO USER GROUP 31
Coding Serverless Chatbots
This mixture of buzzwords, technologies, vendors & errors produces too many options
and risks… so it is easy to not see the big picture… and find the needle in the “haystack
of chatbots”.
The Plan for Today is
1.Find the tools that will help us cast the widest net
• Create Serverless Chatbots for Twilio SMS, Slack & Facebook in minutes
• Create Alexa Bot/Skill from the same codebase
• Rework Alexa code for the “Serverless purists”
2.Cover important (non-Serverless) Voice UI specific topics:
• In-depth look at creating Alexa Skills
• Understanding Voice-First design
• Best practices for designing Voice User Interfaces
SERVERLESS TORONTO USER GROUP 32
Casting the Widest Net…
Tooling-wise…
SERVERLESS TORONTO USER GROUP 33
Meet Claudia.js
Discovering Claudia in the “Serverless Applications with Node.js” book felt like
discovering Spring Framework in Rod Johnson’s book “Professional Java Development”
back in 2005!
SERVERLESS TORONTO USER GROUP 34
https://claudiajs.com has much narrower scope than Serverless Framework – just AWS
Cloud, just Node.js language. Also:
• Claudia is a command-line deployment utility, not a framework.
• It does not abstract away AWS services, but instead automates all the error-prone
deployment and configuration tasks and sets everything up the way JavaScript
developers expect out of the box.
It comes with two very useful Node.js libraries to make getting started with AWS easier:
• Claudia API Builder allows you to create the API on API Gateway, and
• Claudia Bot Builder allows you to create chatbots for many messaging platforms.
SERVERLESS TORONTO USER GROUP 35
Claudia Bot Builder
SERVERLESS TORONTO USER GROUP 36
Supported messaging platforms as of July 2018:
1. Facebook Messenger
2. Slack (channel slash commands and apps with slash commands)
3. Skype
4. Viber
5. Telegram
6. Twilio (SMS service)
7. Amazon Alexa
8. Line
9. Kik
10. GroupMe
Just Academic?
Claudia.js & Claudia Bot Builder – not just academic, used in real products like
https://www.mindmup.com (by the Claudia creator) and https://vacationtracker.io (by
Montreal’s http://cloudhorizon.com)
SERVERLESS TORONTO USER GROUP 37
OK, Let’s Create Serverless Chatbots in Minutes
It is so easy that I feel a little bit like that Mechanical Turk – with right tools, there is no
magic to it 😊
Let’s code Fictitious Customer Support bot, over SMS, Slack, Facebook & Alexa… and
then rework Alexa example. Out bot will have dumbed down back-end logic:
SERVERLESS TORONTO USER GROUP 38
Global Dependencies
1. Own an AWS account and properly set up the AWS credentials file.
2. Install Node.js and its package manager, NPM.
3. Install Claudia from NPM as a global dependency.
$ npm install claudia -g
Local Dependencies
Create an empty folder, and a new NPM project inside it
$ npm init -y
$ npm install claudia-bot-builder -S
$ npm install huh -S
# generate dynamic content with excuse generator
SERVERLESS TORONTO USER GROUP 39
$ cat bot.js
var botBuilder = require('claudia-bot-builder'),
excuse = require('huh');
module.exports = botBuilder(function (message) {
return 'Thanks for sending ' + message.text +
'. Your message is very important to us, but ' +
excuse.get();
});
SERVERLESS TORONTO USER GROUP 40
Twilio SMS
$ claudia create --region us-east-1 --api-module bot --configure-
twilio-sms-bot
Follow prompts… as each Messaging Platform has specific setup requirements, you will
need to check its documentation. E.g. Twilio SMS setup requires:
Twilio Account ID: xyz
Twilio Auth Token: zyx
Twilio SMS Number: 647-931-6363
…
"twilio": "https://ci1236543d.execute-api.us-east-1.amazonaws
.com/latest/twilio",
Finish Twilio SMS setup by specifying webhook for the specified phone number:
SERVERLESS TORONTO USER GROUP 41
Try it, text anything to 647-931-6363 😊
SERVERLESS TORONTO USER GROUP 42
SERVERLESS TORONTO USER GROUP 43
Slackbot
$ claudia update --configure-slack-slash-command
SERVERLESS TORONTO USER GROUP 44
SERVERLESS TORONTO USER GROUP 45
Facebook Messenger
$ claudia update --configure-fb-bot
SERVERLESS TORONTO USER GROUP 46
Alexa
$ claudia update --configure-alexa-skill
…
"alexa": "https:// ci1236543d.execute-api.us-east-1.amazonaws
.com/latest/alexa"
Plus, some more configs… then
SERVERLESS TORONTO USER GROUP 47
Alexa Bot – Demo Time
Test it: “Alexa, ask Messenger to send support request”.
Voice 539 - alexa
demo.m4a
https://www.dropbox.com/s/p60cbgpxuaye4e9/Voice%20539%20-%20alexa%20demo.m4a?dl=0
SERVERLESS TORONTO USER GROUP 48
Alexa – Take 2
Claudia Bot Builder supports Alexa skills, but because Alexa can trigger a Lambda
function, you can save money and decrease latency if you deploy the skill without an API
Gateway.
Code
$ cat skill.js
const alexaSkillKit = require('alexa-skill-kit')
exports.handler = function(event, context) {
alexaSkillKit(event, context, parsedMessage => {
return 'Hello there! This is Alexa speaking.';
})
}
SERVERLESS TORONTO USER GROUP 49
$ npm init -y
$ npm install alexa-skill-kit –save
$ claudia create --region us-east-1 --handler skill.handler --
version skill
$ claudia allow-alexa-skill-trigger --version skill
{
"Sid": "Alexa-1234567890321",
"Effect": "Allow",
"Principal": {
"Service": "alexa-appkit.amazon.com"
},
"Action": "lambda:InvokeFunction",
"Resource": "arn:aws:lambda:us-east-1:987654321012:function:ale
xa:skill"
}
$ claudia update --region us-east-1 --handler skill.handler --
version skill
SERVERLESS TORONTO USER GROUP 50
Point Alexa Skill Endpoint to AWS Lambda
SERVERLESS TORONTO USER GROUP 51
Alexa – Take 3 begins
Full story about Alexa Devices & Skill, Skills creation/deployment & Voice-first design
follows…
In Depth Look at Alexa Skills
• What is Voice User Interface (VUI)?
• High Level View
• Creating an Alexa Skill
• ASK Developer Console – Demo Time
What is Voice User Interface (VUI)?
A voice user interfaces (VUIs) allow people to use voice input to control computers and
devices. They enable that “Sci-Fi Movie”-like experience.
High Level View…
SERVERLESS TORONTO USER GROUP 52
Meet the Alexa Device Family
SERVERLESS TORONTO USER GROUP 53
Alexa Skills Kit (ASK)
There’s also Alexa Voice Service (AVS) for creating Alexa enabled products – but not in
scope of this talk.
SERVERLESS TORONTO USER GROUP 54
Alexa, tell messenger to send {support request}
Alexa Skill Invocation
SERVERLESS TORONTO USER GROUP 55
Intents, Utterances, and Slots
SERVERLESS TORONTO USER GROUP 56
Variables (slots) in One-shot Invocation
SERVERLESS TORONTO USER GROUP 57
Problems with One-shot / Single-breath Invocations
Command stops at silence – so you cannot use it for dictation
Long commands cause Cognitive-overload
SERVERLESS TORONTO USER GROUP 58
Solution to cognitive overload
Use conversation, it’s more natural… like when you call your travel agent.
SERVERLESS TORONTO USER GROUP 59
Creating an Alexa Skill
Amazon Developer Portal
• Invocation name
• Language Model (Intents, Slots, Samples)
• Publishing Details
AWS Management Console – optionally
• Web service code – Skill Fulfilment & Dialog Managements
SERVERLESS TORONTO USER GROUP 60
Fulfilment Implementation Choices
SERVERLESS TORONTO USER GROUP 61
Voice Input / Request Path
SERVERLESS TORONTO USER GROUP 62
Automatic Speech Recognition
SERVERLESS TORONTO USER GROUP 63
Voice Output / Response Path
SERVERLESS TORONTO USER GROUP 64
ASK Developer Console – Demo Time
Alexa Skills Kit = ASK
http://alexa.design
SERVERLESS TORONTO USER GROUP 65
Understanding Voice First Design
• How Building for Voice Differs from Traditional App Design
• Problems with Hierarchical Graph UI
• Frame-based UI design alternative
• Dialog Management – Demo Time
• Emerging Voice-first Design Patterns
SERVERLESS TORONTO USER GROUP 66
How Building for Voice Differs from Traditional App
Design
Wording choices
Often too many ways to express the same intention – Bot needs to be trained.
SERVERLESS TORONTO USER GROUP 67
Talk with Users, not at Users – but How?
Multi-turn Dialogs can reduce cognitive overload caused by one-shot / singe-breath
commands.
SERVERLESS TORONTO USER GROUP 68
Problems with Hierarchical Graph UI
Traditional Web sites, Mobile apps, and Interactive Voice Response (IVR) systems force
users via specific path in the hierarchical graph.
Information Architecture – typical Website
Website hierarchies are hard to navigate/skim via voice. E.g. you are looking for the
routing number on the Banking website… it is buried deep down in the site taxonomy
tree, because it’s rarely needed:
SERVERLESS TORONTO USER GROUP 69
In voice, the opposite is true. You'd never want
the user to have to say, “Ask ABC Bank for:
menu, menu, menu, routing number.” Instead,
you’d want to enable the user to simply say,
“Ask ABC Bank for my routing number.” In
other words, the routing number intent is now
presented at the top level.
Turn taxonomy tree upside down – Make all
options Top-Level; this allows finding needed
info quickly.
While menus add depth to GUIs, they introduce friction to voice-first UIs. Voice
interactions should instead offer their experience at the top level – without the need to
learn its information architecture.
SERVERLESS TORONTO USER GROUP 70
Finite State - typical IVR call flow
• System completely controls the conversation with the user.
• It asks the user a series of questions,
• ignoring (or misinterpreting) anything the user says that is not a direct answer to
the system’s questions.
SERVERLESS TORONTO USER GROUP 71
Frame-based UI Design Alternative
SERVERLESS TORONTO USER GROUP 72
Frame-based UI…
• Frames are mixed-initiative, because conversational initiative can shift between
system & user.
• User can answer multiple questions at once (over-answer).
• System asks questions of user, filling any slots that user specifies.
• If user answers more questions at once, system has to fill slots and not ask these
questions again.
SERVERLESS TORONTO USER GROUP 73
Dialog Management in Alexa
SERVERLESS TORONTO USER GROUP 74
Dialog Management – Demo Time
Plan My Trip Demo
Alexa cookbook “recipe” that demonstrates Alexa features related to dialog
management (like Dialog.Delegate directive)
https://github.com/alexa/alexa-cookbook/tree/master/feature-demos/skill-demo-plan-
my-trip
1. Alexa open “Plan My Trip Demo”
• I’m leaving Boston
2. Alexa tell “Plan My Trip Demo, I'm going skiing on Sunday”
3. Demonstrate how non-US city like Toronto does not mesh nice with my accent.
SERVERLESS TORONTO USER GROUP 75
Demo Code Generator for the same Interaction Model
Paste Interaction Model into http://alexa.design/codegenerator then create AWS
Lambda from the resulting code… and wire into another Alexa skill.
1. Alexa open “code generator demo”
2. Help
3. I'm leaving Boston tomorrow
SERVERLESS TORONTO USER GROUP 76
Emerging Voice-first Design Patterns
1. Be adaptable: Let users speak in their own words
2. Be personal: Individualize your entire interaction – have context & history
3. Be available: Collapse your menus; make all options top-level
4. Be relatable: Talk with them, not at them – over-answers, ambiguities, implicit
confirmations
SERVERLESS TORONTO USER GROUP 77
Closing Thoughts
• Good Use Cases
• Misuse Cases & Tips
• Let’s go deeper
• Serverless Toronto next steps
SERVERLESS TORONTO USER GROUP 78
Good Use Cases
Focus on apps that remove friction points in life. E.g. every time you can make
interaction with machines:
1. Faster – break “within hands reach” rule (timers, alarms & switches are “the killer
voice apps”)
2. Simpler – e.g. reduce # of clicks to get to mobile app for driving instructions,
playlists, or
3. Bring delight – that’s why VA jokes are so popular (they make people happier).
“Friction will always lose. Alexa and Voice is the future of the frictionless world. It is
going to explode” – Gary Vaynerchuk
Misuse Cases & Tips
• Using Voice as an API wrapper!
• Forcing voice everywhere. If you even think it’s easier to walk up to the machine, or
use the Web Browser – don’t create a Voice app.
SERVERLESS TORONTO USER GROUP 79
Your app will become another friction point – a.k.a. unused, if you don’t:
• understand the Voice-first vs. traditional Web/Mobile apps design differences,
• approach Voice UI more like writing a conversational dialogue for a screenplay,
than an API design.
SERVERLESS TORONTO USER GROUP 80
Voice apps have to be intuitive, because there’s no skimming like through web pages –
so please don’t expect users to learn your API or Taxonomy… no more “Norman Doors”
please 😊
SERVERLESS TORONTO USER GROUP 81
Let’s go deeper
Pick your mentors carefully
• Info overload – unlike 30 years ago, when we had lack of information
• Finding good info – nowadays feels like going through the junkyard.
Here is my list so far – if you find more great sources, please share:
Alexa & Voice-First Design
http://alexa.design/guide
https://twitter.com/PaulCutsinger - Head of Alexa Voice Design Education
https://www.twitch.tv/amazonalexa - Live coding with Paul’s team (check out early
“Building a college coaching skill” episodes)
http://alexa.design/blog - Stay on top od Alexa development, catch-up with past best
practices & tips!
https://www.meetup.com/voice-tech-to/ - Our local User Group about Voice-First
design
https://web.stanford.edu/class/cs224s/ - The Stanford “Spoken Language Processing”
CS224S course
SERVERLESS TORONTO USER GROUP 82
https://sigchi.org - ACM SIGCHI - Special Interest Group on Computer-Human
Interaction
ASK-CLI Command Line Interface
http://bit.ly/cli-guide
http://alexa.design/cli
Books
https://www.manning.com/books/serverless-applications-with-nodejs
https://www.manning.com/books/voice-applications-for-alexa-and-google-assistant
https://www.packtpub.com/application-development/hands-chatbots-and-
conversational-ui-development - good book with wide chatbot platforms coverage &
interesting projects (PaaS)
https://www.amazon.com/Design-Everyday-Things-Revised-Expanded/dp/0465050654 -
best selling book (by Don Norman) on the topic of designing Intuitive User Interfaces
SERVERLESS TORONTO USER GROUP 83
Source Code Repos
https://claudiajs.com/tutorials
https://github.com/stojanovic - Create chatbots for Facebook Messenger, Slack,
Amazon Alexa, Skype, Telegram, Viber, Line, GroupMe, Kik and Twilio and deploy to
AWS Lambda in minutes
https://github.com/claudiajs/example-projects#chat-bots
https://aws.amazon.com/blogs/compute/create-and-deploy-a-chat-bot-to-aws-lambda-
in-five-minutes/
http://goo.gl/H5CEpW - meetup demos & Alexa skill Interaction Model
Amazon Tools
https://github.com/alexa/alexa-cookbook - Alexa code samples & tips
http://alexa.design/codegenerator - ASK-SDK Code Generator for Alexa Skill Language
Models
https://storywriter.amazon.com/tutorials - Skill design is more like writing a screenplay,
than coding
SERVERLESS TORONTO USER GROUP 84
Food for Thought – Demo Time
The Good, the Bad and the Ugly of the voice-first experience
Play some of he recordings I ran into while preparing this talk:
1. ACM SIGCHI video – Radar Pace - A Conversational System for Coaching
Good – strive towards this!
2. Mobile Protection IVR recording – 2 minutes of friction while driving
Bad – rewrite this. IVRs can be & should be better nowadays!
3. Connected Lab video about CNN Voice App – #ConversationsWorthHaving
Ugly – don’t do this! You know better now 😊
SERVERLESS TORONTO USER GROUP 85
Serverless Toronto Next Steps
See how little Serverless can be in a Serverless Talk?
That’s exactly because Serverless Computing moves infrastructure issues out of the way,
and allows you – the developer, to focus more on the business domain at hand – e.g.
Conversational User Interfaces (CUI) we covered today!
Any Volunteers for our Future Talks?
Remaining Use Cases… Microservices, Websites, IoT, Big Data… and Security is always
interesting
• especially in the serverless world where clients can talk directly to back-end
services via HTTPS,
• without the need for traditional Application servers.

More Related Content

PDF
The future of media queries?
PDF
8 Ways to Improve App Store User Experience
PDF
designing conversations: Conversational interfaces, Bot Interactions, Chatb...
PPTX
Artificial Intelligence as an Interface - How Conversation Bots Are Changing ...
PDF
Exploring the physical web
PPTX
Chat bots
PDF
Converations on conversational Ux
PDF
Let's Build a Chatbot!
The future of media queries?
8 Ways to Improve App Store User Experience
designing conversations: Conversational interfaces, Bot Interactions, Chatb...
Artificial Intelligence as an Interface - How Conversation Bots Are Changing ...
Exploring the physical web
Chat bots
Converations on conversational Ux
Let's Build a Chatbot!

What's hot (20)

PDF
Chatbot Artificial Intelligence
PDF
Chatbots New York City and Global Meetup #001 - Talkabot Highlights
PDF
The Chatbot Imperative: Intelligence, Personalization and Utilitarian Design
PPTX
Build a Chatbot with IBM Watson - No Coding Required
PDF
Introduction to chat bot
PDF
Conversational Intelligence and Better Customer Conversations
PDF
A Brief Intro to Chatbot
PDF
Chatbots. Old Topic - New Era
PDF
Designing Intelligent Coversations: A Chatbot Workshop
PDF
Introduction to Chatbots
PDF
Ride the Wave of Conversational UX
PPTX
AI Agent and Chatbot Trends For Enterprises
PPTX
Nihad Abbasov-Intellectual technology presentation
PDF
Building chat bots using ai platforms (wit.ai or api.ai) in nodejs
PPTX
Everyone's Need to Know About Chatbot Framework & Platform
PDF
101 Conversational User Interfaces
PPTX
Chatbot
PDF
iOS design: a case study
PDF
Chatbot Revolution: Exploring Opportunities, Use Cases, & Bot Design
PPTX
Chat Bots Presentation 8.9.16
Chatbot Artificial Intelligence
Chatbots New York City and Global Meetup #001 - Talkabot Highlights
The Chatbot Imperative: Intelligence, Personalization and Utilitarian Design
Build a Chatbot with IBM Watson - No Coding Required
Introduction to chat bot
Conversational Intelligence and Better Customer Conversations
A Brief Intro to Chatbot
Chatbots. Old Topic - New Era
Designing Intelligent Coversations: A Chatbot Workshop
Introduction to Chatbots
Ride the Wave of Conversational UX
AI Agent and Chatbot Trends For Enterprises
Nihad Abbasov-Intellectual technology presentation
Building chat bots using ai platforms (wit.ai or api.ai) in nodejs
Everyone's Need to Know About Chatbot Framework & Platform
101 Conversational User Interfaces
Chatbot
iOS design: a case study
Chatbot Revolution: Exploring Opportunities, Use Cases, & Bot Design
Chat Bots Presentation 8.9.16
Ad

Similar to 3-in-1 talk on Serverless Chatbots, Alexa skills & Voice UI best practices (the Amazon way) (20)

PDF
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...
PDF
A.I. in the Enterprise: Computer Speech
PDF
Chatbots DDD North2016
PDF
Messaging is the new platform
PDF
Tech On Trend - Chatbots
PPTX
Chatbot Technology
PDF
[TechWorldSummit Stockholm 2019] Building Bots for Human with Conversational ...
PDF
USECON Webinar 2017: Alina's Guests - Floor Drees from sektor5
PDF
USECON Webinar "Alina's Guests": Chatbots with Floor Drees from sektor5
PDF
The Conversational Business [REPORT PREVIEW]
PDF
How to build an AI-powered chatbot.pdf
PDF
How to build an AI-powered chatbot.pdf
PDF
How to build an AI-powered chatbot.pdf
PPTX
AI-powered Chatbots - what they are and where they're going
PDF
Do you speak human?
PDF
The rise of Chatbots and Virtual Assistants in Customer Experience
PDF
The Chatbots Are Coming: A Guide to Chatbots, AI and Conversational Interfaces
 
PDF
Cocolevio AI Chatbot 9.20.19
PDF
Every Business Needs a Chatbot
PDF
SITB160: Rise of the Machines Here Come the Bots!
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...
A.I. in the Enterprise: Computer Speech
Chatbots DDD North2016
Messaging is the new platform
Tech On Trend - Chatbots
Chatbot Technology
[TechWorldSummit Stockholm 2019] Building Bots for Human with Conversational ...
USECON Webinar 2017: Alina's Guests - Floor Drees from sektor5
USECON Webinar "Alina's Guests": Chatbots with Floor Drees from sektor5
The Conversational Business [REPORT PREVIEW]
How to build an AI-powered chatbot.pdf
How to build an AI-powered chatbot.pdf
How to build an AI-powered chatbot.pdf
AI-powered Chatbots - what they are and where they're going
Do you speak human?
The rise of Chatbots and Virtual Assistants in Customer Experience
The Chatbots Are Coming: A Guide to Chatbots, AI and Conversational Interfaces
 
Cocolevio AI Chatbot 9.20.19
Every Business Needs a Chatbot
SITB160: Rise of the Machines Here Come the Bots!
Ad

More from Daniel Zivkovic (20)

PDF
'The Art & Science of LLM Reliability - Building Trustworthy AI Systems' by M...
PDF
AI - Your Startup Sidekick (Leveraging AI to Bootstrap a Lean Startup).pdf
PDF
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
PDF
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
PDF
Opinionated re:Invent recap with AWS Heroes & Builders
PDF
Google Cloud Next '22 Recap: Serverless & Data edition
PDF
Conversational Document Processing AI with Rui Costa
PDF
How to build unified Batch & Streaming Pipelines with Apache Beam and Dataflow
PDF
Gojko's 5 rules for super responsive Serverless applications
PDF
Retail Analytics and BI with Looker, BigQuery, GCP & Leigha Jarett
PDF
What's new in Serverless at AWS?
PDF
Intro to Vertex AI, unified MLOps platform for Data Scientists & ML Engineers
PDF
Empowering Developers to be Healthcare Heroes
PDF
Get started with Dialogflow & Contact Center AI on Google Cloud
PDF
Building a Data Cloud to enable Analytics & AI-Driven Innovation - Lak Lakshm...
PDF
Smart Cities of Italy: Integrating the Cyber World with the IoT
PDF
Running Business Analytics for a Serverless Insurance Company - Joe Emison & ...
PDF
This is my Architecture to prevent Cloud Bill Shock
PDF
Lunch & Learn BigQuery & Firebase from other Google Cloud customers
PDF
Azure for AWS & GCP Pros: Which Azure services to use?
'The Art & Science of LLM Reliability - Building Trustworthy AI Systems' by M...
AI - Your Startup Sidekick (Leveraging AI to Bootstrap a Lean Startup).pdf
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Opinionated re:Invent recap with AWS Heroes & Builders
Google Cloud Next '22 Recap: Serverless & Data edition
Conversational Document Processing AI with Rui Costa
How to build unified Batch & Streaming Pipelines with Apache Beam and Dataflow
Gojko's 5 rules for super responsive Serverless applications
Retail Analytics and BI with Looker, BigQuery, GCP & Leigha Jarett
What's new in Serverless at AWS?
Intro to Vertex AI, unified MLOps platform for Data Scientists & ML Engineers
Empowering Developers to be Healthcare Heroes
Get started with Dialogflow & Contact Center AI on Google Cloud
Building a Data Cloud to enable Analytics & AI-Driven Innovation - Lak Lakshm...
Smart Cities of Italy: Integrating the Cyber World with the IoT
Running Business Analytics for a Serverless Insurance Company - Joe Emison & ...
This is my Architecture to prevent Cloud Bill Shock
Lunch & Learn BigQuery & Firebase from other Google Cloud customers
Azure for AWS & GCP Pros: Which Azure services to use?

Recently uploaded (20)

PPTX
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
PPTX
Classification Systems_TAXONOMY_SCIENCE8.pptx
PPTX
GEN. BIO 1 - CELL TYPES & CELL MODIFICATIONS
PPTX
Taita Taveta Laboratory Technician Workshop Presentation.pptx
PPTX
Comparative Structure of Integument in Vertebrates.pptx
PPTX
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
PPTX
Vitamins & Minerals: Complete Guide to Functions, Food Sources, Deficiency Si...
PPTX
microscope-Lecturecjchchchchcuvuvhc.pptx
PDF
AlphaEarth Foundations and the Satellite Embedding dataset
PDF
diccionario toefl examen de ingles para principiante
PPTX
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
PPTX
2. Earth - The Living Planet earth and life
PDF
Phytochemical Investigation of Miliusa longipes.pdf
PPTX
SCIENCE10 Q1 5 WK8 Evidence Supporting Plate Movement.pptx
PPTX
INTRODUCTION TO EVS | Concept of sustainability
PDF
bbec55_b34400a7914c42429908233dbd381773.pdf
PDF
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
PPTX
TOTAL hIP ARTHROPLASTY Presentation.pptx
DOCX
Q1_LE_Mathematics 8_Lesson 5_Week 5.docx
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
7. General Toxicologyfor clinical phrmacy.pptx
Classification Systems_TAXONOMY_SCIENCE8.pptx
GEN. BIO 1 - CELL TYPES & CELL MODIFICATIONS
Taita Taveta Laboratory Technician Workshop Presentation.pptx
Comparative Structure of Integument in Vertebrates.pptx
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
Vitamins & Minerals: Complete Guide to Functions, Food Sources, Deficiency Si...
microscope-Lecturecjchchchchcuvuvhc.pptx
AlphaEarth Foundations and the Satellite Embedding dataset
diccionario toefl examen de ingles para principiante
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
2. Earth - The Living Planet earth and life
Phytochemical Investigation of Miliusa longipes.pdf
SCIENCE10 Q1 5 WK8 Evidence Supporting Plate Movement.pptx
INTRODUCTION TO EVS | Concept of sustainability
bbec55_b34400a7914c42429908233dbd381773.pdf
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
TOTAL hIP ARTHROPLASTY Presentation.pptx
Q1_LE_Mathematics 8_Lesson 5_Week 5.docx

3-in-1 talk on Serverless Chatbots, Alexa skills & Voice UI best practices (the Amazon way)

  • 1. 3-in-1 Talk on Serverless Chatbots, Alexa Skills, and Voice UI Best Practices (The Amazon way) Author: Daniel Zivkovic, Cloud Solutions Architect, TriNimbus Date: July 2018
  • 2. SERVERLESS TORONTO USER GROUP 2 Introductions
  • 3. SERVERLESS TORONTO USER GROUP 3 About this Meetup
  • 4. SERVERLESS TORONTO USER GROUP 4 About my company, role… sponsors
  • 5. SERVERLESS TORONTO USER GROUP 5 Around the room
  • 6. SERVERLESS TORONTO USER GROUP 6 Serverless – Where we left off Event driven compute as a Glue
  • 7. SERVERLESS TORONTO USER GROUP 7 Chatbots are one of the Use Cases 1. RESTful Microservices 2. Web Applications 3. Mobile Backends 4. IoT 5. Data Processing – Batch / Streaming / Big Data 6. IT Automation – DevOps 7. Chatbots & Amazon Alexa Refresher Serverless course at: https://youtu.be/O5mNoT3vb3Q or https://www.slideshare.net/dzivkovi/lets-go-serverless And again, since the only cloud I know is AWS – I’m limiting presentation to this brand, but most concepts are portable to other clouds & other AI-assisted services/devices. Let’s dive in…
  • 8. SERVERLESS TORONTO USER GROUP 8 Bots, Chatbots, Virtual Assistants, Voice Assistants are cool buzzwords! They are everywhere, and it’s getting harder and harder to understand what they really are and what they are not. The lines are getting blurry as the media uses this word to describe simple scripts, intelligent and conversational versions; even “messaging” and “chatbot” are intertwined for some. That’s why it’s difficult to explain the actual differences between a bot, chatbot, virtual assistant, and messaging and to understand what customers really want.
  • 9. SERVERLESS TORONTO USER GROUP 9 Do all these terms mean the same thing? • A bot (short for “robot”) is an automated program that runs over the Internet. Some bots run automatically, while others only execute commands when they receive specific input. Chat bots were one of the first types of automated programs to be called “bots” and became popular in the 1990s, with the rise of online chatrooms. • Chatbots have evolved since then. Some say that “virtual assistant” and “chatbot” are the same; some disagree. • Both chatbots and virtual assistants are more intelligent than a simple bot. When a bot only follows the script, the chatbot and virtual assistant have more options to interpret the command. Supported by artificial intelligence (AI) they understand the meaning of what was said or typed. They can look at the phrases but also understand what specific words mean in a certain context. Why Voice Assistants are in the same category as Chatbots Voice assistants are chatbots, it’s just that instead of written text we use voice. One difference is that they have to have “wake word” to know you are addressing them (like a person’s name). That’s why common joint name for voice assistants & text assistants is Virtual Assistants.
  • 10. SERVERLESS TORONTO USER GROUP 10 Products Landscape Conversational Systems
  • 11. SERVERLESS TORONTO USER GROUP 11 Messaging Platforms Used for/by chatbots 1. Facebook 2. Slack 3. Skype 4. Viber 5. WhatsApp 6. Telegram 7. Twilio (Phone call & SMS) 8. Amazon Connect (cloud-based Contact Centre) …
  • 12. SERVERLESS TORONTO USER GROUP 12 Evolution of Interaction with Technology
  • 13. SERVERLESS TORONTO USER GROUP 13 The De-evolution of Mankind
  • 14. SERVERLESS TORONTO USER GROUP 14 New Evolutionary Leap for Mankind Notice how all the time throughout the mankind history “the tools” were within hand's reach.
  • 15. SERVERLESS TORONTO USER GROUP 15 • With voice, for the first-time in human evolution ever – we can operate machines out of your hand's reach! • That explains why setting the timer to N-minutes is “the killer voice app” 😊
  • 16. SERVERLESS TORONTO USER GROUP 16 I gave up on speech recognition over a decade ago (blaming my tick accent, hoarseness & pace of speech) … so How is this possible? Enabled by the advances in Artificial Intelligence (AI) technologies Recent developments in machine learning (ML) algorithms have improved the performance of AI tasks such as: • Automatic Speech Recognition (ASR), • Natural Language Understanding (NLU), • Text to Speech Synthesis (TTS), and • Image Recognition.
  • 17. SERVERLESS TORONTO USER GROUP 17 Voce Dialogue System Architecture 1. Noise to words 2. Words to meaning 3. Meaning to task (command/intent/function) and/or send 4. Responses and/or current dialogue context/state back to user, using 5. Text-to-Speech (TTS)
  • 18. SERVERLESS TORONTO USER GROUP 18 Technology is moving toward Intelligent AI-based Conversations … that was until recently seen only in Sci-Fi movies like: Hall from “2001: A Space Odyssey” https://www.imdb.com/title/tt0062622/ Samantha from the movie “Her” https://www.imdb.com/title/tt1798709/
  • 19. SERVERLESS TORONTO USER GROUP 19 Ava from “Ex Machina” https://www.imdb.com/title/tt0470752/
  • 20. SERVERLESS TORONTO USER GROUP 20 or Teddy and Dolores from “Westworld” https://www.imdb.com/title/tt0475784/
  • 21. SERVERLESS TORONTO USER GROUP 21 When machines will pass the Turing Test: https://en.wikipedia.org/wiki/Turing_test
  • 22. SERVERLESS TORONTO USER GROUP 22 Is Artificial Intelligence threat to Mankind? • Elon Musk thinks AI is our biggest existential threat
  • 23. SERVERLESS TORONTO USER GROUP 23 • I believe that AI & ML are just threat for the white-collar workers: AI will be for us what Machines were for blue-collar workers. But this falls into Sci-Fi like Jules Verne’s Nautilus submarine was in “Twenty Thousand Leagues Under the Sea” back in 1870… computers still need us 😊
  • 24. SERVERLESS TORONTO USER GROUP 24 2018 Reality Check Our users started to expect intelligence, and if the voice experience does not go well, 97% will not come back to our app… Let’s round it down to 9 out of 10. So, we have to create really good voice experience…. Voice first design differs…. And we have to fake intelligence by coding intelligent-sounding responses - mimicking what humans would do.
  • 25. SERVERLESS TORONTO USER GROUP 25 We’re still faking it With Chatbots we're faking lots of intelligences, much like that short-statured chess player in the Mechanical Turk from 18th century – You are now “developer in a box”: Mechanical Turk (https://en.wikipedia.org/wiki/The_Turk) An 18th Century automaton that could beat human chess opponents seemingly marked the arrival of artificial intelligence.
  • 26. SERVERLESS TORONTO USER GROUP 26 Fiction vs. Reality – Confusion or Marketing Opportunity Everybody uses the word chatbot, so it allows vendors to sell something very simple and narrow in function. The one buying into the vendor’s claims, expects something more sophisticated and, when everything is deployed, is often disappointed in what they get. The explosion of new buzzwords: AI, Machine Learning (ML), Automatic Speech Recognition (ASR), Natural Language Understanding (NLU) as a subset of the wider world of Natural Language Processing (NLP) – especially • when mixed with Bot, Chatbot, VA, CUI, VUI terms, and • multiplied by numerous Messaging Platforms, enables creative/pretentious marketing, and becomes the source of good PR:
  • 27. SERVERLESS TORONTO USER GROUP 27 From Big banks Like Wells Fargo that “received industrywide attention as the first U.S. bank to pilot an artificial intelligence chatbot on Facebook Messenger” https://stories.wf.com/helpful-banking-assistanton-facebook/ or TD – promoting info about Alexa App availability to death with ~245,000 results for search https://www.google.ca/search?q=td+bank+chatbot+alexa
  • 28. SERVERLESS TORONTO USER GROUP 28 and Non-profits E.g. WordPress community at recent AWS Launchpad event titled “Boost Your WordPress Website with AI & ML” https://www.youtube.com/watch?v=7edDZ6OKh7Q
  • 29. SERVERLESS TORONTO USER GROUP 29 to Personal Branding “Building a Twitter art bot with Python, AWS, and socialist realism art” is to me the best Blog title ever! http://veekaybee.github.io/2018/02/19/creating-a-twitter-art-bot/
  • 30. SERVERLESS TORONTO USER GROUP 30 Will it Really Work? AI Industry is still young & error-prone – e.g. Microsoft Tay shutdown after “Twitter taught Microsoft’s AI chatbot to be a racist asshole in less than a day” back in 2016. https://www.theverge.com/2016/3/24/11297050/tay-microsoft-chatbot-racist
  • 31. SERVERLESS TORONTO USER GROUP 31 Coding Serverless Chatbots This mixture of buzzwords, technologies, vendors & errors produces too many options and risks… so it is easy to not see the big picture… and find the needle in the “haystack of chatbots”. The Plan for Today is 1.Find the tools that will help us cast the widest net • Create Serverless Chatbots for Twilio SMS, Slack & Facebook in minutes • Create Alexa Bot/Skill from the same codebase • Rework Alexa code for the “Serverless purists” 2.Cover important (non-Serverless) Voice UI specific topics: • In-depth look at creating Alexa Skills • Understanding Voice-First design • Best practices for designing Voice User Interfaces
  • 32. SERVERLESS TORONTO USER GROUP 32 Casting the Widest Net… Tooling-wise…
  • 33. SERVERLESS TORONTO USER GROUP 33 Meet Claudia.js Discovering Claudia in the “Serverless Applications with Node.js” book felt like discovering Spring Framework in Rod Johnson’s book “Professional Java Development” back in 2005!
  • 34. SERVERLESS TORONTO USER GROUP 34 https://claudiajs.com has much narrower scope than Serverless Framework – just AWS Cloud, just Node.js language. Also: • Claudia is a command-line deployment utility, not a framework. • It does not abstract away AWS services, but instead automates all the error-prone deployment and configuration tasks and sets everything up the way JavaScript developers expect out of the box. It comes with two very useful Node.js libraries to make getting started with AWS easier: • Claudia API Builder allows you to create the API on API Gateway, and • Claudia Bot Builder allows you to create chatbots for many messaging platforms.
  • 35. SERVERLESS TORONTO USER GROUP 35 Claudia Bot Builder
  • 36. SERVERLESS TORONTO USER GROUP 36 Supported messaging platforms as of July 2018: 1. Facebook Messenger 2. Slack (channel slash commands and apps with slash commands) 3. Skype 4. Viber 5. Telegram 6. Twilio (SMS service) 7. Amazon Alexa 8. Line 9. Kik 10. GroupMe Just Academic? Claudia.js & Claudia Bot Builder – not just academic, used in real products like https://www.mindmup.com (by the Claudia creator) and https://vacationtracker.io (by Montreal’s http://cloudhorizon.com)
  • 37. SERVERLESS TORONTO USER GROUP 37 OK, Let’s Create Serverless Chatbots in Minutes It is so easy that I feel a little bit like that Mechanical Turk – with right tools, there is no magic to it 😊 Let’s code Fictitious Customer Support bot, over SMS, Slack, Facebook & Alexa… and then rework Alexa example. Out bot will have dumbed down back-end logic:
  • 38. SERVERLESS TORONTO USER GROUP 38 Global Dependencies 1. Own an AWS account and properly set up the AWS credentials file. 2. Install Node.js and its package manager, NPM. 3. Install Claudia from NPM as a global dependency. $ npm install claudia -g Local Dependencies Create an empty folder, and a new NPM project inside it $ npm init -y $ npm install claudia-bot-builder -S $ npm install huh -S # generate dynamic content with excuse generator
  • 39. SERVERLESS TORONTO USER GROUP 39 $ cat bot.js var botBuilder = require('claudia-bot-builder'), excuse = require('huh'); module.exports = botBuilder(function (message) { return 'Thanks for sending ' + message.text + '. Your message is very important to us, but ' + excuse.get(); });
  • 40. SERVERLESS TORONTO USER GROUP 40 Twilio SMS $ claudia create --region us-east-1 --api-module bot --configure- twilio-sms-bot Follow prompts… as each Messaging Platform has specific setup requirements, you will need to check its documentation. E.g. Twilio SMS setup requires: Twilio Account ID: xyz Twilio Auth Token: zyx Twilio SMS Number: 647-931-6363 … "twilio": "https://ci1236543d.execute-api.us-east-1.amazonaws .com/latest/twilio", Finish Twilio SMS setup by specifying webhook for the specified phone number:
  • 41. SERVERLESS TORONTO USER GROUP 41 Try it, text anything to 647-931-6363 😊
  • 43. SERVERLESS TORONTO USER GROUP 43 Slackbot $ claudia update --configure-slack-slash-command
  • 45. SERVERLESS TORONTO USER GROUP 45 Facebook Messenger $ claudia update --configure-fb-bot
  • 46. SERVERLESS TORONTO USER GROUP 46 Alexa $ claudia update --configure-alexa-skill … "alexa": "https:// ci1236543d.execute-api.us-east-1.amazonaws .com/latest/alexa" Plus, some more configs… then
  • 47. SERVERLESS TORONTO USER GROUP 47 Alexa Bot – Demo Time Test it: “Alexa, ask Messenger to send support request”. Voice 539 - alexa demo.m4a https://www.dropbox.com/s/p60cbgpxuaye4e9/Voice%20539%20-%20alexa%20demo.m4a?dl=0
  • 48. SERVERLESS TORONTO USER GROUP 48 Alexa – Take 2 Claudia Bot Builder supports Alexa skills, but because Alexa can trigger a Lambda function, you can save money and decrease latency if you deploy the skill without an API Gateway. Code $ cat skill.js const alexaSkillKit = require('alexa-skill-kit') exports.handler = function(event, context) { alexaSkillKit(event, context, parsedMessage => { return 'Hello there! This is Alexa speaking.'; }) }
  • 49. SERVERLESS TORONTO USER GROUP 49 $ npm init -y $ npm install alexa-skill-kit –save $ claudia create --region us-east-1 --handler skill.handler -- version skill $ claudia allow-alexa-skill-trigger --version skill { "Sid": "Alexa-1234567890321", "Effect": "Allow", "Principal": { "Service": "alexa-appkit.amazon.com" }, "Action": "lambda:InvokeFunction", "Resource": "arn:aws:lambda:us-east-1:987654321012:function:ale xa:skill" } $ claudia update --region us-east-1 --handler skill.handler -- version skill
  • 50. SERVERLESS TORONTO USER GROUP 50 Point Alexa Skill Endpoint to AWS Lambda
  • 51. SERVERLESS TORONTO USER GROUP 51 Alexa – Take 3 begins Full story about Alexa Devices & Skill, Skills creation/deployment & Voice-first design follows… In Depth Look at Alexa Skills • What is Voice User Interface (VUI)? • High Level View • Creating an Alexa Skill • ASK Developer Console – Demo Time What is Voice User Interface (VUI)? A voice user interfaces (VUIs) allow people to use voice input to control computers and devices. They enable that “Sci-Fi Movie”-like experience. High Level View…
  • 52. SERVERLESS TORONTO USER GROUP 52 Meet the Alexa Device Family
  • 53. SERVERLESS TORONTO USER GROUP 53 Alexa Skills Kit (ASK) There’s also Alexa Voice Service (AVS) for creating Alexa enabled products – but not in scope of this talk.
  • 54. SERVERLESS TORONTO USER GROUP 54 Alexa, tell messenger to send {support request} Alexa Skill Invocation
  • 55. SERVERLESS TORONTO USER GROUP 55 Intents, Utterances, and Slots
  • 56. SERVERLESS TORONTO USER GROUP 56 Variables (slots) in One-shot Invocation
  • 57. SERVERLESS TORONTO USER GROUP 57 Problems with One-shot / Single-breath Invocations Command stops at silence – so you cannot use it for dictation Long commands cause Cognitive-overload
  • 58. SERVERLESS TORONTO USER GROUP 58 Solution to cognitive overload Use conversation, it’s more natural… like when you call your travel agent.
  • 59. SERVERLESS TORONTO USER GROUP 59 Creating an Alexa Skill Amazon Developer Portal • Invocation name • Language Model (Intents, Slots, Samples) • Publishing Details AWS Management Console – optionally • Web service code – Skill Fulfilment & Dialog Managements
  • 60. SERVERLESS TORONTO USER GROUP 60 Fulfilment Implementation Choices
  • 61. SERVERLESS TORONTO USER GROUP 61 Voice Input / Request Path
  • 62. SERVERLESS TORONTO USER GROUP 62 Automatic Speech Recognition
  • 63. SERVERLESS TORONTO USER GROUP 63 Voice Output / Response Path
  • 64. SERVERLESS TORONTO USER GROUP 64 ASK Developer Console – Demo Time Alexa Skills Kit = ASK http://alexa.design
  • 65. SERVERLESS TORONTO USER GROUP 65 Understanding Voice First Design • How Building for Voice Differs from Traditional App Design • Problems with Hierarchical Graph UI • Frame-based UI design alternative • Dialog Management – Demo Time • Emerging Voice-first Design Patterns
  • 66. SERVERLESS TORONTO USER GROUP 66 How Building for Voice Differs from Traditional App Design Wording choices Often too many ways to express the same intention – Bot needs to be trained.
  • 67. SERVERLESS TORONTO USER GROUP 67 Talk with Users, not at Users – but How? Multi-turn Dialogs can reduce cognitive overload caused by one-shot / singe-breath commands.
  • 68. SERVERLESS TORONTO USER GROUP 68 Problems with Hierarchical Graph UI Traditional Web sites, Mobile apps, and Interactive Voice Response (IVR) systems force users via specific path in the hierarchical graph. Information Architecture – typical Website Website hierarchies are hard to navigate/skim via voice. E.g. you are looking for the routing number on the Banking website… it is buried deep down in the site taxonomy tree, because it’s rarely needed:
  • 69. SERVERLESS TORONTO USER GROUP 69 In voice, the opposite is true. You'd never want the user to have to say, “Ask ABC Bank for: menu, menu, menu, routing number.” Instead, you’d want to enable the user to simply say, “Ask ABC Bank for my routing number.” In other words, the routing number intent is now presented at the top level. Turn taxonomy tree upside down – Make all options Top-Level; this allows finding needed info quickly. While menus add depth to GUIs, they introduce friction to voice-first UIs. Voice interactions should instead offer their experience at the top level – without the need to learn its information architecture.
  • 70. SERVERLESS TORONTO USER GROUP 70 Finite State - typical IVR call flow • System completely controls the conversation with the user. • It asks the user a series of questions, • ignoring (or misinterpreting) anything the user says that is not a direct answer to the system’s questions.
  • 71. SERVERLESS TORONTO USER GROUP 71 Frame-based UI Design Alternative
  • 72. SERVERLESS TORONTO USER GROUP 72 Frame-based UI… • Frames are mixed-initiative, because conversational initiative can shift between system & user. • User can answer multiple questions at once (over-answer). • System asks questions of user, filling any slots that user specifies. • If user answers more questions at once, system has to fill slots and not ask these questions again.
  • 73. SERVERLESS TORONTO USER GROUP 73 Dialog Management in Alexa
  • 74. SERVERLESS TORONTO USER GROUP 74 Dialog Management – Demo Time Plan My Trip Demo Alexa cookbook “recipe” that demonstrates Alexa features related to dialog management (like Dialog.Delegate directive) https://github.com/alexa/alexa-cookbook/tree/master/feature-demos/skill-demo-plan- my-trip 1. Alexa open “Plan My Trip Demo” • I’m leaving Boston 2. Alexa tell “Plan My Trip Demo, I'm going skiing on Sunday” 3. Demonstrate how non-US city like Toronto does not mesh nice with my accent.
  • 75. SERVERLESS TORONTO USER GROUP 75 Demo Code Generator for the same Interaction Model Paste Interaction Model into http://alexa.design/codegenerator then create AWS Lambda from the resulting code… and wire into another Alexa skill. 1. Alexa open “code generator demo” 2. Help 3. I'm leaving Boston tomorrow
  • 76. SERVERLESS TORONTO USER GROUP 76 Emerging Voice-first Design Patterns 1. Be adaptable: Let users speak in their own words 2. Be personal: Individualize your entire interaction – have context & history 3. Be available: Collapse your menus; make all options top-level 4. Be relatable: Talk with them, not at them – over-answers, ambiguities, implicit confirmations
  • 77. SERVERLESS TORONTO USER GROUP 77 Closing Thoughts • Good Use Cases • Misuse Cases & Tips • Let’s go deeper • Serverless Toronto next steps
  • 78. SERVERLESS TORONTO USER GROUP 78 Good Use Cases Focus on apps that remove friction points in life. E.g. every time you can make interaction with machines: 1. Faster – break “within hands reach” rule (timers, alarms & switches are “the killer voice apps”) 2. Simpler – e.g. reduce # of clicks to get to mobile app for driving instructions, playlists, or 3. Bring delight – that’s why VA jokes are so popular (they make people happier). “Friction will always lose. Alexa and Voice is the future of the frictionless world. It is going to explode” – Gary Vaynerchuk Misuse Cases & Tips • Using Voice as an API wrapper! • Forcing voice everywhere. If you even think it’s easier to walk up to the machine, or use the Web Browser – don’t create a Voice app.
  • 79. SERVERLESS TORONTO USER GROUP 79 Your app will become another friction point – a.k.a. unused, if you don’t: • understand the Voice-first vs. traditional Web/Mobile apps design differences, • approach Voice UI more like writing a conversational dialogue for a screenplay, than an API design.
  • 80. SERVERLESS TORONTO USER GROUP 80 Voice apps have to be intuitive, because there’s no skimming like through web pages – so please don’t expect users to learn your API or Taxonomy… no more “Norman Doors” please 😊
  • 81. SERVERLESS TORONTO USER GROUP 81 Let’s go deeper Pick your mentors carefully • Info overload – unlike 30 years ago, when we had lack of information • Finding good info – nowadays feels like going through the junkyard. Here is my list so far – if you find more great sources, please share: Alexa & Voice-First Design http://alexa.design/guide https://twitter.com/PaulCutsinger - Head of Alexa Voice Design Education https://www.twitch.tv/amazonalexa - Live coding with Paul’s team (check out early “Building a college coaching skill” episodes) http://alexa.design/blog - Stay on top od Alexa development, catch-up with past best practices & tips! https://www.meetup.com/voice-tech-to/ - Our local User Group about Voice-First design https://web.stanford.edu/class/cs224s/ - The Stanford “Spoken Language Processing” CS224S course
  • 82. SERVERLESS TORONTO USER GROUP 82 https://sigchi.org - ACM SIGCHI - Special Interest Group on Computer-Human Interaction ASK-CLI Command Line Interface http://bit.ly/cli-guide http://alexa.design/cli Books https://www.manning.com/books/serverless-applications-with-nodejs https://www.manning.com/books/voice-applications-for-alexa-and-google-assistant https://www.packtpub.com/application-development/hands-chatbots-and- conversational-ui-development - good book with wide chatbot platforms coverage & interesting projects (PaaS) https://www.amazon.com/Design-Everyday-Things-Revised-Expanded/dp/0465050654 - best selling book (by Don Norman) on the topic of designing Intuitive User Interfaces
  • 83. SERVERLESS TORONTO USER GROUP 83 Source Code Repos https://claudiajs.com/tutorials https://github.com/stojanovic - Create chatbots for Facebook Messenger, Slack, Amazon Alexa, Skype, Telegram, Viber, Line, GroupMe, Kik and Twilio and deploy to AWS Lambda in minutes https://github.com/claudiajs/example-projects#chat-bots https://aws.amazon.com/blogs/compute/create-and-deploy-a-chat-bot-to-aws-lambda- in-five-minutes/ http://goo.gl/H5CEpW - meetup demos & Alexa skill Interaction Model Amazon Tools https://github.com/alexa/alexa-cookbook - Alexa code samples & tips http://alexa.design/codegenerator - ASK-SDK Code Generator for Alexa Skill Language Models https://storywriter.amazon.com/tutorials - Skill design is more like writing a screenplay, than coding
  • 84. SERVERLESS TORONTO USER GROUP 84 Food for Thought – Demo Time The Good, the Bad and the Ugly of the voice-first experience Play some of he recordings I ran into while preparing this talk: 1. ACM SIGCHI video – Radar Pace - A Conversational System for Coaching Good – strive towards this! 2. Mobile Protection IVR recording – 2 minutes of friction while driving Bad – rewrite this. IVRs can be & should be better nowadays! 3. Connected Lab video about CNN Voice App – #ConversationsWorthHaving Ugly – don’t do this! You know better now 😊
  • 85. SERVERLESS TORONTO USER GROUP 85 Serverless Toronto Next Steps See how little Serverless can be in a Serverless Talk? That’s exactly because Serverless Computing moves infrastructure issues out of the way, and allows you – the developer, to focus more on the business domain at hand – e.g. Conversational User Interfaces (CUI) we covered today! Any Volunteers for our Future Talks? Remaining Use Cases… Microservices, Websites, IoT, Big Data… and Security is always interesting • especially in the serverless world where clients can talk directly to back-end services via HTTPS, • without the need for traditional Application servers.