Build conversational experiences for retail order management using Amazon Lex

In the following sample conversation, the caller wants to reschedule the order shipment The representative catches the order ID and confirms the status of the order to identify eligibility for rescheduling. Next, the agent reschedules the delivery to the requested date.

Agent: Thank you for calling Acme. How can I assist you today?
Caller: I want to reschedule my shipment.
Agent: Sure. I can aid with that. Please say or go into the 13-digit order number.
Caller: 1234 56789 1234
Representative: I have your order number as 1234 56789 1234. Is that appropriate?
Caller: Yes
Representative: Got it. Your order is still being processed, so it can be rescheduled. Can you inform me the date you want the order provided on?
Caller: November 20th
Representative: November 20, 2021. For verification, can I have the postal code of your billing address?
Caller: 12345
Representative: Thank you. We will provide your order on the new scheduled date of Nov 20th 2021.

Clients get in touch with retailers customer assistance for reasons such as inspecting order status, updating shipping preferences, redeeming loyalty points, handling refunds, and finding a physical store. Contextual and tailored discussions help develop relationships with clients and drive repeat service, decrease churn, and boost client lifetime worth.
In this post, we evaluate how you can utilize a pre-built solution with Amazon Lex to deliver rich client service experiences for order management, such as getting order status, tracking a package, and canceling or customizing an order.
Option summary
Amazon Lex provides the sophisticated deep knowing functionalities of automated speech recognition (ASR) for converting speech to text, and natural language understanding (NLU) to acknowledge the intent of the text, to enable you to develop applications with extremely engaging user experiences and lifelike conversational interactions. Amazon Lex for retail offers pre-built services that help you enhance brand commitment on an omnichannel consumer journey. The pre-built bots are set up with intents, sample utterances, and slot types for retail order management usage cases and are incorporated with Amazon Connect contact circulations.
Let us review a few sample conversations as we cover the different elements of the order status pre-built solution:
In the following sample discussion, the caller desires to check the order status The representative confirms the order and gathers ID. Using this information, the representative searches for the order status and updates the caller.

Agent: Thank you for calling Acme. How can I help you today?
Caller: I wish to inspect my order status.
Agent: Sure, I can help you with that. Please say or enter the 13-digit order number.
Caller: 1234 56789 1234
Agent: To verify, I have your order number as 1234 56789 1234. Is that right?
Caller: Yes
Agent: Ok. Offer me a moment. Your order has actually been shipped. Do you need to know the delivery information?
Caller: Yes
Representative: Sure. Caller: Thank you.

The RetailOrderManagementBot contains intents for common order management activities such as getting order status, tracking a bundle, customizing an order or canceling, returning an item, and rescheduling the delivery. It consists of the following intents:

ReturnItem– This intent catches the order ID and assists with starting a return of a product, after confirming the order ID.

We use Amazon Lex bot to validate the caller, carry out transactions (for example, “reschedule shipment”) or provide the caller with the requested details (for example, “get order status”).
We utilize AWS Lambda to mimic access to backend systems and to run business reasoning needed for finishing transactions. For the function of this article, the data utilized is kept in a DynamoDB table.
To answer any user questions, we configure Amazon Kendra search index so the bot can search for the information and supply a reaction.
You can deploy the conversational experience on a Connect circumstances or incorporate it with your site.

The bot definition includes a complete dialog together with the triggers to handle the discussion. Each bot likewise incorporates with an AWS Lambda function which contains code to simulate service reasoning execution. Integration with Amazon Kendra provides the ability to address natural language concerns throughout the discussion.
Solution architecture
Lets review the total architecture for the solution (see the following diagram).

RescheduleDelivery– This intent records the order ID and helps with rescheduling the delivery.

TrackPackage– This intent captures the order ID and offers the existing status of the shipping status.

We include a template that creates an AWS CloudFormation stack for you containing AWS resources, along with the required AWS Identity and Access Management (IAM) functions. With these resources in location, you can use the pre-built service for retail order management on the Amazon Connect channel.
Requirements
You should have the following pre-requisites before we release the solution

GetOrderStatus– This intent records the order ID and supplies the existing status of the order.

EndConversation — This intent ends the discussion based on user input such as “thanks, I am done”.

Fallback — This intent is invoked when the input does not match any of the configured intents.

CancelOrder– This intent catches the order ID and aids with canceling the order.

An AWS account

Access to the following AWS services

Choose Launch Stack to launch an AWS CloudFormation stack in the Region of your choice:.

Cleanup.
To prevent sustaining any charges in the future, erase all the resources created.

Deploy the pre-built service.
To deploy this solution, finish the following steps:.

Resolving expressions.
In response to open-ended questions, consumers might use phrases to offer an answer. When using for a refund, callers might supply different reasons (for example, “product harmed”, “ordered by mistake”, “wrong size”) that have to be further translated prior to organization reasoning can be carried out. You can state something like not required, bought by mistake, or item damaged”).
The following screenshot shows the slot meaning and the associated dialog method:.

if previous_intent == GetOrderStatus:.
if order_number:.
dialog.set _ session_attribute( intent_request, order_number, order_number).
session_attributes = dialog.get _ session_attributes( intent_request).

About the Authors.
Jaya Prakash Kommu is a Technology Lead on the Smartbots.ai team. He handles a passionate group of AI engineers developing next generation conversational AI user interfaces. JP delights in playing football when not architecting bots.
Sandeep Srinivasan is a Product Manager on the Amazon Lex group. As an eager observer of human habits, he is passionate about consumer experience. He invests his waking hours at the intersection of individuals, technology, and the future.

