---
title: "Mastra: ฟีเจอร์ เวอร์ชัน และ Quickstart · DotsAgent"
description: "Mastra โดย Mastra: ไลเซนส์ เวอร์ชันล่าสุด รองรับ MCP, การรันงานแบบต่อเนื่อง การอนุมัติโดยมนุษย์ การ tracing และ evals พร้อม Quickstart ที่คัดลอกไปใช้ได้"
url: https://dotsagent.io/th/frameworks/mastra
---

เฟรมเวิร์ก · Mastra

# ภาพรวม Mastra

เฟรมเวิร์ก TypeScript ที่รวม agents, workflows ซึ่งหยุดและทำงานต่อได้, memory, evals และ UI ของ Studio ไว้ในแพ็กเกจเดียว ใช้ร่วมกับแอป Next.js, Express หรือ Hono ได้ทันที โดย core ใช้สัญญาอนุญาต Apache-2.0 ส่วนไดเรกทอรี ee/ ใช้สัญญาอนุญาตสำหรับองค์กร

**เหมาะสำหรับ:**  ทีม TypeScript ที่ต้องการ stack เดียวสำหรับ agents, workflows, memory และ evals

## ข้อมูลสำคัญ

- **ผู้ดูแล**: Mastra
- **ภาษา**: TypeScript
- **ไลเซนส์**: Apache-2.0 (core)
- **เวอร์ชันล่าสุด**: `@mastra/core 1.73.0` · 1 ตุลาคม 2569
- **Repository**: [mastra-ai/mastra](https://github.com/mastra-ai/mastra) · 28,467 ดาว
- **ตัวเลือกแบบโฮสต์**: [Mastra Cloud / Mastra Platform](https://mastra.ai/docs)mastra deploy สร้างและ deploy Docker image

## Quickstart

ติดตั้งแพ็กเกจ ตั้งค่าข้อมูลรับรอง แล้วเรียกใช้ agent ตัวอย่างที่เล็กที่สุดจากเอกสารทางการ Model ID เป็นค่าที่เอกสารใช้ และอาจยังไม่ได้เปิดใช้งานในบัญชีของคุณ

`ติดตั้ง`

```
npm install @mastra/core@latest zod@latest typescript@latest @types/node@latest mastra@latest  (or scaffold: npm create mastra@latest)
```

ต้องใช้ 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)
```

[แหล่งข้อมูล Quickstart](https://mastra.ai/docs)

## ฟีเจอร์

| ใช้ได้กับทุกโมเดล | — | ระบุโมเดลเป็น string ในรูปแบบ provider/model |
| --- | --- | --- |
| MCP client | — | — |
| MCP server | — | MCPServer เปิดให้ใช้งาน agents, tools, workflows, prompts และ resources |
| หลาย agent | — | เอเจนต์สามารถทำหน้าที่เป็น tools ให้เอเจนต์อื่นได้ |
| การทำงานต่อเนื่องแบบทนทาน | — | หยุดและทำงานต่อได้ โดยบันทึก snapshots ใน libSQL, Postgres และฐานข้อมูลอื่น ๆ |
| การอนุมัติโดยมนุษย์ | — | suspend() และ resume() ใช้รับข้อมูลจากมนุษย์ |
| Tracing | — | ส่งออกข้อมูลผ่าน OTel ไปยัง Langfuse, Braintrust, Datadog และ LangSmith |
| Evals | — | Scorers ทำงานระหว่างรันโดยสุ่มตัวอย่าง หรือทำงานแบบออฟไลน์ใน CI ได้ |

## การเปลี่ยนแปลงล่าสุด

- npm create mastra สร้าง harness สำหรับใช้งานทั่วไป พร้อม workspace, shell tools, memory และ schedules
- Mastra Factory ออกแบบมาสำหรับ software factory ที่สร้างจาก coding agents

## ทางเลือกในภาษาเดียวกัน

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

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

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

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

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

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

## แหล่งข้อมูล

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

แหล่งอ้างอิงอิสระสำหรับผู้สร้าง AI agent ไม่มีส่วนเกี่ยวข้องกับผู้ให้บริการที่กล่าวถึง

© 2026 DotsAgent · ตรวจสอบข้อมูลเมื่อ 1 ตุลาคม 2569
