All articlesThe Chronicle / Geodd

Open-Source AI Agent Frameworks: 7 Top Picks Compared

The best open-source AI agent frameworks in 2026 are LangGraph, Pydantic AI, CrewAI, the OpenAI Agents SDK, Microsoft Agent Framework, Mastra, and Strands Agents. A good pick matches your language, your tolerance for hand-built orchestration, and the ecosystem you already run on. LangGraph suits teams that need auditable, long-running workflows. Pydantic AI suits Python teams that want typed, testable agents. CrewAI suits role-based multi-agent teams. Mastra suits TypeScript shops, and Microsoft Agent Framework suits .NET and Azure teams. The OpenAI Agents SDK and Strands Agents suit teams that want a thin loop with little ceremony.

The problem is that every model provider and cloud now ships its own framework, and the feature lists overlap. Picking on a README is how teams end up rewriting an agent six weeks in. This article gives you seven options with the same facts for each: how it works, who it suits, and where it falls short. It then compares them side by side and shows what an agent run costs once you attach a model.

We wrote it from the infrastructure side. Geodd serves open models through an OpenAI-compatible API, and an agent framework is only as useful as the model endpoint behind it. Cost, tool calling, and data handling decide whether an agent survives production, so the last section covers them.

1. LangGraph

LangGraph is the strongest choice when you want explicit control over every step an agent takes. It treats an agent as a graph of steps with defined transitions.

A model railway junction where switch points route wagons onto different tracks.

How it works

Each node handles a prompt or sub-task, and edges decide where data goes next, so you control branching and error handling directly. Since 1.0 the project has focused on durable execution, which resumes an agent where it stopped after a failure. It also offers human-in-the-loop interrupts and both short-term and long-term memory.

  • Languages: Python and JavaScript
  • Style: graph-based, stateful workflows
  • Tracing: LangSmith, plus third-party tools such as Langfuse

Who it suits

Pick LangGraph when the process itself must be auditable. Think document analysis, code generation, or research synthesis that runs for hours and must pause for approval. The project README lists Klarna, Replit, and Elastic as production users. It fits teams that already think in state machines and want to inject custom logic at specific stages.

The cost is upfront structure. You wire state, memory, and approval flows yourself, and the fast release cycle has deprecated older API patterns, so plan for migrations. For a single agent with three tools, it is more machinery than you need.

Choose LangGraph when you need to dictate every step the agent can take.

2. Pydantic AI

Pydantic AI is the best fit for Python teams that want validated, typed agent logic without heavy orchestration. It feels like FastAPI for agents.

How it works

You declare an agent's inputs, tool signatures, and outputs as Python types. The framework handles validation and OpenTelemetry instrumentation, which moves whole categories of errors from runtime to write-time. Since 2.x it also adds durable execution, so agents keep progress across API failures and restarts, and a type-hint-driven graph system.

  • Languages: Python
  • Style: type-safe single agents and small agent systems
  • Models: OpenAI, Anthropic, Gemini, DeepSeek, Grok, Cohere, Mistral, and others

Who it suits

Choose it when your agent lives inside an existing Python service and you care about typed outputs, dependency injection, and fast test loops. Because tool arguments and results are validated, a model that returns a malformed field fails loudly instead of corrupting downstream data. That matters when an agent writes to a database or calls a billing API.

It is not the tool for orchestrating many cooperating actors with checkpointed, replayable state. LangGraph gives you more structure there. It is also Python-only, so a TypeScript team should look at Mastra instead.

Choose Pydantic AI when the quality of structured output matters more than orchestration depth.

3. CrewAI

CrewAI is the most approachable way to build a team of role-based agents. It is a standalone framework, not built on LangChain.

Three desk trays holding a magnifying glass, a fountain pen, and a rubber stamp.

How it works

You give each agent a role and skillset, then let them cooperate inside a "Crew" that coordinates shared context. Since 1.0, CrewAI pairs Crews with Flows, which are event-driven workflows with conditional branching and state handling. Flows let you wrap agent autonomy inside deterministic business logic. Memory, checkpointing, and structured outputs are available.

  • Languages: Python
  • Style: role-based crews plus event-driven flows
  • Commercial layer: the Agent Management Platform for lifecycle management

Who it suits

It suits work that splits naturally across specialists, such as a planner delegating to a researcher and a writer, with a validator checking the result. Teams that think in job roles pick it up quickly, and Flows give engineering a way to keep the surrounding process predictable.

The core framework is free, but production features take integration work, and the initial configuration assumes technical comfort. Role-based crews also burn more tokens than a single agent, because agents pass context to one another. Measure that before you commit.

Choose CrewAI when your problem maps to a team of specialists, not a single flow.

