Serverless Alexa Skill with DynamoDB

As the rise of personal assistants grow, I thought I’d learn a new skill and attempt to roll my own. I’ve seen various different example of users using Alexa to report on metrics, as well as different maintainability models. Of what I could find, none combined both - dynamic sentence return with ease of maintainability.

My first Alexa skill was created as a reporting tool, where I have different appliances report in different numeric values, such as how many users have clicked on an event, or the total network packets sent through my router for a given period of time. I then used these metrics and through regex replacement, have Alexa report back to me, in a clean, easy to understand, database defined sentence.

In my DynamoDB table I have three attributes, the metric, the total_count, and the response. When an intent is called I take the name of the intent, call it MyExampleIntent, and look for “my example” (casing to space) within the database. If it is there, I then take the response value - ex. The total number of my example is {total_count} - and return that with the numeric value from the total_count attribute. Therefore, when anyone wants to add a new intent, they can update the serverless file with the intent name and sample utterances, and then add a new item to the table with that metric. On the next deploy of the skill, you’ll see the new metric. It’s as simple as that!

Check out the project on my GitHub and let me know what you think.

NFS-API