What is Microsoft Bot Framework Overview

botGetting started with the Microsoft Bot Framework


The Microsoft Bot Framework provides just what you need to build and connect intelligent bots that interact naturally wherever your users are talking, from text/sms to Skype, Slack, Office 365 mail and other popular services.


The Microsoft Bot Framework (preview): framework enables organizations to build intelligent agents, known as Bots.

Bots let users interact with intelligent solutions as though they are conversing with another person, and interactions can take many forms, from text/SMS to Office365 mail to Skype and Slack. The Framework provides developers with a developer portal and SDK to build Bots, a Bot Connector service to connect to social channels such as Twitter and Slack, and a Bot Directory to discover and use existing bots.

Bots (or conversation agents) are rapidly becoming an integral part of your digital experience 



Bots  are as vital a way for users to interact with a service or application as is a web site or a mobile experience. Developers writing bots all face the same problems: bots require basic I/O; they must have language and dialog skills; and they must connect to users

The Bot Framework provides tools to easily solve these problems and more for developers e.g., automatic translation to more than 30 languages, user and conversation state management, debugging tools, an embeddable web chat control and a way for users to discover, try, and add bots to the conversation experiences they love.

The Bot Framework has a number of components including the Bot Connector, Bot Builder SDK, and the Bot Directory.


Bot Connector

The Bot Connector lets you connect your bot(s) seamlessly to text/sms, Office 365 mail, Skype, Slack, and other services. Simply register your bot, configure desired channels and publish in the Bot Directory.


Getting Started – Its all in web API


Bot Builder SDK

The Bot Builder SDK is an open source SDK hosted on GitHub that provides everything you need to build great dialogs within your Node.js- or C#-based bot.




Simple Dialog Model

The concept of a dialogue is simple the set of questions and results which the user is asked and provided. (the Conversation with the USER)




Getting Started

Key things you need to consider for the API is Scale, so you have a state per session and a state per user.

