There are now five credible AI agent SDKs you might pick in 2026, and most of them are good at very different things. This article is a practical decision tree, written by people building agentlib but trying to be honest about where the others shine.
The contenders
Claude Agent SDK (Anthropic). Python and TypeScript. Cloud-only (Claude). Probably the most mature primitive set — subagents, skills, snapshots, hooks. Tied tightly to Claude as the model. MIT licensed.
OpenAI Agents SDK (OpenAI). Python and JavaScript. Cloud-only (OpenAI + OpenAI-compatible). Handoff-first design. Apache-2.0.
Mastra (Mastra Labs). TypeScript only. Node / Bun / Deno / Cloudflare Workers. Cloud-only, multi-provider. Agent loops, workflows, MCP, RAG. MIT.
LangChain (LangChain Inc.). Python + JavaScript. Originally a chain-and-RAG framework that’s grown agent primitives. Multi-provider. MIT.
agentlib (Neul Labs). Dart only. Runs in Flutter apps natively — iOS, Android, macOS. On-device + cloud,
unified by ModelRoute. MIT.
The 30-second decision
| Constraint | Pick |
|---|---|
| Agent runs in a Flutter app | agentlib |
| Agent runs natively in an iOS or Android app | agentlib |
| Needs on-device LLM inference | agentlib |
| Privacy-sensitive: no data leaves the device | agentlib |
| Python / TS backend, Claude is the model | Claude Agent SDK |
| Python / JS backend, OpenAI is the model | OpenAI Agents SDK |
| TypeScript backend, multi-provider | Mastra |
| Edge runtime (Workers, Vercel) | Mastra (TS edge support) |
| Heavy RAG over a custom corpus | LangChain + a vector store |
| Already invested in LangChain | LangChain + LCEL |
If your situation hits more than one row, you might want two of these together (see “Combining them” below).
The longer version
Native mobile + on-device
This is agentlib’s territory. None of the others run inside an iOS app sandbox without a Node subprocess. None of the
others have a FoundationModelsProvider or GeminiNanoProvider. The closest is Mastra, which is TypeScript and could
in theory run in a webview embedded in a mobile app — but that’s not really “native to the device” in the way Flutter
- Dart is. If your agent lives on a phone, pick agentlib.
Server-side, Claude-only
Pick the Claude Agent SDK. The primitive set is mature (subagents, skills, snapshots, hooks), the Anthropic team maintains it, and you get features in lockstep with the model. The only reason to choose anything else here is if you need explicit multi-provider support — Anthropic’s SDK is, reasonably, Claude-first.
Server-side, OpenAI-only, handoff-heavy
Pick the OpenAI Agents SDK. The handoff primitive is the cleanest of any framework — “this conversation is now the specialist’s problem” — and the SDK was designed around it. Less primitive surface than the Claude SDK (no snapshots, fewer hooks) but it’s right for the workflows it targets.
Server-side, TypeScript, multi-provider
Pick Mastra. It’s the cleanest TypeScript-first agent framework with multi-provider support. Good MCP integration, solid workflow primitives, edge-runtime support out of the box. Younger than the Anthropic SDK so the surface evolves fast — pin versions.
Heavy RAG, pipelines, classifiers
Pick LangChain or LlamaIndex. The agent loop in LangChain has matured but the framework’s center of gravity is still retrieval + chains. If most of your work is “retrieve, transform, output”, LangChain is more idiomatic than treating the same pipeline as an “agent”. If you go this way, expect to pin versions tightly — the API has churned a lot.
Capability matrix
| Capability | agentlib | Claude SDK | OpenAI Agents | Mastra | LangChain |
|---|---|---|---|---|---|
| Native iOS + Android | ✓ | ✗ | ✗ | ✗ | wrapped |
| On-device models | ✓ | ✗ | ✗ | ✗ | wrapped |
| Subagents (parallel/background) | ✓ | sync | via handoff | ✓ | via LCEL |
| Progressive-disclosure skills | ✓ | ✓ | ✗ | ✗ | ✗ |
| Snapshots (fork / revert) | ✓ | partial | ✗ | partial | ✗ |
| Hooks | 21 | ~10 | guardrails | some | ✗ |
| Unix-shell tool surface | ✓ | bash | ✗ | ✗ | ✗ |
| MCP (HTTP + WS) | ✓ | HTTP | ✗ | HTTP | ✗ |
| Suspend / resume + push-resume | ✓ | ✗ | ✗ | partial | ✗ |
| Multi-provider out of box | 7 | 1 | 1 | many | many |
| License | MIT | MIT | Apache-2.0 | MIT | MIT |
The honest read: agentlib has the deepest primitive surface specifically for mobile. The Claude SDK has the deepest primitive surface for server-side Claude. The OpenAI Agents SDK is the cleanest handoff-first design. Mastra is the strongest TypeScript story. LangChain is the strongest retrieval story.
Combining them
We do this a lot, and we think you should too.
Pattern A: cloud backend + on-device agent. Run a Claude Agent SDK or Mastra pipeline on the server. Run agentlib in the Flutter app. The device calls the backend for heavy reasoning; the agentlib agent handles UI orchestration, on-device classification, offline fallback. They interoperate over JSON-RPC tool calls or MCP.
Pattern B: orchestrator on the backend + sub-orchestrator on the device. Claude Agent SDK’s orchestrator spawns mobile work; the agentlib runtime picks it up via push-resume; results stream back via webhooks or MCP notifications.
Pattern C: retrieval pipeline (LangChain) + agent on top (Claude SDK or agentlib). Use LangChain for what it’s best at (retrieval + transformation), and surface the results to an agent loop in whichever SDK fits your runtime.
Migration notes
From Claude Agent SDK to agentlib (for mobile use):
AgentSpec≈ Anthropic’s agent descriptor.- Subagents map almost 1:1 (with parallel + background added).
- Skills shape is identical — same markdown bundle layout.
- Hooks are a superset — agentlib’s 21 includes everything in the Claude SDK plus mobile-lifecycle hooks.
- Tool schemas: agentlib uses a Zod-style
Schema.object(...); mapping is mechanical.
From OpenAI Agents SDK to agentlib:
- The OpenAI handoff is
AgentSpec.handoffsin agentlib — the v1.1.0 addition. - Guardrails map onto
PreToolUse+PostToolUsehooks. - Tool schemas: same idea, different syntax.
From LangChain to agentlib:
- LCEL chains map onto a custom orchestrator agent + subagents. Don’t expect a 1:1 port.
- LangChain retrievers become tools the agent calls.
What we’d actually pick
Each row of this matrix is a real product we’ve worked on or talked to teams shipping. Honest picks:
- Slack-style bot, server-side: Claude Agent SDK + MCP.
- Customer-support web app: Mastra + Postgres + RAG.
- Internal-tools agent that drives spreadsheets: OpenAI Agents SDK + handoffs.
- iOS / Android app with AI assistant features: agentlib.
- Voice-driven mobile assistant: agentlib (voice CLIs are first-party).
- Privacy-sensitive mobile assistant: agentlib with
onDeviceOnly. - Search-over-docs product: LangChain (or LlamaIndex) + a vector DB.
The decision really is mostly about where the agent runs. Pick that first; everything else follows.