Part 1 of a 2-part series focused on building chatbots. We show you how to use QnA Maker, PowerVA, Power Automate, and Flow to create a chatbot for a website.
Creating a ChatBot for your website is an excellent way for you to provide an interactive experience for your end users to help find the information they need. With some intuitive tools from Microsoft, it’s possible to have one up and running with no coding required. In this two-part tutorial, we will be going over start to finish on how to build an intelligent Chatbot that can answer FAQ questions, and how to embed it into a custom website. In part 1, we will go through building out the knowledge base we need to provide intelligence to our Chatbot, and in part 2 we will build out the actual Chatbot and publish it to a website.
Kiefer Consulting has built a Chatbot using both the Azure App Service and Service Virtual Agent. You can see the bot in the bottom right hand corner of the Kiefer website.
What you will need
- QnA Maker: To build the knowledge base for the bot
- Azure QnA Service: An Azure account to build out the service
Creating a Knowledge Base
The first step is to build out the guts of the ChatBot using QnA Maker. The intelligence of the bot is derived from a database of question and answer pairs that we will be feeding the bot from various websites or documents. To get started, head over to QnA Maker, sign-in, and select “Create a knowledge base.”
We will then go through the setup process step by step, starting with “Create a QnA Service.”
Selecting this will take you to Azure where you can create a new QnA Service to power your QnA Maker knowledge base. Go through the steps for selecting a resource group and name. For pricing tier, there is either the “Free F0” tier, or the “Standard S0” tier. If you will be feeding the bot knowledge from more than 3 documents, or if the documents over 1MB in size, you will need to choose the standard tier. For this tutorial, we will be using the free tier. Continuing on, select a Azure Search location near where your users will be and the “Free F” Azure Search pricing tier for now, as we can always scale up if needed. After finishing, click “Review + create”
After reviewing your information, click “Create” to build out the service.
After it’s complete, you can head back to QnA Maker and finish building out your knowledge base. Under “Step 2: Connect your QnA service to your KB”, you can now select your newly created QnA Service.
For Step 3, give your knowledge base a meaningful name. And in Step 4, we will populate our knowledge base. Here, you can power the knowledge base from a variety of different resources. For our example, we will use the URL for an FAQ page on our website that answers questions about Kiefer Consulting. But feel free to try out whatever you like, including documents. This is a powerful tool that can extract question and answer pairs in meaningful ways, plus you’ll still be to review and update them after. Under Chit-chat, you can add a persona for your chatbot to allow for small talk that can fit your companies style. We’ve chosen the “Professional” template.
The last step is to click “Create your KB”.
After a little bit, your knowledge base will be ready. You will see a list of Question and Answer pairs that was derived from what you selected earlier. You can also create, modify, or delete QnA pairs on this screen. Another nice feature is being able to “Test”.
This will open up a chat pain where you can try asking it various questions to see how it responds. Feel free to try out various questions. The questions don’t have to be an exact match either, as the tool will try to predict what the best answer will be. You can see the details by clicking “Inspect” on a question that you type.
From this pane, you can see more details on what the bot is thinking. There is a “Confidence score” that indicates how likely it thinks that it got an answer right. We will be using confidence scores and user feedback when we build out the actual chatbot in the next part to help make it better over time.
Once you’re done playing with it, select “Publish” at the top.
Then select the “Publish” button again to make this knowledge base accessible via an endpoint.
Now we will be able to access this knowledge base using an HTTP Post request with the given information.
You will need to take note of the following information for the next part of our tutorial: knowledge-base-ID, resource name, and endpoint-key.
We’ve walked through the steps of building out a knowledge base using QnA Maker. We created a QnA Service in Azure, fed our knowledge base FAQs through a URL (or documents), tested the KB while viewing confidence scores, and published the KB to make it accessible.
In part 2 of this tutorial, we will go over how we can build out an interactive ChatBot using PowerVA that will utilize the knowledge base we’ve just created here., and how we can publish it to your website.