About Alexa Conversations
Alexa Conversations is a deep learning–based approach to dialog management that enables you to create natural, human-like voice experiences on Alexa. Alexa Conversations helps skills respond to a wide range of phrases and unexpected conversational flows, and gives skills the conversational memory to sustain long, two-way interactions between Alexa and the user.
You can create a skill that uses Alexa Conversations to manage the entire skill experience, or you can extend an existing skill with Alexa Conversations. For example, your skill can use your existing code to handle simple interactions. Then, your skill can delegate dialog management to Alexa Conversations for tasks that involve many two-way conversations with the user.
- Why Alexa Conversations?
- Alexa Conversations features
- Should I build my skill with Alexa Conversations?
- How you create a skill with Alexa Conversations
- Requests from Alexa Conversations to your skill
- Adding Alexa Conversations to an existing skill
- Related topics
Why Alexa Conversations?
Alexa Conversations helps users experience natural conversations with Alexa. Alexa Conversations uses artificial intelligence (AI) to bridge the gap between experiences you can build manually and the vast range of possible conversations. You provide sample dialogs that show your expected interactions and you provide templates for the APIs you need called, and Alexa's AI extrapolates the spectrum of phrasing variations and dialog paths. Instead of identifying and coding every possible way users might engage your skill, Alexa's AI creates the permutations and handles dialog state management, context carry-over, and corrections for you.
Alexa Conversations is especially useful for use cases where the conversation can take a number of unanticipated paths as the user naturally talks to the skill, such as when a user chooses a movie, orders food, or makes a reservation. For example, when ordering a pizza, a user might do the following:
- Answer more than one question at once ("Medium, two toppings.")
- Ask questions and expect Alexa to track previously provided information ("How many people does that feed?")
- List values ("Pepperoni and green pepper.")
- Make a correction ("Make that a large.")
Through machine learning, Alexa Conversations can handle the complexity and wide variation in these types of conversations. Instead of configuring hard-coded conversation paths, you provide ideal user experiences as dialogs. Alexa's AI extrapolates additional conversational paths and learns to handle a wide range of unexpected dialogs, different pathways, and nonlinear user flows. Alexa Conversations monitors the dialog context, producing a natural conversational experience that gathers the information your skill requires to complete a task. Only then does Alexa Conversations call your skill code. You can re-train your model to fill in gaps or handle new inputs and re-certify your skill at any time.
For best practices that can help you design your workflow, write dialogs, and set user expectations, see Design with Alexa Conversations.
Alexa Conversations features
Alexa Conversations performs the following functions for your skill:
- State management – Selects and renders Alexa speech prompts to guide the user to the next state.
User: I'd like to order a pizza for delivery.
Alexa: Ok. What size pizza?
Alexa: What toppings?
User: Green peppers and olives.
Alexa: Would you like to order anything else?
Alexa: Ok. Your pizza will arrive in about 25 minutes.
- Dialog variations – Asks the user follow-up questions to gather missing information.
User: I want the weather.
Alexa: What date and city?
Alexa: What date?
Alexa: Ok. Tomorrow in Seattle, you can expect a high of 71 degrees and a low of 57 degrees.
- User-driven corrections – Handles the user changing their mind.
User: I want a medium family dog.
Alexa: Do you prefer high energy or low energy dogs?
User: High energy.
Alexa: What about a border collie?
User: How about a small dog?
Alexa: In that case, I recommend a Jack Russell Terrier. Would you like me to search local shelters and rescue groups for a Jack Russell Terrier?
- Context carry-over – Updates an option without needing the user to repeat the other options.
Alexa: That's a medium pizza with green peppers, olives, and light sauce for delivery, right?
User: I'd like two of those.
Alexa: No problem. Two medium pizzas with green peppers, olives, and light sauce for delivery, right?
For details on how Alexa Conversations performs these functions, see How Alexa Conversations Works.
Should I build my skill with Alexa Conversations?
Consider using Alexa Conversations if:
- You're a published voice developer who has experience with Node.js or Python, and you're familiar with the basic constructs of AI and machine learning.
- Your skill is goal-based, such as for booking transportation, buying tickets, providing recommendations, or ordering food.
- Your skill has open-ended, two-way interactions with the user and requires collecting several complex data points to accomplish the user goal.
- You can't manage all potential user interactions and states in your skill code to create a flexible, natural experience for users.
- You don't want to write code to manage the state for all use interactions.
Alternatively, you can build your skill using intent-based dialog management. For details, see Create the Interaction Model for Your Skill and Define the Dialog to Collect and Confirm Required Information. Use intent-based dialog management if:
- Your skill requires a pre-determined dialog path and specific workflow the user is expected to follow.
- You want to maintain complete control over turn-by-turn state management within your skill code.
How you create a skill with Alexa Conversations
You create and work with Alexa Conversations skills in one of two ways:
Developer console – You can create an Alexa Conversations skill by using a guided experience in the developer console. For details, see Alexa Conversations Guided Development Experience.
Command line (Beta) – You can use the Alexa Skills Kit Command-Line Interface (ASK CLI) to build and deploy skills that you author in Alexa Conversations Description Language (ACDL) (Beta). For details, see About Alexa Conversations Description Language (ACDL) (Beta).
Requests from Alexa Conversations to your skill
During run time, Alexa Conversations uses AI, based on the dialog management model, to manage the conversation with the user. Alexa calls your skill endpoint only when the user has provided all the information that the API needs to fulfill the request. You can host your skill endpoint on AWS Lambda or your web server. When Alexa does call your skill, the JSON requests and responses are similar to the format described in the Request and Response JSON Reference for custom skills.
The request to your skill is similar to an intent request, but is of type
Dialog.API.Invoked. The response from the skill includes a status and a return value. These values contain the data that Alexa Conversations uses to select and populate the response template and inform subsequent dialog turns and API calls. For details about the request and response format for Alexa Conversations, see Request and Response Reference for Alexa Conversations. For details about how your skill handles calls from Alexa Conversations, see Handle API Calls for Alexa Conversations.
Adding Alexa Conversations to an existing skill
You can have Alexa Conversations handle all or part of the dialog management for an existing skill. To switch from intent-based dialog management to Alexa Conversations (or vice versa), you send a
Dialog.DelegateRequest directive from your skill code. Delegation switches back when the skill explicitly sends another
Dialog.DelegateRequest directive. You can save session attributes, such as the dialog state, when you hand off delegation. For details, see Steps to Add Alexa Conversations to an Existing Skill and Hand off Dialog Management to and from Alexa Conversations.