One weather agent, built the way each framework's own documentation builds it. Press play on both and watch what really differs.
Checked against the official docs on 21 November 2026
By Microsoft
Microsoft's framework for agents and multi-agent workflows, the successor to AutoGen and Semantic Kernel.
pip install agent-framework-foundry azure-identityBy OpenAI
A lightweight package with very few abstractions for building agentic apps.
pip install openai-agentsOfficial docs: openai.github.io/openai-agents-python 52 animated lessons
Watch it run
Press Play to watch it run, or step through with ← →. Then switch to Practice and run it yourself.
# Microsoft Agent Framework (Python). Install: pip install agent-framework-foundry azure-identity
# Sign in with `az login`; replace project_endpoint and model with your Foundry values.
import asyncio
from agent_framework import Agent
from agent_framework.foundry import FoundryChatClient
from azure.identity import AzureCliCredential
def get_weather(city: str) -> str:
"""Get the weather for a given city."""
if city.lower() == "chennai":
return "31 C, humid"
return f"No weather data for {city}."
weather_agent = Agent(
client=FoundryChatClient(
project_endpoint="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project",
model="gpt-5.4-mini",
credential=AzureCliCredential(),
),
name="weather_agent",
instructions="You are a helpful assistant. Use get_weather to answer weather questions.",
tools=[get_weather],
)
async def main():
# Non-streaming: get the complete response at once
result = await weather_agent.run("What's the weather in Chennai?")
print(f"Agent: {result}")
asyncio.run(main())Nothing yet. Press Play.
Watch it run
Press Play to watch it run, or step through with ← →. Then switch to Practice and run it yourself.
# OpenAI Agents SDK. Install: pip install openai-agents
# Needs OPENAI_API_KEY in the environment (see the Agents SDK quickstart).
import asyncio
from agents import Agent, Runner
from agents.decorators import tool
@tool
def get_weather(city: str) -> str:
"""returns weather info for the specified city."""
if city.lower() == "chennai":
return "31 C, humid"
return f"No weather data for {city}."
weather_agent = Agent(
name="weather_agent",
instructions="Answer weather questions clearly. Use get_weather when it helps.",
model="gpt-5-nano",
tools=[get_weather],
)
async def main():
result = await Runner.run(
weather_agent,
"What's the weather in Chennai?",
)
print(result.final_output)
if __name__ == "__main__":
asyncio.run(main())Nothing yet. Press Play.
Translation
| Concept | Microsoft Agent Framework | OpenAI Agents SDK |
|---|---|---|
| AgentA model plus instructions and tools | Agent, with a chat client | Agent |
| ToolA function the model can ask for | Function tools (@tool or plain function) | Function tools |
| Conversation stateWhat is remembered inside one chat | AgentSession | Sessions |
| Long-term memoryWhat is remembered across chats | Context providers | Agent memory (sandbox agents only) |
| Handing work to another agentMulti-agent delegation | Handoff orchestration, agents as tools | Handoffs, Agent.as_tool() |
| Fixed workflowSteps in an order you decide, not the model | Workflows (WorkflowBuilder) | Not built in: orchestrate in code |
| Human in the loopPause and ask a person | Tool approval, ctx.request_info() | needs_approval, RunState |
| Tracing and evaluationSee what happened, check quality | Observability (OpenTelemetry), Evaluation | Tracing (built in) |
| Deployment in the docsWhere the docs tell you to run it | Foundry Hosted Agents, self-hosting | Not built in |
The example agents follow each framework's own quickstart and use the model its docs use; they are shown for reading and were not benchmarked against each other. This site is independent and is not affiliated with Microsoft or OpenAI.