Introduction
Main idea of this project is to show Alexa ability in the area of Interactive voice response (IVR) & automate Call center actions. Actually Alexa has an edge over IVR as customer reply to IVR using numbers only, however Alexa customer can reply using normal wording.
As a sample on the above idea, we can use Alexa as a Hotel call center. Hotels always seek to give best experience to their customers. During rush hour of the day many customers call different departments in Hotel seeking for help or asking for a service. For example
- At certain time of the day customers should check out. At this time many phone calls will happen asking for bellman.
- At launch time, many customers will call room service to know the menu, main dishes.
At rush hours maybe customers need to wait till one of Employees can talk to him as usually he will be serving other customers.
Solution
Using Alexa we can define different skills so customer doesn't need to call the room service or reception. Each room in hotel will have a device and each button will introduce a service, ex: choosing a main Dish from menu, asking for extra cup or blanket,..
Customer can use click on certain button on this remote control to invoke different Alexa service which will guide him and take his choice. At back-end one of the Hotel employees will monitor coming requests from Alexa and create work-order for this request to the concerned parties in hotel
Proof of concept
As a proof of concept we have implemented one service that will tell customer about today main dishes so customer can choose one of them. It is called "Smart Hotel".
Customer will connect to skill using microphone & raspberry 3. Skill reads Dishes and saves customer selection from/in DynamoDB. Hotel restaurant will check requested dishes using Android application connected to DynamoDB through Congnito
Customer will power on the device and start talking
"Alexa open restaurant menu"
Device will direct request to Alexa skill which will reply back to customer with today menu
Dear Customer, kindly check our delicious menu for today launch to choose from. To select a dish just say it is number.
Dishes for today are:
Option one Meatloaf
Option two Beef Steaks.
Option three Baked and Roasted Chicken.
Option four Pasta.
if customer wants to choose "Meatloaf", he will say
number one
Certification
First I create a "Smart Hotel" skill (skill is certified and you can access it form here). Using this skill you can hear a fixed set of dishes that defined inside Lambda function. This skill integrated with Raspberry to hear existing dishes and select one of them using mic connected to Raspberry.
Later I create another skill "today menu" (skill is certified and you can access it form here). This skill read list of dishes from HacksterDishes table and save customer choice in CustomerDishes table. I created also an android mobile application that connect to CustomerDishes table and read customer selection. This android application represent a back-end part that can be used by cookers in the hotel restaurant.
Then "today menu" is certified in UK Alexa store by 14 June
Voice User Interface Diagram
Below video explain project life cycle
Create a Lambda function & Skill
To create Lambda function
- You will need to create AWS account and you will need a valid credit card for registration
- Bellow screenshots will guide you through steps of creation the Lambda function
Create skills set
- Bellow screenshots will guide you through steps of creation the Alexa Skill
For more detailed about creating lambda function & Alexa skill, check this tutorial
Database
Create two tables:
- HacksterDishes to save today dishes
- CustomerDishes to save customer selections
Adjust security privilege to Lambda function can access the tables.
For detailed information please access this DyanmoDB tutorial
Raspberry
Define new Alexa voice service
Configure login with Amazon
Configure Raspberry
For more information about above steps you can check this tutorial
Access requested Dishes from Android
Configure Cognito & access privilege so Android application can access the "CustomerDishes" table
I made some changes in android sample application to read requested dishes that Alexa saved in DynamoDB. changes are:
- Modify IDENTITY_POOL_ID & TEST_TABLE_NAME
public static final String IDENTITY_POOL_ID = "us-east-1:......";
// Note that spaces are not allowed in the table name
public static final String TEST_TABLE_NAME = "CustomerDishes";
- Change region in code to match table region
CognitoCachingCredentialsProvider credentials = new CognitoCachingCredentialsProvider(
context,
Constants.IDENTITY_POOL_ID,
Regions.US_EAST_1);
- Define your table inside the code
@DynamoDBTable(tableName = Constants.TEST_TABLE_NAME)
public static class RequestedDishes {
private String requestID;
private String dishName;
private String userID;
@DynamoDBHashKey(attributeName = "requestID")
public String getRequestID() {
return requestID;
}
public void setRequestID(String requestID) {
this.requestID = requestID;
}
@DynamoDBAttribute(attributeName = "dishName")
public String getDishName() {
return dishName;
}
public void setDishName(String dishName) {
this.dishName = dishName;
}
@DynamoDBAttribute(attributeName = "userID")
public String getUserID() {
return userID;
}
public void setUserID(String userID) {
this.userID = userID;
}
}
- Update applications screen
Node.js
- To handle displaying an image for the dish and to change the card name based on the selected dish
function buildSpeechletResponseWithURL(title, speechOutput, repromptText, dishURL , shouldEndSession) {
return {
outputSpeech: {
type: "PlainText",
text: speechOutput
},
card: {
type: "Standard",
title: title,
text: repromptText,
image: {
largeImageUrl:dishURL
}
},
reprompt: {
outputSpeech: {
type: "PlainText",
text: repromptText
}
},
shouldEndSession: shouldEndSession
};
}
- To handle synchronous communication with DynamoDB. use context.succeed()
readDishesFromDB( dishesSentence , dishesArray ,
function (DishesSentence,DishesArray) {
console.log("inside Call back of readDishes. DishesSentence = " + DishesSentence );
context.succeed(prepareDishes(DishesSentence , DishesArray , callback));});
- Save Array of dishes in session attributes to be accessed during the whole session
sessionAttributes = {
"speechOutput": speechOutput,
"repromptText": repromptText,
"dishesArray" : dishesArray
};
Comments