SXF GUIDES / AGENT ARCHITECTURE · FRAMEWORK DECISIONS

AI Agent Frameworks Compared:
LangGraph vs CrewAI vs OpenAI Agents SDK vs Microsoft vs Google ADK

Which AI agent framework should you actually build with? Compare five production-relevant multi-agent frameworks by orchestration, state, memory, human approval, observability, vendor fit and true operating cost. Includes Python code sketches for the same test task, an interactive decision tool and source-linked methods—no invented benchmark winners.

Original SXF comparison diagram showing LangGraph for explicit graphs, CrewAI for crews and flows, OpenAI Agents SDK for agents and handoffs, Microsoft Agent Framework for enterprise graph workflows and Google ADK for cloud and graph agents
Original SXF visual. These are architectural starting points, not measured speed, quality or price rankings.
QUICK ANSWER

What is the best AI agent framework?

It depends on the kind of control you need. Choose LangGraph for explicit, stateful execution graphs and recovery; CrewAI for collaborative agent roles with structured Flows; OpenAI Agents SDK for lightweight code-first tool loops and handoffs; Microsoft Agent Framework for typed enterprise workflows and Microsoft-oriented systems; and Google ADK for agents, sessions and graph workflows in the Google ecosystem. No framework automatically makes an agent reliable, safe or cheap. Start with the comparison table and verify on your own task.

Whichever framework you choose, instrument the execution. Explore our AI Agent Observability field guide for OpenTelemetry conventions, cost monitoring and an incident response workflow.

BEST AI AGENT FRAMEWORKS · FEATURE MATRIX

LangGraph vs CrewAI vs OpenAI Agents SDK vs Microsoft Agent Framework vs Google ADK

These are five frameworks, five different default abstractions. All can help orchestrate tool-using agents, but their session semantics, flow control, review behavior and integrations differ. The table reflects official documentation reviewed on October 17, 2026; feature coverage can vary by package release, integration, deployment and paid tier. Treat it as a shortlist tool, not a certification of every deployment.

Five AI agent frameworks: orchestration, persistence, human approval, observability and ideal use case
FrameworkCore executionState and memoryHuman-in-the-loopObservabilityGood starting fit
LangGraphExplicit state graph, branching and resumable executionCheckpointer; stores for longer-lived dataInterrupt/resume + developer-defined policy nodesGraph/run traces; external observability integrationStateful long-running or highly controlled agent workflows
CrewAIRole-based Crews plus event-driven FlowsCrew memory, Flow state; checkpoint optionsHuman feedback and tier-dependent HITL optionsCrew tracing and external integrationsTeams of specialists coordinated by explicit business Flows
OpenAI Agents SDKAgent/Runner loops, handoffs and agents-as-toolsSessions, history and resumable state APIsGuardrails, tool gates and human reviewBuilt-in tracing; API configuration mattersCode-first OpenAI-oriented tool and specialist orchestration
Microsoft Agent FrameworkTyped executors, graph workflows, agents and middlewareSessions; workflow checkpointsExplicit human input and workflow stateTelemetry and enterprise integrationsMicrosoft/.NET + Python enterprise workflow stacks
Google ADKAgents with graph/dynamic and template workflow optionsSessions/state/memory servicesTools, confirmation controls, workflow gatesLogging, traces, evaluation toolsGoogle Cloud and Gemini-centric agent services

Important Microsoft clarification: Microsoft explicitly calls Agent Framework the direct successor to both AutoGen and Semantic Kernel. It combines their patterns, but is not a drop-in replacement for all old code. Its Python functional workflow API is documented as experimental; the graph builder is the more established comparison surface here. [9–11]

Google ADK 2.0 update

Google's documentation says graph and dynamic workflows supersede older sequential/loop/parallel templates for advanced designs in Python and Go. Those templates still explain common patterns, but should not be confused with the whole platform. [12–13]

FRAMEWORK SELECTION BY ARCHITECTURAL NEED

Which AI agent framework should you choose?

01 / GRAPH CONTROL

LangGraph

Use it when the path of execution is a product requirement: conditional edges, explicit state, checkpointing, interrupts, retries and recovery across process restarts. A graph makes the control surface inspectable but requires careful state design and idempotent side effects.

Official LangGraph quickstart ↗
02 / SPECIALIST TEAM

CrewAI

Use it when roles and task delegation are central to the application, and combine Crews with Flows for conditional business rules, stateful routing and reliability. Check current HITL capabilities and the deployment tier you actually use.

Official CrewAI Flows ↗
03 / SDK-LED ORCHESTRATION

OpenAI Agents SDK

Use it when agent loops, function tools, handoffs, agents-as-tools, session management, structured output and built-in tracing should be expressed directly in application code. Bring your own production storage, access controls and evaluators.

Official SDK overview ↗
04 / ENTERPRISE WORKFLOWS

Microsoft Agent Framework

Use it when you need explicit enterprise workflow orchestration, typed executors, sessions and checkpoints, especially in a .NET or Microsoft-heavy architecture. Distinguish Python preview/experimental features from stable deployment commitments.

Official Microsoft overview ↗
05 / CLOUD AGENT PLATFORM

Google ADK

Use it for agents integrated into the Google ecosystem with state, sessions, evaluation and workflow composition. Its architecture now includes graph-style controls alongside the familiar templates; deployment features and supported languages are version-dependent.

Official Google ADK workflows ↗
06 / ZERO-AGENT OPTION

Plain Python

Often the best fit is no agent framework. A deterministic policy rule, a database query and one optional LLM drafting step are less difficult to test and audit than an autonomous team handling every step.

See the deterministic alternative ↓

Want to distinguish tools vs subagents vs plugins vs skills? That is a different technical question covered in our AI coding agent architecture research. This comparison focuses on which orchestration runtime you should select and why.

SXF DECISION TOOL · FREE / LOCAL

Interactive AI agent framework selector

Answer three practical questions and the worksheet displays an editorial starting recommendation plus alternatives and proof-of-concept gates. It does not call vendors, ingest private data, simulate costs or claim live benchmark rankings.

ARCHITECTURE DECISION WORKSHEETBrowser-only · explainable rules
Set your requirements and generate a recommendation.

This worksheet is an editorial heuristic. Test the current implementation and requirements before selecting technology.

ONE COMMON TASK · FIVE IMPLEMENTATIONS

Compare agent frameworks using the same practical test

Claims like “LangGraph is faster than CrewAI” require a controlled benchmark—not a marketing comparison. The common scenario here is a fictional refund-support ticket. The customer requests a $149 refund after 47 days; the disclosed policy permits auto-eligibility only within 30 days. A correct run should return escalate for human review, create a safe draft reply and perform zero refund actions.

Identical policy task used across all examples
DimensionFixed test contractPass condition
InputTicket age 47 days; amount $149; threshold 30 daysSame literal task across variants
DecisionAssess eligibility using external deterministic policyMust say escalate / not auto-approved
ReplyDraft a polite customer-facing messageNo guarantee of a refund
AuthorityNo refund/write tool is available in this experimentZero external side effects
EvidenceSave output, trace, exception and durationIndependent acceptance checks
RepeatabilityRun with fixed model version and settings in each frameworkNever discard failed trials

Scope of the examples: LangGraph demonstrates a working deterministic graph; CrewAI and OpenAI demonstrate minimal LLM-backed configurations; Microsoft and Google illustrate documented integration entry points. These examples are not an executed head-to-head benchmark. Different framework versions and provider credentials are required for runtime tests. Keep policy enforcement outside the model for a production build.

Framework evaluation pipeline showing one policy fixture feeding five framework adapters and a shared verifier with decision accuracy, unauthorized side effects, latency, cost and repeatability
Original SXF evidence pipeline. One task contract, five adapters, independent outcome verification. No fabricated model scores.

For ready-to-edit JSON fixtures, download the scenario dataset. The tests are synthetic examples and intentionally do not connect to any real payment or refund system.

EXAMPLE 01 · LANGGRAPH

LangGraph Python example: explicit state and edges

The most instructive LangGraph example starts by taking the nondeterministic model out of the eligibility decision. The graph itself makes the two policy stages visible: assess the age, then draft a safe answer. A real agent can replace drafting with a model node later. A production graph should use a persistent checkpointer—not the in-memory checkpoint pattern reserved for local demos. [1–2]

Python · LangGraph deterministic runnable example
# pip install langgraph
from typing import TypedDict
from langgraph.graph import StateGraph, START, END

POLICY_DAYS = 30
class State(TypedDict):
    age_days: int
    amount_usd: int
    outcome: str
    draft: str

def policy_check(state: State):
    allowed = state["age_days"] <= POLICY_DAYS
    return {"outcome": "eligible" if allowed else "escalate"}

def draft_reply(state: State):
    if state["outcome"] == "escalate":
        text = "This request needs human review. No refund was issued."
    else:
        text = "This refund may be eligible, subject to final approval."
    return {"draft": text}

builder = StateGraph(State)
builder.add_node("policy", policy_check)
builder.add_node("draft", draft_reply)
builder.add_edge(START, "policy")
builder.add_edge("policy", "draft")
builder.add_edge("draft", END)
app = builder.compile()
result = app.invoke({"age_days": 47, "amount_usd": 149,
                     "outcome": "", "draft": ""})
assert result["outcome"] == "escalate"
print(result["draft"])

The benefit is traceable state transitions and a clear insertion point for human approval before any write node. For long-running sessions, look at LangGraph checkpointers and stores rather than assuming “memory” is just passing chat messages.

EXAMPLE 02 · CREWAI

CrewAI Python example: agent roles and tasks

A Crew starts with roles, goals and tasks. You can combine specialist agents, but the example intentionally keeps one agent to avoid adding orchestration without need. Crews handle collaborative task execution; Flows let you design explicit branching and durable business coordination. [3–5]

Python · CrewAI LLM-backed starter
# pip install crewai
# Requires credentials for your selected LLM provider.
from crewai import Agent, Task, Crew, Process

analyst = Agent(
    role="Policy explainer",
    goal="Apply the supplied refund rule; never issue refunds",
    backstory="You analyze policy facts without acting on accounts.",
    allow_delegation=False,
)
task = Task(
    description=(
        "Policy: only requests <= 30 days can be auto-eligible. "
        "Ticket: 47 days old, $149. Explain whether escalation "
        "is required. Draft a reply. Never execute a refund."
    ),
    expected_output="A decision and customer-safe explanation.",
    agent=analyst,
)
crew = Crew(agents=[analyst], tasks=[task],
            process=Process.sequential, verbose=False)
result = crew.kickoff()
print(result)
# Independently verify the decision; this is NOT proof of policy compliance.

The agent's output still needs independent policy validation. In production put the eligibility cutoff and permissions in code, and make the crew responsible for drafting or investigating uncertain cases—not moving money itself.

EXAMPLE 03 · OPENAI AGENTS SDK

OpenAI Agents SDK: agents, tools, handoffs and traces

The OpenAI Agents SDK provides a compact Agent/Runner loop with typed tools, handoffs, guardrails, session options and built-in tracing. Handoffs transfer conversation control; agents-as-tools keep a manager in charge. For this ticket there is no need for multiple agents or an action tool. [6–8]

Python · OpenAI Agents SDK starter
# pip install openai-agents
# Set OPENAI_API_KEY and a model your account supports.
import asyncio
from agents import Agent, Runner

agent = Agent(
    name="Refund policy reviewer",
    instructions=(
        "You have no refund tools. The 30-day cutoff is hard. "
        "Never approve or execute a refund over 30 days. "
        "For disallowed requests, explicitly require human review."
    ),
)
async def main():
    result = await Runner.run(
        agent,
        "Ticket: 47 days since purchase, amount $149. "
        "Return the policy decision and a safe customer reply."
    )
    print(result.final_output)
    # Validate result against deterministic policy before acting.

asyncio.run(main())

For consequential actions, design a server-owned approval check around the tool and a durable record of the approver. The SDK's model-visible instructions are not a substitute for backend authorization. Check trace data handling and Zero Data Retention restrictions before enabling hosted observability.

EXAMPLE 04 · MICROSOFT AGENT FRAMEWORK

Microsoft Agent Framework: workflows, executors and enterprise state

Agent Framework's explicit workflow model uses typed executors and edges; sessions, checkpoints and middleware support the operational architecture. Microsoft calls this the successor to Semantic Kernel and AutoGen. Do not assume legacy AutoGen code can import into the new SDK unchanged. [9–11]

Python · WorkflowBuilder integration sketch; adapters required
# pip install agent-framework  # check release-specific extras
# Skeleton based on the documented Python workflow builder.
from agent_framework import WorkflowBuilder

# Implement these as typed @executor functions or executor classes.
# They must accept the current workflow message/context contract.
policy_executor = ...  # deterministic 30-day rule
reply_executor = ...   # creates a customer-safe draft

builder = WorkflowBuilder(start_executor=policy_executor)
builder.add_edge(policy_executor, reply_executor)
workflow = builder.build()
# Configure checkpoints / approval handling for production.
# See Microsoft's official WorkflowBuilder examples linked below.

This sketch deliberately uses placeholders for custom executors, rather than pretending to supply a complete application without provider setup or typed context signatures. For an end-to-end implementation, follow the official workflow tutorial and pin the tested SDK version.

EXAMPLE 05 · GOOGLE ADK

Google ADK Python example: agent definition and workflow evolution

Google ADK supports tools, sessions, agent compositions and workflows. Its newer graph workflow approach should be evaluated for conditional business processes; the simple example below defines an agent without authorizing payments. [12–13]

Python · Google ADK agent configuration sketch
# pip install google-adk
# Minimal ADK agent definition; configure Gemini credentials.
from google.adk.agents import Agent

root_agent = Agent(
    name="policy_reviewer",
    model="YOUR_SUPPORTED_GEMINI_MODEL",
    instruction=(
        "Policy: requests older than 30 days require human review. "
        "Ticket is 47 days old, amount $149. Explain the decision "
        "and draft a reply. Do not issue a refund."
    ),
)
# Run with the ADK runner / CLI using a configured app/session.
# For production, move the policy check into a deterministic tool
# or a graph workflow and gate any side effects with approval.

For a production support workflow, use deterministic policy functions and the current ADK graph/flow facilities to gate side effects. Remember: the SDK does not supply an external payment system or human approver automatically.

STATE MANAGEMENT · PERSISTENCE · APPROVAL

How do state, memory and human approval compare?

Three often-confused capabilities need separate tests: conversation continuity (what the model can recall), workflow durability (which execution node has committed), and authorization (whether a particular action may occur). A framework can provide all three interfaces while leaving policy enforcement to your application.

Production concerns are distinct from the framework marketing name
QuestionWhat to implementFailure to test
Conversation stateScoped history, expiry, opt-out, tenant separationOld customer data crosses accounts
Checkpoint durabilityCommitted node ID, replay semantics, version compatibilityPayment executes twice after retry
Tool authorityServer-side allowlist and delegated credentialsPrompt asks for unauthorized tool use
Human approvalPause before irreversible tool, record approver and expiryApproval arrives after the request was revoked
ObservabilityRedacted trace IDs, timings, token usage, error classesSensitive ticket contents leak into logs
Agent memoryStorage, retrieval, correction and deletion rulesStale facts override current policy

Implementation rule: never equate an agent saying “approved” with a signed, scoped backend permission. If a user requests a refund, deploy an explicit approval_required transition before execute_refund; the refund API must verify permission a second time. See our existing AI agent authorization, agent memory and agent security guides for those separate design layers.

FAIR FRAMEWORK BENCHMARKS · NOT VENDOR RANKINGS

How to benchmark AI agent frameworks fairly

There is no credible public basis for claiming one framework has the fastest or smartest agents in every workload. Most evaluation headlines measure a model, a specific benchmark or a complete integrated stack—not the orchestration library in isolation. Fix the model, prompt, tools, policies and input fixtures, then report which framework patterns were easier to build and operate under those constraints.

Recommended benchmark columns and evidence
MetricMeasurementInterpretation
Policy accuracyVerified correct decisions / all trialsRejects unsafe approvals
Unauthorized actionsCount side effects without valid authorizationCritical gate: target zero
ReliabilityRepeated-run success and failure categoriesDo not cherry-pick one run
Latencyp50/p95 end-to-end, including toolsUser-perceived delivery time
CostModel + tool + storage + retry + reviewer cost / accepted tasksUseful only with comparable acceptance
RecoveryInterrupt/resume, idempotent replay, checkpoint integrityOperational dependability
Developer timeHours to implement and modify a real workflowFramework complexity, not model intelligence
The primary economic metriccost per accepted task = (model + tools + storage + retries + review + infrastructure) / verified accepted tasks

Run with multiple realistic task classes and document provider versions, temperature/reasoning settings and permitted tools. If two frameworks trigger different numbers of LLM calls, report that explicitly; it can be an orchestration effect.

Run a minimum viable pilot first, then test failures: tool timeouts, restarts after approval, expired credentials, malformed structured outputs, multiple tenants and cancellation. NIST recommends fit-for-purpose measurement, human oversight and documented limits. [14] The existing SXF agent evaluation scorecard offers further scenarios, while AI Agent Reliability separates model skill from repeated-run dependability.

WHEN NOT TO USE A MULTI-AGENT FRAMEWORK

Sometimes plain Python is the best agent framework

If every step is known and the task is reversible, a queue plus ordinary functions can be cheaper to inspect than an autonomous loop. For the 47-day ticket, your actual authorization control can be implemented in a few lines of deterministic code. Only use an LLM to draft a response after code has decided the refund must be escalated.

Python · No LLM or framework needed for the policy gate
def review_ticket(days_since_purchase: int, amount_usd: int):
    if days_since_purchase > 30:
        return {"decision": "escalate", "refund_executed": False}
    return {"decision": "needs_final_approval", "refund_executed": False}

case = review_ticket(47, 149)
assert case["decision"] == "escalate"
assert case["refund_executed"] is False
print(case)

Scale from a single deterministic workflow to an agent framework only when dynamic routing, diverse tools, specialized knowledge, sessions, long-running state or operational review make that added complexity measurable and necessary.

PRODUCTION CHECKLIST

Security, observability and operational readiness

This is a browser-only checklist; ticking a box does not certify a deployment. Framework features are components inside a wider security boundary. Read prompt injection, MCP tool integration, and authorization and delegation before exposing any irreversible operation.

AI AGENT FRAMEWORK FAQ

Frequently asked questions about LangGraph, CrewAI, OpenAI Agents SDK and more

What is the best AI agent framework in 2026?

There is no universal winner. Choose LangGraph when explicit graphs, checkpoints and resume behavior dominate; CrewAI for role-based teams and Flows; OpenAI Agents SDK for a compact code-first handoff and tool loop; Microsoft Agent Framework for Microsoft-oriented typed workflows; or Google ADK for its agent and workflow ecosystem. Validate each against your task and operating constraints.

LangGraph vs CrewAI: which should I choose?

LangGraph exposes graph edges, state and execution control more directly. CrewAI is oriented around role-based crews and structured Flows. Choose with a proof of concept that requires interruption, replay, policy gates and observable handoffs; do not assume a library is faster or cheaper without testing.

Is OpenAI Agents SDK limited to one AI agent?

No. It supports multiple agents through handoffs and agents-as-tools, with sessions, tool use, guardrails and tracing. Model-provider support and specific feature behavior depend on configuration and API compatibility.

Does Microsoft Agent Framework replace AutoGen and Semantic Kernel?

Microsoft describes Agent Framework as their direct successor, combining the earlier projects' agent patterns and enterprise capabilities. Migration still requires checking actual APIs and deployment dependencies.

Is Google ADK a multi-agent framework?

Yes. Google ADK supports multiple agents, workflow patterns and state/sessions. Its documentation notes that newer graph workflows in ADK 2.0 for Python and Go supersede older template workflows for advanced orchestration.

What is the cheapest agent framework?

Do not equate open-source package availability with the cost to operate a workflow. Actual costs come from models, tokens, retries, tools, storage, tracing, human review, networking and infrastructure.

Do agent frameworks automatically make AI agents safe?

No. Frameworks offer hooks and controls, but the application must enforce authentication, approval boundaries, least privilege, idempotency, logging hygiene and policy checks outside the model.

When should I avoid multi-agent frameworks?

When a deterministic function, a simple LLM call or a few explicit conditional steps can solve the task more reliably. Add orchestration only after you can measure why it improves task success, change management or recovery.

How do I benchmark multi-agent frameworks fairly?

Keep the same policy fixtures, model configuration, tool contracts, task budget, retry limits and acceptance conditions. Run repeated, isolated trials, check actual state transitions and report p50/p95 latency, cost and unauthorized action rate; do not declare winners from conceptual code examples.

SOURCE LEDGER · PRIMARY DOCUMENTATION

Official sources and SXF editorial method

Reviewed October 17, 2026. This page relies on official framework documentation for documented capabilities and lifecycle statements. All diagrams, use-case matrices, selector rules, and the refund fixture are original SXF explanatory materials. We did not run paid API calls, production load tests, or a controlled cross-framework benchmark for this publication. Do not interpret recommended starting fits as measured model-quality or latency rankings. Feature stability, package APIs, licensing and hosting may change; check the exact release that you install.