Intergrade QnA Maker to your bot using Bot Framework Composer

July 12, 2021

QnA Maker is a cloud-based API service, part of Azure Cognitive Services, that lets you create a conversational question-and-answer layer over your existing data. It gives you the ability to build knowledge bases and extract questions and answers to incorporate in your bot.


Preface

QnA Maker offers a bot the ability to answer questions from a knowledge base. This is a subject that I have covered in the past at this blog. However this is a new, faster, easier and code-free way to implement it to your bots, so it deserves a new post. Let us get into it!


Create

Open the Bot Framework Composer and click Create new to create your new bot.


Choose the Core Bot with QnA Maker template and click Next.


Fill in the deatails about your bot (including your bot’s name) and click Next.


Now you will be asked to name your knowledge base and give a URL contaning all of the answered questions. We will use the same URL we used last time, and click Create.


Once your bot is created, you will notice a notification requiring you to Set up QnA Maker. You can click the title of the notification as it is a link.


After clicking the notification, you will be prompted to Set up the QnA Maker. Select the Create and configure new Azure resources option, if you have not created any resources. Then click Next.


You will now need to Sign in to your Azure account.


Enter the directory and subscription for the new resources and click Next.


You now have the ability to create a new resource group for your new resources and choose their Pricing tier. Fill in the details and click Next.


Once the process is complete you will receive a notification. Now your bot is fully working!


The new resources are available in your azure account. If you would like to have a look at your knowledge base and tinker with it, you can visit the QnA Maker portal and you can find everything about your knowledge base there.



Test

To test the capabilities of your bot, click the Start bot button in the Bot Framework Composer, and open your bot in the Web Chat.


Ask your bot a question, which is included in the site we included in our knowledge base and observe how well it responds. Within the current implimentation, it seems to be working pretty well!


And this is an easier way of connecting your bot with a knowledge base without the need for any code!

About Me

Hi, my name is Demetris Bakas and I am a software engineer that loves to write code and be creative. I always find new technologies intriguing and I like to work with other people and be a part of a team. My goal is to develop software that people will find useful and will aid them in their everyday lives.
For any questions feel free to contact me at social media using the links below.