How Alexa Works

It’s easy to think of Alexa as an omniscient voice that lives inside of some speaker device in your house or car, and that always-present access to Alexa is what makes her such a useful assistant. In reality, however, all of Alexa’s know-how lives in the cloud.

When you ask Alexa a question, the device you are speaking to sends a sound capture of what was heard to the Alexa Voice Service (AVS), a cloud-based service that applies Natural Language Processing (NLP) to interpret what Alexa hears and translates it into a speech request that is then forwarded to application code—a skill—that handles the request.

The skill itself typically executes as a function in AWS Lambda. It is also possible to develop the skill as a conventional REST API that is hosted outside of AWS Lambda, anywhere that can be reached by Alexa. That approach, however, is less common. We won’t be covering this style of skill in this book.

After a skill has finished processing the request, it returns a response which goes back to AVS. AVS translates the skill’s response into a voice response that it sends back to the Alexa device for her to speak out loud.

The following diagram illustrates how an Alexa request and response flow from the user’s spoken query through AVS, the skill running in AWS Lambda, and then back to the user’s device.

images/hello/HelloSequence.png

 

For the purposes of developing Alexa skills, it’s not important to understand how the Alexa device works or the inner-workings of Alexa’s NLP service. It is important, however, to understand how Alexa takes what she hears and directs the request to the relevant function running in AWS Lambda. So let’s take a deeper dive into the rightmost portion of the diagram to see what makes a skill tick.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset