How to compare agent frameworks
| Criterion | LangGraph | CrewAI | OpenAI Agents SDK | Google ADK |
|---|---|---|---|---|
| Core abstraction | State graph | Roles and events | Agent and Runner | Graphs and agents |
| Execution state | Checkpoints | Persistence and checkpoints | Sessions and RunState | Sessions and events |
| Orchestration mechanism | Nodes and transitions | Crew and Flow | Handoff or tool | Graph or delegation |
| SDK languages | Python, TypeScript | Python | Python, TypeScript | Python, TypeScript, Go, Java, Kotlin |
Separate the model from its runtime: the same model can work in several architectures, and one library can integrate several model providers. Compare who controls transitions, how state is saved, how delegation is bounded and what stops execution. API compatibility does not guarantee identical support for tools, streaming or structured outputs. [1][5][8][12]
An open-source library does not make inference or operations free. Separate model, infrastructure and managed-service charges from engineering time. Capabilities vary by release and SDK language; pin versions before a comparative experiment.
LangGraph: explicit state graphs
The Graph API defines state, nodes and edges, including conditional transitions. You can combine model-based classification with deterministic authorization, parallel retrieval and a verification loop. LangGraph does not require LangChain; Python and TypeScript implementations are available. [1][2]
A checkpointer saves execution state associated with a thread identifier; persistent storage can support recovery after process restart. An interrupt pauses execution for a human decision. Resuming can rerun code in the node before the interrupt, so external side effects must be idempotent. Choose this abstraction for explicit branching and state control, while budgeting for node contracts and state-update design. [3][4]
CrewAI: roles, tasks and flows
A Crew consists of agents and tasks with expected outcomes. Sequential processing follows a defined order; hierarchical processing uses a manager to coordinate work. This suits document analysis, report generation and clear divisions of responsibility. Adding agents does not automatically improve quality. [5][6]
Flows provide event-driven control, routing and explicit state outside a single Crew. @persist stores flow state; a separate checkpointing mechanism saves and resumes execution for agents, Crews and Flows. Saving state is not equivalent to replaying every external effect safely. Check which callbacks need reattaching. CrewAI is primarily a Python library. [7][9][25]
In the documented CrewAI 1.15.47 release, restoring a checkpoint may omit callable guardrails and callbacks. Reattach them from trusted application code before execution resumes, not from user data. Importing functions named by saved state requires separate opt-in and should be restricted to trusted checkpoints. Test that the same security policy remains enforced after restoration. [9]
OpenAI Agents SDK: agent loops and delegation
Agent configures instructions, models and tools; Runner executes turns until an outcome or stopping condition. A handoff transfers control to another agent, whereas an agent exposed as a tool returns a result to its parent. Python and TypeScript SDKs are available. Other model providers can be integrated, but not every OpenAI API feature is portable. [8][10][11]
Sessions manage conversation history, while RunState supports serialization of paused runs with pending approvals. This is not automatically equivalent to a durable business-process engine. Tracing and guardrails help inspect behavior, but coverage depends on the tool and delegation mechanism. Enforce authorization independently of the model. [13][14][15][21]
In the Python SDK, input guardrails run for the first agent in a chain; output guardrails cover the final output. Function-tool guardrails do not automatically cover handoffs or every hosted tool. Parallel input checks may detect a problem after execution has started. Keep serialized RunState in server-controlled storage and verify the reviewer’s identity and current permissions before each action. [13][15]
Google ADK: orchestration and service integration
ADK includes agents, tools, sessions and evaluation mechanisms. The 2.0 line for Python, TypeScript and Go supports graphs, dynamic workflows and agent collaboration; ADK should no longer be described only through the older SequentialAgent, ParallelAgent and LoopAgent classes. Java and Kotlin SDKs also exist, but do not assume feature parity. [12][16][24]
Sessions, events and state manage context and execution. Google Cloud integrations may simplify deployment in that environment, but ADK is not necessarily restricted to Gemini models. Verify model adapters, session-store requirements and event-schema migration when upgrading from ADK 1.x. [16][17][18]
The graph documentation also lists Kotlin from version 1.5.0, with graphs marked experimental. The separate Resume mechanism is documented for Python and Kotlin; it needs appropriate configuration, persistent storage for recovery after a restart, and additional implementation for custom agents. Do not infer resumability merely from graph support in a given SDK. [24][27]
The same process in four architectures
- Retrieve order
- Returns policy
- Proposal
- Approval
- Approval denied:no write
- Approval granted:Authorized write
Consider a returns assistant that retrieves an order, looks up the applicable returns policy, drafts a proposal and requests authorized approval of a refund. LangGraph can express the steps as a graph; CrewAI as a Flow invoking a specialist Crew; Agents SDK as a coordinator invoking specialists as tools; ADK as a graph of agent and function nodes. All variants use the same business services and contracts.
The model does not authorize a refund. The backend derives the customer's identity, validates the order, calculates the amount and binds approval to exact parameters. It records an operation identifier and checks the payment system before retrying after a lost response. Checkpointing does not guarantee exactly-once external execution. [19]
Security, testing and observability
Restrict tools to the required scope, validate arguments and results, isolate tenants and bound time, calls and spending. Instructions embedded in documents or MCP responses are untrusted data. Delegation must not expand privileges. Traces and checkpoints may contain sensitive data; restrict their contents, retention and access. [19]
Unit-test tool contracts, integration-test state recovery and regression-test the end-to-end process on a stable dataset. Include denied approval, duplicate delivery, missing evidence and a lost response after a write. Measure task success, policy violations, calls and p95 latency. Separate deterministic control tests from repeated model evaluations. [4][15][20][22][23]
For recovery tests, interrupt execution before a tool call, after the payment service accepts a refund but before its result is recorded, and while approval is pending. After restarting, inspect business state rather than only model history. Reject another tenant’s checkpoint, expired approval and an incompatible state schema; enforce single ownership of an active run or concurrency control. The idempotency key should identify the business operation and be enforced by the service that performs the write. [3][4][9][13][19][27]
Cost and selection criteria
| Variant | Monthly cost | Successful tasks | Cost per successful task |
|---|---|---|---|
| A | 440 USD | 9 000 | 0.0489 USD |
| B | 660 USD | 9 500 | 0.0695 USD |
For an illustrative 10,000 monthly tasks, variant A averages three model calls at USD 0.01 and two tool operations at USD 0.002, plus USD 100 infrastructure: USD 440. Variant B averages five model calls and three tool operations with the same infrastructure: USD 660. At 90% and 95% success respectively, cost per successful task is approximately USD 0.0489 and USD 0.0695. This is not a benchmark of particular libraries. Include engineering time, retries, persistence and platform fees as applicable.
In this illustration B costs USD 220 more and produces 500 additional successful outcomes. Assuming equal value per successful outcome, the incremental break-even value is USD 0.44 per additional success. This is illustrative and excludes fixed costs not included in the example. In a pilot, measure failed-task handling, manual interventions and retries as well as quality across independent repetitions.
Start with the smallest process meeting requirements. Consider LangGraph for explicit state graphs, CrewAI for role-based task division, Agents SDK for a lightweight tool loop and OpenAI integrations, and ADK for graphs and Google service integration. A simple backend and one model call may need no agent framework. Pilot on identical data, model and budget before comparing individually optimized configurations.
Related guide: Harness Engineering explains how to design agent execution environments. [26]
