# Contents

The 7 Best AI Agent Frameworks: Features and Tradeoffs

Building an agent is easy. Building one that survives production is not.

You can write a working agent in an afternoon. Call a model, let it choose a tool, run the tool, feed the result back, repeat until the task is done. That is a hundred lines in a single file, and it genuinely works.

The difficulty appears later, when that agent needs to remember what happened last week, resume a task after a process restart, ask a human for approval before it deletes something, run untrusted code without endangering the host, and produce enough telemetry that an engineer can explain a bad output three days after it happened.

An agent framework is the layer that decides how much of that you build yourself. Some frameworks are thin, giving you a clean model abstraction and staying out of the way. Others are opinionated orchestration engines with a durable state machine at the center. A third group are effectively packaged agents, where the framework ships a working harness and you configure it rather than assemble it.

These are genuinely different products aimed at genuinely different problems, and the differences only become visible under load. Rather than cataloging every library on GitHub, this guide covers seven frameworks that teams are actually shipping with today, spanning the main architectural approaches you are likely to evaluate.

By the end, you should understand what each framework believes about agent design, the tradeoffs that follow from those beliefs, and which applications each one fits.

What Is an AI Agent Framework?

An AI agent framework is the software layer that manages the loop between a language model and the tools it uses.

At minimum, that means calling a model, parsing its request to use a tool, executing the tool, returning the result, and repeating until the task is complete. Every framework in this guide does that. If it were the whole problem, the category would not exist.

The reason it does exist is that production agents accumulate requirements that have nothing to do with the loop itself. An agent needs somewhere to store conversation history and somewhere else to store durable facts about a user. It needs to survive a deployment mid-task. It needs to stop and wait for a human on consequential actions, sometimes for hours. It needs guardrails on both input and output. It needs to run generated code somewhere that is not your API server. It needs traces, and evaluations that catch regressions before users do.

Frameworks differ in how many of those concerns they absorb and how many they leave to you.

Model abstraction layers give you a uniform interface across providers, streaming, structured output, and tool calling, then let you build orchestration yourself. They are the least prescriptive option: you write the loop.

Orchestration engines require you to express the agent as a structure the framework understands, typically a graph of nodes or a workflow of steps. In exchange, the framework can persist that structure to a database, so a run can be paused, resumed after a crash, inspected mid-flight, or replayed later. This is the sense in which they are prescriptive. They constrain how you are allowed to describe control flow, and the payoff is execution state that outlives the process, and often the session, that created it.

Packaged harnesses invert the deal entirely. They ship a working agent, usually a coding agent, with its system prompt, toolset, context management, and permission model already assembled and tuned. You configure and constrain it rather than build it. The tradeoff is that you inherit its opinions about how an agent should behave, and those opinions are hard to override where you disagree.

No single category is better than the others; they solve different problems. A support triage bot and an autonomous refactoring agent have almost nothing in common architecturally, and a framework tuned for one will feel like the wrong shape for the other.

How to Evaluate an AI Agent Framework

Feature matrices are misleading in this category, because the same word means different things to different vendors. "Memory" can mean an in-process message array or a vector-backed store with retrieval and decay. "Sandbox" can mean a microVM with its own kernel, or a list of permitted shell commands checked before execution on your own machine. Both ship under the same word, and the gap between them is the difference between a contained breach and a total one.

These five dimensions have proven more useful than feature counts.

Agent and Workflow Primitives

The first question is what the framework asks you to build with.

Some frameworks give you an agent object and let control flow emerge from the model's decisions. Others make the control flow explicit and typed: a graph with nodes and edges, or a workflow with sequential steps, branches, and parallel fan-out. A third pattern is delegation, where agents hand off to other agents or call them as tools.

Emergent control flow is faster to prototype and harder to reason about. Explicit control flow requires more upfront design and gives you a system you can test, replay, and explain. The right choice depends on how much nondeterminism your domain tolerates. A research assistant can afford to wander. A workflow that issues refunds cannot.

Multi-agent structure is worth checking specifically. Some frameworks make delegation a named primitive, with a documented way for one agent to hand a task to another and get a result back. In others you build the same thing yourself by wrapping an agent in a function and registering it as a tool. Both work, but the first gives you tracing, error handling, and state passing between agents for free, while the second means you own those problems. Ask the question early, because retrofitting delegation onto an agent that grew organically is one of the more painful refactors in this space.

State, Memory, and Durability

Most agent demos are stateless. Almost no agent products are.

Separate three things that get conflated. Conversation state is the message history within a session. Long-term memory is knowledge that persists across sessions and is retrieved when relevant. Execution state is the framework's own record of where a run is, which is what makes resumption possible.

The third is the one teams underestimate. If your agent's execution state lives only in process memory, then a deploy, a crash, or a timeout loses the task. Durable execution persists each step so a run resumes from its last completed step rather than the beginning. That matters enormously for long tasks, and not at all for a chat turn that finishes in four seconds.

Human-in-the-loop is the same problem wearing a different hat. Pausing an agent for hours while a person reviews a proposed action is only possible if the run's state can outlive the process holding it. Check whether the framework treats suspension as a real primitive or as an exception you catch and reconstruct yourself.

Execution and Isolation Model

Any agent that writes code, installs packages, runs tests, or operates a shell needs somewhere to do that, and the frameworks in this guide disagree profoundly about where.

Three distinct postures show up, and they are frequently mistaken for one another.

Host execution with permissions runs commands directly on the machine running your agent, controlling risk through allowlists, approval prompts, and interception hooks. This is a permission model, not containment: an allowlisted command such as pythongit, or make can spawn arbitrary processes, so a model inclined to work around the list generally can. It is appropriate for a developer's laptop and dangerous for a multi-tenant service. The better-documented frameworks say this plainly; the rest leave you to discover it.

A further trap is partial coverage. A framework may ship a real OS-enforced sandbox that applies to only one tool, leaving file operations, plugin processes, and lifecycle hooks running on the host beside it. Where such a sandbox is opt-in, or falls back to unsandboxed execution when it cannot start, the honest question is not whether the framework has a sandbox but what fraction of the agent's actual capabilities the sandbox covers when the defaults are left alone.

In-process interpreter isolation runs model-authored code inside an embedded engine such as QuickJS or a V8 isolate, with no filesystem, no network, and no process access. It is a genuine improvement, and it has one limitation that is easy to miss.

The code being isolated is the glue the model writes to sequence your tools, not the tools themselves. Suppose you expose two tools, queryDatabase and sendEmail, and the model writes a short program that calls the first, filters the rows, and passes the result to the second. That program runs inside the interpreter, where it genuinely cannot touch your filesystem or open a socket. But queryDatabase and sendEmail are your functions, and they execute on the host with the full privileges you gave them; the sandboxed program simply calls out to them and receives the results back.

So the boundary constrains what the model can improvise, not what it can reach. If a tool can delete records, a model that can call that tool can delete records, sandbox or no sandbox. This is the right design for the threat it addresses, which is model-written glue code doing something unintended. It is not a substitute for isolation when the thing you actually fear is the tool's own capability, or when the code being run came from a user rather than from your own tool definitions.

External environment isolation delegates execution to a separate machine boundary (a container, microVM, or full VM) reached over an API. The agent orchestrates from your infrastructure while code runs somewhere that cannot reach it. This is the only posture where a compromised execution step does not imply a compromised application, and it is the one that becomes non-negotiable once you are running code on behalf of users you have not met.

The direction of travel is worth noting, because several frameworks have revised their positions recently. In April 2026 CrewAI removed CodeInterpreterTool from crewai-tools and marked the allow_code_execution and code_execution_mode flags on Agent as deprecated, with removal scheduled for v2.0, directing users to a dedicated sandbox service instead. AG2's 1.0 rewrite in July 2026 retired the autogen.coding executor family from the main package, replacing it with a pluggable sandbox layer where the execution backend is a required argument with no default. The earlier executors remain available in AG2's separately maintained Classic distribution.

The two changes differ in kind. CrewAI deleted a feature and pointed elsewhere; AG2 rebuilt the same capability so that the isolation backend must be chosen explicitly. But both moved in the same direction, away from code execution that happens by default in the same process as the agent.

Ask which posture the framework defaults to, whether the boundary is configurable, and whether the framework's own documentation is honest about what its isolation does and does not cover. That last signal is more informative than the feature itself.

Observability and Evaluation

Agents fail in ways that unit tests do not catch. The same prompt produces different trajectories, and a regression often looks like a subtly worse tool-selection pattern rather than an exception.

Two capabilities matter. Tracing captures the full run, including every model call, tool invocation, argument, result, token count, and latency, so a failure can be reconstructed after the fact. Evaluation runs an agent against a fixed set of cases and scores the results, so behavioral drift is caught before deployment rather than after.

Pay attention to where these live and who owns the data. Some frameworks ship tracing in the box and export to any OpenTelemetry backend. Others instrument for free but require the vendor's hosted platform to actually see anything, which is a reasonable business model and a real consideration for regulated buyers. Vendor-neutral instrumentation is worth a premium if your telemetry has to land in infrastructure you already own.

Language Support and Deployment Model

Finally, the practical constraints.

Language support is more decisive than it should be. Roughly half this category is TypeScript-first and roughly half is Python-first, and cross-language options are the exception. If your product is a Next.js application, a Python-only framework means standing up and operating a second service. If your team's expertise is in the data and ML ecosystem, a TypeScript-only framework means rebuilding tooling you already have.

For deployment, ask a simpler question: what does the framework actually hand you at the end?

Some hand you a library. You import it, and where it runs is entirely your decision and entirely your responsibility. Others hand you a build step that produces a deployable server, often with preconfigured targets for specific hosting platforms. That is faster to get live, at the cost of fitting the shape the vendor had in mind.

