AI Zone Admin Forum Add your forum

NEWS: survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

CS integration with Alexa

Has anyone connected CS with alexa?
Are there any open source githubs that already have this?
I dont plan to connect this right away, but it might be an interesting “skill” for alexa to add a powerhouse CS backend.
Is alexa a sandbox, not allowing outside rest requests?


  [ # 1 ]


Alexa is not a sandbox. You register a hook with your Alexa skill to service the requests. The Amazon demo’s help you do this to a Lambda function, but you can register your own server. You also need to use Alexa’s catch-all/unknown intent, since you obviously don’t want to use Amazon’s intent resolution mechanism (for with I wholeheartedly agree).

As far as I know there are no open source projects to transform Alexa requests to and from CS requests. What I have done is use the Adapter Pattern. I wrote Adapter (RESTful service written node.js using Express) that translates from various front ends like Alexa, WebX Teams, or my own custom web client using Ajax. The sole purpose of the adapter is to take in messages from the front end, convert them to CS format and send them to the CS engine; wait on the answer and then format the response to the way the front end expects. There is a lot of use of OOB in this since it is stateless. One of the things I have to do is package up the front end’s context (userId, message number, room, Alexa context, etc.) and send it as JSON via OOB to CS. I have CS hold onto that JSON data and return it back with the response using the post processing mechanism in CS.

For Alexa, specifically, you would register your adapter’s URL:port/request with your Alexa skill. Be sure the unknown intent’s are passed through. Write your adapter to translate from Alexa incoming to CS format. Be sure to put the Alexa context info into the OOB. Have CS hold onto the OOB data while it does its job. Write a translator in the adapter to convert the OOB data and the response to Alexa format. And, finally return the whole thing to Amazon.

Hope this helps, but I bet it only confirms your fears on what is required. LOL

Stephen G.

Stephen G.


  [ # 2 ]

Yes, such an interface looks somewhat challenging to implement. 
It is likely it could be packaged as a “product” so that others could use this interface.
It is not a core feature for us, as we use ios and android (and pc and other os) as the front end.
Linux clones as a back end.  And postgres as the database.
And we have a solid interface for that setup.

If you are possibly interested in a swap meet, let me know.


  [ # 3 ]

Pardon my ignorance, but, what is a swap meet?

The interface is not hard to implement. Alexa will deliver a JSON structure to you via the callback. all you have to do to create the CS message is 1) pull out the actual message text, 2) stringify the Alexa JSON object, 3) put them together as [json string]actual message text. The alexa context is in the OOB as json string. Do your work and be sure to send the json string back to the adapter as OOB along with the response. Then your adapter only has to use the OOB data and response to create a valid JSON response to Amazon. There are lots of NPM, java, python, ect. libraries out there to help create valid alexa responses.

Stephen G.


  login or register to react