Freigeben über


What is the Microsoft 365 Agents SDK (preview)?

[This article is prerelease documentation and is subject to change.]

The Microsoft 365 Agents SDK is used to build self-hosted agents. It's a collection of libraries and tools that allow you to build an agent in code. The SDK facilitates communication between a client and one or more agents by handling the conversation between them. The SDK provides an easy path to incorporate Microsoft AI services, such as Graph, Azure OpenAI, and non-Microsoft AI services.

With this framework, you can create agents deployable to a channel of your choice, with scaffolding to handle the required communication. Developers can also use numerous generative AI services that are secure and compliant, available on any required channel using the Azure Bot Service to facilitate the hosting and adapters.

Supported languages

The Agents SDK is currently in Public Preview and supports C# using the .NET 8.0 SDK only. Support for Python and Node.js is coming soon.

What is an agent?

In the past, conversational AI primarily answered frequently asked questions from employees or customers using natural language understanding (NLU) technology. NLU can understand, interpret, and direct logic to generate the right responses based on the identified utterance or intent.

Now, generative AI provides a quicker and simpler way to respond to questions using large language models. Generative AI generates outputs based on the input to the model and the nature of the underlying foundation model. You can tailor the output of generative AI through fine-tuning and prompt engineering.

You can see this experience in Microsoft 365 Copilot. Supported with business data via the Microsoft Graph or internet sources, Microsoft 365 Copilot generates grounded answers to a user’s questions. Organizations can create copilot agents that extend the behavior and functionality of Microsoft 365 Copilot using the embedded builder or Microsoft Copilot Studio, or create standalone agents.

There are various routes to creating a standalone agent. One option is the Agents SDK.

The Agents SDK provides the scaffolding required to manage communication (typically via messages), channel management, and deployment capabilities using the activity protocol.

What is the activity protocol?

The activity protocol allows for agent logic and middleware logic to run agnostic to the channel it exists on. The protocol brokers communications and translate messages to a common set of libraries. Events and messages are routed to where they need to go, at the right time. Learn more information about the activity protocol in How an agent works in the Microsoft 365 Agents SDK.

Agents SDK components

Agents built with the Agents SDK make use of several components:

  • Agents SDK for developing agents in C#
  • Bot Connector Service, which relays messages and events between agents and channels
  • Azure resources for agent management and configuration

Additionally, agents can use other Azure services, such as:

  • Azure AI services to build intelligent applications
  • Azure Storage for cloud storage solution

Add AI services to your agent with the Agents SDK

You can add AI services to your agent, such as Semantic Kernel and Azure OpenAI API. The Agents SDK makes adding services easy by providing samples you can follow.

How to build an agent with the Agents SDK

You can start using the Agents SDK in C#. Python and Node.js support is coming soon. Start developing using Visual Studio or Visual Studio Code.

Plan your middleware and agent logic

Having a thorough understanding of goals, processes, and user needs helps you create a successful agent. You can create a basic agent or add more sophisticated capabilities such as speech, natural language understanding, and question answering using the services of your choosing.

Get started building with the Agents SDK

You can get started with the core files using the Agents SDK samples, which demonstrate the SDK's capabilities. Learn more about creating and testing an agent in Create and test a basic agent.

With Azure AI Bot Service and the Agents SDK, you can use other libraries and services to extend your agent's functionality.

Test your agent

Once you plan and build your agent, test it out. Initially, you can test locally, and then test it out in the planned channel of choice.

Agents can have many different parts working together. Before publishing, test your agent. We provide several ways to test agents before they're released for use:

  • Unauthenticated testing using the Bot Framework Emulator.
  • Authenticated local testing using Dev Tunnels.
  • Test your agent in the chosen channel in a developer environment. Learn more in Test your agent. Once configured through the Azure portal, your agent can also be reached through a web chat interface. The web chat interface is a great way to grant access to your agent to testers and other people who don't have direct access to the agent's running code.

Connect to a channel to publish

Connect your agent to channels, such as Facebook, Messenger, Slack, Microsoft Teams, Telegram, and Short Messaging Service (SMS) via Twilio. The Agents SDK does most of the work necessary to send and receive messages from the different platforms. Your agent application receives a unified, normalized stream of messages regardless of how many channels you're connected to and what types.

Evaluate

Use the data collected in the Azure portal to identify opportunities to improve the capabilities and performance of your agent. You can get service-level and instrumentation data like traffic, latency, and integrations. Analytics also provides conversation-level reporting on user, message, and channel data.