One related thing is worth checking before you commit. Almost every vendor in this category gives the framework away and sells something adjacent, usually observability, a model gateway, or a hosted runtime. That is a reasonable way to fund open-source work. It only becomes a problem when a capability you assumed was part of the framework turns out to require the paid product, so it is worth establishing early which parts of the documented experience assume you have bought something.

The 7 Best AI Agent Frameworks

1. Mastra

Best for: TypeScript teams that want explicit, durable workflows with memory, evals, and observability included rather than assembled.

Mastra is a TypeScript agent framework built around a specific position: that once an agent reaches production, the sequence of steps it takes should be something you wrote down, not something it decided.

The contrast is with the common pattern where you hand a model a set of tools and let it work out the order at runtime. That is flexible, and it means the path through your system can differ on every run, which makes failures hard to reproduce and behavior hard to test. Mastra's answer is Workflow, composed through a chainable API of .then().branch(), and .parallel(). The result is a typed object describing what happens in what order, which you can read in the source, assert against in a test, and replay after a failure. Models still make decisions inside the steps; what they no longer decide is the shape of the run.

Agent remains available for the cases where you do want an open-ended loop, so this is a default rather than a restriction.

The framework is unusually complete for its age. Memory is built in, spanning conversation history, RAG, and an Observational Memory system, with execution state persisted through a pluggable storage layer. Because that state is durable, suspend-and-resume is a real primitive: a workflow can pause indefinitely awaiting human input and resume later in a different process. Teams needing stronger delivery guarantees can swap in the Inngest workflow runner for step memoization and automatic retries. Evaluations and observability ship as modules rather than as a separate purchase, though Mastra also sells a hosted Observability product, Studio, and Server.

Mastra's treatment of code execution is worth explaining, because the feature name gives little away. Normally an agent uses tools by emitting one call at a time and waiting for each result. Code mode inverts that: createCodeMode() gives the model a single execute_typescript tool, and the model writes a short TypeScript program that calls your tools itself, with loops, conditionals, and intermediate variables. Ten dependent tool calls become one program instead of ten round trips through the model.

That program has to run somewhere, and this is where Mastra differs from its peers. The execution boundary is a required decision rather than a default. Its documentation states that "because code mode runs model-authored code, you must choose its execution boundary deliberately," and the options are explicit: LocalSandbox() runs the program on the host with host privileges, which the docs say plainly rather than burying; IsolatedVmCodeModeTransport runs it in an in-process V8 isolate; and @mastra/quickjs runs it in a QuickJS engine compiled to WebAssembly. Additional backends can be plugged in behind the same interface.

The documentation is equally clear about the limit that applies to every framework using this pattern: only the model-written program is sandboxed, while the tools it calls are bridged back to the host and run there with full privileges. That is the correct boundary for untrusted glue code, and it is not a boundary against untrusted workloads, which is why Mastra composes cleanly with external sandbox infrastructure such as Daytona once the code being run originates with your users rather than your own tool definitions. Note that code mode is marked beta and may take breaking changes without a major version bump.

Deployment is flexible. mastra build produces a Hono server that runs anywhere Node does, with first-party deployers for Vercel, Netlify, and Cloudflare, plus documented paths to AWS Lambda, Bedrock AgentCore, Kubernetes, Render, and Temporal. Mastra also invests heavily in developer experience through Studio, a visual environment for iterating on agents, and supports MCP servers natively. At roughly 27.7k GitHub stars, its adoption curve has been among the steepest in the category.

Why You Might Choose Mastra

  • Explicit, typed workflow graphs with branching and parallelism as first-class constructs.

  • Durable execution state enabling indefinite suspend-and-resume for human-in-the-loop.

  • Memory, RAG, evals, and observability included in the framework rather than bolted on.

  • Deliberate, pluggable code-execution boundaries with unusually candid documentation.

  • Visual iteration through Studio and native MCP server support.

  • Broad deployment story, from serverless platforms to Kubernetes and Temporal.

  • Runs across Node, Bun, Deno, and Cloudflare Workers.

Potential Tradeoffs

Mastra is TypeScript-only, with no Python path. Teams whose agent logic needs to sit close to an existing Python data or ML stack will need a service boundary. Licensing is also dual: the core is Apache-2.0, while components under ee/ fall under a source-available Mastra Enterprise License that requires a paid license for production use, so "open source" warrants a read of which features you are relying on.

2. LangGraph

Best for: Teams that want a mature, low-level orchestration engine with durable execution, available in both Python and TypeScript.

LangGraph is the orchestration layer in LangChain's stack, and the most explicitly systems-oriented framework in this guide. It describes itself as a low-level framework for stateful agents, and its lineage is unusual for the category. Rather than borrowing from other agent libraries, LangGraph borrows from distributed data processing: its execution model follows Pregel, Google's system for large-scale graph computation, and Apache Beam.

In practice that means the graph advances in discrete supersteps. Every node eligible to run in a given step runs, each producing state updates; those updates are applied together at the end of the step, and only then does the next step begin. The benefit is that progress has clean checkpoint boundaries. Because the runtime knows exactly which step completed and what the state was when it did, it can persist that point and resume from it later. This is the machinery behind LangGraph's durable execution, and it is why that capability feels more solid here than in frameworks where persistence was added afterwards.

