Decision guide

AI Agent Frameworks Compared

How should you build an AI agent: your own loop, an agent SDK, a graph framework or a hosted platform?

Side by side

CriterionPlain SDK loopClaude Agent SDKLangGraphOpenAI Agents SDKCrewAIManaged agent platform
Control over the loopTotalHigh (hooks, permissions)High (explicit graph)MediumLower (framework-driven)Configuration-level
Persistence and resumptionBuild it yourselfSessionsCheckpointing built inSessions; build long-running persistenceLimited; add your ownBuilt in (hosted sessions)
Built-in tools and sandboxNoneFiles, shell, web; you provide the machineBring your ownHosted tools on OpenAI's platformTool integrationsHosted sandbox per session
Model portabilityAny (you choose the SDK)ClaudeMany providersOpenAI-first; others via adaptersMany providersThe platform's models
Learning curveLowest to startLowMedium-highLowLowLow (API concepts)
Operational burdenYoursYours (runs in your process)Yours (or their platform)YoursYoursMostly the provider's

When to choose each

Plain SDK loop

Call the model API with tools and run the loop yourself (often under 100 lines).

Choose when

  • One or a few tools and a clear task
  • You want full control and minimal dependencies
  • Learning how agents work

Avoid when

  • Long-running agents that need persistence, resumption or sandboxes

Claude Agent SDK

The agent harness behind Claude Code as a library: built-in file and shell tools, permissions, context management, subagents and MCP.

Choose when

  • Coding, file and terminal-heavy agents
  • You want a proven loop with context management and permissions
  • Claude models

Avoid when

  • Strict multi-provider model portability
  • Simple single-call features

LangGraph

A graph-based framework for stateful agents: nodes, edges, checkpoints, human-in-the-loop and resumable runs.

Choose when

  • Workflows with explicit steps, branches and approval points
  • Long-running runs that must survive restarts
  • You want to mix providers

Avoid when

  • Small agents where a graph adds ceremony

OpenAI Agents SDK

A lightweight SDK for agents with tools, handoffs between agents, guardrails and built-in tracing.

Choose when

  • Multi-agent handoffs with little code
  • Teams already on OpenAI models and tracing

Avoid when

  • Deep custom orchestration and persistence needs

CrewAI

A framework for role-based multi-agent 'crews' with tasks and processes.

Choose when

  • Prototyping multi-agent collaboration quickly
  • Business workflows described as roles and tasks

Avoid when

  • Tight control over every step, cost and latency

Managed agent platform

A hosted service runs the agent loop and a sandbox for its tools (for example Claude Managed Agents); you define the agent and start sessions.

Choose when

  • You don't want to run loops, sandboxes or schedulers yourself
  • Scheduled or long-running agents with file workspaces
  • Versioned agent configurations

Avoid when

  • Data or tools that must stay entirely inside your infrastructure (unless the platform offers self-hosted sandboxes)

Verdict

Start with a plain loop to learn what your agent actually needs; most production agents are a model, a few well-designed tools and strict limits. Move to the Claude Agent SDK for coding and file-heavy agents, LangGraph when you need explicit stateful workflows with checkpoints and approvals, the OpenAI Agents SDK or CrewAI for quick multi-agent prototypes, and a managed platform when you'd rather not run loops, sandboxes and schedules yourself. Whatever you choose, evals, tracing and approval gates matter more than the framework.

Learn more

Sources

Was this page helpful?