compare

Which agent SDK should you pick?

agentlib next to the four SDKs you're most likely evaluating. The matrix below is factual — pick the column whose constraints fit yours.

Capability agentlib Claude SDK OpenAI Agents Mastra LangChain
Native iOS + Android ● Dart, no subprocess ○ Python/TS, Node subprocess ○ Node/JS only ○ Node/TS backend ◐ via wrappers
On-device model providers ● Foundation Models · Gemini Nano · llama.cpp · MediaPipe ○ Anthropic cloud only ○ OpenAI cloud ○ cloud only ◐ via separate libs
Subagents ● sync · parallel · background ◐ sync only ◐ via handoffs ● agent-as-tool ◐ via LCEL
Progressive-disclosure skills ● name+desc only until invoked ● same shape ○ — ○ — ○ —
Snapshots (fork / revert) ● public API, SQLite-backed ◐ internal checkpoints ○ — ◐ suspend/resume ○ —
Hooks (interception points) ● 21 hooks ◐ ~10 hooks ◐ guardrails only ◐ lifecycle ○ —
Unix-shell-shaped CLI surface ● Sh mini-shell · /bin/* CLIs ◐ real bash via Node ○ JSON-RPC only ○ JSON-RPC only ○ JSON-RPC only
MCP transports ● HTTP · WebSocket ◐ HTTP/stdio ○ — ● HTTP ○ —
Suspend / resume + push-resume ● serialisable RunState · APNs/FCM ○ — ○ — ◐ suspend/resume ○ —
License ● MIT ● MIT ● Apache-2.0 ● MIT ● MIT
bottom line

Native mobile + on-device is non-optional for phones.

If your agent runs on the device, agentlib is the only credible choice today. If your agent runs server-side, Claude Agent SDK or Mastra is probably right.