Vercel AI SDK
Free open-source TypeScript toolkit with a ToolLoopAgent class, many model providers and a separate durable agent package.
(opens full size in a new tab)Facts
- Users
- About 48.5M
- Runs on
- Node.js 22 or laterTypeScript
- Needs
- Node.js 22 or later
- License
- Apache-2.0, open source
- Category
- AI
- Facts checked
Our verdict
#5 of 10 in AI agent frameworks
Agents inside a TypeScript web app
What it does
- Tool-calling agent loop with stop conditions and per-step hooks
- Streaming helpers for React, Next.js, Svelte, and Vue
- Durable agents through a separate workflow package
- OpenTelemetry tracing and a local DevTools viewer
Pros
- Very wide model provider support
- Thin layer that stays close to plain TypeScript
- Huge community and examples
Cons
- In-memory agents lose progress on a crash unless you add the workflow package
- Few multi-agent patterns
- Default model strings route through Vercel's hosted gateway
- Major versions reshape the agent API
- Skip if:
- You don't want a separate workflow package, and your agents must survive restarts
About Vercel AI SDK
The Vercel AI SDK (the ai npm package, from the makers of Next.js) is a free, open-source, provider-agnostic TypeScript library for building AI applications and agents, with UI hooks for React, Svelte, Vue and Angular. Its agent abstraction is the ToolLoopAgent class, which runs a model and tools in a loop with stopWhen and prepareStep for loop control; flows with explicit control are written as plain TypeScript with generateText and streamText. Durable, resumable agents are a separate package, @ai-sdk/workflow, built on the separate Workflow DevKit. Model strings route through the hosted Vercel AI Gateway by default, or direct provider packages can be used. It has no Python version and runs on Node.js 22 or later; it does not require Vercel hosting. AI SDK DevTools is a local-only debug viewer.
Ranked in
-
#5 of 10 AI agent frameworks Agents inside a TypeScript web app 3.8/5
How it scored
-
Control over flow and state , counts double 3/5
ToolLoopAgent has approval pauses and flows are plain TypeScript, but it runs in memory and loses progress on a crash. Durable resume needs the separate @ai-sdk/workflow package on the Workflow DevKit, whose self-hosting is unclear, so it is not credited as a level 4 or 5 engine.
3/5 means: An agent loop that can pause for human approval and save sessions, but multi-step flows are your own code and crash recovery needs an outside engine
For most use cases, start with the ToolLoopAgent. Use core functions (generateText, streamText) when you need explicit control over each step for complex structured workflows.
ai-sdk.dev/docs/agents/overview · checked When you need reliable, repeatable outcomes with explicit control flow, use core functions with structured workflow patterns combining:
ai-sdk.dev/docs/agents/overview · checked The WorkflowAgent from @ai-sdk/workflow is designed for building durable, resumable agents that run inside a workflow. It runs a tool loop like ToolLoopAgent and adds automatic state persistence, tool schema serialization, and tool approval flows that survive workflow step boundaries.
ai-sdk.dev/docs/agents/workflow-agent · checked A standard ToolLoopAgent runs entirely in memory — if the process crashes, all progress is lost.
ai-sdk.dev/docs/agents/workflow-agent · checked @ai-sdk/workflow requires Workflow 5, as well as the ai package and zod peer dependencies. The workflow package provides the Workflow DevKit runtime (getWritable, 'use workflow', 'use step').
ai-sdk.dev/docs/agents/workflow-agent · checked
Show all 5
-
Production track record and API stability 4/5
Stable versioned releases, maintained by Vercel as a main product, and very heavy use (about 48.5M weekly npm downloads). Major versions have shipped often (agent API renamed between 5, 6 and 7), so no 5.
4/5 means: Stable 1.0 or later with a stability commitment, active maintenance and named production users
28.2k stars
github.com/vercel/ai · checked {"downloads":48501198,"start":"2026-11-16","end":"2026-11-22","package":"ai"}
api.npmjs.org/downloads/point/last-week/ai · checked The ToolLoopAgent is the recommended approach for building agents with the AI SDK because it:
ai-sdk.dev/docs/agents/overview · checked
-
Tracing and debugging 4/5
Built-in OpenTelemetry telemetry that sends spans to the backend you register, plus the free AI SDK DevTools viewer for stepping through runs during development (not for production). No rewind or replay.
4/5 means: Built-in tracing to the backend you choose, plus a visual debugger or trace viewer, local or from the maker, usable without a paid plan
AI SDK DevTools gives you full visibility over your AI SDK calls with generateText, streamText, and ToolLoopAgent. It helps you debug and inspect LLM requests, responses, tool calls, and multi-step interactions through a web-based UI.
ai-sdk.dev/docs/ai-sdk-core/devtools · checked AI SDK DevTools is intended for local development only. Do not use in production environments.
ai-sdk.dev/docs/ai-sdk-core/devtools · checked Telemetry is enabled automatically once an integration is registered — no per-call configuration is needed:
ai-sdk.dev/docs/ai-sdk-core/devtools · checked
-
Freedom to switch model providers 5/5
Provider-agnostic with native provider packages and no provider favored, switched by a model string, with Gateway routing and fallback (the Gateway is a hosted Vercel service; fallback is from the Gateway's own record). Local models via community providers are supported.
5/5 means: Everything in 4, with no provider getting features others don't, and fallback or routing between providers built in
The AI SDK is a provider-agnostic TypeScript toolkit designed to help you build AI-powered applications and agents using popular UI frameworks like Next.js, React, Svelte, Vue, Angular, and runtimes like Node.js.
github.com/vercel/ai · checked By default, the AI SDK uses the Vercel AI Gateway to give you access to all major providers out of the box. Just pass a model string for any supported model:
github.com/vercel/ai · checked
-
Multi-agent support 2/5
The docs show subagents as tools wrapped around an agent, with no handoff or supervisor primitives or A2A support.
2/5 means: One agent can call another as a tool, with no other built-in patterns
-
Learning curve and everyday developer experience 5/5
Strong typing with zod tool schemas, short quick start and widely praised docs.
5/5 means: Everything in 4, with a design practitioners single out as pleasant to work in, such as plain code, strong typing and errors caught before runtime
The ToolLoopAgent is the recommended approach for building agents with the AI SDK because it:
ai-sdk.dev/docs/agents/overview · checked For most use cases, start with the ToolLoopAgent. Use core functions (generateText, streamText) when you need explicit control over each step for complex structured workflows.
ai-sdk.dev/docs/agents/overview · checked
-
Integrations and community help , counts half 5/5
MCP support, many provider packages and UI framework hooks, and the largest TypeScript community by downloads (about 48.5M per week) and stars (28.2k).
5/5 means: The largest ecosystem in the field, with integrations for nearly every model, tool and data store and the most tutorials and experienced developers
The AI SDK is a provider-agnostic TypeScript toolkit designed to help you build AI-powered applications and agents using popular UI frameworks like Next.js, React, Svelte, Vue, Angular, and runtimes like Node.js.
github.com/vercel/ai · checked 28.2k stars
github.com/vercel/ai · checked {"downloads":48501198,"start":"2026-11-16","end":"2026-11-22","package":"ai"}
api.npmjs.org/downloads/point/last-week/ai · checked
Top of this ranking
- LangGraph #1
- Pydantic AI #2
- Mastra #3
-
Sources
21 quotes from 6 pages; the 14 most useful are below.
-
Limits and known issues 3
A standard ToolLoopAgent runs entirely in memory — if the process crashes, all progress is lost.
ai-sdk.dev/docs/agents/workflow-agent · checked stream() does not apply a default step limit. When stopWhen is omitted, it continues until the model stops calling tools or another natural termination con
ai-sdk.dev/docs/agents/workflow-agent · checked AI SDK DevTools is intended for local development only. Do not use in production environments.
ai-sdk.dev/docs/ai-sdk-core/devtools · checked
-
Features 8
By default, the AI SDK uses the Vercel AI Gateway to give you access to all major providers out of the box. Just pass a model string for any supported model:
github.com/vercel/ai · checked The ToolLoopAgent is the recommended approach for building agents with the AI SDK because it:
ai-sdk.dev/docs/agents/overview · checked For most use cases, start with the ToolLoopAgent. Use core functions (generateText, streamText) when you need explicit control over each step for complex structured workflows.
ai-sdk.dev/docs/agents/overview · checked Use runtimeContext as the agent's shared runtime state. It flows through the agent loop, is available in prepareStep and lifecycle callbacks, and can be updated between steps.
ai-sdk.dev/docs/agents/overview · checked The WorkflowAgent from @ai-sdk/workflow is designed for building durable, resumable agents that run inside a workflow. It runs a tool loop like ToolLoopAgent and adds automatic state persistence, tool schema serialization, and tool approval flows that survive workflow step boundaries.
ai-sdk.dev/docs/agents/workflow-agent · checked use workflow brings durability, reliability, and observability to async JavaScript. Build apps and AI Agents that can suspend, resume, and maintain state with ease.
workflow-sdk.dev · checked AI SDK DevTools gives you full visibility over your AI SDK calls with generateText, streamText, and ToolLoopAgent. It helps you debug and inspect LLM requests, responses, tool calls, and multi-step interactions through a web-based UI.
ai-sdk.dev/docs/ai-sdk-core/devtools · checked Telemetry is enabled automatically once an integration is registered — no per-call configuration is needed:
ai-sdk.dev/docs/ai-sdk-core/devtools · checked
Show all 8
-
Platforms and requirements 1
The AI SDK is a provider-agnostic TypeScript toolkit designed to help you build AI-powered applications and agents using popular UI frameworks like Next.js, React, Svelte, Vue, Angular, and runtimes like Node.js.
github.com/vercel/ai · checked
-
License 1
The AI Toolkit for TypeScript. From the creators of Next.js, the AI SDK is a free open-source library for building AI-powered applications and agents
github.com/vercel/ai · checked
-
How widely it is used 1
{"downloads":48501198,"start":"2026-11-16","end":"2026-11-22","package":"ai"}
api.npmjs.org/downloads/point/last-week/ai · checked