Durable execution is the headline capability and the most mature implementation here. LangGraph persists progress such that a run resumes from exactly where it stopped after a failure, rather than replaying from the start. Its interrupt mechanism is correspondingly strong: a graph can pause mid-run, expose its state for inspection and modification, and continue with human-supplied changes. Combined with built-in short-term working memory and long-term cross-session memory, this makes LangGraph the default choice for agents whose tasks are measured in minutes or hours rather than seconds. Subgraphs, streaming, and conditional branching round out the control-flow surface, and above LangGraph the vendor now ships Deep Agents, a higher-level layer adding planning, subagents, and a virtual filesystem.

Availability in both Python and JavaScript is a genuine differentiator, since it lets a team share an architecture across a Python backend and a TypeScript frontend without maintaining two mental models. Both LangGraph and LangChain are MIT licensed. Star counts are worth reading carefully: LangChain's 145.6k reflects years as the ecosystem's default import, while LangGraph's 41k is the number relevant to orchestration specifically.

Why You Might Choose LangGraph

  • The most mature durable-execution implementation in the category.

  • Interrupts that expose and allow modification of graph state mid-run.

  • Built-in short-term and long-term memory.

  • Available in both Python and TypeScript.

  • Subgraphs and composable graph structure for complex multi-agent systems.

  • Large ecosystem of model, vector store, and tool integrations inherited from LangChain.

Potential Tradeoffs

Observability and evaluation are delegated to LangSmith, a commercial product from the same vendor, so the open-source libraries alone leave you assembling tracing yourself. The stack has also grown into four overlapping products (LangChain, LangGraph, Deep Agents, and LangSmith), and choosing the right entry point is a real onboarding cost. LangGraph core ships no code-execution sandbox, so agents that run generated code need external isolation.

3. CrewAI

Best for: Python teams building role-based multi-agent systems, who want memory and a large observability ecosystem without designing a graph first.

CrewAI takes the most distinctive conceptual approach in this guide. Where the other frameworks ask you to describe control flow, CrewAI asks you to describe a team. An Agent is defined by a role, a goal, and a backstory; a Task is defined by a description and an expected_output; a Crew binds them together and a Process, either sequential or hierarchical, decides who works when. For a large class of problems, declaring the outcome you want and letting agents negotiate the path is genuinely faster than drawing a graph, and it is the most approachable on-ramp in the category.

CrewAI now ships two paradigms and is refreshingly direct that you must choose between them. Crews are autonomous and role-driven, suited to work where the path is not known in advance. Flows are event-driven, with typed state, explicit control, and persistence via @persist and restore_from_state_id. Flows are increasingly the recommended entry point, since the official quickstart is now "Build your first CrewAI Flow," which is a notable admission that emergent collaboration alone was not enough for production. Teams adopting CrewAI should read that signal and start with Flows unless they have a specific reason not to.

Memory is a genuine strength and was recently unified into a single Memory class with a remember()recall()forget() API. It is more sophisticated than most: content is analyzed by an LLM on write to infer scope, category, and importance, and recall uses composite scoring that blends semantic similarity, recency, and importance, tunable through recency_weight and recency_half_life_days. A separate Knowledge system handles RAG-style sources. Memory works standalone, inside Crews, on individual Agents, or within Flows.

On execution, CrewAI has just made the most decisive move of any framework here: CodeInterpreterTool has been removed, and Agent.allow_code_execution and code_execution_mode are deprecated. The old tool degraded from Docker isolation to a restricted-Python fallback to an explicitly unsafe mode, and CrewAI's documentation now simply directs teams to a dedicated sandbox service instead. First-party sandbox tooling ships in crewai-tools[daytona] as three composable tools: DaytonaExecTool for shell commands, DaytonaPythonTool for Python, and DaytonaFileTool for filesystem operations, all sharing lifecycle controls with ephemeral, persistent, and attach-to-existing modes. Ephemeral is the default, which is the correct default. This is a cleaner security posture than any in-process interpreter, and it is worth noting that CrewAI reached it by deleting code rather than adding it.

Observability is where CrewAI's ecosystem scale shows. Built-in Tracing ties into the CrewAI AMP platform, Event Listeners and step hooks allow custom instrumentation, and roughly seventeen third-party platforms are documented, including Langfuse, Arize Phoenix, MLflow, Opik, Weights & Biases Weave, Datadog, and Braintrust. Human-in-the-loop is well covered through a @human_feedback decorator for Flows, task-level human input, and a platform-level resume endpoint. CrewAI is MIT licensed with roughly 58k stars, the largest community in this guide.

