microsoft/agent-framework
Python
Captured source
source ↗microsoft/agent-framework
Description: A framework for building, orchestrating and deploying AI agents and multi-agent workflows with support for Python and .NET.
Language: Python
License: MIT
Stars: 11233
Forks: 1880
Open issues: 670
Created: 2025-04-28T19:40:42Z
Pushed: 2026-06-11T00:43:54Z
Default branch: main
Fork: no
Archived: no
README: 
Welcome to Microsoft Agent Framework!

Microsoft Agent Framework (MAF) is an open, multi-language framework for building production-grade AI agents and multi-agent workflows in .NET and Python.
Microsoft Agent Framework is built for teams taking agents from prototype to production. It provides a consistent foundation for building, orchestrating, and operating agent systems across Python and .NET, while keeping architecture choices open as requirements evolve, and supports a broad ecosystem including Microsoft Foundry, Azure OpenAI, OpenAI, and the GitHub Copilot SDK, with samples and hosting patterns for both local development and cloud deployment.
Watch the full Agent Framework introduction (30 min)
Is this the right framework for you?
MAF is a strong fit if you:
- are building agents and workflows you expect to run in production,
- need orchestration beyond a single prompt or stateless chat loop,
- want graph-based patterns such as sequential, concurrent, handoff, and group collaboration,
- care about durability, restartability, observability, governance, or human-in-the-loop control,
- need provider flexibility so your architecture can evolve without major rewrites.
Key Features
Explore new MAF capabilities and real implementation patterns on the official blog.
- Python and C#/.NET Support: Full framework support for both Python and C#/.NET implementations with consistent APIs
- [Python packages](./python/packages/) | [.NET source](./dotnet/src/)
- Multiple Agent Provider Support: Support for various LLM providers with more being added continuously
- [Python examples](./python/samples/02-agents/providers/) | [.NET examples](./dotnet/samples/02-agents/AgentProviders/)
- Middleware: Flexible middleware system for request/response processing, exception handling, and custom pipelines
- [Python middleware](./python/samples/02-agents/middleware/) | [.NET middleware](./dotnet/samples/02-agents/Agents/Agent_Step11_Middleware/)
- Orchestration Patterns & Workflows: Build multi-agent systems with graph-based workflows supporting sequential, concurrent, handoff, and group collaboration patterns; includes checkpointing, streaming, human-in-the-loop, and time-travel
- [Python workflows](./python/samples/03-workflows/) | [.NET workflows](./dotnet/samples/03-workflows/)
- Foundry Hosted Agents (new): Deploy and host your agents to Foundry-hosted infrastructure with just 2 additional lines of code
- [Python samples](./python/samples/04-hosting/foundry-hosted-agents/) | [.NET samples](./dotnet/samples/04-hosting/FoundryHostedAgents/)
- Observability: Built-in OpenTelemetry integration for distributed tracing, monitoring, and debugging
- [Python observability](./python/samples/02-agents/observability/) | [.NET telemetry](./dotnet/samples/02-agents/AgentOpenTelemetry/)
- Declarative Agents: Define agents using YAML for faster setup and versioning
- [Declarative agent samples](./declarative-agents/)
- Agent Skills: Build domain-specific knowledge bases from multiple sources—files, inline code, class libraries—for agents to discover and use
- [Skills design](./docs/decisions/0021-agent-skills-design.md)
- AF Labs: Experimental packages for cutting-edge features including benchmarking, reinforcement learning, and research initiatives
- [Labs directory](./python/packages/lab/)
- DevUI: Interactive developer UI for agent development, testing, and debugging workflows
- See the DevUI in action
Table of Contents
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Learning Resources](#learning-resources)
- [Quickstart](#quickstart)
- [Basic Agent - Python](#basic-agent---python)
- [Basic Agent - .NET](#basic-agent---net)
- [More Examples & Samples](#more-examples--samples)
- [Community & Feedback](#community--feedback)
- [Troubleshooting](#troubleshooting)
- [Contributor Resources](#contributor-resources)
Getting Started
Installation
Python
pip install agent-framework # This will install all sub-packages, see `python/packages` for individual packages. # It may take a minute on first install on Windows.
.NET
dotnet add package Microsoft.Agents.AI # For Foundry integration (used in the .NET quickstart below): dotnet add package Microsoft.Agents.AI.Foundry dotnet add package Azure.AI.Projects dotnet add package Azure.Identity
Learning Resources
- [Overview](https://learn.microsoft.com/agent-framework/overview/agent-framework-overview) - High level overview of the framework
- [Quick Start](https://learn.microsoft.com/agent-framework/tutorials/quick-start) - Get started with a simple agent
- [Tutorials](https://learn.microsoft.com/agent-framework/tutorials/overview) - Step by step tutorials
- [User Guide](https://learn.microsoft.com/en-us/agent-framework/user-guide/overview) - In-depth user guide for building agents and workflows
- [Migration from Semantic Kernel](https://learn.microsoft.com/en-us/agent-framework/migration-guide/from-semantic-kernel) - Guide to migrate from Semantic Kernel
- [Migration from AutoGen](https://learn.microsoft.com/en-us/agent-framework/migration-guide/from-autogen) - Guide to migrate from AutoGen
Quickstart
Basic Agent - Python
Create a simple Azure Responses Agent that writes a haiku about the Microsoft Agent Framework
# pip install agent-framework # Use `az login` to authenticate with Azure CLI import os import asyncio from agent_framework import Agent from agent_framework.foundry import FoundryChatClient from azure.identity import AzureCliCredential async def main(): # Initialize a chat agent with Microsoft Foundry # the endpoint, deployment name, and api version can be set via environment variables # or they can be passed in directly to the FoundryChatClient…
Excerpt shown — open the source for the full document.
Notability
notability 8.0/10Major framework launch with high community traction.