Smarter Sale & Service with Microsoft Bot Framework - Part 2

In the previous article, I shared my view on how Bot applications can help businesses to provide a smarter Sale and Service. The emphasis in that article was to explain drivers of developing Smart BOTs and shed some light on the overall architecture. In this article, I will walk through some user stories and the solution itself. The Bot Solution is available in this GitHub project.

User Stories

User Identification

The solution identifies users from their channel handle (i.e. SkypeID). For users connecting for the first time , the solution creates a contact in CRM with basic information extracted from the channel. These contacts created by BOT application can be merged with existing CRM contacts. The information sourced from channels will be used to identify users the next time they initiate a conversation. The channel information are stored in Channel ID, First name and Last name fields of our CRM solution.

Intent Recognition

One a user is identified, the solution listens to the user and based on the user messages, the solution identifies the user intention. The intention can be "getting the latest opportunity status" or "expressing interest in one of existing products of services" or anything else which is applied to your business.

Opportunity Status

Once the user expresses the intention to know about the status of his last product opportunity, the system will ask for the opportunity ID or product name (These parameters are configurable). The opportunity ID or product name can also be detected from the user sentence without need to ask an additional question of "What is the product ID you are inquiring about?". Nevertheless, based on the user's response, the opportunity status and its owner will be returned to the user. In case the owner is a team, contact centre's details will be provided.

New Opportunities

On the event of expressing interest in new products or services, the solution will ask for the product or service name and quantity of products (if applicable). It will then create an opportunity with products line items in CRM. The number of requested products by the customer are included in the product line items.

An opportunity summary report will be created by the solution and sent to the user upon request. During this process, user's email address is captured if no email is in the user record.

Product Stock Check

Creating opportunity and reporting its status is only one part of the entire scenario. There is also an integration between CRM and D365 Operations to check the available stock. In case the requested stock is not available in the warehouse, the solution sends a message to the warehouse manager to order more stock.

Solution Components

Configuration

Many parameters in the above user stories are configurable. Below is the list of field with a brief description:

  • Contact Identified: used to identify the customer in CRM (It can be handle, mobile and email whereas currently handle is being used)
  • BOT ID: is the name of the BOT skype ID
  • Sales Queue: is the queue which the opportunity is assigned
  • Default Price list: is the Guid of the default price ist to be used by the solution
  • BOT Web Application
  • A Bot Web Application is a web application containing all logic, dialogs and communication flow. It is built on top of the Bot Framework Library. The Bot Web Application will have configurations required to connect to the BOT App (Hosted in Azure) and LUIS app.

BOT App

A Bot application should be registered in Microsoft Azure whose AppID and AppPassword will be used in our BOT Web Application. It basically connects the Bot application components such as supported channels and Bot Web Application in a common point. The BOT app is different than BOT Web Application. The Bot app is an azure service which contains information about the channels, Bot Metadata and Microsoft App information whereas the Bot Web Application hosts the Bot application logic, dialogs and controllers. Without a Bot App, we cannot connect to the Bot Web Application and without a Bot Web Application we don't have any application logic and flow.

LUIS

LUIS service is an intelligent service hosted in Azure which can be used to identify user intents and this way eliminates the needs to many prompts and dialogs to understand the exact user intention. We create a LUIS solution from Luis.ia, training and publish it. The solution job is to get a string of words and identifies the intention of sentence with one word only. For example, the sentence "I would like to know the status of my application #App123" is translated to "Application.Status" with a parameter "#App123". Once this intention is detected, we can call a method "GetOpportunityStatus ("#App123") to get the response from CRM.

Connector

Connector is a class library specifically built to intermediate between CRM, AX and our Bot Web Application. It encapsulates all required functionality to serve users. For example, it identifies the user, creates opportunities, gets status of opportunities, creates opportunity line items, executes workflows and etc. Basically this component is created to make a separate and business specific layer on top of CRM APIs.

MS Flow

In some cases we can make use of MS Flow which will eliminate to do additional coding but it all depends on the functionality we would like to achieve.

Comments

Popular Posts