Artificial Intelligence

AI Agent SDKs in 2026: the framework is free, the decision is yours

The framework race is over. In 2026, agent infrastructure is open and free. The only variable left is your architecture.

AI Agent SDKs in 2026: the framework is free, the decision is yours

If 2024 was the year of chatbots and 2025 the year of RAG, 2026 is definitely the year of AI agents. And the good news follows the trend of free APIs: all major agent frameworks are open-source, with MIT or Apache 2.0 licenses, and zero licensing cost. What you pay for is LLM token consumption — and, as we've seen, even that can be free by combining providers like Groq, OpenRouter, and Cerebras. This article maps the agent SDK ecosystem in mid-2026, with technical analysis, comparative table, and copy-paste-ready code.

The market consolidated: few winners, open standards

After two years of Cambrian explosion, the agent framework market consolidated around a few mature options. In Python, LangGraph became the production standard for complex stateful workflows, CrewAI dominates rapid multi-agent prototyping, and the labs' own SDKs (OpenAI Agents SDK, Claude Agent SDK, Google ADK) gained traction in single-model stacks. In TypeScript, Mastra emerged as the most complete native framework and the Vercel AI SDK reigns in chat interfaces with streaming.

Two structural moves changed the game. First, Microsoft moved AutoGen to maintenance mode, unifying it with Semantic Kernel into Microsoft Agent Framework 1.0 (GA in April 2026, with stable APIs for .NET and Python). Second, the MCP (Model Context Protocol) and A2A (Agent-to-Agent) protocols were donated to the Linux Foundation and became interoperable standards: an agent built in Google ADK can discover and invoke a LangGraph or CrewAI agent. In practice, this means switching frameworks stopped being a rewrite and became a refactor — lock-in fell along with the cost barrier.

Python: LangGraph for production, CrewAI for speed

The LangGraph (MIT, ~26k stars) models agents as a cyclic directed graph: nodes are functions or LLM calls, edges define control flow. This delivers what enterprise production demands — typed state, durable checkpoints (SQLite, Postgres), automatic resumption after failures, time-travel debugging, and human-in-the-loop. Klarna, Replit, Uber, and LinkedIn run LangGraph in production. The price is the learning curve: a simple ReAct agent takes ~120 lines, versus ~40 in minimalist frameworks. Version 1.0 stabilized the API, with a commitment to not break compatibility until 2.0.

The CrewAI (MIT, ~53k stars) attacks from the opposite flank: role-based abstraction. You define agents with role, goal, and backstory, assemble a "crew" (researcher → writer → reviewer), and have a working multiagent prototype in an afternoon, with ~20 lines of code. The company reports usage by 63% of the Fortune 500. Weaknesses show up at scale: limited observability, barely configurable retry, and sequential execution by default. The typical path is to prototype in CrewAI and migrate to LangGraph when the workflow demands conditional routing and auditability.

Among the lab SDKs, the OpenAI Agents SDK (MIT, successor to the experimental Swarm) stands out for its minimal API — Agents, Handoffs, Guardrails, and Tracing — and works with any endpoint compatible with the OpenAI API, including Groq, OpenRouter, Ollama, and vLLM. Meaning: you can run an entire multiagent system on Llama 3.3 70B free on Groq, changing only base_url and api_key. The Claude Agent SDK, meanwhile, exposes the same harness that powers Claude Code, with filesystem access, shell, subagents, and the deepest MCP integration on the market — the natural choice for code agents and OS automation. For those who value type safety, Pydantic AI (MIT) brings the "FastAPI feel" to agents: structured outputs validated with automatic retry on validation failure. And for prototypes and research, smolagents from Hugging Face (Apache 2.0, ~1,000 lines of core logic) implements Code Agents that write Python instead of JSON to call tools.

Três jeitos de orquestrar agentes LangGraph grafo com estado e ciclos início nó: agente condição nó: ferramenta nó: humano ciclo CrewAI equipe baseada em papéis Pesquisador coleta e analisa fontes Escritor redige o rascunho Revisor valida e entrega cada papel tem role, goal e backstory OpenAI Agents SDK triagem com handoffs Agente de triagem classifica o pedido handoff Vendas especialista Suporte especialista guardrails validam entrada/saída
Three ways to orchestrate agents: stateful graph (LangGraph), role-based crew (CrewAI), and triage with handoffs (OpenAI Agents SDK).

TypeScript: Mastra and Vercel AI SDK share the throne

The JS/TS ecosystem is no longer a second-class citizen. Mastra (Apache 2.0, ~22k stars, from the founding team of Gatsby) combines ReAct-style agents, a graph workflow engine with .then(), .branch(), and .parallel() operators (the TS equivalent of LangGraph), persistent memory, RAG, MCP, and Zod validation. The mastra dev command spins up a local playground with Swagger UI — a developer experience LangGraph doesn't match. Replit, PayPal, and Brex use it in production. The Vercel AI SDK (Apache 2.0, the most downloaded AI SDK on npm) remains unbeatable for chat UIs: useChat hooks that manage streaming automatically and routing to 25+ providers. The winning combo in 2026 is Mastra for orchestration + Vercel AI SDK for the interface. LangGraph.js exists, but historically it lags 4 to 8 weeks behind the Python version with every release.

Quick framework map

Framework

Language / License

Main architecture

Ideal scenario

LangGraph

Python + TS / MIT

Graph with state, checkpoints, HITL

Complex enterprise production

CrewAI

Python / MIT

Multiagent by roles (Crews + Flows)

Rapid prototyping, content pipelines

OpenAI Agents SDK

Python + TS / MIT

Agents + Handoffs + Guardrails

Triage/routing, OpenAI-compatible APIs