The Dialog starts by a conversation

   1: public async Task<Message> Post ([FromBody]Message message)
   2: { 
   3:     if (message.Type =="Message")
   4:     {
   5:     //return a reply to the user
   6:     return await Conversation.SendAsync (message, () => new Echo.Dialog ());
   7:     }
   8:     else
   9:     {
  10:         return HandleSystemMessage (message);


The Web Api then calls Dialogues – This is a simple example of a Dialog

   1: [Serializable]
   2: public class EchoDialog : IDialog
   3: {
   4:     private int count =1;
   5:     public async Task StartAsync (IDialogContext context)
   6:     {
   7:     context.Wait(MessageRecievedAsync);
   8:     }
  10:     public async Task MessageRecievedAsync(IDialogContext context, IAwaitable<Message> argument)
  11:     {
  12:         var message = await argument;
  13:         if (message.Text="Enter your command here")
  14:     {
  15:         PromptDialog.Confirm(
  16:         context,
  17:         AfterResetAsync,
  18:         "Message you want here",
  19:         "response for failure");
  20:         }
  21:         else
  22:         {
  23:         await context.PostAsync(string.Format("{0}:You Said{1}", this.count++, message.Text));
  24:         context.Wait(MessageReceivedAsync);
  25:         }
  26: }



You can also add some cool freatures like Microsoft LUIS


Adding Cortana Cognitive Services such as LUIS (See my previous post on LUIS)

   1: [LuisModel]("Enter your Key", "Enter your Subscription ID")]
   2: [Serializable]
   3: public class SimpleAlarmDialog : LUISDialog
   4: {
   5:    [LuisIntent ("builtin.intent.alarm.find_alarm")]
   6: public async Task FindAlarm(IDialogContext context, LUISResult result)
   7: {
   8:     Alarm alarm;
   9:     if (tryFindAlarm(result, out alarm))
  10:     {
  11:         await context.PostAsync($"found alarm{alarm}");
  12:     }
  13:     else
  14:     {
  15:         await context.PostAsync("did not find alarm");
  16:     }
  17:     context.Wait(MessageReceived);
  18: }    


Using FormFlow


So as an Example of a Simple sandwich order system


User is prompted the following the questions


  1. Select your Sandwich filling?
  2. Select your Sandwich length?
  3. Select your bread type?
  4. Would you like Cheese?
  5. Select your Sandwich Topping?
  6. Select your Sauce Option?


Example code






Get started with the Bot Connector.

Microsoft Bot Samples: https://github.com/Microsoft/BotBuilder

Get started developing your first bot bot: https://dev.botframework.com/

Documentation: http://docs.botframework.com/sdkreference/

Getting the latest version of Skype for Bot Support – http://www.skype.com/go/getskype-full
Bot Framework Directory http://dev.botframework.com see the Bot Directory tab

Bot FAQ http://docs.botframework.com/faq/#navtitle



Caption Bot http://www.captionbot.ai

Project Murphy Demo - http://www.projectmurphy.net/

Project Murphy why? http://www.projectmurphy.net/story

Comments (16)
  1. Ali Yurt says:

    Useful post! thanks for sharing.

  2. Lee Stott says:

    So since the launch of the BOT Framework just over a month ago – more than 20,000 developers have signed up and started developing BOTS. So many developers have contributed to enhancement suggestions and code contributions being made by the community to the Bot Framework open source Bot Builder SDKs available on GitHub. https://github.com/Microsoft/BotBuilder

    Here are few updates 3rd May 2016

    • The Bot Directory, the public directory of bots registered with Bot Framework, is now open to developers for bot submission and review. The Bot Directory itself isn’t live yet, but when it is available, users will be able to discover, try, and add bots to their favorite conversation experiences.
    • Beginning today, those favorite conversation experiences can include Facebook Messenger. With the addition of Facebook Messenger as a supported channel, now your text, image, card, and button capable bots can reach more people across an even broader variety of the world’s top conversation experiences – from Skype, to Slack to Text/SMS, Office 365 mail and more.

    Get those submissions going, and if you have any feedback, we’d love to hear it. https://feedback.botframework.com/

  3. Bhaskar says:

    Can we write the bot code in a language other than Node JS or .Net ?

    1. Amir Sasson says:

      Yes, As long as you maintain the rest api specific protocol

  4. Lee Stott says:

    Hi The following link is the best resources for Bot Framework and its regularly updated with the latest resources https://blogs.msdn.microsoft.com/smich/2016/09/30/microsoft-bot-framework-resources/

  5. tsahi says:

    I’ve been a .NET developer for some years now, and I’ve seen one or two (or more) SDK’s in my life. In the past two hours or so I’ve sipped through the Bot Framework docs, and for the life of me, I couldn’t figure out what this framework is all about. What benefit do I get from it? The only thing I could find is that I can build a single bot that will talk through multiple channels. Is that it? Is that what this whole framework does?
    I’m in the process of building a Skype for Business internal company bot, to provide some info to company employees. Is this framework something I should consider?

    1. Lee Stott says:

      What is the Microsoft Bot Framework?
      Microsoft Bot Framework is a comprehensive offering to build and deploy high quality bots for your users to enjoy in their favorite conversation experiences. Developers writing bots all face the same problems: bots require basic I/O; they must have language and dialog skills; they must be performant, responsive and scalable; and they must connect to users – ideally in any conversation experience and language the user chooses. Bot Framework provides just what you need to build, connect, manage and publish intelligent bots that interact naturally wherever your users are talking – from text/sms to Skype, Slack, Facebook Messenger, Kik, Office 365 mail and other popular services. see https://docs.botframework.com/en-us/support/

      1. Subramani says:

        @ Lee scott. Does this support Skype for business as a channel?

  6. aakash says:

    hi how we can store chat bot data into our custom storage.?? I am using node js.

    1. Lee Stott says:

      Hi your best looking at the following resources at https://docs.botframework.com/en-us/technical-faq/ and then asking a question on the MSDN forum at https://social.msdn.microsoft.com/Forum where one of the product team can answer this.

    2. MrSnoopy says:

      Did you find an answer for your question. I’d be interested in this also.

  7. Lee Stott says:

    Some training resources for BOT development https://github.com/Azure/bot-education

  8. Prakash says:

    BOT Connector and Channels – Are there any fees involved in using these connectors / channels as part of BOT Framework Developer portal? and If there are no fees, can we use them in our productive applications? The reason for asking the question, we have created a bot which is ready for deployment, but we are not sure whether to depend on BOT Connectors / Channels available in Developer portal for productive deployment. Hence, the question. If we cannot depend on the connectors available in developer portal, are there any alternate options?

    1. Lee Stott says:

      Hi Prakash

      Bots are free you only pay for the services which your BOT Consumes such as Microsoft Cognitive Services or Functions see https://azure.microsoft.com/en-us/pricing/details/bot-service/?v=17.23h

  9. Dan says:

    There’s an issue in the 2nd code example, line thirteen:

    if (message.Text=”Enter your command here”)

    This should be a comparison op, not an assignment.

Comments are closed.

Skip to main content