Send Inline Knowledge Base Article on Live Chat with Bots

Updated 

Overview

At Sprinklr, we've introduced the inline KB feature, seamlessly integrating our knowledge base into the live chatbot. It dynamically retrieves and presents updated articles in real-time, eliminating constant chatbot updates. Automatic rendering of fresh documentation ensures users access accurate and current info, boosting efficiency across channels. Update documents centrally for universal reflection, be it in community, bot flow, or embedded directly in the Sprinklr Live Chat widget.

Before You Start

Its pivotal to configure the following on the platform:

·     Sprinklr Knowledge Base (KB): Before implementing the bot workflow, it is essential to have a functioning KB in Sprinklr. The KB should contain a collection of articles that provide relevant information to users.

·     Bot Workflow Configuration: To determine which KB articles to display in different scenarios, a well-defined bot workflow needs to be set up. This workflow will define the rules and logic that govern the behaviour of the bot, including when and where to show specific KB articles.

Configuration steps:

  1. Create a Live Chat.

  2. Create a Knowledge Base.

  3. To utilize the inline KB feature, follow these steps to configure it :

    1. Add a bot reply to the dialogue tree

    2. Include Groovy code within the bot reply.

    3. Toggle on "Write Script" to publish the dynamic asset.

The following is a sample groovy codeblock to publish a dynamic asset.

--------/// Static ///--------

def card = [: ];

card['assetStatus'] = 'APPROVED';

card['availableAfterTime'] = 1589358506007;

card['visibleFromTime'] = 1589358506007;

card['visibleTillTime'] = 2251614506007;

card['neverExpire'] = true;

card['channelTypes'] = [];

card.channelTypes.add('SPRINKLR_LIVE_CHAT');

card['deleted'] = false;

card['assetType'] = 'TEMPLATE_ASSET';

def socialAsset = [: ];

card['socialAsset'] = socialAsset;

socialAsset['channelType'] = 'SPRINKLR_LIVE_CHAT';

socialAsset['templateType'] = 'SPRINKLR_ENTITIES';

socialAsset['_socialAssetType'] = 'TEMPLATE_ASSET';

socialAsset['omniChannelTemplate'] = true;

socialAsset['cannedResponse'] = false;

socialAsset['disableManualResponse'] = false;

def content = [: ];

socialAsset['content'] = content;

content['type'] = 'SPRINKLR_ENTITIES';

content['entityType'] = 'KNOWLEDGE_BASE_CONTENT';

--------/// Static ///--------

 

--------/// Content of Asset ///--------

content['title'] = 'Please choose one of the following options:' --> Title

content['description'] = 'select'; --> Description

content['message'] = 'this is msg'; --> Message

--------/// Content of Asset ///--------

 

def request = [: ];

content['request'] = request;

request['report'] = 'KB_CONTENT_REPORT';

request['reportingEngine'] = 'KNOWLEDGE_BASE';

def page = [: ];

request['page'] = page;

page['page'] = 0;

page['size'] = 15;

 

--------/// Filter ///--------

def filters = [];

request['filters'] = filters;

def filter1 = [:];

filter1['filterType'] = 'OR';

def filter1_1 = [: ];

filter1_1['filterType'] = 'IN';

filter1_1['field'] = 'KB_FOLDER_ID';

filter1_1['values'] = ['63f63276d9934d7c348c2d86'];

def filter1_2 = [: ];

filter1_2['filterType'] = 'IN';

filter1_2['field'] = 'KB_RELATED_FOLDER_IDS';

filter1_2['values'] = ['63f63276d9934d7c348c2d86'];

filter1['filters'] = [];

filter1['filters'].add(filter1_1);

filter1['filters'].add(filter1_2);

filters.add(filter1);

--------/// Filter ///--------

 

--------/// Sort ///--------

def sorts = [];

request['sorts'] = sorts;

def sort = [: ];

sort['key'] = 'KB_CREATED_DATE';

sort['order'] = 'DESC';

--------/// Sort ///--------

 

return card;

By following these instructions, you can seamlessly retrieve articles from the knowledge base, enhancing your chatbot's functionality and providing real-time access to relevant information.

​​

4.   Articles open directly in the Live chat app for a seamless experience. Users can give feedback via thumbs-up or thumbs-down icons below articles, improving the knowledge base and system effectiveness.

Note: Inline KB is not supported in CLASSIC skin.