Agentic AI

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

Short answer

An AI agent framework runs the agent loop for you (model, tools, state, approvals, tracing). Pick by the shape of the work: LangGraph or Google ADK 2.x for fixed processes with branches and human approvals, CrewAI for role-based teams and quick prototypes, the OpenAI Agents SDK for the least code on OpenAI models, the Claude Agent SDK for file, code and shell work, and plain Python for a small agent. In my test of the same agent built six ways, all five frameworks passed 80 of 80 runs; they differed in prompt overhead (up to 2.9 times), install size (47 MB to 625 MB) and how they pause for a human.

"LangGraph or CrewAI?" is the question I get most after every agent workshop. Then come the follow-ups: "What about Google ADK? Should I just use the OpenAI Agents SDK? Is the Claude Agent SDK only for coding?"

Most comparison articles answer with a feature list copied from each project's homepage. I wanted numbers. So I built the same agent six times: once in plain Python and once in each of LangGraph, CrewAI, the OpenAI Agents SDK, Google ADK and the Claude Agent SDK. Every version got the same tools, the same safety rule and the same human-approval step, and every version ran the same 8 tests 10 times. I measured lines of code, the prompt tokens each framework sends to the model, latency, install size and what happens when things go wrong.

This guide gives you the results, the code for all six, and a clear way to choose. If you have never built an agent, start with How to Build Your First AI Agent. The plain-Python baseline here is the same agent from that post.


Which AI agent framework should you use?

Choose by the shape of your work, not by popularity. Use LangGraph or Google ADK 2.x when you need fixed steps, branches and approvals. Use CrewAI for role-based teams and fast prototypes. Use the OpenAI Agents SDK for the least code on OpenAI models. Use the Claude Agent SDK when the agent works with files, code or a shell. Use plain Python for one agent with two or three tools.

If your agent…PickWhy
Follows a fixed process with branches, retries and human approvalsLangGraph or Google ADK 2.xYou draw the steps as a graph, and state is saved at each step, so a run can pause and resume
Is easiest to describe as a team of roles (researcher, writer, reviewer)CrewAIRoles, goals and tasks are the building blocks; the fewest lines in my test
Runs on OpenAI models and needs handoffs between a few agentsOpenAI Agents SDKA small loop with tools, handoffs, guardrails and approvals built in
Reads and edits files, runs commands or writes codeClaude Agent SDKIt is the Claude Code harness as a library, with file, shell and search tools ready to use
Lives on Google Cloud, or needs Go, Java or TypeScript alongside PythonGoogle ADKStrong Google Cloud integration and several language SDKs
Is a .NET or Azure shopMicrosoft Agent FrameworkThe successor to AutoGen and Semantic Kernel, for Python and .NET
Has one job and two or three toolsNo frameworkAbout 30 lines of Python, and nothing you don't understand

All five frameworks passed every test in my build-off. The differences are in how much each one adds to your prompts, your install and your mental load, which is what the rest of this guide measures.

What does an AI agent framework actually do?

An agent framework runs the loop for you: it sends the conversation and tool definitions to the model, runs the tool the model asks for, feeds the result back and repeats until the model gives an answer. It also adds the parts that are tedious to build well: state, retries, input validation, human approval, tracing and connections to MCP servers.

In my harness engineering guide I called this code the harness: everything around the model that decides what it sees, what it can do and when it stops. A framework is a ready-made harness. Here is what that usually includes:

  • The tool loop: turning Python functions into tool schemas, calling them, and handling the model's reply.
  • Validation: checking the model's tool arguments against the schema before your code runs.
  • State and memory: keeping the conversation, and often saving it so a run can survive a restart.
  • Human in the loop: pausing before a risky action until a person approves.
  • Multi-agent patterns: handoffs, supervisors, crews and graphs (see Multi-Agent Systems).
  • Integrations: model providers, MCP servers, A2A, tracing and evaluation tools.

None of this is magic. My plain-Python version does the core loop in 31 lines. What you pay for with a framework is the second half of that list, done carefully by people who have seen many failure cases.

The five frameworks in one minute each

Each framework has one core idea: LangGraph is a graph, CrewAI is a team, the OpenAI Agents SDK is a small loop, Google ADK is a workflow of agents, and the Claude Agent SDK is a full coding-agent harness. Knowing that idea tells you most of what each one is good at.

Five mental models for AI agent frameworks. LangGraph: a graph of nodes and edges with shared state and checkpoints. CrewAI: a team of agents with roles, goals and tasks. OpenAI Agents SDK: a small loop of agent, tools and handoffs with guardrails. Google ADK 2.x: a workflow runtime where agents, tools and functions are nodes. Claude Agent SDK: the Claude Code harness with built-in file, shell and search tools, subagents and MCP. Plain Python: your own while loop.
One idea per framework. Tap to enlarge.

LangGraph: you draw the graph

From the LangChain team. You define nodes (a model call, a tool call, any Python function), edges between them, and a shared state. A checkpointer saves the state after each step, which is what makes pausing for approval, resuming after a crash and "time travel" debugging possible. It reached 1.0 in October 2025. It is the framework every other one gets compared to: in Google's India search suggestions, every SDK I checked has a "vs langgraph" query.

CrewAI: you hire a team

You describe agents with a role, goal and backstory, give them tasks with an expected output, and put them in a crew that runs the tasks in order or under a manager agent. It also has Flows for event-driven pipelines. CrewAI is quick to start and reads almost like a job description, which is why it is popular for prototypes. It reached 1.0 in October 2025.

OpenAI Agents SDK: a small loop with a few primitives

