{"id":21387,"date":"2019-06-07T12:26:59","date_gmt":"2019-06-07T11:26:59","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?p=21387"},"modified":"2022-10-03T17:17:17","modified_gmt":"2022-10-03T16:17:17","slug":"context-management","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-intelligence\/context-management\/","title":{"rendered":"Context Management"},"content":{"rendered":"<p><span style=\"font-weight: 400\">Effective context management is important because it allows Virtual Assistants to interact with users in a way that is easier, quicker, more helpful, and less robotic and scripted. Contextual data helps users complete tasks faster and allows you to create more natural, human-like back and forth conversations.<\/span><\/p>\n<p><span style=\"font-weight: 400\">For example, let us consider the following conversation:<\/span><\/p>\n<p><code><em><span style=\"font-weight: 400\">User: What is the cost of an Economy flight ticket from London to Paris on Aug 15, 2022?<br \/><\/span><\/em><\/code><code><\/code><code><em><span style=\"font-weight: 400\">VA: It\u2019s \u20ac242.<br \/><\/span><\/em><\/code><code><em><span style=\"font-weight: 400\">User: Great! I would like to book it.<\/span><\/em><\/code><\/p>\n<p><span style=\"font-weight: 400\">In the above conversation, the <\/span><em><span style=\"font-weight: 400\">booking <\/span><\/em><span style=\"font-weight: 400\">is in the context of an economy flight on Aug. 15, 2022&#8230; The VA should not be asking the user whether they would like to book a flight or a hotel; what their departure and destination cities are or when they want to fly. The context from the previous intent should already be available to the VA, so it can handle the intent according to the existing contextual data. The XO Platform allows you to capture and reuse contextual data for a large variety of scenarios, so you can create more complex use cases and redefine the enterprise customer experience. The following are examples of a few such scenarios:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><strong>Sharing context across intents, FAQs<\/strong><span style=\"font-weight: 400\">: As seen from the above example, maintaining context for all intents i.e. dialog tasks, FAQs, makes it easy to customize the user experience<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Context-driven FAQs<\/strong><span style=\"font-weight: 400\">: Certain intents (tasks or FAQs) can be made available only when certain other intents (tasks or FAQs) are in the context.<\/span><span style=\"font-weight: 400\"><br \/><\/span><span style=\"font-weight: 400\">For example, FAQ intent <\/span><em><span style=\"font-weight: 400\">What are the meal options available?<\/span><\/em><span style=\"font-weight: 400\"> should be available only when <\/span><em><span style=\"font-weight: 400\">Book a flight<\/span><\/em><span style=\"font-weight: 400\"> task is in the context.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Follow-up Intent: <\/strong><span style=\"font-weight: 400\">Context of the current intent can be used to identify subsequent intents from the user utterances.<\/span><span style=\"font-weight: 400\"><br \/><\/span><span style=\"font-weight: 400\">For example, User utterance <\/span><em><span style=\"font-weight: 400\">what are the extra charges?<\/span><\/em><span style=\"font-weight: 400\"> should be responded with FAQ intent <\/span><em><span style=\"font-weight: 400\">What are the charges for a Premium Economy seat ?<\/span><\/em><span style=\"font-weight: 400\"> if the user\u2019s previous intent was <\/span><em><span style=\"font-weight: 400\">what are the benefits of booking a Premium Economy seat?<\/span><\/em><\/li>\n<li style=\"font-weight: 400\"><strong>Sharing Entity Values across Intents<\/strong><span style=\"font-weight: 400\">: Entity values or conversation flows can be driven using the previous intent\u2019s context information.<\/span><span style=\"font-weight: 400\"><br \/><\/span><span style=\"font-weight: 400\">For example, The <\/span><em><span style=\"font-weight: 400\">City Name<\/span><\/em><span style=\"font-weight: 400\"> entity in <\/span><em><span style=\"font-weight: 400\">Check Weather<\/span><\/em><span style=\"font-weight: 400\"> intent can be pre-populated if the user has executed <\/span><em><span style=\"font-weight: 400\">Check Flight Status<\/span><\/em><span style=\"font-weight: 400\"> intent and has provided value for the <\/span><em><span style=\"font-weight: 400\">Destination City<\/span><\/em><span style=\"font-weight: 400\"> entity.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">This document talks about the concepts behind the implementation of context management in the Kore.ai XO Platform. For a detailed step-by-step example, <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/how-tos\/context-switching\/\"><span style=\"font-weight: 400\">refer here<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h1><span class=\"ez-toc-section\" id=\"Use_Case_Example\"><span style=\"font-weight: 400\">Use Case Example<\/span><\/span><\/h1>\n<p><code><em><span style=\"font-weight: 400\">User: When is my flight to Singapore?<br \/><\/span><\/em><\/code><code><em><span style=\"font-weight: 400\">VA: Your flight from New York to Singapore is confirmed for Jun 20th.<br \/><\/span><\/em><\/code><code><em><span style=\"font-weight: 400\">User: Do I need a Visa?<br \/><\/span><\/em><\/code><code><em><span style=\"font-weight: 400\">VA: Yes, you need a visa to visit Singapore for business or tourism<br \/><\/span><\/em><\/code><code><em><span style=\"font-weight: 400\">User: I would like to apply for one<br \/><\/span><\/em><\/code><code><em><span style=\"font-weight: 400\">VA: Sure I can help with a Visa to Singapore. Let me know the duration of the stay.<\/span><\/em><\/code><\/p>\n<p><span style=\"font-weight: 400\">To achieve the above conversation, the context object can be used as follows:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><em><span style=\"font-weight: 400\">Flight Booking Enquiry<\/span><\/em><span style=\"font-weight: 400\"> emits the destination city entity value.<\/span><\/li>\n<li style=\"font-weight: 400\"><em><span style=\"font-weight: 400\">Visa FAQ<\/span><\/em><span style=\"font-weight: 400\"> uses the entity value emitted by the Booking Enquiry Intent.<\/span><\/li>\n<li style=\"font-weight: 400\"><em><span style=\"font-weight: 400\">Visa Application<\/span><\/em><span style=\"font-weight: 400\"> consumes the terms Visa and Singapore from the Visa FAQ.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">This article will help you in achieving the above scenario.<\/span><\/p>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h1><span class=\"ez-toc-section\" id=\"Implementation\"><span style=\"font-weight: 400\">Implementation<\/span><\/span><\/h1>\n<p><span style=\"font-weight: 400\">Context management involves the following steps:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><strong>Output Context<\/strong><span style=\"font-weight: 400\"> to define tags that indicate the current intent is executed.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Intent Preconditions<\/strong><span style=\"font-weight: 400\"> to extract the output context tags for scoping the subsequent intent detection.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Contextual Intent Detection<\/strong><span style=\"font-weight: 400\"> using context tags to identify the terms\/nodes from the FAQs.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Conversation Flows<\/strong><span style=\"font-weight: 400\"> to customize the flows.<\/span><\/li>\n<\/ul>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Output_Context\"><span style=\"font-weight: 400\">Output Context<\/span><\/span><\/h2>\n<p><strong>Context Tags<\/strong><span style=\"font-weight: 400\"> are generated and stored in the <\/span><strong>context object<\/strong><span style=\"font-weight: 400\"> to be used for managing the assistant\u2019s behavior and user experience. The Platform creates a context object for every user intent, like dialog tasks and FAQs (<\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-builder-tool\/dialog-task\/context-object\/\"><span style=\"font-weight: 400\">refer here for more on Context Object<\/span><\/a><span style=\"font-weight: 400\">).<\/span><\/p>\n<p><strong>Default Contexts Tags<\/strong><\/p>\n<p><span style=\"font-weight: 400\">Intent names, Entity names, and FAQ Term\/Node names are emitted by default.<\/span><\/p>\n<p><strong>Custom Context Tags<\/strong><\/p>\n<p><span style=\"font-weight: 400\">Additionally, the following can be defined to be included in the Context Object:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><strong>Context Tags<\/strong><span style=\"font-weight: 400\"> \u2013 You can add context tags from the NLP settings for Dialog, Action, Alert, Info Tasks, and Entities.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Entity Value<\/strong><span style=\"font-weight: 400\"> \u2013 You set an option to indicate whether entity values captured should be emitted or not for each entity node.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Use context tags for finding FAQ<\/strong><span style=\"font-weight: 400\"> \u2013 You can indicate whether KG paths to be shortlisted using context tags.<\/span><\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Dialog_Tasks\"><span style=\"font-weight: 400\">Dialog Tasks<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">The Platform supports emitting details of a dialog task when executed by the user:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The intent name is emitted as a contextual tag for all dialog tasks when the task execution is initiated.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can add any additional tags from the <\/span><strong>NLP Properties <\/strong><span style=\"font-weight: 400\">tab of the dialog task (you may have to scroll down).<\/span><span style=\"font-weight: 400\"><br \/><\/span><span style=\"font-weight: 400\"><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163439\/context-output-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-47462\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163439\/context-output-1.png\" alt=\"\" width=\"558\" height=\"657\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163439\/context-output-1.png 558w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163439\/context-output-1-255x300.png 255w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><\/a><br \/><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can emit output context tags from any place where JavaScript is written (script node, advanced prompts, <\/span><em><span style=\"font-weight: 400\">run a script<\/span><\/em><span style=\"font-weight: 400\"> option, etc.) using the <\/span><code><span style=\"font-weight: 400\">contextTags.add(string value)<\/span><span style=\"font-weight: 400\">.<\/span><\/code><\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Alert_Tasks\"><span style=\"font-weight: 400\">Alert Tasks<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">The Platform supports emitting details of the <\/span><strong>alert <\/strong><span style=\"font-weight: 400\">tasks when executed by the user:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The task name is emitted as a contextual tag for all alert tasks when the task execution is initiated.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can add any additional tags at the time of task creation under <\/span><strong>More<\/strong><span style=\"font-weight: 400\"> Options or from the <\/span><strong>General<\/strong><span style=\"font-weight: 400\"> Settings.<br \/><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163445\/context-output-alert-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47465\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163445\/context-output-alert-1-1024x434.png\" alt=\"\" width=\"640\" height=\"271\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163445\/context-output-alert-1-1024x434.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163445\/context-output-alert-1-300x127.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163445\/context-output-alert-1.png 1922w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can also emit output context tags from pre-processors or post-processors using the <\/span><code><span style=\"font-weight: 400\">contextTags.add(string value)<\/span><\/code><span style=\"font-weight: 400\">.<br \/><\/span><\/li>\n<\/ul>\n<p>\u00a0<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Entity\"><span style=\"font-weight: 400\">Entity<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">Entity values captured from end-users are emitted based on the:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><strong>Auto emit the entity values captured<\/strong><span style=\"font-weight: 400\"> switch. Entity Value Tags will be emitted as shown in the following section.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You have the option to add any additional tags.<\/span><\/li>\n<\/ul>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163450\/context-output-entity-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47468\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163450\/context-output-entity-1.png\" alt=\"\" width=\"550\" height=\"664\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163450\/context-output-entity-1.png 550w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163450\/context-output-entity-1-248x300.png 248w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/a><\/p>\n<p>\u00a0<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Knowledge_Graph\"><span style=\"font-weight: 400\">Knowledge Graph<\/span><\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The Node\/term name is emitted as a contextual tag for all mandatory and optional terms present in the path qualified when a question is answered.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can add any additional tags per term from the <\/span><strong>Settings<\/strong><span style=\"font-weight: 400\"> page for the term\/node.<br \/><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163456\/context-output-kg-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47471\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163456\/context-output-kg-1-1024x434.png\" alt=\"\" width=\"640\" height=\"271\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163456\/context-output-kg-1-1024x434.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163456\/context-output-kg-1-300x127.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163456\/context-output-kg-1.png 1922w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can also emit output context tags from advanced prompts using the <\/span><code><span style=\"font-weight: 400\">contextTags.add(string value)<\/span><\/code><span style=\"font-weight: 400\">.<\/span><\/li>\n<\/ul>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Intent_Preconditions\"><span style=\"font-weight: 400\">Intent Preconditions<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">Intent pre-conditions are used to define the intent detection scope for intents and FAQs. These are a set of conditions that must be fulfilled for the intent\/FAQ to be detected and executed.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Dialog_Tasks-2\"><span style=\"font-weight: 400\">Dialog Tasks<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">Intent pre-conditions for dialog intents are set to define when a dialog is detected i.e. making a dialog available for detection only when specific tags are available in the context.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can add one or more intent pre-conditions for making a dialog intent available.<br \/><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163509\/intent-precondition-task-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47477\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163509\/intent-precondition-task-1.png\" alt=\"\" width=\"558\" height=\"657\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163509\/intent-precondition-task-1.png 558w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163509\/intent-precondition-task-1-255x300.png 255w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><\/a><\/span><span style=\"font-weight: 400\"><br \/><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Dialog intents with pre-conditions are detected only if the defined pre-conditions are met.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The intent with a precondition set is treated as a sub-intent and will be part of the <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-intelligence\/sub-intents-and-follow-up-intents\/#Linked_Task_Exceptions\"><span style=\"font-weight: 400\">Linked Task Exception<\/span><\/a><span style=\"font-weight: 400\"> behavior from the Dialog level Hold and Resume settings.<\/span><\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"Alert_Tasks-2\"><span style=\"font-weight: 400\">Alert Tasks<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">Intent pre-conditions for <\/span><strong>alert <\/strong><span style=\"font-weight: 400\">tasks are set to define when a task is detected i.e. making a task available for detection only when specific tags are available in the context.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can add one or more intent pre-conditions for making a task intent available.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Task intents with pre-conditions must be detected only if the defined pre-conditions are met.<br \/><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163514\/ontent-preconditions-alert-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47480\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163514\/ontent-preconditions-alert-1-1024x434.png\" alt=\"\" width=\"640\" height=\"271\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163514\/ontent-preconditions-alert-1-1024x434.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163514\/ontent-preconditions-alert-1-300x127.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163514\/ontent-preconditions-alert-1.png 1922w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><br \/><\/span><\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"Knowledge_Graph-2\"><span style=\"font-weight: 400\">Knowledge Graph<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">Intent pre-conditions for Knowledge Graph can be associated with terms.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can define intent pre-conditions for any of the terms present in the Knowledge Graph.<br \/><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163504\/intent-preconditions-kg-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47474\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163504\/intent-preconditions-kg-1-1024x434.png\" alt=\"\" width=\"640\" height=\"271\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163504\/intent-preconditions-kg-1-1024x434.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163504\/intent-preconditions-kg-1-300x127.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163504\/intent-preconditions-kg-1.png 1922w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Paths that contain terms with pre-conditions are qualified only if the pre-conditions are met.<\/span><\/li>\n<\/ol>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Contextual_Intent_Detection\"><span style=\"font-weight: 400\">Contextual Intent Detection<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">Contextual intent detection helps in detecting relevant intents using the output context set by previously executed intents.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Tasks\"><span style=\"font-weight: 400\">Tasks<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">You can define <\/span><em><span style=\"font-weight: 400\">Rules<\/span><\/em><span style=\"font-weight: 400\"> for identifying contextually relevant intents by using output context tags the same as traits (<\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/nlp\/traits\/\"><span style=\"font-weight: 400\">refer here for more<\/span><\/a><span style=\"font-weight: 400\">).<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Knowledge_Graph-3\"><span style=\"font-weight: 400\">Knowledge Graph<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">The Platform consumes the output context tags and uses them for improving intent detection in the Knowledge Graph engine based on the flag set by the developer. This flag ensures that the context tags are used to qualify paths in the Knowledge Graph. Context tags are used to extract terms and these terms are clubbed with any other terms present in user utterance. The consolidated list of terms is used for qualifying the path.<\/span><\/p>\n<p><span style=\"font-weight: 400\">You can configure this as follows:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Select the <\/span><strong>Build<\/strong><span style=\"font-weight: 400\"> tab from the top menu<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">From the left menu, click <\/span><strong>Natural Language &gt; Thresholds &amp; Configurations<\/strong><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click <\/span><strong>Knowledge Graph<\/strong><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Locate <\/span><strong>Qualify Contextual Paths <\/strong><span style=\"font-weight: 400\">and set it to <\/span><em><span style=\"font-weight: 400\">Yes.<br \/><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163520\/qualify-contextualpaths-kg-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47483\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163520\/qualify-contextualpaths-kg-1-1024x434.png\" alt=\"\" width=\"640\" height=\"271\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163520\/qualify-contextualpaths-kg-1-1024x434.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163520\/qualify-contextualpaths-kg-1-300x127.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003163520\/qualify-contextualpaths-kg-1.png 1922w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/span><\/em><em><span style=\"font-weight: 400\"><br \/><\/span><\/em><\/li>\n<\/ol>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Conversation_Flows\"><span style=\"font-weight: 400\">Conversation Flows<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">The context tags available in the context object are used to customize the conversation flows.<\/span><\/p>\n<p><span style=\"font-weight: 400\">These can be used as follows:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">To pre-populate entity values.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">To define transition conditions.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">For custom conversation flow.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">The Scripts to access the context tags are:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">From the current context: <\/span><code><span style=\"font-weight: 400\">context.currentTags.tags<\/span><\/code><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">From the previous context: <\/span><code><span style=\"font-weight: 400\">context.historicTags[0].tags<\/span><\/code><\/li>\n<\/ul>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<p><code><\/code><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Effective context management is important because it allows Virtual Assistants to interact with users in a way that is easier, quicker, more helpful, and less robotic and scripted. Contextual data helps users complete tasks faster and allows you to create more natural, human-like back and forth conversations. For example, let us consider the following conversation:&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[73,72,71,70,69],"class_list":["post-21387","post","type-post","status-publish","format-standard","hentry","category-bot-intelligence","tag-context-management","tag-context-swtiching","tag-follow-up","tag-follow-up-tasks","tag-followup-tasks"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/21387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=21387"}],"version-history":[{"count":29,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/21387\/revisions"}],"predecessor-version":[{"id":47486,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/21387\/revisions\/47486"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=21387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=21387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=21387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}