dotsagent.io
Language:English
Framework · Vercel

Vercel AI SDK at a glance

Vercel's provider-agnostic TypeScript toolkit, where ToolLoopAgent is the main agent class as of AI SDK 7. It ties tool loops to streaming UI helpers, and WorkflowAgent adds runs that survive restarts.

Best for: Next.js and web developers who want tool-loop agents tied closely to streaming UI.

Key facts

Maintainer
Vercel
Languages
TypeScript
Licence
Apache-2.0
Latest version
ai 7.0.126 · September 30, 2026
Repository
vercel/ai · 27,070 stars
Hosted option
Vercel Functions + Vercel Workflow
A general hosting platform rather than an agent-specific runtime.

Quickstart

Install the package, set the credentials, then run the smallest agent from the official docs. Model IDs are the ones the docs use and may not be enabled on your account.

Install
npm install ai zod  (inferred; not copied from docs)

Needs AI Gateway or provider key

TypeScript
import { ToolLoopAgent, tool } from 'ai';
import { z } from 'zod';

const weatherAgent = new ToolLoopAgent({
  model: "anthropic/claude-sonnet-5.5",
  tools: {
    weather: tool({
      description: 'Get the weather in a location (in Fahrenheit)',
      inputSchema: z.object({
        location: z.string().describe('The location to get the weather for'),
      }),
      execute: async ({ location }) => ({
        location,
        temperature: 72 + Math.floor(Math.random() * 21) - 10,
      }),
    }),
    convertFahrenheitToCelsius: tool({
      description: 'Convert temperature from Fahrenheit to Celsius',
      inputSchema: z.object({
        temperature: z.number().describe('Temperature in Fahrenheit'),
      }),
      execute: async ({ temperature }) => {
        const celsius = Math.round((temperature - 32) * (5 / 9));
        return { celsius };
      },
    }),
  },
});

const result = await weatherAgent.generate({
  prompt: 'What is the weather in San Francisco in celsius?',
});

console.log(result.text); // agent's final answer
console.log(result.steps); // steps taken by the agent

Quickstart source

Features

Any modelYesAny provider package, or AI Gateway strings such as anthropic/claude-sonnet-5.5
MCP clientYes@ai-sdk/mcp client
MCP serverNot confirmed
Multi-agentYesSubagents; HarnessAgent runs Claude Code, Codex or Pi
Durable runsYesWorkflowAgent, which needs the Workflow 5 beta
Human approvalYestoolApproval with HMAC-signed approvals and OPA policies
TracingNot confirmed
EvalsNot confirmed

Recent changes

  • AI SDK 7 makes ToolLoopAgent the recommended agent class.
  • HarnessAgent runs Claude Code, Codex or Pi as the agent.
  • WorkflowAgent (@ai-sdk/workflow) replaces the Workflow DevKit's DurableAgent.
  • runtimeContext and toolsContext replace experimental_context.

Alternatives in the same language

Sources

  1. ai-sdk.dev/docs/agents/overview
  2. ai-sdk.dev/docs/agents/tool-approvals
  3. ai-sdk.dev/docs/agents/workflow-agent
  4. ai-sdk.dev/docs/ai-sdk-core/mcp-tools
  5. vercel.com/kb/guide/durableagent-to-workflowagent
  6. registry.npmjs.org/ai
  7. api.github.com/repos/vercel/ai

Independent reference for people who build AI agents. Not affiliated with any vendor named here.

© 2026 DotsAgent · Facts checked October 1, 2026