Favicon of Mastra

Mastra

TypeScript AI agent framework that runs locally or on your server, with memory, MCP, evaluations, and models from OpenAI, Anthropic, and Gemini.

Screenshot of Mastra website

Mastra is a TypeScript framework for developers building AI agents and applications on their own servers or inside existing web apps. Its server runs locally or as a standalone deployment; Mastra Cloud provides a hosted alternative. Model routing connects to providers such as OpenAI, Anthropic, and Gemini, so running the framework locally doesn't keep those model requests on your machine.

Agents can choose tools and work through open-ended tasks, while graph-based workflows give developers explicit control over execution. The framework brings both approaches together with persistent memory and ways to inspect agent behavior.

  • Workflows support branching, parallel steps, and retries. Agents and workflows can pause for human input or approval, retain their execution state, and resume later.
  • Memory combines conversation history, semantic recall, and observational memory. Agents can also retrieve context from APIs, databases, and files.
  • MCP support lets developers expose agents, tools, and structured resources to other compatible systems.
  • Built-in evaluations, traces, metrics, and logs help teams assess results and investigate failures. Mastra Studio provides a local interface for testing and managing agents, workflows, and tools.

Mastra integrates with React, Next.js, and Node.js, with Vercel's AI SDK UI and CopilotKit available for assistant interfaces. Its core framework is open source under Apache 2.0; enterprise code is source-available under the Mastra Enterprise License.

Similar to Mastra