4. OpenAI Agents SDK

The OpenAI Agents SDK is the lightest of the seven. It gives you a few primitives and gets out of the way.

How it works

It packages four ideas: agents (an LLM with instructions and tools), handoffs for delegating between agents, guardrails for validating inputs and outputs, and sessions that manage conversation history. Despite the name, it is provider-agnostic and supports over 100 non-OpenAI models through LiteLLM and any-llm integrations. Built-in tracing and realtime voice agents ship with it.

  • Languages: Python, with a separate JavaScript/TypeScript version
  • Style: lightweight multi-agent primitives
  • Tracing: built in

Who it suits

It suits teams that want an officially maintained, minimal abstraction for multi-agent handoffs, including teams that plan to run open-weight models behind it. The LiteLLM route is what lets you swap the model without rewriting agent logic. If your workflow is "triage agent hands off to specialist agent, with a guardrail on each side," this is the shortest path.

It gives you little orchestration structure beyond handoffs. Complex branching, retries, and durable state are yours to build. The release cadence is fast, so pin versions and read changelogs before you upgrade.

Choose the OpenAI Agents SDK when you want handoffs and guardrails with the least code.

5. Microsoft Agent Framework

Microsoft Agent Framework is the default for .NET shops and Azure-centric teams. It is also where Microsoft now points new agent work.

How it works

It succeeds both AutoGen and Semantic Kernel for new projects. It combines AutoGen's multi-agent patterns with Semantic Kernel's enterprise focus. You get graph-based workflows (sequential, concurrent, handoff, and group collaboration), a middleware system, and YAML-based declarative agent definitions. APIs are consistent across Python and .NET, and OpenTelemetry observability is built in.

  • Languages: Python and .NET/C#
  • Style: graph-based workflows with middleware
  • Hosting: optional deployment to Microsoft Foundry

Who it suits

Choose it if your stack is C# or you are migrating off AutoGen or Semantic Kernel. AutoGen's README says it will not receive new features and is community managed going forward, so do not start a new project on it. Semantic Kernel still ships releases, but Microsoft's agent investment flows into Agent Framework, which provides a migration guide.

Outside the Microsoft world the pull is weaker. LangGraph is more widely adopted and has a deeper catalog of third-party integrations. For a Python-and-Linux shop with no Azure footprint, you gain little by choosing this one.

Choose Microsoft Agent Framework when C# or Azure is a hard requirement.

6. Mastra

Mastra is the TypeScript-native option. It bundles agents, workflows, RAG, memory, and evals in one package.

How it works

Created by the team behind Gatsby, Mastra provides agents with memory and tool calling, and workflows with .then(), .branch(), and .parallel() control flow. It adds RAG, built-in evals and observability, and an interactive Studio for running agents and inspecting memory. Model routing covers more than 40 providers, and suspend-and-resume supports human approval steps. The core is Apache-2.0 licensed.

  • Languages: TypeScript
  • Style: full-stack agent framework with graph workflows
  • Fit: Next.js, Vite, Express, and Node environments

Who it suits

It suits JavaScript and TypeScript teams that do not want a separate Python service just to run AI logic. You can bundle agents into your web app or expose them as REST endpoints. Workflows, retrieval, and evals in one package keep a small team out of glue-code work.

The trade-off is ecosystem breadth. LangChain with LangGraph.js has more integrations and more battle-tested patterns, and it transfers better if part of your stack is Python. The framework is free, while managed hosting for Studio has paid plans, so confirm current pricing if you plan to use it.

Choose Mastra when your whole product lives in TypeScript.

7. Strands Agents

Strands Agents is AWS's open-source framework built around a model-driven loop. You define a model, tools, and a prompt, and the SDK runs the rest.

How it works

The agent loop comes with context management, guardrails, and execution limits built in. Amazon Bedrock is the default provider, with first-class support for Anthropic, OpenAI, and Google Gemini and more beyond those. Every step of the loop emits OpenTelemetry-based traces. It is Apache-2.0 licensed and runs on AWS, other clouds, or on-prem.

  • Languages: Python and TypeScript
  • Style: model-driven agent loop
  • Tracing: OpenTelemetry

Who it suits

It suits teams that want to iterate fast with little orchestration code. If you are on AWS you get deep Bedrock integration by default. If you are not, you can point it at another supported provider and keep the same loop.

Model-driven means you hand more decisions to the model. When the process must be deterministic and auditable, a workflow-driven framework such as LangGraph is safer. Strands also has a younger community than the LangChain ecosystem, so expect to read source more often.

Choose Strands Agents when you want a short path from prototype to a traced production loop.

How to choose between the seven

Choose by language first, then by how much control you want, then by ecosystem. The table and checklist below narrow the field in minutes.