Claude Agent SDK

Python + TS / proprietary OSS

Autonomous agent + subagents + MCP

Code agents, OS automation

Google ADK

Py/Go/Java/TS / Apache 2.0

Agent hierarchy + native A2A

Google Cloud, multi-language

Pydantic AI

Python / MIT

Type-safe, validated structured output

Python production with explicit contracts

smolagents

Python / Apache 2.0

Minimalist code agents (ReAct)

Prototypes, research, hackathons

Mastra

TypeScript / Apache 2.0

ReAct + graph workflows + networks

TS production agents, serverless

Vercel AI SDK

TypeScript / Apache 2.0

Streaming UI + tool loop

Chat UIs in Next.js/React

Tamanho da comunidade: estrelas no GitHub (milhares, ~2026) LangChain 137k AutoGen / AG2 58k CrewAI 53k LlamaIndex 50k Agno 40k Semantic Kernel 28k LangGraph 26k smolagents 26k Vercel AI SDK 25k Mastra 22k Estrelas indicam comunidade, não adoção: LangGraph.js tem ~2,3k estrelas e 529 mil downloads semanais no npm.
GitHub stars by framework (thousands, ~2026). Stars indicate community, not production adoption.

Your first agent in five minutes — for free

The synergy between open-source frameworks and free APIs is the sweet spot where everything clicks. Since the OpenAI Agents SDK accepts any OpenAI-compatible endpoint, you can build an agent with tools running 100% free on Groq's free tier (14,400 requests/day on Llama 3.1 8B, no card required). Install the dependencies:

O loop agêntico (ReAct): como um agente decide e age Usuário prompt / tarefa Agente (LLM) raciocina e decide a próxima ação Ferramenta tool / function call Resposta final tarefa concluída 1. chama a ferramenta 2. resultado volta 3. quando terminar o ciclo decidir → agir → observar repete quantas vezes for preciso
The agentic loop (ReAct): the LLM decides, calls tools, observes results, and repeats until the task is done.
BASH
pip install openai-agents python-dotenv

And paste the minimal agent with a mock weather search tool, pointing to Groq via base_url:

PYTHON
import osfrom dotenv import load_dotenvfrom agents import Agent, Runner, function_toolfrom agents.extensions.models.litellm_model import LitellmModelload_dotenv()@function_tooldef clima(cidade: str) -> str:    """Retorna o clima atual de uma cidade."""    return f"Em {cidade}: 24°C, parcialmente nublado."agente = Agent(    name="Assistente",    instructions="Responda em português, de forma direta.",    model=LitellmModel(        model="groq/llama-3.3-70b-versatile",        api_key=os.environ["GROQ_API_KEY"],    ),    tools=[clima],)resultado = Runner.run_sync(agente, "Como está o tempo em Petrópolis?")print(resultado.final_output)

The full agentic loop — the model decides to call the tool, gets the result back, and formulates the final answer — happens in seconds and costs zero. For multi-agent in CrewAI, the same logic applies: define LLM(model="groq/llama-3.3-70b-versatile") and assemble your crew. And remember the same API best practices: keys in .env (never in Git), spending limits enabled, and extra caution with agents that execute code or shell — sandbox is not optional in production.

When it's worth paying: the enterprise layer

The market rule in 2026 is clear: the framework is free; you pay for the operations layer — managed observability, deploy, security, and compliance. LangSmith has a free tier of 5,000 traces/month and a Plus plan at $39/seat/month; the open-source alternative Langfuse (MIT, self-hostable) delivers the essentials for ~1/3 of the cost. CrewAI Enterprise goes from $25/month up to ~$75-90K/year contracts with SOC2, HIPAA, and SSO — and LLM consumption typically exceeds the license by 2-3x. In the clouds, AWS Bedrock AgentCore ($0.0895 per vCPU-hour, charging only for consumed CPU), Azure AI Foundry (native integration with Microsoft 365), and Vertex AI Agent Builder (grounding with Google Search) are all framework-agnostic: you run your LangGraph or CrewAI on top of them. The right choice is simply the cloud where your data already lives. Pay when the costs of failure, audit, or compliance exceed the effort of building that infrastructure internally — before that, open-source + Langfuse gets it done.

Onde está o custo real de um agente em produção Camada de operação (opcional, paga) LangSmith, CrewAI Enterprise, Bedrock AgentCore, Azure AI Foundry, Vertex AI US$ 0 a US$ milhares/mês Tokens do LLM — o custo dominante em plataformas enterprise, chega a 2-3x o valor da licença; free tiers podem zerar US$ 0 (free tier) a 2-3x a licença Framework open-source (MIT / Apache 2.0) LangGraph, CrewAI, Agents SDK, Pydantic AI, Mastra, smolagents, ADK... sempre US$ 0 Regra de 2026: o framework é grátis — você paga (se pagar) por tokens e pela operação gerenciada.
The cost stack of an agent in 2026: framework always free, tokens as the dominant cost, managed operations optional.

The right framework is the one that solves your problem with less code

The same democratization logic from APIs applies to agent SDKs: the barrier is no longer cost or access, it's just a decision. Complex and auditable workflow? LangGraph. Multi-agent prototype in an afternoon? CrewAI. TypeScript stack? Mastra. Code agent? Claude Agent SDK. Simple triage over an OpenAI-compatible API? OpenAI Agents SDK. In all cases, adopt MCP for tools and A2A for agent-to-agent communication from the start — it's these open standards that make the decision reversible. Start with the simplest option that works, spend 80% of your time on prompts and tool definition (not on framework choice), and incorporate evaluation and observability from day one. Your first agent's code fits in twenty lines and runs for free. All that's left is to start.