mastra README

The project's README from github.com/mastra-ai/mastra. As one markdown file: README.md.

Mastra

npm version CodeQl GitHub Repo stars Discord Twitter Follow NPM Downloads Static Badge

Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.

It includes everything you need to go from early prototypes to production-ready applications. Mastra integrates with frontend and backend frameworks like React, Next.js, and Node, or you can deploy it anywhere as a standalone server. It's the easiest way to build, tune, and scale reliable AI products.

Why Mastra?

Purpose-built for TypeScript and designed around established AI patterns, Mastra gives you everything you need to build great AI applications out-of-the-box.

Some highlights include:

Get started

The recommended way to get started with Mastra is by running the command below:

npm create mastra@latest

Follow the Installation guide for step-by-step setup with the CLI or a manual install.

If you're new to AI agents, check out our templates, course, and YouTube videos to start building with Mastra today.

Alternative: Use this pre-built prompt to get started
Create a new Mastra project. Mastra is a framework for AI applications and agents on a modern TypeScript stack. Before running the command, ask these questions one at a time and wait for each answer unless it was already provided:

1. Project name? (default: "my-mastra-app")
2. Provider? (required; options: "openai", "anthropic", "google", "xai")

If the provider isn't supported, ask again and list the supported values.

Run: `npm create mastra@latest <project-name> -- --llm <provider>`

The command creates a default Mastra project, installs Mastra skills for detected coding assistants, and initializes Git when appropriate.

After creation, enter the project directory and start the dev server: `npx bgproc start -n <project-name> -w -- npm run dev`

Open Mastra Studio at `http://localhost:4111`. Studio is the interface for building, testing, and managing agents, workflows, and tools.

Also mention that the Mastra model router provides access to thousands of models: https://mastra.ai/models

Documentation

Visit our official documentation.

Build with AI

Learn how to make your agent a Mastra expert by following the Build with AI guide.

Contributing

Looking to contribute? All types of help are appreciated, from coding to testing and feature specification. Read CONTRIBUTING.md for more details on how to get involved.

If you are a developer and would like to contribute with code, please open an issue to discuss before opening a Pull Request.

Information about the project setup can be found in the development documentation

Support

We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.

It's also super helpful if you leave the project a star here, at the top of the page

Licensing

This repository uses a dual-license model:

See LICENSE.md for the full license mapping and ee/LICENSE for the enterprise license terms.

Security

We are committed to maintaining the security of this repo and of Mastra as a whole. If you discover a security finding we ask you to please responsibly disclose this to us at [email protected] and we will get back to you.

mastra (mastra-ai/mastra)

Searching Database…

28.9K ·GitHub
这是什么?Mastra 是一个用于构建 AI 应用和智能体的 TypeScript 框架,帮你从早期原型一路做到可上线的产品。
这是装好就能用的成品应用,还是用来搭建自己产品的工具?它是一个框架,不是现成的产品:你可以把它的智能体和工作流打包进你的 React、Next.js 或 Node.js 代码里,也可以把它们部署成独立的服务。
我该怎么上手?需要先准备什么?你需要使用基于 Node.js 的现代 TypeScript 技术栈。推荐的做法是运行「Get started」部分给出的 Mastra CLI 命令;手动安装的方式在安装指南里有说明。
它是完全开源的吗,还是有什么限制?大部分是:核心框架采用 Apache-2.0 许可证,但任何 ee/ 目录下的代码适用 Mastra Enterprise License——开发和测试可以免费使用,用于生产环境则需要有效的企业许可证。
和直接调用模型 API 相比,为什么要选 Mastra?它把成熟的 AI 模式——模型路由、智能体、工作流编排、记忆和评估——开箱即用地集成在同一个 TypeScript 技术栈里,这样你从原型做到上线的过程中就不用自己把这些部件一个个拼起来。
我是 AI 智能体方面的新手,有可以学习的资料吗?有:项目为新手准备了现成的模板、一门课程和 YouTube 视频,还有一个开放的社区 Discord,你可以在那里提问,也可以寻求把项目跑起来的帮助。
工作流的写法是什么样的?工作流基于图结构,使用直观的控制流语法:用 .then()、.branch() 和 .parallel() 来编排步骤的顺序、分支和并行执行。
Creator
mastra-ai
Size
2 GB
Stars
28.9K
Age
2y
Commits · 90 Days