Bot overview

Bots are software applications that interact with users through text-based conversations. Bots follow predefined rules to answer questions or do specific tasks. AI-powered bots use artificial intelligence to understand natural language, have complex conversations, and handle more tasks. Bots can be as simple as basic scripts or as advanced as AI systems that learn and adapt. You can build Teams bots as virtual assistants in Microsoft Teams and Microsoft 365.

Bot apps offer a range of business advantages:

  1. Automation: Bots handle repetitive tasks, saving you time and effort.
  2. Availability: Bots work round-the-clock without needing breaks.
  3. Efficiency: Bots manage multiple tasks simultaneously, improving overall efficiency.
  4. Customer engagement: Bots interact with customers and provide instant responses and support.
  5. Scalability: Bots can be scaled to handle more tasks or interactions as user needs evolve.

How do bots work?

A Teams bot works by following a set of rules or using AI to understand and respond to user requests. When a user sends a message to a bot, it processes the input, determines the user need, and then provides a response or performs an action.

Here's an example of a simple bot on Teams that takes short commands from a user:

Graphical representation shows the user experience in a chat bot.

Bots - the developer experience

Let's consider an example: As a developer, you must build a bot to automate repetitive tasks and enhance efficiency and user engagement. The following image shows how you can build a bot app to meet the user requirements:

Image shows developer experience for a chatbot.

Understand bot development basics

Let's learn about some common bot elements and how they work together to make a bot effective within Teams.

  • Activity handler: This component manages and processes events or activities generated by users interacting with the bot. These activities can include text or image messages, bot events like users joining or leaving, @mentions, user actions such as booking or ordering through the bot, and handling errors.
  • Event: This is an occurrence that's triggered when a user interacts with a bot. An event can make a bot respond or take action. For example, an event can occur when a user sends a message, clicks a button, or shares an input.
  • Conversation: This is an interactive exchange between a user and a bot. A conversation can include text or voice messaging. It involves user inputs, the bot's responses, the context of the conversation such as history and state, the intent of the conversation (the user's goal or purpose), and dialog that can be a multi-turn exchange.
  • Bot logic: It's a key part of conversation logic. It works alongside the activity handler to define how decisions are made. This includes integrating rules, conditions, and other factors to determine how the bot must respond.
  • Bot scope: This refers to what a bot can do and how it interacts with users within Microsoft Teams. A bot can be deployed in Teams in three ways: as a personal chatbot, within a group chat, or within a channel.

Explore bot capabilities

You can choose one or more of the following capabilities for your bot app. Use either Bot Framework SDK or Teams AI library with Teams Toolkit to build these capabilities in your bot.

  • Custom engine agent: A custom engine agent is a bot that uses AI to perform automated tasks. It understands natural language, can engage in conversations, and answer questions. You can use them for virtual assistance, language translation, predictive analysis, and more. Custom engine agents, which are AI-enabled Teams bots, can be built using custom AI models of your choice.

    For more information, see build a custom engine agent.

  • Conventional bots:

    • Conversational bot: A conversational bot simulates interactions with users, allowing them to engage with a web service through text, interactive cards, and dialogs. It understands user input and responds accordingly, making it useful for virtual assistance, customer service, and more.

      For more information, see create Teams conversation bot.

    • Notification bot: A notification bot is an automated tool that sends alerts to users in Teams channels, group chats, or personal chats. Use a notification bot for sending reminders, alerts, or updates. Users can also interact with the bot by responding to options or links within the notification or by providing feedback.

      For more information, see build notification bot with JavaScript.

    • Workflow bot: A workflow bot automates and streamlines business processes by interacting with users, applications, and data to manage tasks and workflows. Use a workflow bot to automate repetitive tasks, assign work, track progress, and more to improve efficiency by reducing manual effort.

      For more information, see build workflow bot with JavaScript.

    • Command bot: Use a command bot to automate responses for simple commands in a chat. With Teams Toolkit, you can create a command bot template that displays the UI using an Adaptive Card.

      For more information, see build command bot with JavaScript.

Next step