My small PoC on Alexa integration using Pega V7.4 Personal Edition

Finally I was successful in integrating Alexa with Pega V7.4 PE. Though it looks simple but is tricky to setup the configuration from both Alexa and Pega side. To perform this whole PoC, we need to install the AlexaChannel component from Pega and do the connection settings accordingly. Using developer.alexa.com site, we need to create a skill (eg: account balance) and the corresponding intents to finish the Build Model from Alexa. Once we are done, we need to call our Pega API service (REST) call from Alexa using Endpoint configuration and we are done to test the skill using Alexa developer console => Test menu. Once you start typing the command in that console (eg:balance, what is my balance etc), Alexa calls Pega REST API and respond to the asked commands.

Pega V7.4 side configuration
·        After installation of “AlexaChannel_20180703T133432007” package/component from PDN, we need to add it in our Application rule and make sure to have the RSV: AlexaChannel:01-01 in the rulesets staack. Create a new version from AlexaChannel:01-01-xx to work on the Alexa component from Pega. Click on the landing page:Channels and Interfaces from Application menu on top of the designer studio. 















·        Make sure to have all the settings in Alexa Channel service package (rule:alexachannel) with the proper service method(rule:alexa) is selected and the Admin access grp is used.
·        Make sure to install the ngrok in the machine and have the proper authentication given to that s/w by running the given command from http://ngrok.com site after signup done.
·        Before making the Endpoint configuration changes in alexa developer console, we need to run the ngrok.exe from the folder where we installed above. Run the below command to expose the localhost:8080 to public and call the Pega REST API service call from alexa developer console. 
      C:\>temp>ngrok http 8080
·        After the above command run, we get a URL like “https://aaaa” and copy that for forming a final URL to be used from Endpoint section in alexa developer portal.
      http://localhost:8080/prweb/PRRestService/alexachannel/srv/alexa (This is the URL to be tunneled into a new “https” URL using the above ngrok tool.

Note: We can use the below command in place of ngrok to tunnel the localhost to “https:”
C:\> ssh -R 80:localhost:8080 ssh.localhost.run

Alexa Developer Console configuration to call Pega REST service:

Signup for a new account first and create a sample skill: account balance. Create a new Invocation like “balance”. Create a new Intent called “CheckBalance” with 2 or 3 sample utterances like “what is my balance”, “what is my account balance” etc. Save this model by clicking on the “Save Model” button and then build the model by clicking on “Build Model” button.

















Select the “Endpoint” section from the skill and use the Pega REST API service URL after tunneling done.













Once the above settings done, save the model again and run the skill from the Test menu by entering the commands => balance to make a Pega connection and what is my account balance to retrieve the response from Pega mentioned above (The account balance is 1000)












Demo video from alexa developer console:

References:
3) Pega developer help
4) PDN forum

Popular posts from this blog

Connecting Claude to Pega Infinity 25.1.3 via MCP — Step-by-Step

itextpdf API to generate PDF doc from an image file using Pega PE

Understanding of Hugging Face platform for AI/ML platform