1. Home
  2. Kore.ai Conversational Platform
  3. Bot Builder Tool
  4. Defining Bot Tasks
  5. Kore.ai Knowledge Graph
  6. Creating a Knowledge Graph

Creating a Knowledge Graph

You can add a Knowledge Graph to an existing or new Bot. So, if you haven’t already created a bot, refer to Creating a new Bot.

Creating a Knowledge Graph involves the following steps:

Step 1: Add Knowledge Graph to Bot

To open the Knowledge Graph builder:

  1. Log in to Kore.ai Bot Builder and open the bot to which you want to add the Knowledge Graph.
  2. On the Bot main menu, click Knowledge Collection tab and then click Create on the right-hand screen.

Step 2: Create the Ontology

By default, the name of the bot becomes the root node of the ontology and you can edit this. Create the rest of the nodes below the root node as follows:

  1. On the top left side of your Bot Ontology window, hover the mouse over the root node.
  2. Click the plus icon. A box appears below to add a node.
  3. Type the name of the node in the box and press enter.

    Note: This node becomes a child for the root node and can be referred to as a First level node.
  4. Repeat steps 1 to 3 to create other First-level nodes.
  5. After you create First-level nodes, create child nodes as follows:
    • Hover your mouse over any First-level node, and click the icon to create its child node.
    • You can create a child node for any level nodes by hovering the mouse over it and clicking the icon.

Step 3: Add Question and Answers

The next step is to add relevant question-answer sets to the nodes in the ontology. As you enter these questions, pay attention to terms that you can further add to your ontology.

Adding Questions

To enter the question and answer for a selected node:

  1. On the top left side of your Bot Ontology window, click the node to which you want to add questions.
  2. On the top right side of the Bot Ontology, click Add Q&A.
  3. In the User Says box, enter the question that describes the user’s query.
  4. Optionally, if there are alternatives to the same question, click the plus icon to add the other question. Repeat the step for all the alternative questions you want to add.
Note: By default, questions added to a child node are visible for all its parent nodes in the path, up to the root node. If you do not want the questions from child nodes to be seen beyond a certain parent node, click the following icon on the Questions panel of the selected parent:
The questions from all its child nodes will not be visible to the selected parent node and all its parent nodes.

Adding Responses

For the Response, you can either invoke a bot task as the response or compose a simple or channel-specific reply.

Send Message

Use this option to compose a simple text reply or advanced channel-specific messages.

You can add channel-specific responses to questions in your Knowledge Graph. By varying the responses, you can make the language and formatting to leverage the strengths of the selected channels.

To add a channel-specific response, select the channel from the channels list before typing the response as shown below.

 

Note: We recommend you to add one response for All Channels so that it can be used in the absence of a channel-specific response for a channel.
Sometimes the responses to FAQ can be quite lengthy or may include nice-to-have information along with the primary response. To improve the readability of such responses, you can split information into multiple responses that go as separate messages one after another by clicking the chat icon in the top right corner of the response box.

Optionally, if there is an alternative response, click the plus icon to add it. Repeat the step for all the alternative responses you want to add.

Run a Task

You can link a Dialog task as a response to an FAQ. It helps you to leverage the capabilities of the Knowledge Graph and Dialog tasks to handle FAQs that involve complex conversations.

Click the button and select a task from the drop-down list to add it as a response to the question.

Add Tags

When you type a question in the User Says field, the Knowledge Graph suggests some terms that you can add to the graph based on the text. To include a suggested term to the path, click the term and it appears at the end of the Path field.

Once you add a tag, it will be visible below the question like a tag everywhere the question appears. Tags work exactly like terms but are not displayed in the Bot Ontology to avoid clutter. You can add synonyms and classes to tags as you do to terms.

Step 4: Enter Synonyms

You can add multiple synonyms for each term in your Knowledge Graph, making the path discoverable for varied user utterances. You can add synonyms for a term from the Settings window. When you add a synonym for a term in the Knowledge Graph, you can now add them as global synonyms. Local synonyms apply to the term only in that particular path, whereas global synonyms apply to the term even if it appears on any other path in the ontology.

To add synonyms for a term:

    1. On the top left side of your Bot Ontology, hover the mouse over the terms for which you want to add synonyms.
    2. Click the gear icon to open the Settings window.
    3. To add synonyms,  do the following:

      • To add local synonyms, type them in the box under Path Level Synonyms.
      • To add Global synonyms, click Add New under Knowledge Graph Synonyms and enter them.
        Note: Press Enter after typing each synonym in the Synonyms box. If you type multiple synonyms, and without pressing enter, all the synonyms are considered as a single entity, even if they are separated by spaces.
    4. To add synonyms for a child node, enter them in the Synonyms box next to the term.

To add synonyms for a tag:

  1. On the top left side of your Bot Ontology, click the term to which you have added the question.
  2. From the list of questions on the Questions panel, hover the mouse over the question.
  3. Click the edit icon and in the Edit Q&A window, double-click the term.
  4. On the pop-up window that opens, type each synonym and press Enter to add it.
Note: Press Enter after typing each synonym in the Synonyms box. If you type multiple synonyms, and without pressing enter, all the synonyms are considered as a single entity, even if they are separated by spaces.

Step 5: Define Term Usage

Designate the terms in your ontology as Default, Mandatory, or Organizer, depending on their importance in qualifying matching paths as explained below:

  • Default: Default terms do not have any particular considerations in shortlisting qualified paths.
  • Mandatory: When you mark a term as Mandatory, all paths associated with the term are shortlisted for ranking only if the user’s utterance includes the mandatory term or its synonyms.
  • Organizer: Indicates that a term is just a placeholder (folder) and it should not add any value to scoring. When you mark a term as Organizer, it’ll not be counted while shortlisting qualified paths.

Step 6: Create Classes and Add them to Terms

You can create classes with common user utterances and then add them to the relevant terms in your Knowledge Graph.

To create a class:

  1. On the top right side of your Bot Ontology window, click the > Manage Classes.
  2. On the Classes pop-up window, click Add Class.
  3. In the Class Name field, enter a relevant name for the class, for example, Issues.
  4. In the Utterances box, enter all the utterances that you want to include in the class. Examples of the Issues class: it is not working, not working, is not working, and I cannot see.

  5. Click Save.

After you create a class, you can assign it to multiple nodes in the Bot Ontology.

To add a class to a node, follow these steps:

  1. On the top left side of your Bot Ontology, hover the mouse over the terms to which you want to add the class.
  2. Click the gear icon to open the Settings window.
  3. In the Class drop-down list, select the name of a class and then click Save.

Note: Adding a class to a node doesn’t add it to other nodes with the same name. You should add classes to each relevant node separately.

Step 7: Train the Knowledge Graph

After you complete creating the ontology, click the Train button on the top right-hand side of your Bot Ontology window. When you do so, all the paths, synonyms, and question-answer sets are sent to the Graph DB engine.

Note: After every change that you make to the ontology such as adding synonyms to a term or editing the name of a term, you must click the Train button for the changes to reflect in the bot responses.

Step 8: Test the Knowledge Graph

When you complete creating the Bot Ontology and training it, we recommend you to interact with the bot and ask questions connected to the Knowledge Graph. Test the bot responses by using a variety of utterances so that you can identify missing terms, questions, alternative questions, synonyms, and classes.

Note: The Knowledge Graph remains in the Configured status until it’s published.

See Also:

Was this article helpful to you? Yes 5 No