{"id":28507,"date":"2020-01-25T09:13:25","date_gmt":"2020-01-25T14:13:25","guid":{"rendered":"https:\/\/centricconsulting.com\/?p=28507"},"modified":"2024-03-06T15:44:01","modified_gmt":"2024-03-06T20:44:01","slug":"alexa-hows-the-surf-transformed-for-todays-chatbot-technologies_miami","status":"publish","type":"post","link":"https:\/\/centricconsulting.com\/blog\/alexa-hows-the-surf-transformed-for-todays-chatbot-technologies_miami\/","title":{"rendered":"Alexa, How\u2019s the Surf? Transformed for Today\u2019s Chatbot Technologies"},"content":{"rendered":"

In the third part of our \u201cAlexa, How\u2019s the Surf?\u201d blog series, I explain how I transformed an Alexa Skill into a serverless, microservice, multi-modal chatbot platform.<\/h2>\n
\n

Part three in a series.<\/a><\/p>\n

Introduction<\/h2>\n

A few years ago, I wrote a blog about an emerging technology called Amazon Echo<\/a>. That blog post chronicled my journey down the path of creating an Alexa Skill (the technical term for programming with Alexa) called Surf Check.<\/p>\n

While that first post focuses on Alexa, the same principles apply to Google Home and some of the other chatbot technologies available on the market today.<\/strong><\/p>\n

And though I\u2019d like to claim the skill is hugely popular with thousands of hits per day, in reality, Surf Check is just my playground for learning new concepts with Voice User Interfaces. Over the last few years, I tweaked and refactored the original skill as I discovered new Alexa and AWS features. I documented some of those updates, such as creating a Facebook Messenger interface, in a follow-up blog.<\/a><\/p>\n

In this next iteration of the blog series, I take a more holistic view of the various modules to show how, with a little bit of refactoring and a microservice architecture, I transformed my original Surf Check Alexa Skill into a \u201cserverless, microservice, multi-modal chatbot monster\u201d!<\/strong> Hyperbole aside, the result is certainly serverless, leverages microservices, and provides several interfaces for interaction: Alexa, Facebook Messenger<\/a>, Text Messaging, and a good old fashioned Telephone Call.<\/p>\n

How I Did It<\/h2>\n

As you will see, my journey involved a lot of exploration, experimentation, and trial-and-error. While I can\u2019t guarantee that you\u2019ll end up in the same place I did, I\u2019d like to walk you through my process in the hopes it may help you develop your own, if you aren\u2019t able to replicate mine exactly.<\/p>\n

1.\u00a0 Review of Existing Components<\/h4>\n

As I mentioned in the introduction, I\u2019ve implemented several iterations of my Surf Check Alexa Skill. Starting with a fundamental Alexa Skill<\/a> developed in C#, each successive iteration benefited from refactoring in some cases, and wholesale replacement with better components in others. The images in Figure 1 show the basic flow of the Alexa interaction.<\/p>\n

\"\"<\/p>\n

The table in Figure 2 provides a glimpse into the components that served as a starting point for the current iteration.<\/p>\n

\"Blog<\/a>

Figure 2<\/p><\/div>\n

2.\u00a0 Introducing Amazon Pinpoint and Connect<\/h4>\n

With these existing components in mind, I set out to add two new ways of asking \u201cHow\u2019s the surf?\u201d My goal was to preserve much of the work already done. I wanted to add text messaging as the first new method. Several services now offer this capability, including my bank, which allows me to text simple commands to a phone number.<\/p>\n

For example, I can check the balance of my account by texting the word \u201cbalance\u201d to a specific phone number. Likewise, I can withdraw money from my account by texting \u201cwithdraw.\u201d Amazon provides this capability through a relatively newer service called Pinpoint. Amazon Pinpoint positions itself as a marketing and analytics service that enables an organization to engage with users by sending email, SMS, and push notifications.<\/strong><\/p>\n

The second new method is a bit more pedestrian, but it arguably covers a broader swath of users: a telephone service that allows callers to dial a phone number and ask the virtual assistant, \u201cHow\u2019s the surf?\u201d Amazon provides this capability through another of its newer services, called Connect.<\/p>\n

Amazon Connect uses the same technology as Alexa and Lex<\/a> to deliver a cloud-based customer contact service via telephone. Older Interactive Voice Response (IVR) systems, based on decision trees and universally loathed by customers, force the customer to press numbers on their phone to arrive at pre-configured answers. Connect, on the other hand, users natural, intuitive conversation to assist callers.<\/p>\n

In my case, a caller receives a couple of options, including the now-familiar \u201cHow\u2019s the surf?\u201d The caller can speak the instructions instead of pressing a number on his or her phone.<\/strong><\/p>\n

The images in Figure 3 show some of the new methods for asking, \u201cHow\u2019s the surf?\u201d<\/p>\n

\"Tech<\/a>

Figure 3<\/p><\/div>\n

The table in Figure 4 provides a glimpse into the components used to add the new functionality in the current iteration.<\/p>\n

\"Blog<\/a>

Figure 4<\/p><\/div>\n

3.\u00a0 Microservices Thinking<\/h4>\n

I also examined at how all four methods for asking “How’s the surf?” did their work, in addition to the two new methods. Developing software by breaking the modules in an application into loosely coupled services is now one of the more popular trends in software architecture. Developers designed these so-called microservices<\/em> to perform very fine-grained functions with little or no dependencies on other services in the system.<\/p>\n

An application stitches together these microservices using lightweight messaging protocols to develop and scale the microservices independently. With this microservices thinking in mind, the original Alexa Skill leveraged several Python methods to answer the question. A request calls these methods, which get funneled through AWS Lambda<\/a>.<\/strong><\/p>\n

When adding the two new methods (Text Messaging and Telephone Calls), I had a design goal to reuse all of the Python methods I developed previously. Conceptually, the only new code needed should be limited to the specifics of the new interfaces (Text Messaging and Telephone Calls). In that respect, I succeeded, mostly.<\/p>\n

\"Alexa<\/a>

Figure 5<\/p><\/div>\n

The diagram in Figure 5 illustrates how I brought all of the AWS components together to provide a seamless Alexa and Lex experience.<\/p>\n

Not surprisingly, a lot has changed in the technology world in only a couple of years. Hopefully, this blog has shown the improvements made around Voice Assistants, Chatbots, the Cloud, and Serverless Computing.<\/p>\n

By bringing all of those pieces together, I managed the following:<\/strong><\/p>\n

    \n
  • Reused my existing Alexa Skill to create a Chatbot hosted in Facebook Messenger<\/li>\n
  • Re-architected my Alexa Skill handler to use Lambda, an AWS Serverless technology, thereby ridding me of the cost and complexity of maintaining a web server<\/li>\n
  • Added a text messaging interface through Amazon Pinpoint that uses the same Lambda used by the previous interfaces<\/li>\n
  • Added a telephone interface through Amazon Connect that uses the same Lambda used by the previous interfaces<\/li>\n<\/ul>\n

    Conclusion<\/h2>\n

    I did all of the above without needing a data center or much money. My AWS bill for the month was less than $1 \u2013 including all of the components described in this blog and my entire personal web site! I hope these steps help you try your hand at improving or upgrading your own chatbots.<\/p>\n","protected":false},"excerpt":{"rendered":"

    Continuing our \u201cAlexa, How\u2019s the Surf?\u201d series, I explain how I transformed an Alexa Skill into a serverless, microservice, multi-modal chatbot platform.<\/p>\n","protected":false},"author":63,"featured_media":28509,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_oasis_is_in_workflow":0,"_oasis_original":0,"_oasis_task_priority":"","_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"","_relevanssi_noindex_reason":"","footnotes":""},"categories":[1],"tags":[16613],"coauthors":[15012],"acf":[],"publishpress_future_action":{"enabled":false,"date":"2024-07-22 09:42:24","action":"change-status","newStatus":"draft","terms":[],"taxonomy":"category"},"_links":{"self":[{"href":"https:\/\/centricconsulting.com\/wp-json\/wp\/v2\/posts\/28507"}],"collection":[{"href":"https:\/\/centricconsulting.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/centricconsulting.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/centricconsulting.com\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/centricconsulting.com\/wp-json\/wp\/v2\/comments?post=28507"}],"version-history":[{"count":2,"href":"https:\/\/centricconsulting.com\/wp-json\/wp\/v2\/posts\/28507\/revisions"}],"predecessor-version":[{"id":50794,"href":"https:\/\/centricconsulting.com\/wp-json\/wp\/v2\/posts\/28507\/revisions\/50794"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/centricconsulting.com\/wp-json\/wp\/v2\/media\/28509"}],"wp:attachment":[{"href":"https:\/\/centricconsulting.com\/wp-json\/wp\/v2\/media?parent=28507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/centricconsulting.com\/wp-json\/wp\/v2\/categories?post=28507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/centricconsulting.com\/wp-json\/wp\/v2\/tags?post=28507"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/centricconsulting.com\/wp-json\/wp\/v2\/coauthors?post=28507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}