Why You Might Choose CrewAI

  • The most approachable mental model in the category: roles, goals, and tasks.

  • Sophisticated unified memory with importance and recency-weighted recall.

  • Flows provide typed state and explicit control when emergent collaboration is not enough.

  • Remote-sandbox execution as the first-party path, with sensible ephemeral defaults.

  • The broadest third-party observability ecosystem of any framework here.

  • Multiple human-in-the-loop mechanisms, including a platform resume endpoint.

  • Largest community and example corpus, which matters for hiring and troubleshooting.

Potential Tradeoffs

CrewAI is Python-only, and the 1.x line has seen substantial churn in load-bearing APIs: CodeInterpreterTool removed, code-execution flags deprecated, four memory types collapsed into one. Tutorials and model-generated code go stale quickly. Durability is also weaker than the graph frameworks. Checkpointing writes event-driven snapshots through JsonProvider or SqliteProvider, but the documentation states plainly that auto-checkpoint writes "are best-effort: a failed write is logged and the run continues," which is not a foundation for exactly-once or long-horizon work. Native evaluation is similarly thin: crewai test produces LLM-judged scores from one to ten and is locked to OpenAI, so serious evaluation means adopting one of the third-party platforms.

4. OpenAI Agents SDK

Best for: Teams that want a lightweight, provider-agnostic agent loop with sandboxing, voice, and realtime as first-class concerns.

The OpenAI Agents SDK is deliberately minimal, and its primitive list is the clearest statement of scope in this guide: Agents, Sandbox agents, Realtime agents, Voice agents, Handoffs, Agents as tools, Tools, Guardrails, Human in the loop, Sessions, and Tracing. There is no graph DSL and no workflow engine. A Runner drives the loop, handoffs delegate between agents, and control flow is largely the model's business.

Two things distinguish it. First, sandboxing is a genuine framework concern rather than an afterthought. SandboxAgent sits alongside pluggable sandbox clients, namely UnixLocalSandboxClient for macOS and Linux, DockerSandboxClient via the docker extra, and hosted sandbox clients, with a Manifest and GitRepo model for seeding the workspace. The interface is open, so external providers can implement against it, which makes this the most explicitly pluggable execution model of the seven. Second, voice and realtime agents are supported directly rather than through a separate product, which matters for anyone building conversational interfaces.

Tracing is built in and flows to a hosted OpenAI Traces UI with no configuration. Sessions handle conversation history automatically across runs, with SQLAlchemy and Redis backends available as extras. Despite the name, the SDK is provider-agnostic, working against the Responses API, Chat Completions, and by OpenAI's count more than a hundred other models. It is MIT licensed with roughly 29.2k stars on the Python repo, and a separate JavaScript/TypeScript SDK is maintained alongside it.

Why You Might Choose OpenAI Agents SDK

  • Small, legible primitive set that is fast to learn and hard to misuse.

  • First-class sandbox abstraction with local, Docker, and hosted client implementations.

  • Voice and realtime agents supported directly in the framework.

  • Tracing enabled by default with a hosted trace viewer.

  • Automatic session-based conversation history with pluggable backends.

  • Provider-agnostic despite the branding, with Python and TypeScript SDKs.

Potential Tradeoffs

The lightweight design is a real constraint at scale. There is no durable-execution engine, no workflow graph, and no managed deployment, so long-running or crash-tolerant workloads require external infrastructure you operate yourself. Tracing also defaults to OpenAI's hosted backend, which is a data-egress question for regulated buyers who need telemetry to stay in their own systems.

5. Vercel AI SDK

Best for: TypeScript product teams shipping streaming, user-facing AI features where the interface matters as much as the agent.

The Vercel AI SDK came from a different direction than everything else here. It began as the best-in-class toolkit for streaming model output into a web interface and grew agent capabilities on top, and that history is still its greatest strength. If your agent's primary surface is a UI that users watch token by token, nothing in this category competes with it.

Now at v7, the agent surface is substantial. ToolLoopAgent is the primary agent class, WorkflowAgent handles multi-step orchestration, and HarnessAgent wraps established coding harnesses including Claude Code, Codex, and Pi. Loop control is explicit through stopWhen and prepareStepruntimeContext and toolsContext share state across steps, and human-in-the-loop is handled through Tool Approvals and policy-based approval rules. Subagents and Skills extend the model further. Framework-agnostic UI hooks cover Next.js, React, Svelte, Vue, Angular, Expo, and TanStack Start, and resumable streams solve the genuinely hard problem of a user reloading mid-generation. An AI SDK for Python is in beta.

Code Mode, shipped as @ai-sdk/code-mode, lets a model write TypeScript that calls your tools, executing in an isolated QuickJS sandbox with no access to processrequire, the filesystem, fetch, or eval. Vercel's documentation is refreshingly direct about the boundary's limits, instructing readers to "treat the sandbox as defense in depth" and noting that tools "execute in your host application, outside the QuickJS sandbox." It is experimental, requires Node 22+, and does not yet integrate with the SDK's own tool approval flows. Observability is OpenTelemetry-based with a DevTools module. The SDK is Apache-2.0 with roughly 26.6k stars.