if order_number and not order_number_confirmation:.
previous_slot_to_elicit = dialog.get _ previous_slot_to_elicit(.
intent_request).
if previous_slot_to_elicit == OrderNumberConfirmation:.
if intent [ confirmationState] == Confirmed:.
dialog.set _ slot( OrderNumberConfirmation, yes, intent).
order_number_confirmation=yes.
elif intent [ confirmationState] == Denied:.
dialog.set _ slot( OrderNumberConfirmation, None, intent).
prompt = prompts.get( OrderNumber1).
return dialog.elicit _ slot(.
OrderNumber, active_contexts,.
session_attributes, intent,.
[]. elif intent [ confirmationState] == None:.
prompt = prompts.get(.
OrderNumberConfirmation1, order_number= order_number).
return dialog.confirm _ intent(.
active_contexts, session_attributes, intent,.
previous_dialog_action_type= ElicitSlot,
previous_slot_to_elicit= OrderNumberConfirmation)
else:.
timely = prompts.get(.
OrderNumberConfirmation, order_number= order_number).
return dialog.confirm _ intent(.
active_contexts, session_attributes, intent,.
[],. previous_dialog_action_type= ElicitSlot,
previous_slot_to_elicit= OrderNumberConfirmation)

Amazon Lex bot: RetailOrderManagementBot.

Conclusion.
In this post, we evaluated a service for retail order management for common consumer assistance activities such as retrieving order status, tracking a plan, returning an item, and scheduling shipment. The pre-built solution offers a ready-to-deploy contact center setup with Amazon Connect. You can easily extend the service with additional conversation streams that specify to your companys needs. Amazon Lex for retail offers pre-built options that you can use to deliver a constant brand experience, influence client actions, and boost profits. Attempt the pre-built retail service on Amazon Lex today!

order_number_from_session = dialog.get _ session_attribute(.
intent_request, order_number).

Lambda functions: RetailOrderManagementBusinessLogic.

Amazon Lex bots.
Lambda functions.
DynamoDB table.
Amazon Connect Contact circulation.
IAM roles.

previous_intent = dialog.get _ session_attribute( intent_request, previous_intent).

If you provided a Connect ARN during stack development, browse to the Amazon Connect dashboard and pick Phone numbers on the Routing menu in the navigation pane.

The pre-built bots are configured with intents, sample utterances, and slot types for retail order management usage cases and are incorporated with Amazon Connect contact circulations.
The representative records the order ID and validates the status of the order to figure out eligibility for rescheduling. The pre-built bots continue the order number using session attributes so that the order number can be reused later on in the call to update shipment. The agent can then confirm the order number (” I have your order number as 1234567891234. In this post, we examined a solution for retail order management for typical client assistance activities such as obtaining order status, tracking a package, returning a product, and scheduling shipment.

Evaluation the IAM resource development and click on Create Stack. After a few minutes, your stack must be complete. The core resources are listed below:.

IAM gain access to and secret crucial qualifications
Optionally, an existing Amazon Connect circumstances (if you prepare to deploy on Amazon Connect).

Next, associate a contact number with the retail order management contact circulation. As soon as the phone number is associated, the service is ready to be evaluated.

IAM roles: LexRole, LexImportRole, LambdaRole, ConnectRole.

Next, in the Parameters section, enter worths for the Amazon Lex bots, DynamoDB table, and Amazon Connect contact circulation.

Amazon Lex to create bots
Lambda for business reasoning functions
DynamoDB to produce the tables
IAM with access to develop policies and roles
AWS CloudFormation to run the stack

Evaluate the solution.
If you used an Amazon Connect circumstances for implementation, you can call the Amazon Connect phone number and connect with the bot. You can likewise test the option directly on the Amazon Lex V2 console using voice or text.
Retail order management: Key Capabilities.
Lets evaluate a few of the functions used by the pre-built service to provide a smooth consumer experience to the caller.
Persisting information across demands.
A caller might start off with order status and follow up with a demand to expedite shipping. The pre-built bots persist the order number utilizing session qualities so that the order number can be reused later in the call to update shipment. The agent can then verify the order number (” I have your order number as 1234567891234.
The following code is for continuing session characteristics:.

if not order_return_reason and previous_slot_to_elicit == OrderReturnReason:.
prompt = prompts.get(re _ elicit_order_return_reason).
return dialog.elicit _ slot(.
OrderReturnReason, active_context, session_attributes, intent,.
[contentType: PlainText, material: prompt]). Ending conversations.
The pre-built option provides an intent that can deal with the ending of the conversation. After a query resolution, clients may desire to end the conversation by saying something like “Thank you”, “I am done” or “Bye”.
Contact center flows.
You can release the pre-built solution as part of Amazon Connect contact flows. The contact flow utilizes a Get consumer input block to conjure up the Amazon Lex bot.

DynamoDB: retail_order_table.

if order_number_from_session:.
dialog.set _ slot( OrderNumber, order_number_from_session, intent).
order_number = order_number_from_session.

Amazon Connect contact circulation: RetailOrderManagementContactFlow.

For Stack name, enter a name for your stack. This post utilizes the name retail-order-stack, as shown in the following screenshot.

Leave a Reply

Your email address will not be published.