HBCU Conference Build an Alexa Skill session - 2020 Nashville, TN
Have you ever wanted to build your own Alexa Skill, but need a starting point? I got you covered. In this lab, you’ll create your first Alexa Skill in about 10 minutes. You’re going to build using different tools, including the Alexa Developer Console, AWS Lambda, and Amazon Blueprints.
I will reference Amazon AWS documentation and simplify some terms to wrap your brain around the basics.
For this lab, you’ll need:
Before you start building, let me give you an Alexa Skill theory crash course. To get building reasonably quickly, there are a few things you should know, including:
Let’s start by reviewing some critical terminology (a full glossary can be accessed on the external AWS site).
Terminology | Definition |
---|---|
Amazon Resource Name (ARN) | a unique AWS resource identifier |
Automatic Speech Recognition (ASR) | a technology that converts spoken words into text |
AWS Lambda | a cloud service used to host and run code in response to a trigger without servers to manage |
Backend | the infrastructure that stores and arranges your data |
Frontend | the presentation layer of an application (it’s what your users interact with directly) |
Hosted Service | a service that is managed for you, so you don’t have to worry about updates, patches, scaling, etc. |
Intent | an action that fulfills the user’s spoken request |
Interaction Model | a design that defines the relationship between the different part of your Skill |
Invocation | the name of your Alexa Skill |
Natural Language Understanding (NLU) | a technology used by computers to understand what a user’s words mean |
Slot | an option argument in an intent |
Speech Synthesis Markup Language (SSML) | a markup language to creates synthetic speech |
Utterance | the words a user says to Alexa that are meant to get a response |
Voice User Interface (VUI) | a method for users to use voice to interact with and control an Alexa device |
Wake Word | a spoken word that lets your Alexa device know that you are speaking to it. Alexa has a small subset of wake words that can be used, including Alexa, Echo, Computer, and Amazon. |
An Alexa Skill has a front end and a backend, just like a web application has a user-facing front end and an operations backend. Users interact with an Alexa Skill using their voice, and the frontend uses an Interaction Model called Voice User Interface (VUI). The backend for the Skill you will build in this lab is a Lambda function, which is an AWS service that runs your code every time it is triggered by an event.
An Alexa Skill must be enabled for users to interact with it using their voice. The graphic above breaks down a voice command; this is the data that the interaction model accepts to provide data back to the user.
Every application needs a frontend or a way for people to interact with your application. The Interaction Model, in this case, the VUI, defines the logic for the Skill. The VUI maps the user’s verbal input to the intents your Skill can handle. Utterances are the phrases a user may say – they help the Skill connect the intents to words or phrases spoken by the user.
For example, let’s say you build a Skill that does one thing – it responds only to the voice command in the image above. The Skill will need an intent; so, we could name it “DetergentIntent”. The intent defines the behavior of a skill. The intent takes the user’s verbal command and triggers code in your backend.
Most applications today require some kind of backend that stores and arranges data. For Alexa Skill, you have to choose where your code will live. You have three options at this time: Provision Your Own (i.e., Lambda), Alexa-Hosted (Node.js), and Alexa-Hosted (Python). Think of the hosted service backend as your car engine – when you put the key in the ignition and turn your car on, your motor goes into action. When you stop the car and take the keys out of the ignition, your car is completely off - it doesn’t idle.
IMPORTANT _Alexa-Hosted options give you access to an AWS Lambda endpoint with data transfer limitations. If your skills go viral, you’ll want to consider moving it to your own Provisioned service like a custom Lambda function.