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.

BeginnerIntermediateExpert · 12 min read · Last updated:

In short

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.

Versions used

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.

Beginner Which project is which

Three names, one direction

ProjectKnown forPosition in November 2026
Semantic KernelA kernel with plugins and enterprise integrationIts repository points to Agent Framework as the successor
AutoGenResearch-driven multi-agent conversationsArchived; no fixes, features or support from Microsoft
Microsoft Agent FrameworkAgents and graph-based workflowsCurrent; 1.x with long-term support
Semantic Kernelenterprise foundations
AutoGenmulti-agent patterns
Agent Frameworkcombines both lines
Ideas carried over; code interfaces changed, so migration is real work.
Old tutorials look current

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

AspectAgentWorkflow
Who chooses the next stepThe modelYour graph of executors and edges
Best forOpen-ended requests with toolsDefined processes, possibly using agents as steps
PartsChat client, instructions, tools, sessionExecutors, edges, events, checkpoints
Main riskUnpredictable pathsState 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

TermPlain meaning
Chat clientThe object that talks to a model service
AgentA chat client plus instructions and tools, running a loop
ToolA function the model may ask your program to run
SessionThe record of one conversation, so a later turn remembers it
ExecutorOne step in a workflow
EdgeA route from one step to the next, possibly with a condition
CheckpointSaved workflow progress
MiddlewareCode 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.

Intermediate Agents, approval and workflows

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

QuestionDesign answer
The reviewer replies tomorrowPersist the session and the pending request
The same approval arrives twiceConsume it once, keyed by request
The record changed meanwhileRecheck conditions at execution time
Nobody repliesExpire 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.

extracttext to amount
switchover 500?
escalateor auto_pay
output
The condition is ordinary code and can be unit tested.

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 releaseExpected result
Stop the process while a request is pending, then resumeThe same question, asked once
Answer after deploying a changed workflowA clean resume or a clear refusal
Send two answers for one requestOne effect only
Load a checkpoint as another userAccess 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.

PatternHow it worksWatch for
SequentialEach agent works on the previous resultEarly errors carried forward
ConcurrentAgents work at once, results combinedCost, and how disagreements are settled
HandoffOne agent passes control to anotherLoops and lost context
Group chatA shared conversation with turn selectionLong transcripts and no clear end
Magentic-OneA manager plans and directs specialistsMany 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.

ConnectionCheck before enabling
Tool server over MCPAuthentication, allowed tools and approval for changes
Remote agent over A2AIdentity, what context is shared and how results are verified
Hosted model or search serviceData 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.

Expert Testing, migration and operations

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.

FailureResponse to design
Model service is throttlingBack off with a cap, then queue or report
Tool raises an errorReturn a safe message; do not leak internal detail to the model
Agent asks for the same tool repeatedlyCap invocations and stop
One branch of a concurrent step failsChoose 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 conceptQuestion to answer when moving
Plugins or registered functionsWhich become tools, and which need approval?
Planners or agent teamsIs this really a fixed workflow?
Group chat rules and terminationWhat ends the run now, and what is the limit?
Chat history and memoryWhat must be carried over, and in which form?
Filters and hooksWhich middleware replaces each one?
Local code executionWhich isolated sandbox will run code?
  1. Inventory agents, functions, prompts, stored state and who depends on each.
  2. Record real requests and expected outcomes as an evaluation set.
  3. Port tools first, as plain functions with tests.
  4. Move one flow, run both versions in shadow with side effects disabled, and compare.
  5. Shift a small share of traffic, then finish or close old sessions.
  6. Remove the old packages and their credentials.
Illustrative migration, not a real project

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 whenLook further when
Your teams work in .NET or PythonYou need another language
You run on Microsoft's cloud and identity servicesA simple loop covers the need
You need workflows and agents in one modelYour 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

MistakeBetter practice
Starting new work on AutoGenUse Agent Framework
Line-by-line translationRedesign flows that were fixed all along
Group chat for every problemChoose the simplest pattern
Approval held only in memoryPersist and expire pending requests
Keys in source filesManaged identity or a secret store
Assuming Python and .NET match exactlyCheck 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

Next steps