Create an Alexa skill with serverless and a conversation

This article is part of the Watson Assistant learning path. See the Watson Assistant page for more information on features and getting started.

Level Topic Type
100 Introduction to Watson Assistant Article
101 Create your first Assistant-powered chatbot Tutorial
200 Assemble a pizza-ordering chatbot dialog Code pattern
201 Create a banking chatbot Code pattern
202 Create a web-based chatbot with voice input and output Code pattern
300 Create a Google Action with Watson Assistant Code pattern
301 Create an Alexa skill with serverless and a conversation Code pattern
400 Create a next-generation call center with Voice Agent Code pattern

Summary

In this developer pattern, we will create an Alexa skill using Watson™ Assistant via the Apache OpenWhisk serverless framework. Alexa is the voice service behind products like Amazon Echo. IBM Cloud Functions (based on Apache OpenWhisk) will be used to integrate Alexa with Watson Assistant. An example conversation is included to demonstrate how to pass context between different intents.

Description

Leveraging multiple technologies is common in many workflows, and this developer pattern was created to show how you can integrate an Amazon Alexa skill with Watson Assistant. If you’re a developer focused on chatbots or artificial intelligence, this is for you. This pattern shows you how to take a conversation built with Watson and make it available to Alexa users.

We will create an Alexa skill using Watson Assistant via the Apache OpenWhisk serverless framework. Alexa is the voice service behind products like the Amazon Echo. IBM Cloud Functions (based on Apache OpenWhisk) will be used to integrate Alexa with Watson Assistant. An example conversation is included.

When you complete this pattern, you will understand how to:

  • Create an OpenWhisk action in the IBM Cloud Functions serverless platform.
  • Store a session’s conversation context across events.
  • Import a conversation from the BAE or a JSON file.
  • Invoke a conversation with Watson using Node.js.
  • Create an Alexa skill to reach tens of millions of customers.

Flow

flow

  1. User says “Alexa, ask Watson…”
  2. Alexa invokes IBM Cloud Functions with input text.
  3. The action gets a response from Watson Assistant.
  4. The response text is sent back to Alexa.
  5. Alexa replies to the user.

Instructions

Ready to put this code pattern to use? Complete details on how to get started running and using this application are in the README file.

Conclusion

This code pattern showed how you can create an Alexa skill using Watson Assistant through the Apache OpenWhisk serverless framework. The code pattern is part of the Watson Assistant learning path. To continue the learning and learn about more Watson Assistant features, take a look at the next code pattern, Create a next-generation call center with Voice Gateway.