#MDBlocal
Ride B
Developing Alexa Skills with MongoDB & Golang
SANFRANCISCO
#MDBlocal
Ken W. Alger
Developer Advocate at MongoDB
SANFRANCISCO
#MDBLocal
Amazon Web Services (AWS) is not a requirement, it is a convenience.
Something to Note
#MDBLocal
$200.00 in MongoDB Atlas credits with ALGER200
Something to Note
The Alexa Virtual Assistant
Hardware, Skills, and the Flow of Events
#MDBLocal
Amazon Alexa Powered Devices
#MDBLocal
Amazon Alexa Powered Devices
#MDBLocal
What is an Alexa Skill?
#MDBLocal
Alexa, ask Nest to set the thermostat to 75 degrees
Alexa, ask Uber to request a ride
Alexa, ask WebMD for the side effects of Tylenol
Using Alexa Skills
#MDBLocal
Alexa performs a speech to text analysis
Alexa recognizes the invocation word
○ Ex: Uber, Nest, WebMD, etc.
Alexa associates the spoken command to an Intent
The Intent information with optional parameters are sent to the API
Alexa in Action
FaaS with AWS Lambda
Functions as a Service with Go on AWS Lambda
#MDBLocal
The AWS Lambda SDK for Go
#MDBLocal
“Hello World” with AWS Lambda SDK and Go
#MDBLocal
AWS Lambda Dashboard
#MDBLocal
Cross-Compiling Go Applications for Lambda
MongoDB with AWS Lambda
MongoDB with Go on AWS Lambda
#MDBLocal
The MongoDB Go Driver
#MDBLocal
Connecting to MongoDB with Go
#MDBLocal
Sharing a Connection to MongoDB
#MDBLocal
Using an Available MongoDB Connection
The Alexa Developer Portal
Skill Configuration, Testing, and Publishing
#MDBLocal
Alexa Developer Dashboard
#MDBLocal
Not the same as the Skill name.
Used to initiate Skill on an Alexa powered device.
○ Alexa, ask INVOCATION_NAME…
Should be real words that can be easily pronounced.
Should be unique to prevent Skill overlap.
Alexa Invocation Name
#MDBLocal
An Alexa Skill has numerous Intents.
Intents are individual Skill commands or actions.
○ Ex: Get the current temperature.
○ Ex: Get the weekly forecast.
Utterances are phrases to activate an Intent.
The more utterances for an Intent, the less likely to be misunderstood.
Alexa has reserved Intents for specific functionality.
○ Ex: Asking for help using the Skill
Alexa Intents and Sample Utterances
#MDBLocal
Sample Utterances for “AboutIntent”
#MDBLocal
Sample Utterances with Slot Variables
Requests and Responses
Formatting Data Between Alexa and Lambda
#MDBLocal
Alexa Request Payloads
#MDBLocal
Lambda to Alexa Response Payloads
#MDBLocal
The Unofficial Alexa SDK for Go
Processing Alexa Intents
Responding to Alexa Requests in Go
#MDBLocal
“Hello World” with Alexa and Go
#MDBLocal
“Hello Human” with Alexa and Go
#MDBLocal
Alexa Request Payloads
#MDBLocal
Dispatching Alexa Requests
#MDBLocal
HelpIntent
StopIntent
CancelIntent
FallbackIntent
Reserved Alexa Intents
#MDBLocal
Reserved Alexa Intents
MongoDB in an Alexa Skill
Alexa with MongoDB through Example
#MDBLocal
Cooking with MongoDB
#MDBLocal
Connecting to MongoDB with Go
#MDBLocal
Sharing a Connection to MongoDB
#MDBLocal
Dispatching Intents
#MDBLocal
The MongoDB Recipe Schema
#MDBLocal
The MongoDB Recipe Schema
#MDBLocal
Alexa Request Payloads
#MDBLocal
The `GetIngredientsForRecipeIntent` Logic
#MDBLocal
The `GetIngredientsForRecipeIntent` Response
#MDBLocal
The `GetRecipeFromIngredientsIntent` Logic
DEMO
Queue the Demo!
#MDBLocal
https://github.com/mongodb-developer/alexa-golang-example
MongoDB Alexa Skill on GitHub
#MDBLocal
Including MongoDB is simple with the Go driver.
Amazon Web Services (AWS) is not a requirement, it is a convenience.
Invocation names should be real words that are pronounceable with most accents.
Sample utterances should exist for all possible requests.
Functions should finish executing quickly.
Summary
#MDBLocal
$200.00 in MongoDB Atlas credits with ALGER200
MongoDB Atlas
#MDBLocal
Alexa - developer.amazon.com/alexa
Lambda - aws.amazon.com/lambda
MongoDB Go Driver - https://docs.mongodb.com/ecosystem/drivers/go/
Twitter - @kenwalger
Getting Help
THANK YOU
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang

MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang