Microsoft just shipped Agent Framework 1.0 on April 3, 2026 — a production-ready toolkit for building AI agents that replaces both Semantic Kernel and AutoGen. If you've been waiting for a stable, enterprise-grade way to build agents in Python or .NET, this is it.
Microsoft Agent Framework is an open-source library for creating single-agent and multi-agent AI applications with tool calling, MCP support, and built-in state management. It works with OpenAI, Azure OpenAI, Anthropic Claude, Google Gemini, Ollama, and more. Version 1.0 launched on April 3, 2026 with stable APIs and long-term support.
What You'll Need
- Python 3.10+ installed
- An Azure account with an AI Foundry project (free tier works), or an OpenAI API key
- Basic Python knowledge
- A terminal and code editor
Step 1: Install Agent Framework
Open your terminal and install the package:
pip install agent-frameworkThat's one package. It pulls in everything you need for agents, tools, and model clients.
If you're using Azure AI Foundry (recommended for the full experience), also install:
pip install azure-identityFor OpenAI directly, you don't need anything extra — the OpenAI client is built in.
Step 2: Create Your First Agent
Create a file called hello_agent.py. Here's the minimal setup using Azure AI Foundry:
import asyncio
from agent_framework.foundry import FoundryChatClient
from azure.identity import AzureCliCredential
async def main():
client = FoundryChatClient(
project_endpoint="https://your-project.services.ai.azure.com",
model="gpt-4o",
credential=AzureCliCredential(),
)
agent = client.as_agent(
name="HelloAgent",
instructions="You are a friendly assistant. Keep answers brief.",
)
result = await agent.run("What is the capital of France?")
print(f"Agent: {result}")
asyncio.run(main()) Replace project_endpoint with your Azure AI Foundry endpoint. Run it:
python hello_agent.pyYou should see a response like: "Agent: The capital of France is Paris."
Prefer OpenAI directly? Swap FoundryChatClient for OpenAIChatCompletionClient:
from agent_framework.openai import OpenAIChatCompletionClient
client = OpenAIChatCompletionClient(
model="gpt-4o",
api_key="sk-your-key-here",
)Everything else stays the same.
Step 3: Add Tools So Your Agent Can Do Things
An agent without tools is just a chatbot. Tools let your agent call functions, search the web, or interact with external systems.
Create a file called weather_agent.py:
import asyncio
from agent_framework.foundry import FoundryChatClient
from agent_framework import Agent, tool
from azure.identity import AzureCliCredential
@tool
def get_weather(city: str) -> str:
"""Get the current weather for a city."""
# In production, call a real weather API here
weather_data = {
"Paris": "18°C, partly cloudy",
"Tokyo": "22°C, sunny",
"New York": "15°C, rainy",
}
return weather_data.get(city, f"Weather data not available for {city}")
async def main():
client = FoundryChatClient(
project_endpoint="https://your-project.services.ai.azure.com",
model="gpt-4o",
credential=AzureCliCredential(),
)
agent = client.as_agent(
name="WeatherAgent",
instructions="You help users check the weather. Use the get_weather tool.",
tools=[get_weather],
)
result = await agent.run("What's the weather like in Tokyo?")
print(f"Agent: {result}")
asyncio.run(main()) The @tool decorator registers your function. The agent reads the docstring and parameter types to know when and how to call it. When you ask about Tokyo's weather, the agent automatically calls get_weather("Tokyo") and incorporates the result.
Step 4: Connect MCP Servers for External Tools
Agent Framework has first-class MCP (Model Context Protocol) support. This means your agent can connect to any MCP server and use its tools — no custom code needed.
from agent_framework import Agent, MCPServer
mcp_server = MCPServer(
command="npx",
args=["-y", "@modelcontextprotocol/server-filesystem", "/path/to/folder"],
)
agent = client.as_agent(
name="FileAgent",
instructions="You help users manage files.",
tools=[mcp_server],
)Your agent can now read and write files through the MCP filesystem server. Any MCP-compatible server works here — GitHub, Slack, databases, you name it.
Step 5: Build a Multi-Agent Workflow
The real power of Agent Framework is multi-agent orchestration. You can use one agent as a tool for another:
# Create a specialist agent
research_agent = client.as_agent(
name="Researcher",
description="Researches topics and returns summaries.",
instructions="You research topics thoroughly. Be factual and concise.",
)
# Create a main agent that uses the researcher as a tool
main_agent = client.as_agent(
name="Assistant",
instructions="You help users. Delegate research tasks to your research tool.",
tools=[research_agent.as_tool()],
)
result = await main_agent.run("What are the latest trends in quantum computing?")The main agent decides when to call the research agent, passes the query, and uses the response. You can chain as many agents as you need.
How Does Agent Framework Compare to Alternatives?
| Feature | Agent Framework 1.0 | LangGraph | CrewAI | OpenAI Agents SDK | |---------|:---:|:---:|:---:|:---:| | Multi-agent orchestration | Yes (5 patterns) | Yes | Yes | Limited | | MCP support | Native | Via plugin | No | Limited | | Python + .NET | Both | Python only | Python only | Python only | | State management | Built-in sessions | Checkpointing | Basic | Thread-based | | Model providers | 8+ (OpenAI, Claude, Gemini, Ollama...) | Mostly OpenAI/Anthropic | OpenAI-focused | OpenAI only | | Production stability | 1.0 LTS | Stable | 0.x | Beta | | Price | Free / open-source | Free / open-source | Free / open-source | Free / open-source |
Agent Framework stands out for its breadth of model support, first-class .NET support, and the fact that it merges the best ideas from both Semantic Kernel and AutoGen into a single stable release.
What Multi-Agent Patterns Are Available?
Agent Framework 1.0 ships with five orchestration patterns out of the box:
- Sequential — agents run one after another in a defined order
- Concurrent — agents run in parallel and results are collected
- Handoff — one agent passes control to another based on the task
- Group Chat — multiple agents discuss and collaborate on a problem
- Magentic-One — Microsoft's research pattern for complex, multi-step tasks
You pick the pattern that fits your use case. For most projects, sequential or handoff covers what you need.
FAQ
Is Microsoft Agent Framework free? Yes. It's fully open-source under the MIT license. You pay only for the LLM API calls you make (Azure OpenAI, OpenAI, etc.). Azure AI Foundry has a free tier to get started.
Can I use Agent Framework with Claude or Gemini instead of OpenAI? Absolutely. Agent Framework 1.0 supports Anthropic Claude, Google Gemini, Ollama (for local models), GitHub Copilot, and more. Swap the client class and credentials — the agent code stays the same.
What happened to Semantic Kernel and AutoGen? Agent Framework is their direct successor, built by the same Microsoft teams. It combines AutoGen's simple abstractions with Semantic Kernel's enterprise features. Migration guides are available in the official docs.
Do I need Azure to use Agent Framework? No. You can use it with a plain OpenAI API key, Ollama for local models, or any supported provider. Azure AI Foundry gives you extra features like hosted MCP tools and code interpreter, but it's optional.
If you found this useful, subscribe to CodeBrainery for more step-by-step tutorials like this — new guides drop daily. You can also follow us to get notified when we publish something new. Got questions? Drop them in the comments.
