Agent Framework

Frameworks & SDKs 💻 Python ⚖️ MIT 🟢 Actively maintained
13.3k stars

Microsoft Agent Framework (MAF) is an open-source, multi-language framework for building production-grade AI agents and multi-agent workflows in .NET and Python. It provides consistent APIs, orchestration patterns, and observability to help teams move from prototype to production. It is designed for developers who need durable, scalable agent systems with provider flexibility.

Agent Framework: Building Blocks for the Next Generation of AI Agents

🎬 Agent Framework: Building Blocks for the Next Generation of AI Agents · Microsoft Developer

✨ Key features

  • Python and C#/.NET support with consistent APIs
  • Multiple LLM provider support including Azure OpenAI and OpenAI
  • Graph-based orchestration: sequential, concurrent, handoff, group collaboration
  • Built-in OpenTelemetry for distributed tracing and monitoring
  • Declarative agent definition using YAML
  • Agent Skills for domain-specific knowledge bases

🎯 Use cases

  • Build production-grade AI agents with durable execution and human-in-the-loop
  • Orchestrate multi-agent workflows with patterns like handoff and group chat
  • Deploy agents to Microsoft Foundry hosted infrastructure with minimal code
  • Integrate agents with Azure AI services and GitHub Copilot SDK
  • Create custom agent pipelines with middleware for logging and exception handling

📦 Installation

🧰 Requirements: Requires Python 3.x or .NET SDK, and optionally an Azure subscription with Foundry or Azure OpenAI for cloud services.

Python

pip install agent-framework

.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

🚀 Usage

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(),
        ),
        name="HaikuAgent",
        instructions="You are an upbeat assistant that writes beautifully.",
    )
    print(await agent.run("Write a haiku about Microsoft Agent Framework."))

if __name__ == "__main__":
    asyncio.run(main())

.NET

using Azure.AI.Projects;
using Azure.Identity;
using Microsoft.Agents.AI;

string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set.");
string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-5.4-mini";

AIAgent agent = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())
    .AsAIAgent(model: deploymentName, instructions: "You are an upbeat assistant that writes beautifully.", name: "HaikuAgent");

Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agen

⚠️ Good to know

The README notes that using third-party systems is at your own risk and that you are responsible for testing and implementing responsible AI mitigations.

❓ FAQ

What languages are supported?

Python and C#/.NET are fully supported, with Go support available via a separate repository (microsoft/agent-framework-go).

How do I authenticate with Azure?

Use az login to authenticate with Azure CLI, or use DefaultAzureCredential in your code. For production, consider using a specific credential like ManagedIdentityCredential.

Can I use models other than Azure OpenAI?

Yes, the framework supports multiple LLM providers, including OpenAI and others, with more being added continuously.

Is there a way to define agents declaratively?

Yes, you can define agents using YAML for faster setup and versioning, as shown in the declarative-agents samples.

📊 Repository

Stars★ 13,341
Forks🍴 2,262
Open issues🐛 633
Last commit🕒 Sep 4, 2026
Created📅 Apr 2025
Language💻 Python
License⚖️ MIT

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.