Microsoft 365 Agents SDK for .NET reference

Version 1.6.150

The Microsoft 365 Agent SDK simplifies building full stack, multichannel, trusted agents for platforms including Microsoft 365, Teams, Copilot Studio, and Web chat. We also offer integrations with third parties such as Facebook Messenger, Slack, or Twilio. The SDK provides developers with the building blocks to create agents that handle user interactions, orchestrate requests, reason about responses, and collaborate with other agents.

The Agents SDK is a comprehensive framework for building enterprise-grade agents, enabling developers to integrate components from the Azure AI Foundry SDK, Semantic Kernel, and AI components from other vendors.

For more information, see the Microsoft 365 Agents SDK documentation.

Getting started

Sample code is a great way to get started. Look at these samples located at https://github.com/microsoft/Agents/tree/main/samples/dotnet

Name Description Location
QuickStart/Empty Agent Simplest agent samples/dotnet/quickstart
AutoSignIn Simple OAuth agent using Graph samples/dotnet/auto-signin
OBOAuthorization OBO to Copilot Studio Agent samples/dotnet/obo-authorization
Semantic Kernel WeatherAgent which demonstrates a multi-turn AI interaction samples/dotnet/semantic-kernel-multiturn
Streaming Agent Streams OpenAI responses samples/dotnet/azure-ai-streaming
Copilot Studio Client Console app to consume a Copilot Studio Agent samples/dotnet/copilotstudio-client
Copilot Studio Skill Call the echo bot from a Copilot Studio skill samples/dotnet/copilotstudio-skill
RetrievalBot Sample with Semantic Kernel A simple Retrieval Agent that is hosted on an Asp.net core web service. samples/dotnet/RetrievalBot
MultiAgent Demonstrates multiple AgentApplication in the same host samples/dotnet/multiagent
GenesysHandoff Demonstrates how a Microsoft Copilot Studio Agent can hand off a conversation to a live agent in Genesys Cloud. samples/dotnet/genesys-handoff
Proactive Demonstrates the basics of a proactive conversation using in-code and HTTP triggers. samples/dotnet/proactive
OpenTelemetry Agent Configures OTel tracing, metrics, and logging with OTLP export samples/dotnet/otel
Agent Framework Weather agent built with Microsoft Agent Framework SDK samples/dotnet/Agent Framework
Copilot SDK Dungeon Scribe RPG agent powered by the GitHub Copilot SDK samples/dotnet/copilot-sdk
Named Pipe Agent Pipe-only echo agent for the DirectLine App Service extension (DirectLineFlex) samples/dotnet/named-pipe-agent

Packages Overview

We offer the following NuGet packages to create conversational experiences based on agents:

Package Description
Microsoft.Agents.Core Contains the Activity Protocol models and core interfaces used throughout the Microsoft 365 Agents SDK. The Activity Protocol defines the standard message format for agent communication across channels and platforms.
Microsoft.Agents.Storage Provides the storage abstraction layer for the Microsoft 365 Agents SDK. Because agents are stateless by design, this package enables conversation and user state to be persisted across turns.
Microsoft.Agents.Authentication Defines core authentication and token retrieval abstractions for the Microsoft 365 Agents SDK. Supports named, configuration-driven connections to different token providers.
Microsoft.Agents.Connector Contains the client implementation for the Azure Bot Service Channel API and Token API. Used internally by the SDK to send and receive activities through Azure Bot Service channels.
Microsoft.Agents.Builder The primary package for building agents with the Microsoft 365 Agents SDK. Provides the AgentApplication routing framework, middleware pipeline, and turn context model for handling conversational activities across channels and platforms.
Microsoft.Agents.Storage.Transcript Transcript storage for the Microsoft Agents SDK

Project requirements

Projects must target .NET 8.0 or later