Why You Might Choose Vercel AI SDK

  • The strongest streaming and user-facing UI story of any framework here.

  • Framework-agnostic UI hooks across seven frontend ecosystems.

  • Resumable streams that survive a page reload mid-generation.

  • HarnessAgent for wrapping Claude Code, Codex, and Pi behind one interface.

  • Policy-based tool approvals for human-in-the-loop gating.

  • Vendor-neutral OpenTelemetry instrumentation plus a DevTools module.

Potential Tradeoffs

It remains a model and UI toolkit that acquired agent features, not an orchestration engine. There is no durable execution in the SDK, which is a separate Vercel product called the Workflow DevKit, no built-in state store, and no first-party evaluation framework. Defaults also assume Vercel infrastructure: models route through AI Gateway, and the documented execution path is Vercel's own hosting. All of that is convenient inside the ecosystem and something to price in outside it.

6. Google ADK

Best for: Teams that need multi-language support and the strongest built-in evaluation tooling, particularly on Google Cloud.

Google's Agent Development Kit has the widest language coverage in this guide by a distance. Python is primary, with official ports for Java, Kotlin, Go, and TypeScript. For organizations where agent logic has to live in an existing JVM or Go service, ADK is often the only realistic option on this list.

Its Workflow Runtime is a full graph engine covering routing, fan-out and fan-in, loops, retries, state management, dynamic nodes, human-in-the-loop, and nested workflows, with a Task API for structured agent-to-agent delegation. Two features stand out as unusual. Agent Config allows agents to be defined declaratively in YAML with no code, which is a meaningful lever for organizations where non-engineers need to author or review agent behavior. Tool Confirmation provides a human gate specifically on tool execution rather than on the run as a whole.

Evaluation is ADK's clearest advantage. It is the only framework here shipping evaluation as a first-class CLI workflow: adk eval runs .evalset.json files, and adk web provides a development UI for testing, evaluating, and debugging. Teams that treat behavioral regression testing as a release gate get further out of the box with ADK than with anything else in this roundup.

ADK is also the most thorough on code execution, exposing a family of executors selected via code_executor= on the agent: BuiltInCodeExecutor for Gemini-native execution, UnsafeLocalCodeExecutor for in-process local runs, and behind the extensions extra, VertexAiCodeExecutorContainerCodeExecutorGkeCodeExecutor, and AgentEngineSandboxCodeExecutor. The naming alone tells you which one to avoid in production. Third-party sandbox executors, including Daytona, appear in ADK's integrations catalog for teams that want isolation outside Google Cloud. One documented constraint: BuiltInCodeExecutor can only be used by itself within an agent instance. ADK is Apache-2.0 with roughly 21.4k stars on the Python repo, and requires Python 3.10 or later. The current release is 2.8.0.

Why You Might Choose Google ADK

  • Official SDKs for Python, Java, Kotlin, Go, and TypeScript.

  • The strongest built-in evaluation story, with adk eval and a bundled development UI.

  • Full graph workflow runtime with retries, loops, and nested workflows.

  • The broadest set of code executors, from local to container, GKE, and managed sandbox.

  • Agent Config for declarative, no-code agent definitions in YAML.

  • Tool Confirmation for granular human approval of individual tool calls.

  • Deployment-agnostic, with Cloud Run and Vertex AI Agent Engine as managed paths.

Potential Tradeoffs

ADK 2.0 shipped breaking changes to the agent API, event model, and session schema, with sessions incompatible below 1.28, so migration risk is live for existing users. The framework is model-agnostic in principle but optimized for Gemini, and the managed and highest-leverage paths lead to Vertex AI. Teams outside Google Cloud will use a meaningful subset of what ADK offers.

7. Claude Agent SDK

Best for: Teams that want Claude Code's coding-agent capabilities available programmatically, and are prepared to run it inside their own boundary.

The Claude Agent SDK is architecturally unlike everything else here, and understanding why is essential to evaluating it. It is not a framework that calls a model. It is a programmatic wrapper around the Claude Code CLI, which is bundled into the package and invoked as a subprocess. What you get is not a kit for building an agent but an API onto an already very good one.

That is a real advantage where it applies. Claude Code is among the strongest coding agents available, with mature context management, compaction, and a well-tuned toolset of Read, Write, Edit, and Bash enabled by default. Rather than assembling equivalent capability from primitives, you get it immediately. The interface is well designed: query() for one-shot async iteration, ClaudeSDKClient for bidirectional interactive sessions, custom tools through in-process MCP servers via a @tool decorator and create_sdk_mcp_server, programmatic subagents, and session forking. Control is exercised through allowed_toolsdisallowed_toolspermission_modecan_use_tool, and a hooks system where a PreToolUse hook can deny a tool call with a stated reason. Both Python and TypeScript are supported.

Isolation is where this SDK demands the most care, and the picture is more nuanced than it was a year ago. Anthropic now ships a genuine OS-level Bash sandbox, using Seatbelt on macOS and bubblewrap on Linux and WSL2, exposed to the SDK through ClaudeAgentOptions.sandbox, with filesystem write scoping and a network domain allowlist. It is a real boundary enforced by the operating system, not a wrapper.

