Back to blog

Microsoft Agent Framework Architecture Diagram: AutoGen + Semantic Kernel Unified (2026)

How to diagram Microsoft Agent Framework systems — the 1.0 GA SDK unifying AutoGen and Semantic Kernel. Covers chat clients, graph workflows, the Agent Harness, CodeAct, and hosted agents, with prompt templates.

R
Ryan·Senior AI Engineer
·

Microsoft Agent Framework (MAF) reached 1.0 general availability on April 2, 2026, converging two previously separate projects — AutoGen (simple multi-agent abstractions, popular for research and prototyping) and Semantic Kernel (enterprise features like session-based state management, type safety, middleware, and telemetry) — into a single open-source SDK. Rather than choosing between a lightweight research framework and an enterprise-grade kernel, teams now get one runtime with matching APIs across .NET and Python.

A Microsoft Agent Framework architecture diagram needs to communicate more than "an agent calls a model." MAF systems typically span chat clients, tool and MCP integrations, context providers, middleware chains, graph-based multi-agent workflows, and — increasingly — a distinct execution boundary called the Agent Harness where reasoning meets real-world side effects. This guide covers the core building blocks, the CodeAct execution pattern, hosted deployment options, and prompt templates for generating MAF diagrams in seconds.

From two frameworks to one

Before 1.0, teams building on Microsoft's agent stack had to pick a lane. AutoGen offered a fast, conversational multi-agent abstraction well suited to research and rapid prototyping, but lacked the durability and governance features enterprises needed in production. Semantic Kernel offered exactly those enterprise features — structured session state, strong typing, pluggable middleware, first-class telemetry — but with a steeper API surface. Microsoft Agent Framework replaces both with a single SDK that keeps AutoGen's simple agent-authoring ergonomics while inheriting Semantic Kernel's production-hardened primitives underneath. Because the API surface matches across .NET and Python, an architecture diagram for a MAF system looks the same regardless of which language a given service is implemented in — the boxes and arrows represent the same concepts either way.

Core architectural building blocks

Chat clients

The chat client is the abstraction over the underlying model provider — Azure OpenAI, OpenAI, or any other chat-completion-style endpoint. It normalizes request/response handling so the rest of the agent code is provider-agnostic. In a diagram, show the chat client as the single point of contact between an agent and its model, with the model deployment (name, region, provider) labeled explicitly.

Tools and MCP integrations

Tools are functions an agent can invoke — internal business logic, REST calls, database queries. MAF treats the Model Context Protocol (MCP) as a first-class tool source: an agent can attach to one or more MCP servers and expose their tools to the model without hand-writing wrappers for each one. Diagram MCP servers as distinct external nodes connected to the agent through an MCP client boundary, separate from natively defined in-process tools — the trust and network boundary is different even though both appear as "tools" to the model.

Context providers

Context providers supply an agent with retrieved or computed context before each turn — conversation memory, retrieved documents, user profile data. They sit between the incoming request and the chat client call, and should be drawn as a distinct pipeline stage rather than folded into "the agent," since context providers are commonly swapped independently (e.g., replacing a simple in-memory history provider with a vector-backed retrieval provider).

Middleware

