AI POWERED NLP EINSTEIN BOT

Introduction

Einstein bot is an NLU technology that trains chatbots to create a learning model which helps chatbots created with Salesforce understand customer interactions in a chat window. It can be used to greet customers, answer FAQs, reset account information and connect to Salesforce or external CRM systems. The main benefit of this bot is, a Human is not always required to serve or solve customer queries.

Enquiry Now

BENEFITS

• Quick case deflection
• Reduced wait times
• Saved time for agents
• Efficient redirects for customer inquiries
• Intelligent responses through NLU

EINSTEIN BOT STRUCTURE

The main intention of creating bot in our project is to improve customer service through AI-powered NLP and NLU chatbot. And to minimize the efforts of sales agents who were attending each and every customer’s chat request. So now we don’t need Sa’s 24/7 to solve customer queries. The bot provides services like renewal process, to report issues, information management, schedule meetings, answer FAQs, Customer Identification and Authentication etc.,

IMPLEMENTATION

1. Set up basic bot which we can later customize based on our needs.

OVERVIEW

• From the Overview page of the Bot Builder, in the channels section, we can add channel for our bot.
• To connect our bot to chat implementation, we need to select web chat for the channel and select the chat deployment (Tech chat team)

DIALOGS

• Message-Displays an outgoing message from the bot to our customer.
• Question-Gathers information from our customer. Also, Question steps let you present choices for customer responses as buttons or menus.
• Actions-Performs an action on our Salesforce data to present them to customers.
• Rules-Perform specific tasks based on certain conditions. Actions include: call a dialog from within the current dialog, redirect to a different dialog, clear a variable value, transfer to an agent, and set a variable.

VARIABLES

• A variable is a container that stores a specific piece of data collected from the customer or output from Salesforce.
• Since variables are containers of information, they can be used within dialog actions as both inputs and outputs and can be inserted as part of

ENTITIES

• An entity represents a type of data that you want to collect from a customer. It has data types like Boolean, Custom text entities, Date, text, object etc.,

PERMISSION SET

As part of setup, we also need some permission sets to be enabled. This permission set controls which objects and Apex classes bots can access. In our project we grant access to, • Apex classes from apex class access
• To salesforce objects from object settings
• To flows from run flow checkbox in the system permissions.

2. Greet the customer with embedded service chat.
• Here we create custom fields on LiveChatTranscript object to give the bot access to customer information.
• Use pre chat form to get customer details.
• Upload JavaScript to static resources to map fields in the Contact object with fields in the LiveChatTranscript object.
• Use Apex code to get data into a new variable.

3. Greet the customer with messaging

4. Prompt customer with main menu options.
• Use Dialog Groups to create an internal structure to bot dialogs.

• Use the Next Step Tool to add a submenu.

OUTPUT

5. Gather customer information
• Create a custom object to store customer order information.
• Create entities and variables to store formatted data.

6. Call an apex action.
• Create an invocable action with Apex.

o The public class OrderInput and OrderOutput are wrapper classes that include all the input and output variables. Each input and output parameter in these two classes has the @InvocableVariable annotation.
o The getOrderStatus() method has the @InvocableMethod annotation. This method performs a SOQL query to find the order records by order number, then returns the status.
• Now we need to create an Apex Action from Bot Builder.

OUTPUT

7. Call a flow action.
• Create an auto launched flow.

• Create a flow action from Bot Builder.

OUTPUT

8. Optimize bot flow with embedded chat.
• Create custom fields for the order number in both case and LiveChatTranscript.
• Add the Case.OrderNumber field to our pre-chat page configuration.

• Welcome with order number.

OUTPUT

• Or else its welcome with main menu.

OUTPUT

9. Set up Natural Language Processing (NLP) so we can make the bot smarter, and more conversational.
• Create an intent set with training data.
• Associate intents to dialogs.

OUTPUT

10. Create dynamic menus.
• Create a custom object to store appointment information.

• Create an invocable method in Apex to get the list of appointments.

• Call the “Get Open Appointments” Apex method and present dynamic options using a question.

OUTPUT

11. Get Context Info with Embedded Chat.
• Add these two custom fields ChatRequestPage and ShoppingCartValue to the LiveChatTranscript object.
• Add these modifications in code snippet file
{
"label": "ChatRequestPage",
"value": "Payment",
"displayToAgent": true,
"transcriptFields": ["ChatRequestPage__c"]
},{
"label": "ShoppingCartValue",
"value": "600",
"displayToAgent": true,
"transcriptFields": ["ShoppingCartValue__c"]}
• Populate the bot variables with pre-chat form actions.
• Add a new “Transfer Required” dialog.

OUTPUT

• ShoppingCartValue set to 600.

• ShoppingCartValue set to 300.

FLOW DIAGRAM