One of Japan's largest directories x find the right AI in as little as a minute

▶︎ For those who want to list their service

  1. AI BEST SEARCH
  2. Mastra
Mastra

Mastra
: How to use it, features, and the business problems it solves

Add bookmark

What is Mastra?

An open-source AI agent development framework written in TypeScript. It integrates Agents/Tools/Workflows/RAG/Memory/Evals/Observability and lets you switch among LLMs like OpenAI, Anthropic, and Google Gemini. Under "build, observe, and improve," it suits building and running agents that run for days. The framework is free (OSS), with a hosted Mastra Platform available.

Business problems it solves

About "Mastra"

What is Mastra

Mastra is an open-source AI agent development framework you write in TypeScript. It bundles everything you need for agent development — Agents, Tools, Workflows (for complex logic), RAG (retrieval-augmented generation), Memory, Evals, and Observability. Under the banner "Build, observe, and improve agents," it has become a widely supported "leading TypeScript agent framework" suited to building and running agents that run for days (27k+ GitHub stars; used by Replit, SoftBank, Sanity, WorkOS, and Brex).

The Mastra top screen. The heading "Build AI agents," the line "Build, observe, and improve agents that run for days with Mastra, the leading TypeScript agent framework," the npm create mastra command, and on the right an Evals results table (Experiments / Scorers / Datasets) showing scores like correct tool selected 100% and incorrect tool used 62%

Source: Mastra official site

Type
Open-source AI agent development framework
Language
TypeScript / JavaScript
LLMs
OpenAI, Anthropic, Google Gemini, and more (switchable)
Key features
Agents / Tools / Workflows / RAG / Memory / Evals / Observability / Voice
Pricing
Framework free (OSS) + hosted Mastra Platform
Get started
npm create mastra

A complete set of agent-building blocks

Mastra's trait is that the pieces needed for agent development are integrated as a framework from the start, rather than cobbled together from separate libraries. You get TypeScript's type safety while covering everything from development through evaluation and operations.

01Build

  • Agents — Define agents combining LLMs, tools, and memory
  • Tools — Call external APIs and functions safely as tools
  • Workflows — Control complex logic with branching, loops, retries, and human-in-the-loop (HITL)

02Make it smarter

  • RAG — Add document retrieval to ground answers
  • Memory — Remember conversations and state to keep context
  • Voice — Add voice I/O for voice interfaces

03Observe and improve

  • Evals — Assess agent quality with Experiments, Scorers, and Datasets
  • Observability — Trace behaviour with Traces / Metrics / Logs
  • Multi-LLM — Switch the backend model with a config change

How to use

  1. Create a project

    Run the following in your terminal.

    npm create mastra
    
  2. Choose initial settings

    Interactively select the project name, components to use (Agents / Tools / Workflows, etc.), and default LLM provider (OpenAI / Anthropic / Google Gemini, etc.).

  3. Build an agent

    Define an agent in TypeScript and wire in the tools and workflows you need.

  4. Design workflows

    Build workflows with branching, loops, retries, and human-in-the-loop, and control the agent's behaviour.

  5. Deploy and operate

    Deploy locally or to the cloud. With Mastra Platform (hosting), you can offload observability and scaling too.

Features

01Development

  • TypeScript-based all-in-one — Agents, Tools, RAG, and Workflows in one framework
  • Multiple LLM providers — Switch OpenAI / Anthropic / Google Gemini via config
  • Voice integration — Build agents with voice I/O

02Control

  • Flexible workflow control — Branching, loops, retries, human-in-the-loop (HITL)
  • Storage — Manage run history and data

03Operations

  • Evals & Observability — Quality evaluation and monitoring via Traces / Metrics / Logs
  • Mastra Platform — Cloud for deployment, hosting, and observability

Pricing

The Mastra framework itself is open source and free (self-hostable). On top of that, "Mastra Platform" provides cloud deployment and observability.

PlanMonthlyHighlights
OSS frameworkFreeFull features, self-hosted
Starter$0100K events (+$10/100K), 24 CPU hours, 15-day retention, unlimited users/deploys
Teams$2501M events (+$8/100K), 250 CPU hours, 6-month retention, multiple teams, SSO, SOC 2
EnterpriseCustomFor scale. RBAC, audit logs, SLAs, dedicated support

Used purely as a framework, it's free (OSS) — you can try every feature at no extra cost. Mastra Platform is the option when you want to deploy your agents to the cloud and run them with full observability (Traces/Metrics/Logs). Pricing may change, so confirm the latest on the official site.

Pricing is based on the official pricing page (USD) as of August 2026.

How it differs from other agent frameworks

In a space long dominated by Python frameworks (LangChain, LlamaIndex), Mastra stands out by centring on TypeScript/JavaScript and integrating evaluation and observability from the start. It suits teams building agents in the web/Node.js ecosystem.

AspectMastraOther agent-dev options
LanguageTypeScript / JavaScriptOften Python
ScopeIntegrates Agents–RAG–Evals–ObservabilityOften assembled from parts
DeliveryOSS + Mastra Platform (cloud)Mainly libraries
Best forDevelopers building with types in web/Node.jsTeams on an existing Python stack

To build AI apps/agents no-code, Dify; for business workflow automation, n8n is nearby (LangChain and LlamaIndex are Python-centric). If you want to build agents in code with TypeScript and keep evaluation and operations consistent, Mastra is a strong choice.

FAQ

Q. Is Mastra free to use?

Yes. The framework itself is open source and free (self-hostable). The cloud Mastra Platform has a free Starter plan; for heavier use, Teams ($250/mo) or Enterprise.

Q. What language do I use?

TypeScript / JavaScript. It plugs straight into the web/Node.js ecosystem.

Q. Which LLMs are supported?

Multiple providers including OpenAI, Anthropic, and Google Gemini, switchable with a config change.

Q. What can it do?

It covers what you need for agent development — Agents, tools, workflows, RAG, Memory, Evals, Observability, and voice.

Q. How is it different from LangChain?

LangChain is a Python-centric framework. Mastra centres on TypeScript/JavaScript and integrates evaluation and observability, making it suited to development in web/Node.js environments.


Information on this page is based on what was published on the official site as of August 2026. Features and pricing may change, so check the official site for the latest.

Try Mastra

Frequently compared services

Articles featuring Mastra