An Agent has instructions and tools. Handoffs pass control to another agent, guardrails check inputs and outputs, and sessions keep history. In April 2026 OpenAI added a model-native harness and sandboxed execution, so agents can work with files and commands in an isolated workspace. It is still on 0.x version numbers, so expect some API changes between releases.

Google ADK: agents as a workflow

The Agent Development Kit started as a hierarchy of LLM agents and workflow agents (sequential, parallel, loop). ADK 2.0 rebuilt it around a graph-based workflow runtime where agents, tools and plain functions are nodes. Python 2.0 reached general availability on 19 May 2026, and Go and TypeScript followed in June and August. It works with Gemini natively and with other models through LiteLLM, which is how I connected it here.

Claude Agent SDK: the Claude Code harness as a library

Anthropic's SDK gives you the same agent loop that powers Claude Code: built-in tools for reading and editing files, running shell commands and searching, plus subagents, hooks, permissions and MCP. Your own tools run as an in-process MCP server. It is the most capable "out of the box" for file and code work, and also the heaviest. It runs the bundled Claude Code CLI as a subprocess and is built for Claude models.

Versions tested

FrameworkPackage (PyPI)Version testedReleasedMilestone
LangGraphlanggraph1.2.2420 Nov 20261.0.0 on 17 Oct 2025
CrewAIcrewai1.15.4524 Nov 20261.0.0 on 20 Oct 2025
OpenAI Agents SDKopenai-agents0.26.024 Nov 2026First release March 2025; sandbox and harness update April 2026
Google ADKgoogle-adk2.15.125 Nov 20262.0.0 on 19 May 2026
Claude Agent SDKclaude-agent-sdk0.2.18925 Nov 2026First release September 2025

Release dates are from PyPI. These projects ship weekly, so check the version before you copy code from any article, including this one.

The test: one agent, built six ways

Every version is the same read-only sales analyst. It answers questions about an Indian retailer's orders using two tools, refuses to change data, and asks a human before querying a large raw event log. Only the framework changes.

The setup:

  • Data: an in-memory SQLite database with 1,739 orders across six cities (Bengaluru, Mumbai, Delhi NCR, Pune, Chennai, Hyderabad), four categories and four months (July to October 2026), plus a 60,000-row raw event log.
  • Two tools: list_tables and run_select. The shared tool code blocks anything that is not a single SELECT, the same way for every framework.
  • One approval rule: any query touching orders_raw needs a human yes. Each framework implements this with its own approval mechanism. That is the part worth comparing.
  • 8 tests, 10 runs each: four normal questions, one request to delete data, one big query the human rejects, one the human approves, and one where the model sends a broken tool call (the wrong argument name) before retrying.

Why I used a scripted model

Real models vary from run to run, so a single run of each framework on GPT or Claude would mostly measure luck. I wanted to measure the framework. So every framework talked to the same local, scripted model: a small server I wrote that speaks both the OpenAI Chat Completions API and the Anthropic Messages API. It plays a perfect analyst (it always writes the right SQL) and logs every request each framework sends. That gives two things a live model can't: identical behaviour for all six agents, and an exact view of the prompt each framework builds.

The trade-off: a pass here means the framework carried the tool call, the approval and the result correctly. It does not tell you how well a real model reasons inside each framework. The evaluation section of AI Agents That Work shows how to test that part with pass^k runs on your own tasks.

Nothing left my laptop: no API keys, no cloud calls. I switched off CrewAI telemetry and OpenAI Agents SDK tracing, and pointed each SDK at the local server.

The shared tools (identical for all six)

# code/shared/sales.py (data set-up omitted)
import json, re

MAX_ROWS = 50
EXECUTED = []   # every SQL statement that actually ran, for the test checks

def list_tables() -> str:
    """List the tables you can query and their columns."""
    out = {}
    for (name,) in DB.execute("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name"):
        out[name] = [r[1] for r in DB.execute(f"PRAGMA table_info({name})")]
    return json.dumps(out)


def run_select(sql: str) -> str:
    """Run one read-only SELECT query on the sales database and return the rows as JSON."""
    s = sql.strip().rstrip(";")
    if not re.match(r"(?is)^\s*(select|with)\b", s) or re.search(r"(?i)\b(insert|update|delete|drop|alter|create|attach|pragma)\b", s) or ";" in s:
        return "BLOCKED: only a single read-only SELECT is allowed"
    EXECUTED.append(s)
    cur = DB.execute(s)
    cols = [d[0] for d in cur.description]
    rows = [dict(zip(cols, r)) for r in cur.fetchmany(MAX_ROWS)]
    return json.dumps(rows)


def needs_approval(sql: str) -> bool:
    """The human-approval rule: anything touching the 60,000-row raw event log needs a person to say yes."""
    return bool(re.search(r"(?i)\borders_raw\b", sql))

1. Plain Python (no framework)

The baseline: a hand-written loop with the OpenAI client and an if statement for approval.

"""Baseline: no framework. A hand-written tool loop with the OpenAI client (as in my first-agent post)."""
import json, sys, pathlib; sys.path.insert(0, str(pathlib.Path(__file__).parents[1]))
from harness import run, base_url, approver
from sales import SYSTEM, list_tables, run_select, needs_approval
from openai import AsyncOpenAI

client = AsyncOpenAI(base_url=base_url("plain"), api_key="local-test")
TOOLS = [
    {"type": "function", "function": {"name": "list_tables", "description": list_tables.__doc__,
                                      "parameters": {"type": "object", "properties": {}}}},
    {"type": "function", "function": {"name": "run_select", "description": run_select.__doc__,
                                      "parameters": {"type": "object", "properties": {"sql": {"type": "string"}},
                                                     "required": ["sql"]}}},
]

def call_tool(name, args):
    if name == "list_tables":
        return list_tables()
    if needs_approval(args["sql"]) and not approver(args["sql"]):
        return "DENIED: a human did not approve this query"
    return run_select(args["sql"])

async def ask(prompt):
    messages = [{"role": "system", "content": SYSTEM}, {"role": "user", "content": prompt}]
    for _ in range(8):  # hard step limit
        r = await client.chat.completions.create(model="gpt-4o-mini", messages=messages, tools=TOOLS)
        msg = r.choices[0].message
        if not msg.tool_calls:
            return msg.content
        messages.append(msg.model_dump(exclude_none=True))
        for tc in msg.tool_calls:
            result = call_tool(tc.function.name, json.loads(tc.function.arguments))
            messages.append({"role": "tool", "tool_call_id": tc.id, "content": result})
    return "Stopped: step limit reached"

run("plain", ask)

2. LangGraph

A model node and a tool node joined in a loop. The approval is interrupt() inside the tool, which pauses the graph. You resume it with Command(resume=True or False). It needs a checkpointer, because the paused state has to be stored somewhere.

"""LangGraph: you draw the graph. Model node -> tool node -> back, with a checkpointer so a
human approval can pause the run (interrupt) and resume it later (Command)."""
import uuid, sys, pathlib; sys.path.insert(0, str(pathlib.Path(__file__).parents[1]))
from harness import run, base_url, approver
from sales import SYSTEM, list_tables, run_select, needs_approval
from langchain_core.tools import tool
from langchain_openai import ChatOpenAI
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.graph import START, MessagesState, StateGraph
from langgraph.prebuilt import ToolNode, tools_condition
from langgraph.types import Command, interrupt

@tool("list_tables")
def list_tables_tool() -> str:
    """List the tables you can query and their columns."""
    return list_tables()

@tool("run_select")
def run_select_tool(sql: str) -> str:
    """Run one read-only SELECT query on the sales database and return the rows as JSON."""
    if needs_approval(sql) and not interrupt({"sql": sql}):   # pauses the graph until a human answers
        return "DENIED: a human did not approve this query"
    return run_select(sql)

tools = [list_tables_tool, run_select_tool]
llm = ChatOpenAI(model="gpt-4o-mini", base_url=base_url("langgraph"), api_key="local-test").bind_tools(tools)

def model(state: MessagesState):
    return {"messages": [llm.invoke([("system", SYSTEM), *state["messages"]])]}

g = StateGraph(MessagesState)
g.add_node("model", model)
g.add_node("tools", ToolNode(tools))
g.add_edge(START, "model")
g.add_conditional_edges("model", tools_condition)   # tool call? go to tools, else finish
g.add_edge("tools", "model")
graph = g.compile(checkpointer=InMemorySaver())

async def ask(prompt):
    config = {"configurable": {"thread_id": str(uuid.uuid4())}, "recursion_limit": 16}
    result = await graph.ainvoke({"messages": [("user", prompt)]}, config)
    while result.get("__interrupt__"):                  # a tool asked for approval
        sql = result["__interrupt__"][0].value["sql"]
        result = await graph.ainvoke(Command(resume=approver(sql)), config)
    return result["messages"][-1].content

run("langgraph", ask)

3. CrewAI

An agent with a role, a task and a crew. The approval is a @before_tool_call hook. Returning False blocks the call.

"""CrewAI: a team. An Agent with a role, goal and backstory works on a Task inside a Crew.
A before_tool_call hook returning False blocks the tool call until a human says yes."""
import os, sys, pathlib; sys.path.insert(0, str(pathlib.Path(__file__).parents[1]))
os.environ.update(CREWAI_DISABLE_TELEMETRY="true", OTEL_SDK_DISABLED="true", CREWAI_TRACING_ENABLED="false")
from harness import run, base_url, approver
from sales import SYSTEM, list_tables, run_select, needs_approval
from crewai import LLM, Agent, Crew, Task
from crewai.hooks import before_tool_call
from crewai.tools import tool

@before_tool_call(tools=["run_select"])
def approve_big_queries(ctx):
    if needs_approval(ctx.tool_input["sql"]) and not approver(ctx.tool_input["sql"]):
        return False          # blocks the call
    return None

analyst = Agent(
    role="Sales data analyst", goal="Answer sales questions accurately with SQL", backstory=SYSTEM,
    tools=[tool("list_tables")(list_tables), tool("run_select")(run_select)],
    llm=LLM(model="openai/gpt-4o-mini", base_url=base_url("crewai"), api_key="local-test"),
    max_iter=8, verbose=False,
)

async def ask(prompt):
    task = Task(description=prompt, expected_output="A short, direct answer", agent=analyst)
    result = await Crew(agents=[analyst], tasks=[task]).kickoff_async()
    return result.raw

run("crewai", ask)

4. OpenAI Agents SDK

An Agent and a Runner. needs_approval on the tool makes the run stop with interruptions. You approve or reject each one on the saved RunState and run again from that state.

"""OpenAI Agents SDK: a small loop. Agent + tools; needs_approval pauses the run with an
interruption that you approve or reject, then you resume from the saved state."""
import sys, pathlib; sys.path.insert(0, str(pathlib.Path(__file__).parents[1]))
from harness import run, base_url, approver
from sales import SYSTEM, list_tables, run_select, needs_approval
from agents import Agent, OpenAIChatCompletionsModel, Runner, function_tool, set_tracing_disabled
from openai import AsyncOpenAI

set_tracing_disabled(True)   # tracing is on by default and uploads to OpenAI; off for a local test

async def big_query(ctx, params, call_id) -> bool:
    return needs_approval(params.get("sql", ""))

tools = [function_tool(list_tables), function_tool(run_select, needs_approval=big_query)]
model = OpenAIChatCompletionsModel(model="gpt-4o-mini",
                                   openai_client=AsyncOpenAI(base_url=base_url("openai_agents"), api_key="local-test"))
agent = Agent(name="Sales analyst", instructions=SYSTEM, tools=tools, model=model)

async def ask(prompt):
    result = await Runner.run(agent, prompt, max_turns=8)
    while result.interruptions:                       # a tool call is waiting for a human
        state = result.to_state()
        for item in result.interruptions:
            if approver(item.arguments):
                state.approve(item)
            else:
                state.reject(item, rejection_message="DENIED: a human did not approve this query")
        result = await Runner.run(agent, state)
    return result.final_output

run("openai_agents", ask)

5. Google ADK

An LlmAgent run by a Runner over a session. require_confirmation makes the tool emit an adk_request_confirmation event. You answer it with a function response, and the run continues.

"""Google ADK 2.x: an LlmAgent run by a Runner over a session. require_confirmation makes the
tool emit a confirmation request; you answer it with a FunctionResponse and the run continues."""
import uuid, sys, pathlib; sys.path.insert(0, str(pathlib.Path(__file__).parents[1]))
from harness import run, base_url, approver
from sales import SYSTEM, list_tables, run_select, needs_approval
from google.adk.agents import LlmAgent
from google.adk.models.lite_llm import LiteLlm
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService
from google.adk.tools import FunctionTool
from google.genai import types

def big_query(sql: str = "") -> bool:
    return needs_approval(sql)

agent = LlmAgent(
    name="sales_analyst", instruction=SYSTEM,
    model=LiteLlm(model="openai/gpt-4o-mini", api_base=base_url("adk"), api_key="local-test"),
    tools=[FunctionTool(list_tables), FunctionTool(run_select, require_confirmation=big_query)],
)
sessions = InMemorySessionService()
runner = Runner(agent=agent, app_name="sales", session_service=sessions)

async def ask(prompt):
    session = await sessions.create_session(app_name="sales", user_id="u1", session_id=str(uuid.uuid4()))
    message, answer = types.Content(role="user", parts=[types.Part(text=prompt)]), None
    while message:
        pending, next_message = None, None
        async for event in runner.run_async(user_id="u1", session_id=session.id, new_message=message):
            for call in event.get_function_calls():
                if call.name == "adk_request_confirmation":     # the tool is waiting for a human
                    pending = call
            if event.is_final_response() and event.content and event.content.parts and event.content.parts[0].text:
                answer = event.content.parts[0].text
        if pending:
            sql = pending.args["originalFunctionCall"]["args"]["sql"]
            next_message = types.Content(role="user", parts=[types.Part(function_response=types.FunctionResponse(
                id=pending.id, name="adk_request_confirmation", response={"confirmed": approver(sql)}))])
        message = next_message
    return answer

run("adk", ask)

6. Claude Agent SDK

Tools are an in-process MCP server. can_use_tool is called before any tool that is not pre-approved, and returns allow or deny. I turned off the built-in tools with tools=[] and stopped it loading my own Claude Code settings with setting_sources=[].

"""Claude Agent SDK: the Claude Code harness as a library. Your tools run as an in-process MCP
server; can_use_tool is called before any tool that is not pre-approved, and can allow or deny it."""
import tempfile, sys, pathlib; sys.path.insert(0, str(pathlib.Path(__file__).parents[1]))
from harness import run, base_url, approver
from sales import SYSTEM, list_tables, run_select, needs_approval
from claude_agent_sdk import (ClaudeAgentOptions, ClaudeSDKClient, PermissionResultAllow,
                              PermissionResultDeny, ResultMessage, create_sdk_mcp_server, tool)

@tool("list_tables", list_tables.__doc__, {})
async def list_tables_tool(args):
    return {"content": [{"type": "text", "text": list_tables()}]}

@tool("run_select", run_select.__doc__, {"sql": str})
async def run_select_tool(args):
    return {"content": [{"type": "text", "text": run_select(args["sql"])}]}

async def gate(tool_name, tool_input, context):
    if tool_name.endswith("run_select") and needs_approval(tool_input.get("sql", "")) and not approver(tool_input):
        return PermissionResultDeny(message="DENIED: a human did not approve this query")
    return PermissionResultAllow()

options = ClaudeAgentOptions(
    system_prompt=SYSTEM, model="claude-sonnet-4-5", max_turns=8,
    tools=[],                                       # no built-in Bash/Read/Edit tools for this agent
    mcp_servers={"sales": create_sdk_mcp_server("sales", tools=[list_tables_tool, run_select_tool])},
    allowed_tools=["mcp__sales__list_tables"],      # pre-approved; run_select goes through the gate
    can_use_tool=gate, setting_sources=[],          # don't load my own Claude Code settings
    env={"ANTHROPIC_BASE_URL": base_url("claude_sdk").removesuffix("/v1"), "ANTHROPIC_API_KEY": "local-test",
         "CLAUDE_CONFIG_DIR": tempfile.mkdtemp(), "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"},
)

async def ask(prompt):
    async with ClaudeSDKClient(options=options) as client:
        await client.query(prompt)
        async for message in client.receive_response():
            if isinstance(message, ResultMessage):
                return message.result

run("claude_sdk", ask)

The scripted model, the test harness and the runner are about 470 more lines (including the dataset), shared by all six. Here is the output of run_all.py, with the per-question lines trimmed to tests 5 to 8:

plain: 70/80 passed, median 6 ms per question
  Q5 PASS  write refused
  Q6 PASS  denied, not run
  Q7 PASS  correct
  Q8 FAIL  crashed: "ERROR KeyError: 'sql'"
langgraph: 80/80 passed, median 10 ms per question
  Q5 PASS  write refused
  Q6 PASS  denied, not run
  Q7 PASS  correct
  Q8 PASS  bad call rejected, model retried
crewai: 80/80 passed, median 19 ms per question
  Q5 PASS  write refused
  Q6 PASS  denied, not run
  Q7 PASS  correct
  Q8 PASS  bad call rejected, model retried
openai_agents: 80/80 passed, median 11 ms per question
  Q5 PASS  write refused
  Q6 PASS  denied, not run
  Q7 PASS  correct
  Q8 PASS  bad call held for a human (fail closed)
adk: 80/80 passed, median 16 ms per question
  Q5 PASS  write refused
  Q6 PASS  denied, not run
  Q7 PASS  correct
  Q8 PASS  bad call rejected, model retried
claude_sdk: 80/80 passed, median 316 ms per question
  Q5 PASS  write refused
  Q6 PASS  denied, not run
  Q7 PASS  correct
  Q8 PASS  bad call rejected, model retried
plain: 70/80 passed, median 6 ms per question
  Q5 PASS  write refused
  Q6 PASS  denied, not run
  Q7 PASS  correct
  Q8 FAIL  crashed: "ERROR KeyError: 'sql'"
langgraph: 80/80 passed, median 10 ms per question
  Q5 PASS  write refused
  Q6 PASS  denied, not run
  Q7 PASS  correct
  Q8 PASS  bad call rejected, model retried
crewai: 80/80 passed, median 19 ms per question
  Q5 PASS  write refused
  Q6 PASS  denied, not run
  Q7 PASS  correct
  Q8 PASS  bad call rejected, model retried
openai_agents: 80/80 passed, median 11 ms per question
  Q5 PASS  write refused
  Q6 PASS  denied, not run
  Q7 PASS  correct
  Q8 PASS  bad call held for a human (fail closed)
adk: 80/80 passed, median 16 ms per question
  Q5 PASS  write refused
  Q6 PASS  denied, not run
  Q7 PASS  correct
  Q8 PASS  bad call rejected, model retried
claude_sdk: 80/80 passed, median 316 ms per question
  Q5 PASS  write refused
  Q6 PASS  denied, not run
  Q7 PASS  correct
  Q8 PASS  bad call rejected, model retried

Framework                    Pass   Lines  Tokens, 1st call  Tokens/question  ms/question  Import s  Packages  Install MB
Plain Python (no framework)  70/80  31     207               866              6            0.35      16        47        
LangGraph                    80/80  36     204               975              10           0.66      43        97        
CrewAI                       80/80  23     290               1270             19           1.27      119       625       
OpenAI Agents SDK            80/80  24     252               1050             11           0.78      38        98        
Google ADK                   80/80  36     238               1117             16           0.68      84        415       
Claude Agent SDK             80/80  31     599               2328             316          0.43      30        433

Results: what changed between frameworks

All five frameworks passed all 80 runs. Plain Python passed 70: it crashed on the malformed tool call. The frameworks differed in what they add: CrewAI's first prompt was 40% larger than plain Python's, the Claude Agent SDK's was 2.9 times larger, and installs ranged from 47 MB to 625 MB.

Bar charts comparing six versions of the same agent. Prompt tokens on the first model call: LangGraph 204, plain Python 207, Google ADK 238, OpenAI Agents SDK 252, CrewAI 290, Claude Agent SDK 599. Install size: plain Python 47 MB, LangGraph 97 MB, OpenAI Agents SDK 98 MB, Google ADK 415 MB, Claude Agent SDK 433 MB, CrewAI 625 MB. All five frameworks passed 80 of 80 runs; plain Python passed 70 of 80.
Same agent, same scripted model, 80 runs each. Tap to enlarge.
Plain PythonLangGraphCrewAIOpenAI Agents SDKGoogle ADKClaude Agent SDK
Tests passed (8 × 10)70/8080/8080/8080/8080/8080/80
Lines of agent code313623243631
Prompt tokens, first call207204290252238599
Tool schema tokens113111138159126110
Prompt tokens per question866*9751,2701,0501,1172,328
Framework time per question6 ms10 ms19 ms11 ms16 ms316 ms
Import time0.35 s0.66 s1.27 s0.78 s0.68 s0.43 s
Packages installed1643119388430
Install size47 MB97 MB625 MB98 MB415 MB433 MB

Tokens counted with OpenAI's o200k tokenizer on the exact requests each framework sent, so Claude figures are approximate. *Plain Python is lower partly because it crashed on test 8 and made fewer calls. Lines exclude blank lines, comments and docstrings. Google ADK includes LiteLLM. Timings are on a MacBook with an instant local model, so they show framework overhead only; a real model adds 1 to 10 seconds per call.

1. Lines of code: closer than you'd think

For a simple agent, frameworks don't save much typing. CrewAI (23 lines) and the OpenAI Agents SDK (24) were shortest. LangGraph and ADK (36 each) were longest, because they make you wire up the graph or the session and handle the approval event yourself. Plain Python sat in the middle at 31. The saving is not in the happy path. It is in the edge cases you would otherwise write and test yourself, like the broken tool call below.

2. Hidden prompt overhead: what each framework adds

Because the scripted model logged every request, I could see exactly what each framework adds to my 42-word system prompt:

  • LangGraph sent my prompt and tools as written. It was the leanest, even slightly leaner than my hand-written loop.
  • Google ADK appended one line: "You are an agent. Your internal name is "sales_analyst"."
  • OpenAI Agents SDK kept the prompt but used strict JSON schemas with titles for tools, so the tool definitions were 41% larger than mine (159 vs 113 tokens).
  • CrewAI rewrote the prompt around the role ("You are Sales data analyst…", "Your personal goal is…") and wrapped the question as "Current Task" with "the expected criteria for your final answer". That added 40% to the first call.
  • Claude Agent SDK added a billing header line, an SDK identity line, and system reminders with my working directory, platform, shell, OS version, the model name and today's date. It also asked the model for extended thinking with a 31,999-token budget by default. The first call was 2.9 times the plain-Python size, and that is with built-in tools switched off.

