CodeDocs Vault

Microsoft Agent Framework (Pre-Release)

Reference: https://learn.microsoft.com/en-us/agent-framework
GitHub: https://github.com/microsoft/agent-framework
Status: Public Preview (last updated April 2, 2026)

What It Is

Microsoft Agent Framework is an open-source SDK for building AI agents and multi-agent workflows in .NET (C#) and Python. It is the direct successor to both Semantic Kernel and AutoGen, created by the same teams at Microsoft.

It combines:

Core Architecture

Two Primary Abstractions

  1. Agents — Individual AI agents using LLMs to process inputs, call tools, generate responses. All derive from AIAgent (C#) / Agent (Python). Runtime is a structured loop: user input → model inference → tool execution.

  2. Workflows — Graph-based multi-step orchestration. Predefined sequences with explicit control flow, type-safe routing, checkpointing, and human-in-the-loop. Unlike agents (LLM decides steps), workflows have explicitly defined flow.

Use an Agent when... Use a Workflow when...
Task is open-ended/conversational Process has well-defined steps
Need autonomous tool use and planning Need explicit control over execution order
Single LLM call (with tools) suffices Multiple agents/functions must coordinate

Building Blocks

Concept Description
Providers Connectors to AI services (OpenAI, Azure OpenAI, Anthropic, Foundry, Ollama, GitHub Copilot, Copilot Studio, Amazon Bedrock, Foundry Local, Custom)
Tools Function tools, code interpreter, file search, web search, hosted MCP tools, local MCP tools, tool approval (human-in-the-loop)
Sessions (AgentSession) State management for multi-turn conversations, serializable/deserializable
Context Providers Pluggable memory/context injection (before/after agent runs): history, RAG, memory (Mem0, Neo4j, Redis, Azure AI Search)
Middleware Three types: agent run, function calling, chat client. Can inspect/modify inputs/outputs, terminate execution, override results. Function-based, class-based, or decorator-based.
Skills Portable packages of instructions, scripts, resources (open spec at agentskills.io). Progressive disclosure — agents discover and load on demand.
Executors Processing units within workflows (AI agents or custom logic)
Edges Define connections between workflow executors with conditional routing

Installation

Python

pip install agent-framework          # Meta package (core + common providers)
pip install agent-framework-core     # Core abstractions only
pip install agent-framework-openai   # OpenAI provider
pip install agent-framework-foundry  # Microsoft Foundry provider
pip install agent-framework-a2a      # A2A protocol
pip install agent-framework-azurefunctions  # Azure Functions hosting
pip install agent-framework-devui    # Development UI
pip install agent-framework-mem0     # Mem0 memory provider

C# (.NET)

dotnet add package Microsoft.Agents.AI --prerelease
dotnet add package Microsoft.Agents.AI.Foundry --prerelease
dotnet add package Microsoft.Agents.AI.Hosting --prerelease
dotnet add package Microsoft.Agents.AI.Hosting.A2A.AspNetCore --prerelease

Key APIs

C#

Python

Quickstart

Python

from agent_framework.foundry import FoundryChatClient
from azure.identity import AzureCliCredential
 
agent = FoundryChatClient(
    project_endpoint="https://your-foundry.services.ai.azure.com/api/projects/your-project",
    model="gpt-4o",
    credential=AzureCliCredential(),
).as_agent(instructions="You are a friendly assistant.")
 
result = await agent.run("What is the largest city in France?")
print(result)

C#

AIAgent agent = new AIProjectClient(
    new Uri("https://your-foundry-endpoint"),
    new DefaultAzureCredential())
    .AsAIAgent(model: "gpt-4o-mini", instructions: "You are a friendly assistant.");
 
Console.WriteLine(await agent.RunAsync("What is the largest city in France?"));

Provider Support Matrix

Provider Function Tools Structured Output Code Interpreter File Search MCP Tools
Azure OpenAI Yes Yes Yes Yes Yes
OpenAI Yes Yes Yes Yes Yes
Microsoft Foundry Yes Yes Yes Yes Yes
Anthropic (Claude) Yes Yes Yes No Yes
Ollama (local) Yes Yes No No No
Foundry Local Yes No No No No
GitHub Copilot Yes No No No Yes
Copilot Studio Yes No No No No
Amazon Bedrock (Python) Yes -- No No No

Hosting Options

Integration Ecosystem

Migration Paths

How This Maps to Our Kubiya-Inspired Architecture

Our Concept Microsoft Agent Framework Equivalent
Control Plane ASP.NET Core host + A2A protocol for agent coordination
Meta Agent AIAgent with tools that invoke sub-agents via A2A
Specialized Agents Individual AIAgent instances with domain-specific tools
Task Queue / Workers WorkflowBuilder + Executor with checkpointing
Context Graph Context Providers (Neo4j, Azure AI Search, Mem0)
Policy Engine Middleware (agent run middleware for policy checks)
Human-in-the-Loop Built-in tool approval + workflow checkpoints
Audit Trail Middleware (logging middleware on agent run + function calling)
BYO LLM Multiple providers supported out of the box
Connectors Tools (function tools, MCP tools)
Cognitive Memory Context Providers (Mem0, Redis, history providers)
Skills Agent Skills (agentskills.io open spec)
Deterministic Execution Workflows (explicit flow, not LLM-decided)
DevUI Built-in development UI (agent-framework-devui)

Key insight: The Microsoft Agent Framework provides most of our building blocks out of the box. We don't need to build agent orchestration, task execution, middleware, or memory from scratch — we build ON TOP of these primitives. Our value-add is the opinionated platform layer: multi-tenancy, RBAC, connectors marketplace, Slack/Teams integration, enterprise billing, and the meta-agent that ties it all together.