devtake.dev

Vercel's AI SDK 7 makes agents a first-class building block for TypeScript developers

AI SDK 7 ships agent classes, provider-agnostic reasoning control, durable workflows, and a Node 22 + ESM-only baseline. Here's what changed and the migration cost.

Naomi Park · · 4 min read · 2 sources
AI SDK 7 announcement card from Vercel on a dark background
Image: vercel.com · Source

Vercel shipped AI SDK 7 today, and the headline is agents. The TypeScript toolkit, which Vercel says pulls more than 16 million weekly downloads, now ships agent loops, durable workflows, and external coding harnesses as built-in classes rather than patterns you wire up yourself. The trade is a hard break: Node.js 22 and ESM-only.

This is the library release, not the Vercel Ship 2026 keynote from two days ago. The keynote sold the agent vision. The SDK is the part you actually npm install. For anyone building AI features in TypeScript, this release rewrites the code you write, which is why the migration mechanics below matter more than any slide did. Production agents have been the gap in this SDK for a year, and version 7 is Vercel’s answer to that gap rather than a routine point bump.

What’s new in AI SDK 7

The big additions cluster around running agents in production, where the old SDK left gaps. Most of it is new.

  • Agent classes. ToolLoopAgent handles the tool-call loop with built-in approval policies (user-approval, auto-approve, auto-deny, or a custom function), and HMAC signing to validate replayed approvals. WorkflowAgent, from the new @ai-sdk/workflow package, persists state so a run survives a process restart.
  • Provider-agnostic reasoning. A single top-level reasoning option, set as plainly as reasoning: 'high', now works across OpenAI, Anthropic, Google, Groq, xAI, and Bedrock. One knob replaces a pile of per-provider settings.
  • Harness integration. A HarnessAgent interface wraps established external agents, including Claude Code, Codex, OpenCode, and Pi, behind the same API surface.
  • Typed context. Tools get a scoped contextSchema with isolated access, and a typed runtimeContext flows through orchestration so agent state stays type-safe across steps.
  • Observability and media. A global registerTelemetry() and a dedicated @ai-sdk/otel package add OpenTelemetry support with GenAI semantic conventions. generateSpeech() and transcribe() are now stable; video generation and realtime WebSocket sessions ship experimental.

There’s also a terminal UI, @ai-sdk/tui, for poking at agents during development. As Vercel’s team puts it in the announcement: “As agents become more autonomous and longer running, the need for approvals, durability, sandboxing, and robustness increases.”

What’s unclear, and the migration cost

The version-7 jump is a real break, not a cosmetic bump. Two changes will touch almost every project: Node.js 22 is the new minimum, and CommonJS require() is gone, so your package.json needs "type": "module". Older LTS Node and any CJS-only dependency graph will block the upgrade until you sort the ESM story out.

A few renames land in the hot path too. system becomes instructions, onFinish becomes onEnd, and StreamTextResult.fullStream is now just stream. Vercel ships an automated migration, npx @ai-sdk/codemod v7, but codemods rarely catch every call site, and the deprecation of stream helpers like toUIMessageStreamResponse() plus the Vue Chat class means framework glue code needs a manual pass. How clean the realtime and video APIs are in practice is still an open question; both ship as experimental, which is Vercel’s word for “shape may change.”

The reasoning, telemetry, and agent additions are confirmed from Vercel’s own blog post and changelog, credited to a core team of Gregor Martynus, Lars Grammel, Felix Arntz, Aayush Kapoor, and Josh Singh.

Where it sits versus the alternatives

Two camps bracket the AI SDK. On one side, raw provider SDKs from OpenAI and Anthropic give you the closest mapping to each model’s features but lock you to one vendor and one shape of code. The reasoning change is a direct shot at that: one option, six-plus providers, no rewrite to switch. On the other side sits LangChain, the heavyweight orchestration framework with more abstraction layers than most teams want. AI SDK 7’s pitch is the middle ground, typed end to end, lighter than LangChain, and provider-portable in a way the native SDKs aren’t.

That portability story is louder now that the agent infrastructure is moving in-house across the industry. Anthropic just bought Stainless, the SDK-generation shop, and developers are increasingly running coding agents locally. A vendor-neutral TypeScript layer is a hedge against any single provider owning the stack.

What this means for you

If you build AI features in TypeScript, AI SDK 7 is worth a serious look, but not a same-day ai@latest in production. Start by checking whether your project can move to Node 22 and ESM, because that gate blocks everything else. If it can, run the codemod on a branch, then grep for system, onFinish, and fullStream by hand to catch what it misses. The agent classes are the real reason to upgrade: if you’ve been hand-rolling tool-approval loops or trying to make an agent survive a restart, ToolLoopAgent and WorkflowAgent replace fragile custom code with something maintained. If you’re only doing one-shot generateText calls, the win is smaller and the migration tax is the same, so wait until your dependency graph is ESM-clean before you jump.

Share this article

Sources

Mentioned in this article