The last point is the biggest one in practice. When I re-ran the Claude Agent SDK with its default Claude Code system prompt and built-in tools, the first request was about 21,000 tokens (about 6,000 of system prompt, 12,000 of tool definitions and 3,000 of messages) before the agent did anything. That is the cost of a harness built for coding work. It is worth it when you use those tools, and wasteful for a two-tool SQL agent. Prompt caching softens it, but trim the tools and the system prompt when you don't need them, and set thinking explicitly.

3. Speed: frameworks are fast, subprocesses are not

With an instant model, five of the six added 6 to 19 milliseconds per question. That is noise next to a real model call. The Claude Agent SDK added about 316 ms, because my code opened a new client for each question, which starts the bundled Claude Code CLI as a subprocess. Reuse one client across many questions if latency matters.

4. Install footprint: 47 MB to 625 MB

CrewAI pulled in 119 packages and 625 MB. ADK with LiteLLM pulled in 84 packages and 415 MB. The Claude Agent SDK has only 30 packages, but it bundles a 382 MB Claude Code binary. LangGraph and the Agents SDK were both under 100 MB. This matters for Docker images, serverless cold starts and supply-chain risk: every package is code you trust. More on that below.

How each framework pauses for human approval

All five frameworks have a built-in way to stop before a risky tool call and wait for a person. They differ in where the pause lives: inside the tool (LangGraph), in a hook (CrewAI), on the tool definition (OpenAI Agents SDK, Google ADK) or in a permission callback (Claude Agent SDK).

FrameworkMechanismHow you resumeWatch out for
LangGraphinterrupt(value) inside a node or toolgraph.invoke(Command(resume=answer), config) with the same thread_idNeeds a checkpointer; use a database-backed one in production so a pause can last hours
CrewAI@before_tool_call hook returns FalseThe run continues; the model is told the call was blockedHooks are global by default; filter by tool and agent name
OpenAI Agents SDKneeds_approval= on the tool (bool or function)state.approve(item) or state.reject(item), then Runner.run(agent, state)The state is serialisable, so you can store it and ask a person later
Google ADKrequire_confirmation= on FunctionToolSend a FunctionResponse named adk_request_confirmation with confirmedThe original arguments are nested inside the confirmation event
Claude Agent SDKcan_use_tool callback, or a PreToolUse hookReturn PermissionResultAllow or PermissionResultDenyTools listed in allowed_tools skip the callback entirely; the SDK printed a warning about this

In all six versions the delete request (test 5) was refused by the tool, not the model and not the framework. That is deliberate. A rule like "never write to the database" belongs in plain code that the model cannot talk its way past. The approval step is for actions that are sometimes fine and need a person's judgement. My prompt injection guide explains why this split matters.

What happens when the model sends a broken tool call?

In test 8, the model first called run_select with query instead of sql. LangGraph, CrewAI, Google ADK and the Claude Agent SDK rejected the call, sent the error back to the model, and the model retried correctly. The OpenAI Agents SDK held the call for human approval instead (it fails closed). My plain-Python loop crashed.

Real models do this more often than you would hope, especially smaller ones. Catching it is exactly the kind of thing frameworks do well and hand-written loops forget. Three extra lines (a try/except that returns the error to the model) would fix my baseline, but I only learnt that I needed them because the test failed.

There was a second lesson from my first run. My approval code read params["sql"] directly. In three frameworks, that approval code ran before the arguments were validated, so the broken call reached it with no sql key:

  • Google ADK passed the bad arguments to my confirmation function, which raised an error and crashed the whole run.
  • OpenAI Agents SDK caught the error and treated the call as needing approval. It failed closed, which is the safe choice.
  • Claude Agent SDK reported "Tool permission request failed" and denied the call. Also failed closed.
  • LangGraph and CrewAI validated the arguments first, so my approval code never saw them.

Your approval code is part of your security boundary, so it must handle missing and malformed input. After I changed it to params.get("sql", ""), every framework passed. The results table shows that final, fixed run.

What the benchmark numbers don't show

Benchmarks miss the things you feel after a month: how easy it is to debug, how often the API changes, how tied you are to one model vendor, and which languages you can use. Here is my honest read on each.

LangGraphCrewAIOpenAI Agents SDKGoogle ADKClaude Agent SDK
ModelsAny, through LangChain integrationsAny, through native providers and LiteLLMBuilt for OpenAI; others through any OpenAI-compatible endpoint or LiteLLMGemini natively; others through LiteLLMClaude models (also via cloud providers that host Claude)
LanguagesPython, JavaScriptPythonPython, TypeScriptPython, TypeScript, Go, JavaPython, TypeScript
Version stability1.x since Oct 20251.x since Oct 20250.x: expect breaking changes2.x since May 2026; 1.x to 2.x was not drop-in0.x: expect breaking changes
Debugging feelExplicit graph, easy to step through; a lot of conceptsFast to start; prompts are built for you, so read what it sendsSmall surface; easy to read the sourceEvents and sessions take getting used to; good dev UIPowerful defaults; the agent decides a lot, so add hooks and logs
Best atLong, stateful workflows with approvalsRole-based teams and prototypesSimple agents and handoffs on OpenAIGoogle Cloud and multi-language teamsFile, code and shell work

