With the Microsoft 365 Agents SDK, you can create agents deployable to channels of your choice, such as Microsoft 365 Copilot, Microsoft Teams, Web & Custom Apps and more, with scaffolding to handle the required communication. Developers can use the AI Services of their choice, and make the agents they build available using the channel management capabilities of the SDK.
Key features of the Agents SDK
Developers need the flexibility to integrate agents from any provider or technology stack into their enterprise systems. The Agents SDK simplifies the implementation of agentic patterns using the AI of their choice, allowing them to select one or more services, models, or agents to meet their specific requirements.
Use the Agents SDK to:
- Quickly build an agent 'container' with state, storage, and the ability to manage activities and events. Deploy this container across any channel, such as Microsoft 365 Copilot or Microsoft Teams.
- Implement agentic patterns without being restricted to a specific technology stack. The Agents SDK is agnostic regarding the AI you choose.
- Customize your agent to align with the specific behaviors of clients, such as Microsoft Teams.
Supported languages
The Agents SDK supports:
- C# using the .NET 8.0 SDK
- JavaScript using Node.js version 18 and above
- Python 3.9 to 3.11
Create an agent
It is easy to get the starter sample in C#, JavaScript, or Python from Github
To create an agent in C#:
builder.AddAgent( sp =>
{
var agent = new AgentApplication(sp.GetRequiredService<AgentApplicationOptions>());
agent.OnActivity(ActivityTypes.Message, async (turnContext, turnState, cancellationToken) =>
{
var text = turnContext.Activity.Text;
await turnContext.SendActivityAsync(MessageFactory.Text($"Echo: {text}"), cancellationToken);
});
});
This creates a new agent, listens for a message type activity and sends a message back
From here, you can add your chosen custom AI Services (e.g Azure Foundry or OpenAI Agents) & Orchestration (e.g. Semantic Kernel).
Important terms
Some specific concepts that are important to the SDK are:
Turns
- A turn is a unit of work that is done by the agent. It can be a single message or a series of messages. Developers will work with 'turns' and manage the data between themActivity
- An activity is one or more type of unit that is managed by the agentMessages
- A message is a type of activity that is sent to the agent. It can be a single message or a series of messages.
Get Started
Before you get started, you need to take care of some prerequisites. The prerequisites depend on the language you are using to develop your application.
- .NET 8.0 SDK
- Bot Framework Emulator
- Knowledge of ASP.NET Core and asynchronous programming in C#
Download and install
Download the files needed to get started.
To get started with C#/.NET, clone the Agents GitHub repo repo locally. The repo contains SDK source libraries and samples to help you get started building applications using the SDK. Installing the samples installs needed packages for the SDK.