Scripts2026年3月30日·1 分钟阅读

Mastra — TypeScript AI Agent Framework

AI agent framework for TypeScript from the Gatsby team. Build agents with tools, workflows, RAG, memory, evals, and 50+ integrations. Modern TS-native design. 22K+ stars.

TO
TokRepo精选 · Community
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。

npx create-mastra@latest my-agent
cd my-agent
npm run dev

Or add to an existing project:

npm install mastra @mastra/core

介绍

Mastra is an AI agent framework for TypeScript, built by the team behind Gatsby. It provides a modern, TypeScript-native way to build AI agents with tools, multi-step workflows, RAG pipelines, persistent memory, evaluations, and 50+ pre-built integrations. Designed for production use with type safety throughout. 22,000+ GitHub stars, MIT licensed.

Best for: TypeScript/Node.js developers building production AI agents Works with: OpenAI, Anthropic, Google, Ollama, any LangChain-compatible model


Core Features

Agents with Tools

const agent = new Agent({
  name: "Research Assistant",
  instructions: "You help users research topics.",
  model: openai("gpt-4o"),
  tools: { search: searchTool, summarize: summarizeTool },
});

Workflows

Multi-step, branching workflows with automatic state management:

const workflow = new Workflow({ name: "content-pipeline" })
  .step("research", researchStep)
  .step("write", writeStep, { after: "research" })
  .step("review", reviewStep, { after: "write" });

RAG

Built-in vector storage and retrieval with chunking strategies.

Memory

Persistent conversation memory across sessions with thread management.

50+ Integrations

Pre-built connectors for GitHub, Slack, Notion, Google, Stripe, and more.

Evals

Test agent quality with built-in evaluation framework.


FAQ

Q: What is Mastra? A: A TypeScript AI agent framework from the Gatsby team. Build agents with tools, workflows, RAG, memory, evals, and 50+ integrations. 22K+ GitHub stars, MIT licensed.

Q: How is Mastra different from LangChain.js? A: Mastra is TypeScript-native with first-class type safety, built-in workflow engine, persistent memory, and a scaffold CLI. More opinionated and production-oriented.


🙏

来源与感谢

Created by Mastra AI (from the Gatsby team). Licensed under MIT. mastra-ai/mastra — 22,000+ GitHub stars

相关资产