Mastra logo

Mastra

Rivendica

Mastra is an open-source TypeScript framework for AI agents and apps, with memory, workflows, model routing, MCP support, and observability.

Mastra preview

TypeScript framework for AI agents and apps

Mastra is an open-source TypeScript framework for building AI-powered applications and agents. It is designed for teams that want to prototype quickly in TypeScript and move toward production with the same framework, instead of stitching together separate tools for agents, workflows, memory, and observability.

The product combines agent definitions, workflow orchestration, memory, model routing, and observability in one stack. The site positions Mastra as usable with frameworks like React, Next.js, Node, Astro, Express, SvelteKit, and Hono, or as a standalone server that can be deployed anywhere.

Core capabilities

Typed agent definitions

Define typed agents with instructions, models, tools, and runtime behavior in one place, so the agent setup stays explicit and easier to maintain.

Workflow orchestration

Use a graph-based workflow engine to orchestrate multi-step processes with control flow like `.then()`, `.branch()`, and `.parallel()`, plus human-in-the-loop pauses.

Memory and retrieval

Store conversation history and external context from APIs, databases, and files so agents can respond with the right information at the right time.

Observability and evals

Track agent runs with traces, metrics, datasets, evals, and token usage to inspect behavior before and after changes.

MCP server support

Expose agents, tools, and structured resources through Model Context Protocol servers for systems that support MCP.

Model routing

Route requests through a single interface to 90+ model providers, including OpenAI, Anthropic, and Gemini.

Common use cases

  • Embed agents in a product

    Add AI features to an existing product so users can build or interact with agents inside your app.

  • Customer support and assistant flows

    Build customer-facing assistants that answer questions, schedule appointments, send reminders, or complete tasks through chat, WhatsApp, or voice.

  • Internal team copilots

    Create internal copilots for HR, sales, clinical documentation, or document generation where teams need domain-specific help.

  • DevOps and engineering automation

    Automate multi-step operational work such as deployment handling, incident debugging, or infrastructure tasks with explicit workflow control.

  • Data analysis and reporting

    Let users query databases or dashboards in natural language and return answers, charts, or reports.

Pros and Cons

Pros

  • Combines agents, workflows, memory, and observability in one TypeScript framework.
  • Supports a quick start path with a single command and immediate access to Studio.
  • Offers graph-based workflows with pause/resume and human-in-the-loop behavior.
  • Includes built-in observability and eval tooling for measuring agent behavior.
  • Provides hosted and self-hosted pricing paths, including an Apache 2.0 licensed self-hosted option.

Cons

  • The source does not provide detailed deployment guidance, team workflows, or hosting architecture beyond saying it can be deployed anywhere or used as a standalone server.
  • Some ecosystem details are broad rather than exhaustive, so readers may need the docs to confirm exact integrations and implementation constraints.

FAQ

What is Mastra?

Mastra is an open-source TypeScript framework for building AI-powered applications and agents. The docs describe it as a way to prototype quickly and ship with confidence.

How do you get started with Mastra?

Yes. The docs say you can create a new project with a single command such as `npm create mastra@latest`, `pnpm create mastra`, `yarn create mastra`, or `bunx create-mastra`. Studio can be opened immediately after setup.

What frameworks can Mastra integrate with?

Mastra is designed to work with frontend and backend frameworks such as React, Next.js, Node, Astro, Express, SvelteKit, and Hono. It can also be deployed anywhere as a standalone server.

Which AI model providers does Mastra support?

Mastra supports model routing through 90+ providers, including OpenAI, Anthropic, and Gemini.

Does Mastra offer both hosted and self-hosted options?

Mastra offers both a hosted platform and a self-hosted Apache 2.0 option. The pricing page also mentions enterprise self-hosted licensing for teams that need controls such as RBAC, SSO, IAM, and network policy integration.

Quick Facts

Category
Developer Tool
Primary language
TypeScript
Product type
Open-source framework for AI agents and apps
Pricing shape
Hosted platform plans plus self-hosted Apache 2.0 licensing
Source domain
mastra.ai
Setup path
Single-command project creation with Studio access