One more practical point: defaults send data. The OpenAI Agents SDK turns tracing on by default and uploads traces to OpenAI, and CrewAI collects anonymous telemetry unless you switch it off. Both are documented and easy to disable. Check every framework's defaults against your company's data rules before you send it customer data.

Which framework should you choose?

Answer three questions in order: does this need a framework at all, which model and cloud are you committed to, and is the work a fixed process or an open-ended task?

  1. Do you need a framework? If the agent has one job, a few tools and no pauses, write the loop yourself (and add the try/except). You will understand every line. Move to a framework when you need saved state, approvals that wait for hours, several agents, or tracing.
  2. Which model and cloud? All-in on OpenAI: the Agents SDK is the shortest path. On Google Cloud with Gemini: ADK. Building on Claude, especially for code or documents: the Claude Agent SDK. Mixed or undecided: LangGraph or CrewAI keep you model-neutral.
  3. Fixed process or open task? A known sequence with branches and approvals (claims processing, report generation, onboarding): a graph, so LangGraph or ADK 2.x. An open task where the agent should decide its own steps (research, coding, fixing things): a loop-style SDK. A job that maps cleanly to roles: CrewAI.

Whatever you choose, keep your tools as plain functions or MCP servers, like the shared sales.py above. Then switching frameworks later means rewriting about 30 lines, not your whole system. MCP for tools and A2A for agent-to-agent calls are the portability layer; see Agent Skills vs MCP vs Tools.

Also worth knowing

NameWhat it isWhen to look at it
Microsoft Agent FrameworkThe successor to AutoGen and Semantic Kernel; 1.0 on 2 April 2026; Python and .NETAzure and .NET teams; anyone migrating from AutoGen
AutoGenMicrosoft's earlier multi-agent framework, now in maintenance modeOnly for existing projects; plan a move
Pydantic AIType-safe agents with validated, structured outputsWhen outputs must match a schema exactly
LlamaIndexData and retrieval first, with agent workflows on topRAG-heavy agents over many documents
n8nA visual workflow automation tool with AI agent nodes, not a code frameworkBusiness automations that non-developers will maintain
OpenClawAn open-source, self-hosted personal assistant agent that connects models to messaging apps and toolsPersonal or always-on assistants; treat its skills and plugins as untrusted code

How to install an agent framework safely

Agent frameworks run with your API keys and cloud credentials, which makes them a target. On 17 November 2026, two malicious versions of Microsoft's agent-framework package (1.26.1 and 1.26.2) were uploaded to PyPI with a credential stealer. Pin exact versions, lock hashes and keep secrets away from install steps.

According to the GitHub security advisory and Microsoft's update, the malicious code was in the published packages, not in Microsoft's repository, and only the agent-framework meta-package was affected. 1.26.0 is the last clean version. PyPI quarantined both versions within about an hour. The payload used a .pth file, which Python runs automatically at startup, so it ran even if your code never imported the package. If you installed either version, treat that machine and its CI secrets as exposed and rotate them.

