How to Leverage Alexa’s Persistence Capabilities to Your Advantage
“Hey Alexa, what time is it?”, “What is in the news today?”, “What is the weather forecast for today?” The answers to these simple questions can help you jump start your day.
But, what if you need Alexa to remember a more specific piece of information from previous interactions? For example, the last time you took your medication or your current progress in an adventure game. This capability is known as persistence – a feature that is not being fully utilized by many companies or the voice engineering services firms they work with.
Alexa answering your question about the weather is helpful, but she can also remember that you inquire about the forecast first thing every morning when you wake up. This recollection allows Alexa to offer you the information as part of the conversation rather than a one time exchange, showcasing the true value of digital assistants. It is persistence that enables her to remember and recall information, providing a more anthropomorphic, or human-like, personality.
The purpose behind persistence
The goal in developing voice applications is providing interactions with Alexa that are more conversational and less transactional. An interaction along the lines of “Alexa, order me some coffee,” to which she responds, “What type of coffee would you like to order?” sounds completely transactional. Compare that to something like, “Alexa, order me some coffee,” to which she replies, “Sure, I see you ordered a dark roast last week and Colombian the week before. Would you like either of these or a new type of coffee?” Both of these conversations will result in you getting coffee, but the interactions are profoundly different.
Imagine asking your significant other their favorite restaurant every day for weeks and weeks. Odds are you would stop asking because after hearing the answer a few times your brain would commit it to memory. Then, you could capitalize on persistence and take your significant other out for a surprise dinner at that special spot. The thrill they get from knowing you remembered is how you should feel every time you interact with Alexa.
Techopedia, a technology-based encyclopedia resource, defines persistence as “an object or a process characteristic that continues to exist even after the process that created it ceases or the machine it is running on is powered off.” In the case of voice applications for Alexa, persistence means that even if your skill is not currently in use, the responses that have been given in the past are still in memory. And, can be called upon the next time that you invoke your skill.
With this feature, the programming possibilities are endless. Skills from Jeopardy to Skyrim use persistence to create unique, engaging experiences that bring users back over and over. Imagine the benefit to your business of producing that kind of appeal in a voice application!
So, you are probably wondering, how does persistence work? Luckily, we are here to help break it down for you with a few simple steps:
1. You need to come up with a voice UX design that will help you determine what information your application needs to commit to memory and how that data will help your skill.
2. Next, you need a place to store this data and for that, you need a database such as DynamoDB. DynamoDB is a NoSQL (non-relational) database, which makes the storing of data more efficient. Non-relational databases are like the class jock from your high school. He’s great at one thing, but doesn’t do well with relationships. The diagram below shows a solution architecture using DynamoDB.
3. DynamoDB is separate from the core services, yet it is still highly performant. To develop this type of solution, you first create your environment inside of the database that will be holding your data. Next, you add methods that will save and retrieve data from your database for use by your skill.
4. Finally, you need a way to give users the option to save this data (see diagram 2 for an example of how to store data programmatically).
How to give users the option to save or in this case what is known as a ‘save intent’ can be seen in diagram 2 and 3. This can be something as simple as asking Alexa to “save my medications for the day.”
Once this architecture is in place, the new methods you develop will be able to create, update, read, and destroy data as the skill is used.
As you start storing data, you may need to refactor the existing method that will handle your skill. This is the handler that will give your skill the functionality to call upon this stored data and produce meaningful responses. For example, imagine a skill that will help users keep track of their medications, including whether or not they have already taken medication today and the amount in which they have taken. Let’s call it Medi Buddy.
The interaction might look something like this:
User: “Alexa, open Medi Buddy.”
Alexa: “Welcome to Medi Buddy. What medications have you taken today?”
Alexa: “You have now taken two doses today. Please be mindful of this.”
Or, asking Alexa the same question from a different perspective…
User: “Alexa, ask Medi Buddy how many doses of Tylenol I have taken today.”
Alexa: “You have taken two doses of Tylenol today.”
Medi Buddy stores data on medications taken allowing Alexa to use that information in two different contexts. In some instances, that capability simply makes interactions more positive. In others, like our Medi Buddy, its ability to grasp medical facts could be a lifesaver.
Regardless of the question asked, the power of persistence wielded by a skilled voice engineering services firm can help you develop exceptional applications. Contact our development team today and we will get Alexa set up to connect consumers with your business.
Author: Yavi Padilla, Web and Voice UX Engineer