Four properties determine what it means in practice. It is opt-insandbox.enabled defaults to False, so the SDK executes on the host filesystem and shell unless you turn it on. It is Bash-only, and Anthropic's documentation states that "Read, Edit, and Write use the permission system directly rather than running through the sandbox" and that "MCP servers and hooks are separate processes that run unconstrained on the host." It fails open: if the sandbox cannot start, Claude Code "shows a warning and runs commands without sandboxing" unless you explicitly set failIfUnavailable. And reads are unrestricted by default, which Anthropic notes "still allows reading credential files such as ~/.aws/credentials and ~/.ssh/." Native Windows is unsupported.

Everything else is a permission model rather than containment, and Anthropic is unusually candid about the limits. Allowlisting the Bash tool permits it wholesale; scoping it by command is possible but, in their words, "fragile," since a pattern intended to restrict curl to one domain will not match a variable, a redirect, or a reordered flag. Read and Edit deny rules "don't apply to arbitrary subprocesses that read or write files indirectly, like a Python or Node script that opens files itself." Their own summary is that "sandboxing reduces risk but is not a complete isolation boundary," and their guidance for untrusted repositories is a dedicated virtual machine.

For a developer working locally, the defaults are reasonable. For a service running this SDK against code from users you have not met, Anthropic's own recommendation is the honest conclusion: run the whole process inside a container or VM "so that file tools, MCP servers, and hooks are also inside the boundary." That is why sandbox-provider integrations are more load-bearing for this SDK than for anything else in this roundup.

Why You Might Choose Claude Agent SDK

  • Immediate access to a mature, high-performing coding agent rather than a construction kit.

  • Claude Code's context management and compaction included.

  • Fine-grained interception through hooks that can deny tool calls with reasons.

  • Custom tools via in-process MCP servers with a clean decorator API.

  • Bidirectional interactive sessions plus session forking.

  • An OS-enforced Bash sandbox with filesystem and network scoping, once enabled.

  • Candid documentation about where its own permission controls stop working.

  • Python and TypeScript support.

Potential Tradeoffs

It is Anthropic-only, with no provider abstraction, the sole framework here without one. It is also a coding-agent harness rather than an orchestration framework: no workflow graph, no durable execution, no built-in tracing or evaluations. Its Bash sandbox is opt-in and off by default, covers only Bash rather than file tools, MCP servers, or hooks, and fails open when unavailable, so production use still requires you to supply the outer boundary. Licensing deserves care: the repositories carry an MIT LICENSE file, but the README states that use of the SDK "is governed by Anthropic's Commercial Terms of Service... except to the extent a specific component or dependency is covered by a different license," and the bundled Claude Code CLI is proprietary. Read both before assuming permissive terms.

Which AI Agent Framework Should You Choose?

Choose Mastra if...

You are building in TypeScript and want explicit, durable workflows with memory, evals, observability, and deliberate execution boundaries included in the framework rather than assembled from four vendors.

Choose LangGraph if...

You need the most mature durable-execution engine available, with graph-level state inspection and interrupts, in either Python or TypeScript.

Choose CrewAI if...

You are Python-first and want to describe a team of specialized agents rather than design a graph, with strong memory and a large observability ecosystem behind you.

Choose OpenAI Agents SDK if...

You want a small, legible agent loop with sandboxing, voice, and realtime as first-class primitives, and you are comfortable supplying your own orchestration infrastructure.

Choose Vercel AI SDK if...

Your agent's primary surface is a streaming user interface, and shipping that interface well matters more than owning a durable orchestration engine.

Choose Google ADK if...

You need Java, Kotlin, or Go support, or you want the strongest built-in evaluation tooling, and Google Cloud is somewhere you are willing to run.

Choose Claude Agent SDK if...

You want Claude Code's coding capability programmatically and are prepared to supply the isolation it deliberately does not include.

Frequently Asked Questions

Do I Need an Agent Framework at All?

Not always. If your agent makes a handful of tool calls in a single turn and finishes in seconds, a direct provider SDK plus a loop is often clearer than a framework, and easier to debug.

Frameworks earn their weight when the requirements accumulate: persistence across sessions, resumption after failure, human approval on consequential actions, structured multi-agent delegation, tracing, and evaluations. Each is buildable. Building all of them is a platform project, and that is the work these frameworks absorb.

What Is the Difference Between an Agent Framework and an Orchestration Engine?

Increasingly less than the marketing suggests, but the emphasis differs.

A framework focused on the agent gives you a good model abstraction, tools, and a loop, letting behavior emerge from the model's decisions. An orchestration engine puts an explicit, persistent state machine at the center, where the agent is one node in a graph whose execution can be paused, inspected, replayed, and resumed.

Emergent control flow prototypes faster. Explicit control flow is what you want when a wrong turn has consequences.

Can I Use More Than One Framework?

