Chapter 2C
Microsoft Agent Framework
Static reading edition generated from the Microsoft Agent Framework notebook.
Workshop (Setup) - Microsoft Agent Framework
Microsoft Agent Framework (MAF) is an open-source, code-first framework from Microsoft for building AI agents and multi-agent workflows in .NET and Python.
MAF is designed for production-grade agentic systems:
- Supported by Microsoft with active engineering investment across the Foundry ecosystem
- Unified agent abstraction across providers such as Azure OpenAI, OpenAI, Anthropic, and Ollama
- Built-in support for tools, MCP servers, sessions, middleware, and telemetry
- First-class workflow orchestration for deterministic, multi-step processes
- Open-source development with public releases, issues, and migration guidance
MAF is an AI orchestration layer between your application experiences and model providers.
It provides two complementary execution modes:
- Agents for dynamic, LLM-driven reasoning and tool use
- Workflows for explicit, graph-based control flow with checkpoints and human-in-the-loop support
This combination lets you blend flexible agent behavior with deterministic process control in one architecture.
How MAF Builds on Microsoft.Extensions.AI (MEAI)¶
MAF extends the MEAI foundation instead of replacing it.
- Shared model abstractions: MEAI standardizes model interaction (for example through
IChatClient), while MAF adds agent and workflow orchestration on top. - Dependency injection patterns: MAF aligns with familiar
Microsoft.Extensions.*host and service registration patterns used across .NET apps. - Middleware composition: MEAI middleware concepts (telemetry, caching, resilience, safety) map naturally into MAF agent/workflow middleware pipelines.
- Provider portability: both MEAI and MAF are designed to reduce provider lock-in and support interchangeable model backends.
- Operational observability: MAF runtime events and tracing can be integrated with the same OpenTelemetry-first operating model commonly used with MEAI.
A typical MAF pipeline combines key building blocks:
- AIAgent / Agent abstractions for provider-agnostic execution
- Executors and edges to model multi-agent workflow paths
- Agent sessions to manage conversation state
- Context providers and tools to ground decisions with memory and external capabilities
- Events and middleware for observability, safety, and operational controls
These building blocks make it practical to move from prototype agent interactions to enterprise decision orchestration.
Microsoft Agent Framework Resources¶
- GitHub Repo: https://github.com/microsoft/agent-framework (.NET, Python)
- Microsoft Learn Overview: https://learn.microsoft.com/en-us/agent-framework/overview/
- Get Started Tutorial: https://learn.microsoft.com/en-us/agent-framework/get-started/
- Agent Types: https://learn.microsoft.com/en-us/agent-framework/agents/
- Workflows Overview: https://learn.microsoft.com/en-us/agent-framework/workflows/
- Migration Guide from Semantic Kernel: https://learn.microsoft.com/en-us/agent-framework/migration-guide/from-semantic-kernel/
- Migration Guide from AutoGen: https://learn.microsoft.com/en-us/agent-framework/migration-guide/from-autogen/
- Introducing Microsoft Agent Framework (Microsoft Foundry Blog): https://devblogs.microsoft.com/foundry/introducing-microsoft-agent-framework-the-open-source-engine-for-agentic-ai-apps/
- Introducing Microsoft Agent Framework Preview (.NET Blog): https://devblogs.microsoft.com/dotnet/introducing-microsoft-agent-framework-preview/
- Microsoft.Extensions.AI Libraries Overview: https://learn.microsoft.com/en-us/dotnet/ai/microsoft-extensions-ai
- Introducing Microsoft.Extensions.AI Preview (.NET Blog): https://devblogs.microsoft.com/dotnet/introducing-microsoft-extensions-ai-preview/