It is not a one-off: most agent frameworks release every week, and each release pulls in dozens of dependencies. My checklist:

  • Pin exact versions (crewai==1.15.45, not crewai>=1.0), and update on purpose, not by accident.
  • Lock with hashes: uv lock, or pip-compile --generate-hashes with pip install --require-hashes, so a re-uploaded file fails the install.
  • Wait a few days before adopting a brand-new release in production, unless it fixes a security issue.
  • Keep secrets out of install steps: install dependencies in a CI job with no cloud credentials, then run with credentials in a separate step.
  • One virtual environment per agent service, as in this test, so one framework's dependency tree can't touch another.
  • Subscribe to advisories for the frameworks you use (GitHub's Dependabot alerts are free).

Which agent framework should you learn for jobs in India?

Learn the concepts first in plain Python, then LangGraph, then the SDK of the cloud or model your target employers use. Employers hire for agent skills (tool design, state, approvals, evaluation, security) far more than for one framework's syntax.

Search behaviour backs this order. In India's Google search suggestions, LangGraph is the reference point: "openai agents sdk vs langgraph", "google adk vs langgraph", "claude agent sdk vs langgraph" and "pydantic ai vs langgraph" all appear, and "langgraph vs crewai" is the top comparison query. "Google ADK course" also shows up, which fits the many Indian teams working on Google Cloud.

A practical plan:

  1. Build the agent in this post in plain Python until you can explain every line.
  2. Rebuild it in LangGraph, with a database checkpointer and an approval step.
  3. Rebuild it once more in the SDK your target companies use: OpenAI, Google or Anthropic.
  4. Write tests for each version and compare them, the way I did here. That comparison is a far stronger portfolio piece than a tutorial clone.

My 6-month agentic AI skills roadmap puts this into a month-by-month plan.

Agent framework interview questions

These come up in agentic AI interviews. Short, honest answers beat memorised feature lists.

  • LangGraph vs CrewAI: when would you choose each? LangGraph for explicit, stateful processes where I need control over each step and approvals. CrewAI when the problem maps naturally to roles and I want a working prototype fast.
  • What is a checkpointer in LangGraph? It saves the graph's state after each step, keyed by a thread ID, so a run can pause for a human, resume later or recover after a crash.
  • What is a handoff in the OpenAI Agents SDK? A tool that transfers the conversation to another agent, which then takes over. It differs from calling an agent as a tool, where control comes back to the caller.
  • How would you add human approval to an agent? Gate the specific risky tool, not the whole agent. Pause and save the state, ask a person, then resume with approve or reject. Hard rules, like no writes, go in the tool code.
  • Do you always need a framework? No. For one agent with a few tools a plain loop is clearer. I would add one when I need saved state, approvals, several agents or tracing.
  • How do you compare two frameworks fairly? Same tools, same model, same tests, many runs, and measure pass rate, tokens and latency. Log the actual requests to see what each framework adds.
  • What changed in Google ADK 2.0? It moved from a hierarchy of agents to a graph-based workflow runtime where agents, tools and functions are nodes.
  • What is the Claude Agent SDK, and when is it a poor fit? The Claude Code agent harness as a library, with file, shell and search tools. It is a poor fit for a tiny agent, because the default prompt and tool set add many tokens unless you trim them.

Agent framework selection checklist

Run through this before you commit a project to a framework:

  • I can explain why plain Python is not enough for this agent
  • The framework supports my model provider without hacks
  • Tools are plain functions or MCP servers, so I could switch frameworks later
  • Hard safety rules (no writes, spend limits) live in tool code, not prompts
  • Human approval uses the framework's native pause-and-resume, with state stored durably
  • Approval and hook code handles missing or malformed arguments
  • I have logged and read the full prompt the framework sends, and trimmed what I don't need
  • Tracing and telemetry defaults are checked against our data rules
  • Versions are pinned and locked with hashes; secrets are not present at install time
  • A repeatable test suite (pass^k over several runs) runs on every framework or model upgrade

Sources and further reading

Key takeaways

  • Choose by the shape of the work: graphs (LangGraph, ADK 2.x) for fixed processes, CrewAI for role-based teams, the OpenAI Agents SDK for the least code on OpenAI, the Claude Agent SDK for file and code work, and plain Python for small agents.
  • In my build-off, all five frameworks passed 80 of 80 runs. Plain Python passed 70: it crashed on a malformed tool call that every framework handled.
  • Frameworks add hidden prompt text: about 40% more for CrewAI and 2.9 times more for the Claude Agent SDK on the first call, and about 21,000 tokens with Claude Code's default prompt and tools. Log what your framework sends.
  • Install size ranged from 47 MB (plain) to 625 MB (CrewAI). Every package is code you trust.
  • Every framework has native human approval, but approval code must handle malformed input. Hard rules belong in tool code.
  • Pin and hash-lock framework versions. The November 2026 agent-framework PyPI compromise ran without being imported.
  • Keep tools as plain functions or MCP servers, so switching frameworks costs about 30 lines.

Frequently asked questions

What is the best AI agent framework in 2026?

There is no single best one. LangGraph and Google ADK 2.x suit fixed, stateful processes with approvals; CrewAI suits role-based teams and prototypes; the OpenAI Agents SDK is the simplest on OpenAI models; the Claude Agent SDK is strongest for file, code and shell work. For a small agent with a few tools, plain Python is often best.

LangGraph vs CrewAI: which is better?

LangGraph is better when you need explicit control: a graph of steps, saved state, retries and human approvals that can pause and resume. CrewAI is better when the problem maps to roles and tasks and you want a working prototype quickly. In my test both passed every run; CrewAI needed fewer lines but sent about 30% more prompt tokens per question than LangGraph.

Which AI agent framework is best for beginners?

Build your first agent in plain Python so you understand the loop, then learn LangGraph, the framework others are most often compared with. CrewAI and the OpenAI Agents SDK are the quickest to get running if you want results on day one.

Is LangChain the same as LangGraph?

No. LangChain is a library of model, tool and retrieval integrations. LangGraph, from the same team, is the framework for building stateful agents as graphs with checkpoints. LangGraph can use LangChain integrations but does not require LangChain's older agent classes.

Is AutoGen still maintained?

AutoGen is in maintenance mode. Microsoft Agent Framework, which reached 1.0 in April 2026, is the successor to both AutoGen and Semantic Kernel, and Microsoft publishes migration guides.

What changed in Google ADK 2.0?

ADK 2.0 moved from a hierarchy of agents to a graph-based workflow runtime where agents, tools and functions are nodes. Python 2.0 reached general availability on 19 May 2026, followed by Go and TypeScript. Upgrading from 1.x is not drop-in.

Is the Claude Agent SDK only for coding agents?

No, but it is built from the Claude Code harness, so it shines at file, code and shell work. For small agents, trim the built-in tools and system prompt: with Claude Code's defaults my first request was about 21,000 tokens before the agent did anything.

Do I need a framework to build an AI agent?

Not always. A single agent with a few tools needs about 30 lines of Python. A framework earns its place when you need saved state, human approvals that can wait, several agents, input validation or tracing. My plain-Python version crashed on a malformed tool call that every framework handled.

How do AI agent frameworks handle human approval?

LangGraph uses interrupt() and resumes with Command; CrewAI uses a before_tool_call hook; the OpenAI Agents SDK uses needs_approval and approve or reject on the saved run state; Google ADK uses require_confirmation and a confirmation reply; the Claude Agent SDK uses a can_use_tool callback or hooks.

Is n8n an AI agent framework?

n8n is a visual workflow automation tool with AI agent nodes, not a code framework. It suits business automations maintained by non-developers. LangGraph, CrewAI and the SDKs suit agents you build and test in code.

What is OpenClaw?

OpenClaw is an open-source, self-hosted personal assistant agent that connects language models to messaging apps and tools. It is a ready-made agent product rather than a library for building your own agents.

Which agent framework should I learn for jobs in India?

Learn agent concepts in plain Python, then LangGraph, then the SDK of the cloud or model your target employers use (OpenAI, Google or Anthropic). Employers test tool design, state, approvals, evaluation and security more than one framework's syntax.


Choose your agent stack with confidence

The framework is the easy part to change if your tools, tests and safety rules are in good shape. The teams that ship reliable agents spend their time on those, not on framework debates. If you want help choosing a stack for a real use case, or training your team to build, test and secure agents in any of these frameworks, let's talk.

Next read: AI Agents That Work: How to Build, Evaluate and Secure Them

Book a free call →