Mastra
Mastra is an open-source TypeScript framework for building AI-powered applications and agents, with built-in support for workflows, RAG, memory, MCP, evals, and observability.
At a Glance
Apache 2.0 licensed open-source framework. Build and host agents anywhere.
Engagement
Available On
Alternatives
Updated Jun 2026
About Mastra
Mastra is a TypeScript-first, open-source framework for building AI agents and applications, created by the team behind Gatsby. Licensed under Apache 2.0 for its core, it lets developers go from early prototypes to production-ready agents using a modern JavaScript stack. The project has accumulated over 24,000 GitHub stars and reached its latest release, @mastra/core@1.35.0, in May 2026.
What It Is
Mastra is an agentic framework that provides the primitives TypeScript developers need to build, test, and deploy AI-powered products. It covers the full lifecycle: defining agents with LLMs and tools, orchestrating multi-step workflows, managing memory and context, connecting to external services via MCP, evaluating output quality, and observing production behavior. The framework integrates with popular web frameworks like Next.js, Express, Hono, and SvelteKit, or can be deployed as a standalone server.
Core Capabilities
Mastra bundles several distinct building blocks into one cohesive package:
- Model routing — connects to 40+ providers (OpenAI, Anthropic, Gemini, and more) through a single standard interface, with access to 3,000+ models via the Mastra model router.
- Agents — autonomous LLM-driven agents that reason about goals, select tools, and iterate until a stopping condition is met.
- Workflows — a graph-based workflow engine with an intuitive control-flow syntax (
.then(),.branch(),.parallel()) for deterministic multi-step processes. - Human-in-the-loop — suspend and resume agents or workflows awaiting user input, with execution state persisted in storage.
- Memory — conversation history, working memory, and semantic recall so agents behave coherently across sessions.
- MCP servers — author and expose Model Context Protocol servers, making agents and tools accessible to any MCP-compatible system.
- Evals and observability — model-graded, rule-based, and statistical evaluation methods, plus built-in tracing and logging integrated with external observability platforms.
Deployment Model
Mastra agents can be embedded inside existing React, Next.js, or Node.js applications, or deployed as standalone API endpoints via the Mastra Server. The platform layer (Mastra Studio, observability dashboard, and Memory Gateway) is available as a hosted cloud service or as a self-hosted option. The core framework is fully open source under Apache 2.0; enterprise features in ee/ directories are source-available under a separate Mastra Enterprise License and require a valid license for production use.
Who Builds With It
According to the Mastra website, the framework is used by teams at Replit, Sanity, SoftBank, WorkOS, Factorial, and Elastic, among others. Documented use cases span customer-facing assistants, internal copilots, data analysis agents, content automation, DevOps automation, and sales workflow tooling.
Update: @mastra/core v1.35.0 (May 2026)
The latest published release is @mastra/core@1.35.0, released on May 15, 2026. The GitHub repository shows active development with a last push on May 20, 2026, 389 open issues, and over 2,000 forks. The about page notes the team has grown to more than 35 people and has raised a $13M seed round from Gradient, Basecase, and Y Combinator. The project describes itself as getting millions of downloads per month, per vendor-published claims on the about page.
Setup Path
Getting started requires a single command — npm create mastra@latest — which scaffolds a new project and opens Mastra Studio, a local interactive UI for building, testing, and managing agents and workflows. The framework supports npm, pnpm, Yarn, and Bun. Integration guides exist for Next.js, React (Vite), Astro, Express, SvelteKit, and Hono.
Community Discussions
Be the first to start a conversation about Mastra
Share your experience with Mastra, ask questions, or help others learn from your insights.
Pricing
Free (Open Source)
Apache 2.0 licensed open-source framework. Build and host agents anywhere.
- Build and host agents anywhere
- Agents with models, tools, memory, and instructions
- Durable multi-step workflows with typed control flow
- Observational memory across sessions
Starter
Mastra Platform hosted tier at no cost.
- 100K observability events (then $10/100K)
- 24 CPU hours (then $0.35/hr)
- 15 days data retention
- Unlimited users, deployments, and projects
- 1GB data storage
Teams
Mastra Platform for teams with higher limits, SSO, and SOC 2 docs.
- 1M observability events (then $8/100K)
- 250 CPU hours (then $0.25/hr)
- 6 months data retention
- Multiple teams, SSO, and SOC 2 docs
- Unlimited users, deployments, and projects
- 100GB data storage
- 1M memory tokens (then $10/1M)
- 1GB retrieval storage (then $20/GB)
- 100GB data egress (then $0.10/GB)
Enterprise
Custom volume and retention with RBAC, audit logs, support and uptime SLAs, and a dedicated support engineer. Also available as self-hosted with enterprise controls.
- Custom observability events and retention
- RBAC, SSO, IAM, and network policy integration
- Data stays in your VPC
- Flat annual fee — no per-trace or per-seat metering
- Dedicated support engineer
- Architecture and design meetings
- Shared Slack support channel
- Separate service SLAs
- On-prem or cloud platform deployment option
- Audit logs
Capabilities
Key Features
- TypeScript-first agent framework
- Model routing across 40+ providers and 3000+ models
- Autonomous agents with LLM reasoning and tool use
- Graph-based workflow engine with branching and parallel execution
- Human-in-the-loop suspend and resume
- Conversation history, working memory, and semantic recall
- RAG pipeline support
- MCP server authoring and consumption
- Built-in evals (model-graded, rule-based, statistical)
- Observability with traces, logs, and metrics
- Mastra Studio local dev UI
- Cloud deployment via Mastra Server
- Memory Gateway (AI gateway with memory)
- Guardrails for prompt injection and response sanitization
- Integration with Next.js, Express, Hono, SvelteKit, React
- Apache 2.0 open-source core
Integrations
Demo Video

