Skip to content

Solution Overview

Abhijeet Bodhankar edited this page Jan 31, 2020 · 5 revisions

Architecture Image

The Crowdsourcer Bot application has the following main components:

  • QnA Maker: Resources that comprise the QnA Maker cognitive service, which implements the "FAQ" part of the application. The installer creates a knowledge base using the tools provided by QnA Maker.

  • Azure Function: Time triggered azure function is used to create knowledge base (if not exist) and publish knowledge base every 15 minutes. Azure functions post publish downloads the knowledge base and store it in azure blob as QnA pairs JSON string.

  • Crowdsourcer Bot: Crowdsourcer Bot helps a group of people (team) collaborate to obtain voluntary answers to their queries in a fun and transparent manner. It works on the principle of tapping on to the crowd intelligence and collective wisdom of the group.

  • The knowledge base (KB) in QnA Maker is presented in a team as conversational bot interface. Through the bot, the user can ask questions, add, update, delete & view questions.

  • The same bot also implements a messaging extension that have the following tabs

    • Recent answers: Shows the list of the most recently submitted questions with the newest of the questions appearing first in the list
    • Recent updates: Shows the list of the most recently edited questions
    • Unanswered: Shows the list of unanswered questions with the newest of the questions appearing first in the list

QnA Maker

Once the bot is installed for the first time for a tenant, a knowledge base repository is created and gets mapped to the tenant. A tenant will have a single knowledge base mapped to it and the bot will use the same knowledge base when installed in multiple teams within the same tenant. The precision and recall of the bot responses to user questions are directly tied to the quality of the knowledge base, so it's important to follow QnA Maker's recommended best practices. Keep in mind that a good knowledge base requires curation and feedback: see Development lifecycle of a knowledge base.

Team Id, conversation Id, created at, created by, updated at, updated by are stored as metadata for each question in knowledge base. Created at and updated at fields are used for sorting data shown in messaging extension. Conversation Id is used for going to original messaging thread where question was asked.

For more details about QnAMaker, please refer to the QnAMaker documentation.

Bot and Messaging Extension

The bot is built using the Bot Framework SDK v4 for .NET and ASP.NET Core 2.1. The bot has a conversational interface with team scope. It also implements a messaging extension with query commands, which the team users can use to see the list of questions from different category.

For Messaging Extension, transformed knowledge base with QnA pairs and metadata information is stored in blob storage in JSON format by azure function. The same is shown by Crowdsourcer messaging extension for respective section and search categories using Azure search service. Azure function runs at defined interval to update latest data from knowledge base into blob storage.

Bot Commands

  • Ask question: Bot considers any question after @mention bot as a question and queries QnA Maker to get answer. The response card will have additional action buttons to add/edit/delete the QnA pair. Once updated the QnA pair is added to QnA Maker test knowledge base. Bot replies back in the original conversation to show the trail history of all operations performed in QnA pair.
  • Add question: Bot has reserved command for ‘Add Question’ to respond back with cards. Add question can be invoked as bot command and also from messaging extension.
Clone this wiki locally