How to Create an AI Agent is published by General Action, the company that makes Emdash. When we recommend Emdash, we are recommending our own product. About this site
AI agent frameworks compared
Write the loop yourself for a first agent, and adopt a framework when you need something specific that the loop does not give you: saved state, approval pauses, several agents working together, or built-in tracing. A framework does not make an agent smarter. It saves you from writing infrastructure around the same model calls.
Raw SDK or framework
Section titled “Raw SDK or framework”Anthropic’s guide to building effective agents is blunt about the order: “We suggest that developers start by using LLM APIs directly: many patterns can be implemented in a few lines of code.” It adds that if you do use a framework, you should understand the code underneath it.
That advice holds because the two options differ in what you maintain, not in what the model can do.
| You need | Raw SDK loop | A framework |
|---|---|---|
| One agent, a few tools | A short loop you fully understand | More machinery than the job needs |
| To pause and wait for a person to approve a step | You design and store the paused state yourself | Usually built in |
| To survive a crash halfway through a long run | You write the checkpointing | Usually built in |
| Several agents handing work to each other | You write the routing | A core feature of most frameworks |
| A record of every model call and tool call | You add logging | Usually built in as tracing |
| To see the exact request sent to the model | Always visible, because you wrote it | Sometimes hidden behind the framework’s own prompts |
A reasonable rule: start a framework evaluation only when you can name the row you need.
Seven agent frameworks and SDKs
Section titled “Seven agent frameworks and SDKs”Each row describes the project in terms taken from its own repository or documentation, linked in the first column. Languages and licenses were read from those sources on 13 November 2026. Where a project keeps one repository per language, the license shown is the one on the linked repository. Check again before you depend on one.
| Framework | From | Languages | License | What it is for |
|---|---|---|---|---|
| Claude Agent SDK | Anthropic | Python, TypeScript | Python repository: MIT. TypeScript repository: Anthropic’s Commercial Terms of Service. | Claude Code as a library: the same agent loop with built-in tools for files, commands and the web, plus permissions, sessions, subagents and MCP. |
| OpenAI Agents SDK | OpenAI | Python, TypeScript | MIT | A lightweight framework for multi-agent workflows: agents, handoffs between them, guardrails, sessions and tracing. Its README describes it as provider-agnostic. |
| LangGraph | LangChain | Python, TypeScript | MIT | A low-level orchestration framework for long-running, stateful agents, with durable execution and human-in-the-loop pauses. |
| CrewAI | CrewAI | Python | MIT | Teams of role-playing agents, called Crews, combined with event-driven Flows for the parts you want to control precisely. |
| Pydantic AI | Pydantic | Python | MIT | A typed agent loop from the team behind Pydantic, built to work across model providers. |
| Agent Development Kit (ADK) | Python, Java, Kotlin, Go, TypeScript | Apache-2.0 | A code-first toolkit for building, evaluating and deploying agents. Its README says it is optimized for Gemini and model-agnostic. | |
| Microsoft Agent Framework | Microsoft | Python, .NET | MIT | Building, orchestrating and deploying agents and multi-agent workflows. |
This table is a description, not a ranking. We have not benchmarked these projects against each other, and the right choice depends more on your constraints than on any feature count.
How to choose
Section titled “How to choose”Work down this list and stop at the first line that applies.
- You are building your first agent. Use none of them yet. Write the loop.
- Your agent’s job is to work on files and run commands, the way a coding agent does. The Claude Agent SDK gives you those tools already built, which is most of the work.
- You are committed to one model provider. Use that provider’s SDK: the Claude Agent SDK, the OpenAI Agents SDK or Google’s ADK. The defaults will match the API you are calling.
- You need long-running, resumable runs with explicit control over each state. That is the problem LangGraph describes itself as solving.
- You want typed inputs and outputs in a Python codebase. Look at Pydantic AI.
- You are modelling a team of specialists. CrewAI and the OpenAI Agents SDK are both organised around several agents. Confirm first that one agent with more tools cannot do the job, because every added agent adds cost and failure modes.
- Your stack is .NET or Java. Microsoft Agent Framework and ADK cover those languages.
Whatever you pick, keep your tools as plain functions with clear descriptions. They are the part of your agent that survives a change of framework. Tools and MCP explains how to write them.
What a framework costs you
Section titled “What a framework costs you”- Hidden prompts. Anthropic’s guide notes that frameworks often add layers of abstraction that can obscure the underlying prompts and responses. When an agent misbehaves, you need to see the exact text the model received, so learn how to print it.
- A moving target. These projects release often. Pin the version you tested against and read the changelog before upgrading.
- Temptation. Anthropic’s guide warns that frameworks make it easy to add complexity when a simpler setup would do. Multi-agent features are the usual example.
- A second thing to debug. A failure can now be in your code, the framework or the model.
None of this is a reason to avoid frameworks. It is a reason to adopt one for a named need and to keep a test set that tells you whether the move helped.
Hosted agent runtimes
Section titled “Hosted agent runtimes”A third option sits beside frameworks: let the model provider run the loop on its own servers. Anthropic’s documentation describes Managed Agents as a hosted agent harness that runs the agent loop, and OpenAI’s agents guide describes its Agents API as the choice for long-running tasks where OpenAI manages the agent. You write less code and accept more dependence on one vendor. Read the provider’s documentation for current availability and terms.
Frequently asked questions
Do I need a framework to build an AI agent?
No. An agent is a loop around a model API, and you can write that loop in well under a hundred lines with a provider's official SDK. A framework earns its place when you need features the loop lacks, such as saving state between steps, pausing for human approval, or passing work between several agents.
Which AI agent framework is best for beginners?
For learning, none. Write the loop by hand first so you understand what a framework does for you. After that, pick the SDK published by the model provider you already use, because its defaults match that provider's API and its documentation is maintained alongside it.
Are AI agent frameworks free?
Most are open source under the MIT or Apache-2.0 license, so the library costs nothing. You still pay the model provider for every request the framework makes on your behalf, and any hosting or monitoring service you add has its own pricing.
Can I switch frameworks later?
Yes, but the cost depends on how much of your agent lives in framework-specific code. Tool functions and prompts usually move with little change. Orchestration, saved state and tracing are tied to the framework and have to be rebuilt, which is one reason to keep your tools as plain functions.