Middleware wraps agent execution with cross-cutting concerns — logging, retries, content filtering, rate limiting — inherited from Semantic Kernel's pipeline model. Middleware is composable and ordered, so a diagram of a single agent's request path should show middleware as a labeled chain (e.g., auth → rate limit → telemetry → the agent's core logic) rather than a single opaque box.

Graph-based workflows

For multi-agent systems, MAF provides explicit graph-based workflow orchestration: nodes are agents (or functions), edges define the control and data flow between them, and the graph can include branches, loops, and fan-out/fan-in patterns. This is the layer to diagram when a system involves more than one agent — a supervisor routing to specialist workers, a pipeline of sequential reviewers, or a fan-out to parallel agents whose outputs are merged. Draw the graph structure explicitly rather than implying orchestration through prose; MAF's workflow graph is a real, inspectable object in the code, and the diagram should mirror it node-for-node.

The Agent Harness: where reasoning meets execution

The Agent Harness is the layer where model reasoning turns into real side effects — shell access, filesystem operations, human-in-the-loop approval flows, and context management across long-running sessions. It is the architectural boundary that separates "the model decided to do X" from "X actually happened on a machine." In a diagram, the harness boundary should be drawn as an explicit box around anything that touches real compute, storage, or external systems — with approval gates shown as decision nodes on the path, not as an afterthought in a caption. For any agent capable of running shell commands or modifying files, showing the harness boundary is the single highest-value addition you can make to the diagram, because it is where a reviewer's eye should go first when assessing blast radius.

CodeAct: programs instead of one-tool-at-a-time calls

Traditional tool-calling loops ask the model to pick one tool, wait for the result, then decide on the next tool — a round-trip per step. The CodeAct pattern, shipped in the alpha agent-framework-hyperlight package, changes this: instead of selecting tools one at a time, the model writes a short Python program that calls multiple tools via call_tool(...) and the program is executed once, in full, inside a sandboxed Hyperlight micro-VM per call. This collapses what would be several model round-trips into a single generation-and-execute step, cutting latency and token overhead for tasks that involve chaining several tool calls with intermediate logic (loops, conditionals, data transforms between calls).

When diagramming a CodeAct-based agent, draw the sandbox as its own isolated compute boundary — the Hyperlight micro-VM — sitting between the model's code-generation output and the tool surface. Label the boundary clearly: the model never calls tools directly, it emits a program, and the program (not the model) is what actually invokes call_tool(...) from inside the sandbox. This distinction matters for security review — the micro-VM is the enforcement point for tool access, not the model's output filter.

Hosted agents: Foundry and Azure Durable Functions

MAF agents do not have to be self-hosted. The Foundry Hosted Agent Integration lets you run Agent Framework agents as managed services on Microsoft Foundry, offloading scaling, deployment, and lifecycle management. Alternatively, agents can run as Azure Durable Functions, which is the better fit for durable, long-running execution — workflows that need to survive process restarts, wait on external events (like a human-in-the-loop approval), or checkpoint state across steps that take minutes or hours rather than seconds. In a diagram, label which hosting model each agent uses: a Foundry-hosted agent is drawn as a managed service node with Microsoft-operated infrastructure behind it, while a Durable Functions agent is drawn with explicit orchestrator/activity function roles and a durable state store, since that distinction affects how a reader reasons about failure recovery and cost.

Microsoft Agent Framework vs. LangGraph vs. CrewAI

DimensionMicrosoft Agent FrameworkLangGraphCrewAI
Primary language.NET and Python (matching APIs)Python (JS/TS also supported)Python
Orchestration styleGraph-based workflows with explicit nodes/edges for multi-agent orchestrationGraph-based state machines with fine-grained control over state transitionsRole-based crews — agents assigned roles/goals, coordinated via a process (sequential or hierarchical)
Enterprise featuresSession state, type safety, middleware, telemetry inherited from Semantic KernelPersistence and checkpointing via LangGraph Platform; broader ecosystem features are opt-in add-onsLighter-weight by default; enterprise controls typically layered on separately
Hosting storyFoundry Hosted Agent Integration (managed) or Azure Durable Functions (durable, long-running)Self-hosted or LangGraph Platform managed deploymentSelf-hosted; no first-party managed host
Best fitTeams standardized on Azure/Microsoft infrastructure needing both prototyping speed and enterprise governance in one SDKTeams wanting fine-grained, explicit control over agent state machines and cyclic workflowsFast prototyping of role-based agent teams with minimal orchestration boilerplate

Prompt templates for Microsoft Agent Framework architecture diagrams

Supervisor/worker multi-agent workflow

"Microsoft Agent Framework architecture for an incident triage system built as a graph-based workflow. A Supervisor agent (chat client bound to an Azure OpenAI gpt-5.1 deployment) receives an incoming alert from PagerDuty via webhook. The Supervisor's graph routes to one of three worker agents based on alert category: (1) Infra Worker — has tools for querying Azure Monitor metrics and restarting AKS pods; (2) Database Worker — has tools for running read-only diagnostic queries against Azure SQL and checking replication lag; (3) Network Worker — has tools for querying Azure Network Watcher and checking NSG rule changes in the last 24 hours. Each worker runs behind middleware that enforces a read-only mode unless the alert severity is P1, in which case a human-in-the-loop approval gate (Slack message with Approve/Deny buttons) must clear before any mutating tool call (pod restart, failover trigger) is allowed to execute inside the Agent Harness. All three workers report results back to the Supervisor via the graph's fan-in edge, and the Supervisor synthesizes a single incident summary posted to the PagerDuty incident timeline. Full telemetry (each agent's tool calls, latency, and token usage) is exported via the framework's built-in OpenTelemetry integration to Application Insights."

CodeAct tool-calling agent on Azure Durable Functions

"Microsoft Agent Framework architecture for a data reconciliation agent using the CodeAct pattern, hosted as an Azure Durable Function for long-running execution. An orchestrator function receives a reconciliation request naming two data sources (a Snowflake table and a Dynamics 365 entity) and starts a durable orchestration. The agent (chat client on Azure OpenAI gpt-5.1-mini) is invoked as an activity function: instead of calling tools one at a time, it generates a Python program that calls call_tool('query_snowflake', ...), call_tool('query_dynamics', ...), and call_tool('diff_records', ...) in sequence with intermediate pandas transforms, then executes that program once inside a Hyperlight micro-VM sandbox — the sandbox has network egress limited to only the Snowflake and Dynamics connector endpoints. If the diff exceeds 500 mismatched records, the orchestrator pauses on a durable timer and posts a human-in-the-loop approval request to Microsoft Teams before the agent is allowed to call the write_corrections tool, which applies fixes back to Dynamics 365. The Durable Functions orchestrator checkpoints state after every activity so the reconciliation can resume from the last completed step if the process restarts, and the whole run is capped at a 4-hour durable timeout."

Key design principles for Microsoft Agent Framework diagrams

  • Draw the harness boundary explicitly: Anything that touches shell, filesystem, or external side effects belongs inside a clearly labeled Agent Harness box, with human-in-the-loop approval gates shown as decision nodes on the path rather than described only in prose
  • Isolate CodeAct execution as its own compute boundary: The Hyperlight micro-VM sandbox is the real enforcement point for tool access when using CodeAct — draw it as a distinct box between the model's generated program and the tool surface, not as part of the model call itself
  • Label hosted vs. self-managed runtime: Foundry-hosted agents and Azure Durable Functions agents have different failure-recovery and cost characteristics — mark each agent node with its hosting model so reviewers don't assume uniform infrastructure
  • Separate MCP tool sources from native tools: MCP servers cross a network and trust boundary that in-process tool functions don't — draw the MCP client connection as a distinct edge type, not folded into a generic "tools" box
  • Mirror the workflow graph node-for-node: MAF's graph-based workflow is an inspectable object in code — the diagram should match its nodes and edges exactly rather than summarizing multi-agent orchestration as a single arrow

Frequently asked questions about Microsoft Agent Framework architecture

What is Microsoft Agent Framework?

Microsoft Agent Framework (MAF) is an open-source SDK and runtime for building AI agents, released to 1.0 general availability on April 2, 2026. It unifies AutoGen and Semantic Kernel into one framework with matching APIs across .NET and Python, combining AutoGen's simple multi-agent abstractions with Semantic Kernel's enterprise features — session-based state management, type safety, middleware, and telemetry.

Is Microsoft Agent Framework the same as AutoGen or Semantic Kernel?

No — it replaces the need to choose between them. AutoGen and Semantic Kernel were separate projects with different strengths: AutoGen favored fast, lightweight multi-agent prototyping; Semantic Kernel favored production-grade enterprise controls. Microsoft Agent Framework converges both into a single SDK, so teams no longer have to pick one and later migrate to the other as a project moves from prototype to production.

How do I diagram a Microsoft Agent Framework multi-agent system?

Start with the graph-based workflow — draw each agent as a node and each control/data handoff as an edge, matching the structure defined in code. Then layer in the supporting pieces: chat clients per agent, tool and MCP integration points, middleware chains, and — critically — the Agent Harness boundary around anything with real-world side effects. If any agent uses the CodeAct pattern, add the Hyperlight sandbox as its own isolated box between the model's generated program and the tools it calls. Paste this structure as plain English into ArchitectureDiagram.ai and it will generate the diagram automatically.

Related guides: LangGraph architecture diagrams, multi-agent orchestration patterns, MCP architecture diagrams, and AI agent architecture diagrams.

Ready to try it yourself?

Start Creating - Free