talira

The modern TypeScript framework for AI-powered applications and agents

open coreApache-2.0self-hostablefree

Mastra is an open source TypeScript framework for building AI agents and AI features, from prototype to production. It routes to models from 40+ providers through one interface, runs agents that use tools until they finish, orchestrates multi-step processes in a graph-based workflow engine with branches, parallel steps and human-in-the-loop suspend and resume, and manages context with conversation history, RAG and memory. It can author MCP servers, embeds in React, Next.js or Node.js apps or deploys as a standalone server, and ships with evals, observability and a local Studio for testing agents. Its makers also sell Mastra Platform, hosted deployment and observability with free and paid plans.

Problems it solves

  • build AI agents in TypeScript instead of Python
  • add an AI agent to my Next.js app with tools, memory and streaming
  • switch between OpenAI, Anthropic and Gemini models without rewriting my agent
  • orchestrate a multi-step AI workflow with branches and parallel steps
  • pause an AI workflow until a person approves, then resume where it left off
  • give my agent long-term memory and retrieval over my own documents
  • expose my agent's tools as an MCP server other agents can call
  • test and debug my agents locally in a visual studio before shipping
  • measure my agent's quality with evals and trace what it did in production
  • deploy TypeScript agents without setting up my own infrastructure

Features

  • model routing to 40+ providers through one interface
  • agents with tools and stopping conditions
  • graph-based workflows with .then(), .branch() and .parallel()
  • human-in-the-loop suspend and resume with stored state
  • conversation history, RAG and observational memory
  • author MCP servers
  • embed in React, Next.js or Node.js, or run as a standalone server
  • built-in evals and observability
  • Mastra Studio for building and testing agents locally
  • npm create mastra scaffolding

Ways to run it

Mastra Framework

You run it, Apache-2.0

free1

Not included

  • Enterprise features in ee/ directories (auth, agent builder, editor) need a commercial licence for production use2

You arrange

  • hosting for the Node.js server
  • a database for storage and memory
  • API keys for model providers

Self-hosting docs

Mastra Platform

Hosted by Mastra

Free; Starter $25/month; Team $250/month; Enterprise custom3

Only in this edition

  • zero-config deployments
  • hosted observability and trace retention
  • SOC 2 report on Team
  • RBAC, SSO and audit logs on Enterprise

Pricing

Capabilities

Has a command line toolplan not known
Has single sign-onEnterprise plan, priced by sales3

Alternatives

The same job

These do what Mastra does.

  1. VoltAgent Open source TypeScript AI agent framework, with the VoltOps console for observability, evals and deployment
  2. Agent Development Kit (ADK) Google's open source framework to build, debug and deploy AI agents
  3. AI SDK The AI Toolkit for TypeScript, from the creators of Next.js
  4. AgentScope Build and run agents you can see, understand and trust
  5. LangChain A framework for building agents and LLM-powered applications
  6. LangGraph Low-level orchestration framework for building stateful agents

Compare Mastra with the top 3