Mastra is an open-source AI agent framework based on TypeScript, developed by the Gatsby team. It's an opinionated TypeScript framework that helps you quickly build AI applications and features, providing core primitives such as workflows, agents, RAG, integrations, and evaluations.
Project Address: https://github.com/mastra-ai/mastra
Define agents, tools, and RAG workflows using pure TypeScript. Mastra handles streaming, retries, evaluation, and a type-safe REST layer, allowing developers to focus on product logic rather than complex configurations.
Supports various large language models: GPT-4, Claude, Gemini, Llama, etc. It uses the Vercel AI SDK to implement model routing and can interact with providers like OpenAI, Anthropic, and Google Gemini.
Provides a complete set of AI primitives: workflows for complex operations, agents for autonomous decision-making, RAG for knowledge integration, and evaluations for quality and accuracy.
Mastra provides APIs to process document (text, HTML, Markdown, JSON) chunking, create embeddings, and store them in vector databases. During queries, it retrieves relevant chunks to generate LLM responses based on the data, supporting vector databases like Qdrant.
Supports creating pausable/resumable workflow graphs, building RAG pipelines, providing memory functions for agents, creating multi-agent workflows, and viewing everything in a local playground.
npm create mastra
command.Mastra can be run on local machines or deployed to serverless cloud environments, supporting deployment on any cloud platform.
Mastra was founded in 2024 by Abhi Aiyer, Sam Bhagwat, and Shane Thomas, with a team of 8 employees. The team previously developed the well-known open-source React Web framework Gatsby and has extensive experience in web development and open-source projects.
Mastra offers a native TypeScript experience, making it easier for JS/TS developers to integrate AI features without switching languages. It also provides a unified API for AI providers, workflows, and RAG, simplifying the development process.
Compared to other JavaScript agent frameworks, Mastra and LangGraph.js are two leading options, but Mastra focuses more on the TypeScript ecosystem and product developer experience.
npm create mastra
Mastra is building a complete AI development ecosystem, including:
This makes Mastra a powerful choice for building modern AI applications, especially suitable for development teams familiar with TypeScript.