dotsagent.io
ภาษา:ไทย
เฟรมเวิร์ก · 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 · 28,467 ดาว
ตัวเลือกแบบโฮสต์
Mastra Cloud / Mastra Platform
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

ฟีเจอร์

ใช้ได้กับทุกโมเดลใช่ระบุโมเดลเป็น 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

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

แหล่งข้อมูล

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