AutoGen, Semantic Kernel and Microsoft Agent Framework
Two earlier projects led to one successor. Build new work there and move older code on a plan.
Microsoft Agent Framework is Microsoft's successor to both Semantic Kernel and AutoGen, for Python and .NET. Version 1.0 was announced on 3 April 2026 as production-ready with stable APIs and long-term support. The AutoGen repository now states that the project is archived and no longer maintained by Microsoft. Start new work on Agent Framework, and plan the move for existing code.
What you will learn: how the three projects relate, building an agent with tool approval, writing a workflow, the multi-agent patterns, testing without a model service and how to migrate.
Prerequisites: The Agent Loop: Observe, Reason, Plan, Act, Reflect and Orchestration vs Automation vs Frameworks.
Checked in November 2026. The listings were run in Python with the agent-framework-core package, version 1.26.0, using a scripted chat client instead of a model service. The .NET libraries were not run for this page.
Three names, one direction
| Project | Known for | Position in November 2026 |
|---|---|---|
| Semantic Kernel | A kernel with plugins and enterprise integration | Its repository points to Agent Framework as the successor |
| AutoGen | Research-driven multi-agent conversations | Archived; no fixes, features or support from Microsoft |
| Microsoft Agent Framework | Agents and graph-based workflows | Current; 1.x with long-term support |
Many articles and sample repositories still teach AutoGen. They may install and run, but unmaintained software receives no security fixes. The repository advises against production use and points new users to Agent Framework.
The two main ideas
| Aspect | Agent | Workflow |
|---|---|---|
| Who chooses the next step | The model | Your graph of executors and edges |
| Best for | Open-ended requests with tools | Defined processes, possibly using agents as steps |
| Parts | Chat client, instructions, tools, session | Executors, edges, events, checkpoints |
| Main risk | Unpredictable paths | State and version changes during long runs |
If a plain function can do the job, use it. If the path is known, use a workflow. Give a model the choice only where judgment is needed.
Vocabulary for newcomers
| Term | Plain meaning |
|---|---|
| Chat client | The object that talks to a model service |
| Agent | A chat client plus instructions and tools, running a loop |
| Tool | A function the model may ask your program to run |
| Session | The record of one conversation, so a later turn remembers it |
| Executor | One step in a workflow |
| Edge | A route from one step to the next, possibly with a condition |
| Checkpoint | Saved workflow progress |
| Middleware | Code that runs around agent, model or tool calls |
A good first exercise is to build one agent with one read-only tool, print everything it exchanges with the model, then add a second tool that needs approval. Only after that is a workflow or a second agent worth adding.
An agent with an approval gate
The agent has one tool that deletes a record, marked approval_mode="always_require". The scripted client stands in for a model service; it includes the framework's function invocation layer, so tool handling is the real one.
import asyncio
from agent_framework import (Agent, BaseChatClient, ChatResponse, Content,
FunctionInvocationLayer, Message, tool)
DELETED = []
class ScriptedClient(FunctionInvocationLayer, BaseChatClient):
"""Offline stand-in for a model service."""
def __init__(self, *replies):
super().__init__()
self.replies = list(replies)
async def _inner_get_response(self, *, messages, stream, options,
**kwargs):
reply = self.replies.pop(0)
return ChatResponse(
messages=[Message(role="assistant", contents=[reply])])
@tool(approval_mode="always_require")
def delete_record(record_id: str) -> str:
"""Delete one customer record."""
DELETED.append(record_id)
return "deleted"
async def main():
client = ScriptedClient(
Content.from_function_call("c1", "delete_record",
arguments={"record_id": "R-9"}),
Content.from_text("Record R-9 has been deleted."),
)
agent = Agent(client=client, name="records",
instructions="Manage records with care.",
tools=[delete_record])
session = agent.create_session()
response = await agent.run("Delete record R-9", session=session)
request = response.user_input_requests[0]
print("approval needed:", request.function_call.name,
request.function_call.arguments)
print("deleted so far:", DELETED)
approval = request.to_function_approval_response(approved=True)
response = await agent.run(Message(role="user", contents=[approval]),
session=session)
print("answer:", response.text)
print("deleted:", DELETED)
asyncio.run(main())
Output:
approval needed: delete_record {'record_id': 'R-9'}
deleted so far: []
answer: Record R-9 has been deleted.
deleted: ['R-9']
The first call returns a request for approval and deletes nothing. The application sends the decision back in the same session, and only then does the function run. Show a reviewer the function name and arguments exactly as received, check their authority on the server, and test refusal as carefully as approval.
Connecting a real model
Replace the scripted client with a chat client from one of the provider packages. The framework separates the core from integrations for services such as Microsoft Foundry, Azure, OpenAI, Anthropic and others, so install the one you need and follow its authentication guidance. Prefer managed identities or short-lived credentials over keys stored in files.
Approval that survives real life
| Question | Design answer |
|---|---|
| The reviewer replies tomorrow | Persist the session and the pending request |
| The same approval arrives twice | Consume it once, keyed by request |
| The record changed meanwhile | Recheck conditions at execution time |
| Nobody replies | Expire and report, without acting |
A workflow with a branch
An executor receives a message and either sends another on or yields an output. Here an amount is extracted from text and a switch chooses between two destinations.
import asyncio
from agent_framework import (Case, Default, WorkflowBuilder,
WorkflowContext, executor)
@executor(id="extract")
async def extract(text: str, ctx: WorkflowContext[int]) -> None:
await ctx.send_message(int(text.split()[-1]))
@executor(id="auto_pay")
async def auto_pay(amount: int, ctx: WorkflowContext[None, str]) -> None:
await ctx.yield_output(f"{amount}: paid automatically")
@executor(id="escalate")
async def escalate(amount: int, ctx: WorkflowContext[None, str]) -> None:
await ctx.yield_output(f"{amount}: sent to a manager")
def build():
return (
WorkflowBuilder(start_executor=extract, max_iterations=10,
output_from=[auto_pay, escalate])
.add_switch_case_edge_group(extract, [
Case(condition=lambda amount: amount > 500, target=escalate),
Default(target=auto_pay),
])
.build()
)
async def main():
for text in ["claim amount 120", "claim amount 900"]:
result = await build().run(text)
print(result.get_outputs()[0], "|", result.get_final_state().name)
asyncio.run(main())
Output:
120: paid automatically | IDLE
900: sent to a manager | IDLE
The type parameters on WorkflowContext declare what an executor may send and what it may yield, which lets the builder check connections. max_iterations bounds loops, and output_from names the executors whose results count as workflow output. The extraction step is deliberately fragile: real code must handle text without a number and amounts that are negative or in another currency.
Pausing a workflow for a person
A workflow can ask the outside world a question and wait. An executor calls request_info with the data to be decided and the type it expects back. A method marked @response_handler receives the answer.
import asyncio
from agent_framework import (Executor, WorkflowBuilder, WorkflowContext,
handler, response_handler)
class Publish(Executor):
@handler
async def ask(self, draft: str, ctx: WorkflowContext) -> None:
await ctx.request_info(request_data=draft, response_type=bool)
@response_handler
async def decide(self, draft: str, approved: bool,
ctx: WorkflowContext[None, str]) -> None:
verdict = "published" if approved else "discarded"
await ctx.yield_output(f"{verdict}: {draft}")
async def main():
step = Publish(id="publish")
workflow = WorkflowBuilder(start_executor=step,
output_from=[step]).build()
result = await workflow.run("Price list v2")
event = result.get_request_info_events()[0]
print(result.get_final_state().name, "| asks about:", event.data)
result = await workflow.run(responses={event.request_id: False})
print(result.get_final_state().name, "|", result.get_outputs()[0])
asyncio.run(main())
Output:
IDLE_WITH_PENDING_REQUESTS | asks about: Price list v2
IDLE | discarded: Price list v2
The first run ends in a state that says it is idle with a request pending, which is different from finished. The application shows the data to a reviewer, then passes the response back under the request's identifier. In this listing both runs happen in one process, so the pending request lives in memory.
Surviving a restart
To resume after a restart, give the builder a checkpoint storage. The core package includes in-memory and file-based implementations of the storage interface. In-memory storage is lost with the process. A file works for experiments on one machine, but think about concurrent access, access control and clean-up before relying on it for real work.
| Test before release | Expected result |
|---|---|
| Stop the process while a request is pending, then resume | The same question, asked once |
| Answer after deploying a changed workflow | A clean resume or a clear refusal |
| Send two answers for one request | One effect only |
| Load a checkpoint as another user | Access denied by your application |
Checkpoints hold your business data. Protect the storage, and load checkpoint files only from locations your application controls. Durable Execution, Checkpoints and Approvals explains the wider problem.
Multi-agent patterns
The 1.0 announcement lists stable orchestration patterns that cover the common shapes.
| Pattern | How it works | Watch for |
|---|---|---|
| Sequential | Each agent works on the previous result | Early errors carried forward |
| Concurrent | Agents work at once, results combined | Cost, and how disagreements are settled |
| Handoff | One agent passes control to another | Loops and lost context |
| Group chat | A shared conversation with turn selection | Long transcripts and no clear end |
| Magentic-One | A manager plans and directs specialists | Many calls; set firm limits |
Topologies, Specialist Teams and Debate compares these shapes independently of any product.
Connecting to other systems
The framework includes support for connecting agents to tools over the Model Context Protocol and for talking to remote agents over the Agent2Agent protocol. Protocols save custom integration code, but they widen what an agent can reach. Treat every connected server as a supplier: know who runs it, which tools it exposes, what data it receives and what happens when its tool descriptions change.
| Connection | Check before enabling |
|---|---|
| Tool server over MCP | Authentication, allowed tools and approval for changes |
| Remote agent over A2A | Identity, what context is shared and how results are verified |
| Hosted model or search service | Data location, retention and cost limits |
Read What Is MCP? Hosts, Clients, Servers and Capabilities and What Is A2A? Agent Cards, Tasks and Messages for how the two differ. Content returned by any of these is data to be checked, never an instruction your agent must follow.
Testing without a model service
A scripted client like the one above tests tool wiring, approvals and error handling in seconds. Workflows are easier still: executors that do not call models are ordinary async functions in a graph.
- Each switch case, and the default, is taken by a test
- An approval refusal leaves data unchanged
- A tool exception produces a defined result
- A looping workflow stops at its iteration limit
- A checkpoint written by the previous release still loads
Observability and governance
The framework includes observability support based on OpenTelemetry conventions in its core package. Decide which exporter receives traces, whether prompts and tool data are captured and how long they are kept. Middleware offers a place for logging, policy checks and redaction, but authorization belongs in the tool or service that owns the data.
Limits and failure handling
Set a boundary at every level: an iteration limit on workflows, a usage limit or call count on tools, timeouts on service calls and a spending budget per run. Decide what the user sees when a limit is reached. A partial answer presented as complete is worse than a clear statement that the task stopped.
| Failure | Response to design |
|---|---|
| Model service is throttling | Back off with a cap, then queue or report |
| Tool raises an error | Return a safe message; do not leak internal detail to the model |
| Agent asks for the same tool repeatedly | Cap invocations and stop |
| One branch of a concurrent step fails | Choose in advance to fail all or continue with a marked gap |
Migrating from Semantic Kernel or AutoGen
Microsoft publishes migration guides and described migration assistants alongside the 1.0 release. Treat tool output as a draft: it can translate names and structure, but it cannot confirm that behavior is unchanged.
| Existing concept | Question to answer when moving |
|---|---|
| Plugins or registered functions | Which become tools, and which need approval? |
| Planners or agent teams | Is this really a fixed workflow? |
| Group chat rules and termination | What ends the run now, and what is the limit? |
| Chat history and memory | What must be carried over, and in which form? |
| Filters and hooks | Which middleware replaces each one? |
| Local code execution | Which isolated sandbox will run code? |
- Inventory agents, functions, prompts, stored state and who depends on each.
- Record real requests and expected outcomes as an evaluation set.
- Port tools first, as plain functions with tests.
- Move one flow, run both versions in shadow with side effects disabled, and compare.
- Shift a small share of traffic, then finish or close old sessions.
- Remove the old packages and their credentials.
A team has a three-agent AutoGen chat that drafts, checks and files reports. On inspection the order never changes. They rebuild it as a sequential workflow, keep one agent for drafting, replace the checking agent with code and add human approval before filing. Their evaluation set decides whether quality held.
Is it the right choice?
| Good fit when | Look further when |
|---|---|
| Your teams work in .NET or Python | You need another language |
| You run on Microsoft's cloud and identity services | A simple loop covers the need |
| You need workflows and agents in one model | Your platform already provides durable workflows |
It is not limited to Microsoft's models, but test each provider and feature you depend on. Choosing Frameworks: Lock-In, Upgrades and Benchmarks explains the trial.
Common mistakes
| Mistake | Better practice |
|---|---|
| Starting new work on AutoGen | Use Agent Framework |
| Line-by-line translation | Redesign flows that were fixed all along |
| Group chat for every problem | Choose the simplest pattern |
| Approval held only in memory | Persist and expire pending requests |
| Keys in source files | Managed identity or a secret store |
| Assuming Python and .NET match exactly | Check the documentation for your language |
Checklist
- No new code depends on an archived project
- Agents and workflows are chosen according to who should decide
- Risky tools require approval that is persisted
- Workflows have iteration limits and tested branches
- Telemetry destinations are agreed
- Migration has an evaluation set and a way back
Frequently asked questions
Is Semantic Kernel still usable?
Existing applications keep running, and the project presents Agent Framework as its successor. Check the current support statement and plan the move rather than starting new features on the old interfaces.
Is AG2 the same as AutoGen?
No. AG2 is a separate community project that grew from AutoGen. It has its own maintainers and releases, so assess it on its own documentation.
Do I need Azure to use Agent Framework?
No. The core runs locally and there are clients for several providers. Some hosted features depend on Microsoft services.
Can a workflow contain agents?
Yes. Agents can act as steps, while the edges keep the overall process under your control.
References and further reading
- Microsoft Agent Framework overview
- Agent Framework 1.0 announcement
- Agent Framework repository
- Semantic Kernel repository
- AutoGen repository and status notice
Next steps
LlamaIndex, Haystack and DSPy
Data-centered frameworks.
Handoffs, Routing, Shared State and Communication
Pass work between agents.
Human-in-the-Loop and Approval Gates
Design approval gates.