What it does
Mastra is an open-source framework written for TypeScript. You choose a model, write instructions and connect tools so an agent can act on your systems, and you can start with a single agent before adding more structure. For steps that need a fixed order, workflows let you define typed steps, branches and retries, and pause for human input before resuming. A harness handles long-running work with persistent sessions, tool approvals and subagents, and memory keeps useful context across conversations. Observability is paired with evals, metrics, datasets and tracing, so you can see what happened in a run and check whether a change helped. Agents and workflows can be exposed through API endpoints and deployed on your own infrastructure or on Mastra Platform, and the framework connects to React, Next.js and Node apps. The core is open source under Apache 2.0, while enterprise features are source-available under a separate Mastra Enterprise License.
Capabilities
- Agents that combine a chosen model, instructions and tools
- Workflows with typed steps, branches, retries and human-approval pauses
- Memory with observational memory, semantic recall and thread storage
- Evals, datasets, metrics and tracing for debugging and measuring changes
- Model routing to 90+ providers through one interface
- Authoring of MCP servers that expose agents and tools
When to use it
- You build in TypeScript and want agents inside a React, Next.js or Node app
- You need multi-step processes that pause for a person's approval
- You want evals and tracing alongside the agent code
- You plan to deploy on your own infrastructure or through the built-in Vercel, Netlify or Cloudflare deployers