---
title: "Mastra: tính năng, phiên bản và hướng dẫn bắt đầu nhanh · DotsAgent"
description: "Mastra của Mastra: 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/mastra
---

Framework · Mastra

# Tổng quan về Mastra

Framework TypeScript tích hợp agent, workflow có thể tạm dừng và tiếp tục, memory, evals và giao diện Studio trong một package. Framework có thể tích hợp vào ứng dụng Next.js, Express hoặc Hono; phần lõi dùng giấy phép Apache-2.0, còn các thư mục ee/ dùng giấy phép enterprise.

**Phù hợp nhất với:**  Các đội ngũ TypeScript muốn dùng một stack duy nhất cho agent, workflow, memory và evals.

## Thông tin chính

- **Đơn vị duy trì**: Mastra
- **Ngôn ngữ**: TypeScript
- **Giấy phép**: Apache-2.0 (core)
- **Phiên bản mới nhất**: `@mastra/core 1.73.0` · 1 tháng 10, 2026
- **Repository**: [mastra-ai/mastra](https://github.com/mastra-ai/mastra) · 28.467 sao
- **Tùy chọn chạy trên nền tảng lưu trữ**: [Mastra Cloud / Mastra Platform](https://mastra.ai/docs)mastra deploy tạo và deploy một Docker image.

## 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 @mastra/core@latest zod@latest typescript@latest @types/node@latest mastra@latest  (or scaffold: npm create mastra@latest)
```

Cần OPENAI_API_KEY

`TypeScript`

```
// src/mastra/agents/weather-agent.ts
import { Agent } from '@mastra/core/agent'
import { weatherTool } from '../tools/weather-tool.ts'

export const weatherAgent = new Agent({
  id: 'weather-agent',
  name: 'Weather Agent',
  instructions: `
      You are a helpful weather assistant that provides accurate weather information.

      Your primary function is to help users get weather details for specific locations. When responding:
      - Include relevant details like humidity, wind conditions, and precipitation
      - Keep responses concise but informative

      Use the weatherTool to fetch current weather data.
`,
  // Use a string in provider/model format, not provider:model or a provider object.
  model: 'openai/gpt-5.6-sol',
  tools: { weatherTool },
})

// run.mjs (after registering the agent in src/mastra/index.ts)
import { mastra } from './src/mastra/index.ts'

const agent = mastra.getAgentById('weather-agent')
const response = await agent.generate('Weather in SF')
console.log(response.text)
```

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

## Tính năng

| Mọi model | — | Chuỗi định tuyến model theo định dạng provider/model |
| --- | --- | --- |
| MCP client | — | — |
| MCP server | — | MCPServer cung cấp agent, tool, workflow, prompt và resource |
| Đa agent | — | Agent có thể hoạt động như tool cho các agent khác |
| Lượt chạy bền vững | — | Tạm dừng và tiếp tục với snapshot lưu trong libSQL, Postgres và các hệ quản trị khác |
| Phê duyệt của con người | — | suspend() và resume() thu thập thông tin đầu vào từ con người |
| Tracing | — | Các OTel exporter gửi dữ liệu đến Langfuse, Braintrust, Datadog và LangSmith |
| Evals | — | Scorer chạy trực tiếp với sampling hoặc chạy ngoại tuyến trong CI |

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

- npm create mastra hiện khởi tạo harness đa dụng với workspace, shell tool, memory và lịch chạy.
- Mastra Factory hướng đến các software factory được xây dựng bằng coding agent.

## 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)

- [Vercel AI SDK](https://dotsagent.io/vi/frameworks/vercel-ai-sdk)

## Nguồn

1. [mastra.ai](https://mastra.ai/docs)/docs
2. [mastra.ai](https://mastra.ai/docs/connections/mcp)/docs/connections/mcp
3. [mastra.ai](https://mastra.ai/reference/tools/mcp-server)/reference/tools/mcp-server
4. [mastra.ai](https://mastra.ai/docs/workflows/suspend-and-resume)/docs/workflows/suspend-and-resume
5. [mastra.ai](https://mastra.ai/docs/workflows/snapshots)/docs/workflows/snapshots
6. [mastra.ai](https://mastra.ai/ai-agent-observability)/ai-agent-observability
7. [github.com](https://github.com/mastra-ai/mastra/blob/main/LICENSE.md)/mastra-ai/mastra/blob/main/LICENSE.md
8. [registry.npmjs.org](https://registry.npmjs.org/@mastra%2fcore)/@mastra%2fcore

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
