Back to contents

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