# Microsoft Agent Framework

> Build production AI agents and multi-agent workflows in Python and .NET

- Category: Agents & Automation / Agent Frameworks & Builders
- Language: Python, C#/.NET
- Repository: https://github.com/microsoft/agent-framework
- Website: https://learn.microsoft.com/en-us/agent-framework/
- Canonical page: https://ai-tldr.dev/tools/microsoft-agent-framework/

## In short

Microsoft Agent Framework (MAF) is an open, multi-language framework for building AI agents and multi-agent workflows in .NET and Python. It brings together ideas from Microsoft's earlier AutoGen and Semantic Kernel projects under one consistent set of APIs. It sits in the Agent Frameworks & Builders category of the Agents & Automation tools and is open-source, written in Python, C#/.NET.

## Overview

Microsoft Agent Framework (MAF) is an open, multi-language framework for building AI agents and multi-agent workflows in .NET and Python. It brings together ideas from Microsoft's earlier AutoGen and Semantic Kernel projects under one consistent set of APIs.

It is aimed at teams taking agents from prototype to production. MAF covers orchestration that goes beyond a single prompt or a stateless chat loop, with graph-based patterns such as sequential, concurrent, handoff, and group collaboration, plus features like checkpointing, observability, and human-in-the-loop control.

As an app framework, it keeps provider choices open. It supports a broad ecosystem including Microsoft Foundry, Azure OpenAI, OpenAI, and the GitHub Copilot SDK, so the architecture can change as requirements evolve without major rewrites.

## What it does

- Consistent APIs across both Python and C#/.NET
- Graph-based orchestration: sequential, concurrent, handoff, and group collaboration patterns
- Checkpointing, streaming, human-in-the-loop, and time-travel for workflows
- Middleware system for request/response processing, exception handling, and custom pipelines
- Built-in OpenTelemetry integration for distributed tracing and debugging
- Declarative agents defined in YAML, plus a DevUI for testing and debugging

## Getting started

Install the framework for your language, then build a basic agent. The Python quickstart uses Microsoft Foundry and authenticates with the Azure CLI.

1. Install (Python)

   Install the meta-package, which pulls in all sub-packages. First install on Windows can take a minute.

```bash
pip install agent-framework
```

2. Install (.NET)

   Add the core package, plus the Foundry and Azure packages used in the .NET quickstart.

```bash
dotnet add package Microsoft.Agents.AI
# For Foundry integration:
dotnet add package Microsoft.Agents.AI.Foundry
dotnet add package Azure.AI.Projects
dotnet add package Azure.Identity
```

3. Authenticate with Azure

   The Python quickstart authenticates against Microsoft Foundry using the Azure CLI before running the agent.

```bash
az login
```

4. Create a basic agent (Python)

   Build a chat agent backed by Microsoft Foundry. The endpoint, deployment name, and API version can be set via environment variables or passed to FoundryChatClient directly.

```python
import asyncio
from agent_framework import Agent
from agent_framework.foundry import FoundryChatClient
from azure.identity import AzureCliCredential

async def main():
    agent = Agent(
        client=FoundryChatClient(
            credential=AzureCliCredential(),
        ),
    )

asyncio.run(main())
```

## When to use it

- Taking a prototype agent into production with durability, restartability, and observability
- Coordinating several agents with graph workflows (sequential, concurrent, handoff, or group collaboration)
- Adding human-in-the-loop checkpoints to an agent pipeline before actions are taken
- Keeping provider choice open across Microsoft Foundry, Azure OpenAI, and OpenAI as needs change
