How to Build Intelligent Bots with Microsoft Bot Framework: A Step-by-Step Guide

Photo by Fotos on Unsplash

How to Build Intelligent Bots with Microsoft Bot Framework: A Step-by-Step Guide

I am one of those geeks who get fascinated by new technologies and hackathons where fun, interactive experiences can be created. I'm really attracted to the vast power of conversational AI. I'm not a professional developer, but with Microsoft's Bot Framework, one is able to build, test, and even deploy bots to do just about anything.

They are capable of responding to simple questions and complex conversations alike. So, today, I will share with you my step-by-step guide to creating your bots using Bot Framework. Of course, I will add some of my experiences.

What is Bot Framework?

The Bot Framework is a Microsoft tool to create, manage, and deploy chatbots. Chatbots are programs designed to chat with users. These bots can chat with people on websites, apps, Microsoft Teams, and more. The Bot Framework uses Natural Language Processing for the understanding of users. It helps you create engaging and helpful chats with users; this can be done even if you are not a coder.

Things You May Need

Before we dive right in to develop your bot, here are a few things that you will need:

  • Bot Framework Composer: This is an easy-to-use tool that helps you visually design your bot's conversations and integrate with AI services.

  • Azure Subscription: You will deploy your bot and manage it.

  • Basic Understanding of What Your Bot Does: You will want to consider what you want your bot to do. Will it answer frequently asked questions or walk users through a service?

  • A Test Environment: You will need to test your bot in one of the tools, either Bot Framework Emulator or deploy it to a platform like Microsoft Teams.

Step-by-Step Guide

1. Creating Custom Dialogs in Bot Framework Composer

Step 1: Open Bot Framework Composer. Create an Empty Bot.

Step 2: Name your bot and proceed.

Create a Bot Composer

Step 3: In the Greeting trigger, under the Dialog management options, choose "Begin a new dialog" to add a new dialog.

Greeting Dialog in Composer

Step 4: Add a new dialog and introduce questions that shall be used to collect information from the user.

create a new dialog

Step 5: Provide a name and description of the dialog.

dialog details

Step 6: In your dialogue, navigate to the new trigger. Click the "+" sign and pick "Text" from the "Ask a question" options.

Begin Dialog process

Step 7: Type your new question here.

write new questions

Step 8: In the "Property" field of the new "User Input," type the variable name to save the user's response. Example: "user.name."

add user inputs

Step 9: Add a "Number" question type next.

Step 10: Type a question that requires a number as the answer.

Step 11: In the "Property" field of "User Input," provide a name for the number variable. Example: "user.age."

provide name to number variables

Step 12: Add a "Multi-choice" question type.

Step 13: Type the text for your question.

Step 14: Again, enter the variable name in the "Property" field of "User input." Example: "user.gender."

enter name and prompt

Step 15: Scroll down to find the "Array of choices." Add all the answer options the user can pick from.

Array of choices

Step 16: Now, let's send a message back to the user with all the collected info. Click "+" and choose "Send a response."

Send a response

Step 17: You'll find all your variables under the "{x}" list.

find dialog variables

Step 18: Combine the variables to build your message.

Send a response

My Insights

I found developing bots using the Bot Framework quite enjoyable and rewarding. The design of this bot would enable you to realize the needs of your users. Designing it around these needs will take conversation design in your bot. Custom dialogs and features like Adaptive Cards empower the experience from the user side. They make it engaging.

Follow Umesh Pandit

linkedin.com/in/umeshpandit

x.com/umeshpanditax

linkedin.com/newsletters/umesh-pandit-s-not..

Did you find this article valuable?

Support Umesh Pandit by becoming a sponsor. Any amount is appreciated!