Mastra AI is a framework for building and operating AI agents in TypeScript. Its defining trait is that agent definitions, multi-step workflows, conversational memory, and production observability (tracing, metrics, evals) all come in one package instead of being assembled from separate libraries. The core is released as open source under Apache 2.0, and you can either embed it in a React / Next.js / Node.js application or deploy it as a standalone server. It also ships Agent Builder, which lets you assemble agents in the browser, and Studio, where developers and non-engineers can inspect agent behavior on the same screen — so the framework is usable from both code and GUI.
Key Features
- Typed agent definitions: Instructions, the model to use, the tools an agent can call, and its runtime behavior are all declared in one place. Because TypeScript types apply throughout, you can confirm tool inputs, outputs, and response shapes right in the editor
- Workflows for multi-step processing: Combine branches, retries, and sequential steps to define a multi-stage process such as “research → decide → act” as a single workflow, structured so you can trace what happened where after the fact
- Memory and semantic recall: In addition to per-thread conversational memory, Mastra provides semantic recall that searches past exchanges by meaning and brings them back. This makes it easier to keep context intact across long conversations
- Observability and evaluation built in: Traces, latency, token usage, cost, and tool calls are recorded, and combined with evals and scoring you can measure quality continuously. For agents in production, you can trace why a given answer was produced
- 90+ model providers through one interface: Switch between OpenAI, Anthropic, Gemini, and others via a shared model-routing layer. Authoring Model Context Protocol (MCP) servers is supported as well
- Agent Builder and Studio: Agent Builder is a browser-based way to create and manage agents without writing TypeScript. Studio is a visual IDE for testing agents and workflows during development, where non-engineers with domain knowledge can annotate traces and refine prompts
Pricing
Mastra comes in two lines: self-hosting on your own infrastructure, and the Mastra-provided cloud (Mastra Platform).
| Plan | Monthly price | What’s included |
|---|---|---|
| Self-hosted (Apache 2.0) | $0 | The full core — agents, workflows, memory, observability. Host it anywhere you like |
| Platform Starter | $0 | 100K observability events (then $10 per 100K), 24 hours of CPU time (then $0.35/hr), 15-day data retention, unlimited users, deployments, and projects |
| Platform Teams | $250 | 1M observability events (then $8 per 100K), 250 hours of CPU time (then $0.25/hr), 6-month retention, multi-team management, SSO, SOC 2 documentation |
| Platform Enterprise | Contact sales | Custom retention and volume, RBAC, audit logs, support SLAs, a dedicated engineer |
| Self-hosted Enterprise | Contact sales | RBAC, SSO, IAM integration, data kept inside your own VPC. Flat annual fee (no per-trace metering) |
Beyond this, a persistent always-on server is $100 per project, and model calls routed through Mastra’s gateway are billed at market rate plus 5.5%. Database and storage are priced in usage-based tiers.
Pricing is current as of August 2026. Check the official site for the latest figures.
Pros & Cons
✅ Pros
- Designed for TypeScript from the start, so it drops into web and Node.js applications directly — no separate Python runtime to set up
- Agents, workflows, memory, and observability live in the same framework, sparing you the work of stitching several libraries together
- The core is Apache 2.0 open source and free to start. If you want to avoid vendor lock-in, self-hosting is an option
- Over 90 model providers behind a common interface keeps the cost of switching models low
- Studio and Agent Builder let non-engineers take part in checking agent behavior and tuning prompts
⚠️ Cons
- It assumes background knowledge of agent development (LLM calls, tool definitions, prompt design), so it is a different kind of product from a no-code AI chat builder
- The cloud (Mastra Platform) free tier caps observability events, CPU time, and retention, so serious production use points toward Teams or self-hosting
- Some enterprise features fall under a separate license rather than Apache 2.0, which may require a commercial agreement depending on your requirements
- This is a fast-moving area, so APIs and documentation are updated frequently. Budget some effort for keeping up with versions
Comparison with Similar Services
| Criteria | Mastra AI | LangGraph | Vercel AI SDK | CrewAI |
|---|---|---|---|---|
| Primary language | TypeScript | Python / TypeScript | TypeScript | Python |
| Scope | Agents, workflows, memory, observability, server | Graph-based workflows | Model calls and UI integration | Multi-agent role division |
| GUI | Studio / Agent Builder | LangGraph Studio | None (UI components provided) | Management UI available |
| Observability & evals | Built in | LangSmith (separate service) | Assumes external integration | Separate integration |
| License | Apache 2.0 (core) | MIT | Apache 2.0 | MIT |
Who Is It For
- Developers building on Next.js or Node.js who want AI agent features inside the same TypeScript codebase
- Teams that want to go beyond prototypes and improve agent quality while watching traces and evals
- Anyone developing against several LLM providers and comparing or switching between them
- Organizations that want non-engineering domain owners involved in prompt tuning and testing
- Cases where agents must run on your own infrastructure and data cannot leave it
Summary
Mastra AI is a framework that handles everything from building an agent to running and fixing it, all in TypeScript. Because agent definitions, workflows, memory, and observability sit on the same foundation, development stays more legible than assembling individual libraries. The core is open source and free, so a practical path is to start small with self-hosting and consider Mastra Platform once team operations and accumulated observability data become necessary.