Microsoft QnA Maker: Extend Virtual Agents with a Knowledgebase

The Microsoft QnA Maker Extension helps to answer frequently asked questions in a Cognigy.AI virtual agent. Therefore, an already created Knowledgebase can be used as a backup if the virtual agent did not find an intent. This tutorial will explain how to integrate an organization's QnA Maker instance to a Cognigy.AI virtual agent and generate answers.

Table of Contents

  1. Install the Microsoft QnA Maker Extension
  2. Create a QnA Maker Connection
  3. Generate an answer

Install the Microsoft QnA Maker Extension

The first step is to install the required integration. In this case, a so-called Extension is installed to Cognigy.AI. Thus, navigate to the Extensions Marketplace inside of the Virtual Agent and add the Microsoft QnA Maker Extension by clicking on the Install button. Now follow this installation guide and upload the Extension to Cognigy, where it will be displayed as the following:

microsoft-qna-maker-extension-upload.PNG

Congrats! The installation of the Extension is finished!

Create a QnA Maker Connection

In this step, a so-called Connection will be created. If one, in Cognigy.AI, clicks on the previously uploaded Extension, the following details can be observed:

microsoft-qna-maker-extension-details.png

The red-marked part in the above figure shows, that there is one Connection required. Therefore, it needs to be created and filled with the QnA Maker instance information. In order to do so, one initial Flow Node needs to be added to a Flow:

  1. Create a new Flow in Cognigy.AI
  2. Inside of the Flow Chart, click on + and navigate to the Microsoft QnA Maker Extension:

    microsoft-qna-maker-flow-nodes-menu.png

  3. Add the Generate Answer Flow Node by clicking on it:

    microsoft-qna-maker-flow-node-generate-answer.png

  4. In order to edit the Flow Node and create the Connection, please click on it. An Edit Node menu will be opened on the right side of the screen:

    microsoft-qna-maker-flow-node-generate-answer-edit-menu.png

  5. Right next to the Connection field (the first one at the top), one needs to click on the + button. The Connection menu will be opened at the center of the screen:

    microsoft-qna-maker-extension-connection.png
    microsoft-qna-maker-extension-connection-create.png
  6.  The required values can be copied from the Settings page of the referenced QnA Maker Knowledgebase:
    1. Login to https://www.qnamaker.ai/
    2. Select the Knowledgebase that should be connected
    3. On the top right, click on Settings
    4. Scroll down to the Deployment details

      microsoft-qna-maker-connection-information.png
  7. Insert the related Microsoft QnA Maker credentials/information of the organization to the fields. 
    1. runtimeEndpoint
      1. The URL of the hosted QnA Maker instance.
    2. resourceKey
      1. The authentication key is provided after the "EndpointKey" name in the Authorization information.
    3. knowledgebaseId
      1. The actual identifier (ID) of the used Knowledgebase in QnA Maker.
  8. Click on the Create button

Generate an answer

Finally, a virtual agent could generate a fitting answer to a user's question if no intent was found in Cognigy.AI. A possible Flow Chart could look such as the following:

microsoft-qna-maker-flow-example.PNG

This straightforward configuration instantly extends the available list of possible FAQ answers in the chat/voice conversation. In this case, the Generate Answer Flow Node exposes two different so-called Child Nodes, helping the designer developing a valid logic.

On Found Answer

If a fitting answer was found in the QnA Maker Knowledgebase, the On Found path is executed -- the dynamic answer can be sent to the user in a Say Node

microsoft-qna-maker-generate-answer-output-say-node-edit-menu.PNG

while the used CognigyScript is:

{{input.answers[0].answer}}

 The entire result JSON data information is stored in the Input or Context object:

{
    "answers": [
       {
            "questions": [
                "Who is Cognigy?"
           ],
            "answer""Cognigy is an enterprise software provider for Conversational AI automation. Our platform, Cognigy.AI, automates customer and employee communications. Available in on-premises and SaaS environments, Cognigy.AI enables enterprises to have natural language conversations with their users on any channel – webchat, SMS, voice and mobile apps – and in any language.",
            "score"62.8,
            "id"2,
            "source""https://www.cognigy.com/about",
            "isDocumentText"false,
            "metadata": [],
            "context": {
                "isContextOnly"false,
                "prompts": []
           }
       },
        "...": "..."
  ],

}

On Not Found Answer

However, if even the QnA Maker database did not find a fitting answer, the On Not Found path is executed which could lead to a live chat handover event. Again, the Extension's result JSON data is stored in the Input or Context object -- based on the configuration:

{
    "answers": [
       {
        "questions": [],
        "answer""No good match found in KB.",
        "score"0,
        "id"-1,
        "isDocumentText"false,
        "metadata": []
       }
  ],

}

 


Comments

0 comments

Article is closed for comments.

Was this article helpful?
0 out of 0 found this helpful