Edit

AI Integrations

This article is not available for the selected development language.

Note

Our AI libraries are deprecated: The Teams SDK has deprecated its own AI libraries — the @microsoft/teams.ai packages (ChatPrompt, Model, and the older @microsoft/teams.mcp / @microsoft/teams.a2a plugins) — in favor of dedicated AI frameworks. Use the pattern shown in these guides instead: bring the OpenAI SDK (or any framework you like), and wire MCP and A2A directly into your Teams app.

Microsoft Teams SDK provides the platform and conversational interface for your app while remaining agnostic to the underlying intelligence. You can choose any AI framework, model, or protocol that suits your scenario and integrate it into your message handlers. The samples below walk through a few common ways to do that, from a single bot reasoning with an agent to multiple bots collaborating with each other.

  • Build an agent in Teams - create an agent with the OpenAI SDK and Azure OpenAI, add a local clarification tool and remote MCP tool servers, stream responses into Teams, and preserve conversation history across turns.
  • Enhancing the Teams Experience - build on the base integration with richer conversational features: clarification cards, suggested follow-up prompts, inline citations, and structured feedback handling.
  • Exposing Teams to AI Agents (MCP) turn your bot into an MCP server so external agents can reach real users through Teams chat with tools like notify, ask, and request_approval. Useful for human-in-the-loop workflows.
  • Bot-to-Bot with A2A two Teams bots, each with its own agent and human operator, coordinate with each other over the Agent2Agent protocol, with human-in-the-loop (HITL) support when peer requests require human input.

All samples are available in the microsoft/teams.ts examples.

Microsoft Teams SDK provides the platform and conversational interface for your app while remaining agnostic to the underlying intelligence. You can choose any AI framework, model, or protocol that suits your scenario and integrate it into your message handlers. The samples below walk through a few common ways to do that, from a single bot reasoning with an agent to multiple bots collaborating with each other.

  • Building an agent using Microsoft Agent Framework in Teams - creates the core agent and basic Teams integration, adds local and remote MCP tools, streams responses into Teams, and maintains per-conversation memory using sessions.
  • Enhancing the Teams Experience using Teams SDK - builds on the base integration by adding richer conversational features such as suggested follow-up prompts, inline citations, Adaptive Cards, and structured feedback handling.
  • Exposing Teams to AI Agents (MCP) turn your bot into an MCP server so external agents can reach real users through Teams chat with tools like notify, ask, and request_approval. Useful for human-in-the-loop workflows.
  • Bot-to-Bot with A2A two Teams bots, each with its own agent and human operator, coordinate with each other over the Agent2Agent protocol, with human-in-the-loop (HITL) support when peer requests require human input.

All samples are available in the microsoft/teams.py examples.