Microsoft 365 Agents SDK for .NET

repository·main·Indexed 41 days ago

https://github.com/microsoft/agents-for-net

A framework for building full-stack, multichannel, enterprise-grade agents for platforms like M365, Teams, and Copilot Studio. It enables developers to orchestrate requests, reason responses, and integrate with Azure AI Foundry, Semantic Kernel, and other AI components. The SDK includes libraries for Entra ID authentication via MSAL or sidecar providers, Bot Framework dialog integration, and a testing framework featuring AgentTestHost and semantic validation.

Tokens
61.8K
Snippets
118
Records
257
Agent score
52%

What's inside Microsoft 365 Agents SDK for .NET

  1. Overview of Microsoft.Agents.Extensions.Teams

    main

    The Microsoft.Agents.Extensions.Teams library provides specialized extensions for the Microsoft 365 Agents SDK to enable integration with Microsoft Teams. It provides the necessary data models and helper utilities to handle Teams-specific interactions within agent turns.

    Key capabilities include:

    • Teams Activity Models: Access to Teams-specific activity models, channel data, and card types.
    • Teams Context Access: Using TeamsInfo to retrieve roster, meeting, and channel information.
    • Bot Framework Migration: A TeamsActivityHandler compatibility base class designed to simplify the migration of existing bots from the Bot Framework SDK to the Microsoft 365 Agents SDK.
  2. Overview of Microsoft.Agents.Builder

    main

    The Microsoft.Agents.Builder package is the primary library for building agents using the Microsoft 365 Agents SDK. It provides the core infrastructure required to handle conversational activities, including:

    • Routing Framework: Uses AgentApplication to route incoming activities to the appropriate handlers.
    • Middleware Pipeline: Allows for intercepting and processing activities through a pipeline.
    • Turn Context Model: Provides a standardized way to access activity data, channel information, and services during a conversational turn.
  3. Overview of the Teams API Drift Detector

    main

    The Teams API Drift Detector is a .NET command-line application located in scripts/TeamsApiDrift. Its purpose is to identify API changes between two versions of the Microsoft.Teams.Apps NuGet package and determine if the MSTeams extension is affected by those changes.

    It produces deterministic findings for maintainers and can optionally generate bounded context for AI coding assistants (like Copilot CLI) to provide advisory reports. The tool operates by reading NuGet package metadata without loading the actual package assemblies into the running process, ensuring safety and speed.

  4. Overview of Microsoft.Agents.Builder.Testing

    main
    The Microsoft.Agents.Builder.Testing library provides utilities for unit testing agents built with the Microsoft 365 Agents SDK. It allows developers to simulate conversations by sending activities to an agent and asserting on the agent's replies. It supports both standard assertions and optional AI-based semantic validation for more flexible testing.
  5. Use Azure Cosmos DB for persistent conversation state storage

    main

    The Microsoft.Agents.Storage.CosmosDb package provides an implementation of the IStorage interface for the Microsoft 365 Agents SDK. Use this when you need a production-ready, globally distributed storage solution for conversation state.

    It is implemented via CosmosDbPartitionedStorage, which supports partition keys to ensure scalability within Azure Cosmos DB.

  6. Use Microsoft.Agents.CopilotStudio.Client to interact with Copilot Studio agents

    main

    The Microsoft.Agents.CopilotStudio.Client library allows .NET applications to start and manage conversations with agents built in Microsoft Copilot Studio via the conversational channel.

    Prerequisites

    To use this client, your Entra ID app registration must have the CopilotStudio.Copilots.Invoke API permission.

    Authentication

    The client supports both:

    • User-based (delegated) authentication flows.
    • Service principal (application) authentication flows.