Mobile-native agents, in depth.
Long-form articles on the primitives behind agentlib, how it compares to other agent SDKs, and what mobile-native actually means in practice. Subscribe via RSS.
agentlib vs Claude SDK vs OpenAI Agents SDK vs Mastra vs LangChain: which to use
A practical decision tree for picking an agent SDK in 2026. The short answer: pick by where your agent runs — server, edge, or device. Here's the long answer.
CLI-first agent design: why agentlib's Sh mini-shell matters
Frontier LLMs are most fluent in Unix idioms — Read/Grep/Edit and cmd | jq | xargs. agentlib's Sh gives the model that surface inside a sandbox. Here's why it matters.
On-device AI agents in Flutter: Foundation Models, Gemini Nano, llama.cpp
agentlib runs agents on the phone. Four on-device providers — Apple Foundation Models, Gemini Nano, MediaPipe, Fllama — behind one ModelRoute.preferOnDevice([...]) call.
Why agentlib is the only mobile-native AI agent SDK
Every other agent SDK assumes a Node or Python runtime that doesn't fit inside an iOS app sandbox. agentlib is pure Dart, with native bridges for Apple Foundation Models and Gemini Nano.
Voice in, vision out, device automation: building a pocket assistant with agentlib
Wire voice input, vision-based screen understanding, accessibility-driven app automation, and on-device routing together. The pocket-assistant pattern in agentlib.
MCP on mobile: HTTP and WebSocket transports for Model Context Protocol servers
agentlib speaks Model Context Protocol over both HTTP and WebSocket. MCP tools surface as /bin/mcp.<server>.<tool> CLIs, ready for Sh pipelines. Notifications stream live.
Suspend, resume, and push-resume: agents that survive the OS lifecycle
iOS backgrounds apps. Android kills processes under memory pressure. agentlib's Runner state is serialisable, lifecycle hooks fire on every transition, and push notifications can wake the agent.
21 hooks: the most fine-grained agent loop in any SDK
agentlib has more interception points than any other agent SDK. PreToolUse, PostToolUse, OnSuspend, OnLowBattery, OnNetworkChange — guardrails without prompt hacking.
Snapshots, revert, fork: time-travel debugging for mobile AI agents
agentlib's snapshot API is public, content-addressed, and SQLite-backed. snapshot(), revert(), fork() — and an auto-snapshot before any highImpact tool call so users can always undo.
Subagents at scale: parallel and background dispatch on mobile
agentlib's subagents run sync, in parallel, or in the background — each with its own context window. Research + draft simultaneously; index in the background; survive backgrounding.
Progressive-disclosure skills: 30 skills in 600 tokens
Skills are markdown bundles that load lazily. The orchestrator sees only name + description until invocation, so a 30-skill catalog costs ~600 tokens instead of 12 K.