A three-step process: pick a language, set a control level, then check the ecosystem.

Side-by-side comparison

FrameworkLanguagesControl styleBest for
LangGraphPython, JavaScriptExplicit graphAuditable, long-running workflows
Pydantic AIPythonTyped single agentsValidated outputs inside Python services
CrewAIPythonRole-based crews plus FlowsTeams of specialist agents
OpenAI Agents SDKPython, JS/TS (separate)Light primitivesHandoffs and guardrails with minimal code
Microsoft Agent FrameworkPython, .NET/C#Graph workflows, middleware.NET and Azure teams
MastraTypeScriptAgents plus workflowsFull-stack JS/TS products
Strands AgentsPython, TypeScriptModel-driven loopFast iteration, AWS teams

Frameworks worth a look beyond the seven

Google ADK is code-first, centers on a workflow runtime and a Task API for agent-to-agent delegation, and integrates natively with Gemini. Smolagents from Hugging Face has a core of roughly 1,000 lines, and its CodeAgent writes actions as executable Python. The Vercel AI SDK gives TypeScript teams a ToolLoopAgent if they already use it for LLM calls. AutoGen is in maintenance mode, so avoid it for new work.

A short decision guide

  • C# or .NET: Microsoft Agent Framework.
  • TypeScript: Mastra, or the Vercel AI SDK if you only need a loop inside an existing app.
  • Python, strict control: LangGraph.
  • Python, typed and light: Pydantic AI.
  • Python, multi-agent teams: CrewAI.
  • Python, thin loop: OpenAI Agents SDK or Strands Agents.

Whatever you shortlist, run the same task through two candidates for a week. Check the repository license before commercial use, and look at the release history to see how often breaking changes land. Then check how each one traces a run, because debugging an agent without traces is guesswork.

Language and control style eliminate most options before features ever matter.

Running agent frameworks on open models

Every framework above is only the loop. The model behind it decides cost, tool-calling reliability, and where your data goes. This is also what the search for open source agentic AI models is really about: frameworks are not models, and you need both.

Why the model backend matters

Agents call the model many times per task and resend context on each step, so token price dominates your bill. They also depend on tool calling, so a model without it cannot run most of these frameworks' loops. Check that capability first. GLM 5.3 Flash, for example, lists tool calling as unsupported on its model page, so it suits reasoning and long-context analysis rather than tool-driven loops.

Data handling matters for organizational use too. The models below run in Geodd's US-EAST region with zero data retention by default, and Geodd does not use API data for training.

What an agent run costs

Take a task with 20 model calls, averaging 6,000 input tokens and 500 output tokens each. That is 120,000 input and 10,000 output tokens per task. At 10,000 tasks a day:

ModelInput / 1MOutput / 1MCost per task10,000 tasks
GPT-OSS-120B$0.039$0.158about $0.0063about $62.60
DeepSeek V4.1 Flash$0.300$1.100$0.047$470

Both support tool calling and structured outputs. GPT-OSS-120B has a 131.07K-token context, while DeepSeek V4.1 Flash offers 1.05M tokens for agents that carry large documents. Use the pricing page to model your own volumes.

Connecting a framework to an OpenAI-compatible API

Any framework that lets you set a custom base URL, or that routes through LiteLLM, can talk to an OpenAI-compatible endpoint. Test tool calling and streaming with your framework before you commit.

from openai import OpenAI

client = OpenAI(
    base_url="<base URL from the Geodd model page>",
    api_key="<your Geodd API key>",
)

response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4.1-Flash",
    messages=[{"role": "user", "content": "Summarize this ticket."}],
    tools=tools,
)

Price the model per task before you choose the framework, because tokens, not code, set the bill.

Choosing and moving on

The best open-source agent framework is the one that matches your language and your need for control. LangGraph gives you the most explicit control, Pydantic AI the cleanest typing, CrewAI the easiest multi-agent teams, Mastra the best TypeScript fit, and Microsoft Agent Framework the best .NET path. The OpenAI Agents SDK and Strands Agents keep the loop thin.

Run a one-week bake-off on a real task, then attach a model with reliable tool calling and a price you can forecast. When you are ready to size the model side, use Geodd's pricing page to estimate agent costs from your request volume and token usage.

The Chronicle / Bartosz Neuman
Build with Deploypad

Your next idea. A model API away.

Start building with inference and model APIs on Deploypad.

$10 USD Discovery credit

Explore inference and model APIs with $10 in Discovery credit. Enroll in Deploypad and unlock it with your first qualifying automatic top-up. Eligibility and offer details are shown in Deploypad.

Get started on Deploypad
Keep reading

More from Geodd.

All articles