---
title: "Vercel AI SDK: tính năng, phiên bản và hướng dẫn bắt đầu nhanh · DotsAgent"
description: "Vercel AI SDK của Vercel: giấy phép, phiên bản mới nhất, hỗ trợ MCP, lượt chạy bền vững, phê duyệt của con người, tracing và evals, kèm hướng dẫn bắt đầu nhanh để sao chép."
url: https://dotsagent.io/vi/frameworks/vercel-ai-sdk
---

Framework · Vercel

# Tổng quan về Vercel AI SDK

Bộ công cụ TypeScript không phụ thuộc nhà cung cấp của Vercel, trong đó ToolLoopAgent là lớp agent chính kể từ AI SDK 7. Bộ công cụ này kết hợp vòng lặp tool với các helper giao diện streaming; WorkflowAgent bổ sung các lượt chạy có thể tiếp tục sau khi khởi động lại.

**Phù hợp nhất với:**  Nhà phát triển Next.js và web muốn dùng agent vòng lặp tool tích hợp chặt chẽ với giao diện streaming.

## Thông tin chính

- **Đơn vị duy trì**: Vercel
- **Ngôn ngữ**: TypeScript
- **Giấy phép**: Apache-2.0
- **Phiên bản mới nhất**: `ai 7.0.126` · 30 tháng 9, 2026
- **Repository**: [vercel/ai](https://github.com/vercel/ai) · 27.070 sao
- **Tùy chọn chạy trên nền tảng lưu trữ**: [Vercel Functions + Vercel Workflow](https://ai-sdk.dev/docs/agents/workflow-agent)Nền tảng hosting tổng quát, không phải runtime chuyên dụng cho agent.

## Bắt đầu nhanh

Cài package, thiết lập thông tin xác thực, rồi chạy agent đơn giản nhất theo tài liệu chính thức. ID model sử dụng trong tài liệu có thể chưa được bật cho tài khoản của bạn.

`Cài đặt`

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

Cần 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
```

[Nguồn hướng dẫn bắt đầu nhanh](https://ai-sdk.dev/docs/agents/overview)

## Tính năng

| Mọi model | — | Dùng bất kỳ package provider nào hoặc chuỗi AI Gateway như anthropic/claude-sonnet-5.5 |
| --- | --- | --- |
| MCP client | — | client @ai-sdk/mcp |
| MCP server | — | — |
| Đa agent | — | Subagent; HarnessAgent chạy Claude Code, Codex hoặc Pi |
| Lượt chạy bền vững | — | WorkflowAgent, cần bản beta Workflow 5 |
| Phê duyệt của con người | — | toolApproval với phê duyệt ký bằng HMAC và chính sách OPA |
| Tracing | — | — |
| Evals | — | — |

## Các thay đổi gần đây

- AI SDK 7 chọn ToolLoopAgent làm lớp agent được khuyến nghị.
- HarnessAgent chạy Claude Code, Codex hoặc Pi làm agent.
- WorkflowAgent (@ai-sdk/workflow) thay thế DurableAgent của Workflow DevKit.
- runtimeContext và toolsContext thay thế experimental_context.

## Các lựa chọn thay thế cùng ngôn ngữ

- [OpenAI Agents SDK (JS)](https://dotsagent.io/vi/frameworks/openai-agents-js)

- [Claude Agent SDK](https://dotsagent.io/vi/frameworks/claude-agent-sdk)

- [Google ADK](https://dotsagent.io/vi/frameworks/google-adk)

- [LangGraph](https://dotsagent.io/vi/frameworks/langgraph)

- [LlamaIndex](https://dotsagent.io/vi/frameworks/llamaindex)

- [Mastra](https://dotsagent.io/vi/frameworks/mastra)

## Nguồn

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

Tài liệu tham khảo độc lập dành cho những người xây dựng AI agent. Không liên kết với bất kỳ nhà cung cấp nào được nêu ở đây.

© 2026 DotsAgent · Dữ liệu được kiểm tra ngày 1 tháng 10, 2026