Yes, and it is common. A frequent pattern pairs an orchestration framework for durable workflow logic with a packaged harness for the coding-agent step inside it, since the two solve different problems. Vercel's HarnessAgent exists precisely to wrap Claude Code, Codex, and Pi behind a single interface.

The cost is a second set of abstractions, plus two tracing systems to reconcile. Keep the boundary between them narrow and explicit.

Where Should an Agent Run Generated Code?

Not on the machine running your agent, once real users are involved.

Most frameworks default to host execution guarded by allowlists and approval prompts. That is a permission model, not isolation, and several framework docs say so directly. In-process interpreter sandboxes such as QuickJS or V8 isolates are a genuine improvement, with the caveat that in most implementations only the model's orchestration code is isolated while the tools it calls run on the host with full privileges.

Where an OS-level sandbox is offered, read its scope before relying on it. Coverage is frequently narrower than the feature name suggests, being restricted to shell commands while file tools and plugin processes run outside it, switched off by default, or configured to warn and continue when it cannot start.

For untrusted workloads, meaning anything a user prompted, execution belongs behind a real machine boundary such as a container or microVM, reached over an API. Every framework in this guide can be wired to external isolation, and the ones honest about their own limits generally document how.

How Important Is Durable Execution Really?

Entirely dependent on task duration.

For a chat turn completing in seconds, durable execution is overhead. For an agent working for twenty minutes across dozens of tool calls, it is the difference between a retryable step and a lost task, since any deploy, crash, or timeout otherwise restarts everything.

Read the guarantees carefully, because the same word covers very different mechanisms. LangGraph persists progress and resumes from the exact point of failure. Mastra backs suspension with durable storage. CrewAI's checkpoints are documented as best-effort and may fail silently. Those are three different products under one label.

It is also the prerequisite for real human-in-the-loop. Pausing for hours while a person reviews an action requires the run's state to outlive the process holding it.

Are These Frameworks Locked to Specific Model Providers?

Mostly not. Mastra, LangGraph, CrewAI, the OpenAI Agents SDK, and the Vercel AI SDK are all provider-agnostic, and the OpenAI Agents SDK is explicitly so despite the branding. Google ADK is model-agnostic in principle while optimized for Gemini. The Claude Agent SDK is the exception, being Anthropic-only by design.

Provider abstraction is not the same as provider neutrality, though. Watch where the defaults point, whether that is the default model router, the default trace backend, or the default deployment target, because that is where the vendor's business model lives.

How Much Does Language Choice Constrain the Decision?

More than teams expect. Mastra and the Vercel AI SDK are TypeScript-first, with a Python SDK in beta for the latter. CrewAI is Python-only. LangGraph, the OpenAI Agents SDK, and the Claude Agent SDK support both Python and TypeScript. Google ADK is the only one reaching Java, Kotlin, and Go.

In practice this eliminates most of the list before any feature comparison begins, which is worth doing first rather than last.

What About Evaluations?

The weakest area across the category, and the one that hurts most in production.

Google ADK ships the most complete story with adk eval and a bundled development UI. Mastra includes evaluation modules in the framework itself. LangChain's story runs through LangSmith, a commercial product. CrewAI offers crewai test, which is shallow but compensates with the widest third-party integration list. The Vercel AI SDK and Claude Agent SDK have no first-party evaluation framework.

If behavioral regression testing is a release gate for you, weight this heavily. It is much harder to retrofit than tracing.

Should I Expect to Migrate Later?

Plan for it, but do not over-engineer for it.

Migration cost tracks how deeply framework abstractions have penetrated your domain logic. Tool definitions and prompts usually port with modest effort. Workflow graphs, memory schemas, and durable-execution state generally do not.

Keeping tool implementations as plain functions the framework wraps, rather than as framework-native objects, preserves the most optionality for the least upfront cost. The same discipline applies to execution: keeping sandbox operations behind an internal interface makes both framework and infrastructure changes considerably cheaper.

Closing Thoughts

The frameworks in this guide are converging on the same feature list and diverging on something more interesting, which is what they believe an agent fundamentally is. A graph to be traversed, a team to be assembled, a loop to be constrained, or a computer to be driven. That belief shapes every API you will touch, and it is the thing worth matching to your problem. Feature parity arrives eventually; a mismatched mental model is something you fight for the life of the project.

If there is one lesson from watching this category mature over the past year, it is that the hard parts were never the parts that demo well. Model quality improved, tool calling got reliable, and the difficulty moved exactly where experienced engineers expected it to go: state that survives a deploy, behavior you can explain after the fact, and a clear answer to where untrusted code runs. The frameworks that are best positioned today are the ones treating those as core design questions rather than integrations to add later.

That last question is the one we would encourage you not to defer. Execution boundaries are far cheaper to establish while your agent is a prototype than to retrofit once it is running code on behalf of real users. Whichever framework you choose, decide early where that code will run, keep the decision behind an interface you control, and you will keep your options open on everything else.

Tags::
  • AI Agents
  • Agent Frameworks
  • Sandbox