
Mastra
TypeScript framework for building, observing and improving AI agents
About Mastra
Mastra is a TypeScript framework for building AI agents, and it exists because most of the serious agent tooling was written for Python first. If your product is a Next.js app, a Node service or anything else in the TypeScript world, using LangGraph or CrewAI means running a second runtime alongside the one you already ship. Mastra puts agents, workflows, memory, an agent harness, a server and observability into one typed package that runs inside the stack you already have, or as a standalone server you deploy anywhere.
The core framework is Apache 2.0 licensed, with one carve-out worth knowing about before you commit: anything under a directory named ee/ in the repository is covered by a separate Mastra Enterprise License instead, and that includes the auth and agent-builder pieces. The copyright holder is Kepler Software, Inc. On top of the open framework there is a hosted platform, Mastra Cloud, whose pricing is genuinely metered rather than flat. The Starter tier is free with 100K observability events, 24 CPU hours and 15 days of retention, and unlimited users, deployments and projects. The Teams tier is $250 a month, but the published table adds more than twenty separate meters beneath it, including data egress, gateway tokens billed at market rate plus 5.5%, memory token usage, retrieval storage, LibSQL rows and Postgres compute hours. Budget for usage, not for the headline number.
You define an agent in a TypeScript file as a typed object with an id, instructions, a model and a set of tools, and you register it on a Mastra instance alongside any workflows. Workflows are composed from typed steps with retries and branches, so a multi-step process is something your team can read and review rather than a prompt chain. Memory is configured separately, with options for recent message windows, semantic recall and observational memory, so agents keep durable context across threads. The harness coordinates multi-mode agents that share state, threads and storage. You run the whole thing on one Mastra server locally on a port you choose, and deploy the same application to Mastra Cloud or to your own infrastructure without rewriting it. Every run produces traces, metrics and eval scores you can inspect afterwards.
- •Typed Agents - Define instructions, model, tools and runtime behaviour in one place, with TypeScript types across the whole definition rather than dictionaries checked at runtime
- •Workflows - Compose typed steps, retries and branches into production workflows your team can inspect and ship, instead of an opaque sequence of model calls
- •Agent Harness - Coordinate multi-mode agents with shared state, threads and storage, using the same harness that runs Mastra Code
- •Memory - Durable context through observational memory, semantic recall and thread-aware storage, configured declaratively rather than assembled by hand
- •Built-in Observability - Traces, metrics, logs, datasets and evals in the framework itself, so you can inspect every model call, tool call and handoff from one searchable timeline and score runs against repeatable checks before changes reach production
- •One Server, Any Deployment - Register agents and workflows on a single Mastra server, run it locally, and deploy the same app to Mastra Cloud or self-host it
TypeScript and JavaScript teams who want to build agents without adding a Python service to their stack, and who would rather have types and a compiler than discover a malformed tool call in production. It suits people building agents into an existing React, Next.js or Node application, and teams who want evals and tracing from day one rather than bolted on later. It is a reasonable choice if you want the framework to stay open source and self-hosted, and to treat the paid platform as optional. It is a poor fit if your team is Python-first, since LangGraph and CrewAI are more mature there and Mastra gains you nothing. It is also a poor fit if you need predictable flat billing, because the hosted platform meters more than twenty dimensions and the $250 tier is a floor rather than a price.
Pricing
$0 - $250/mo
- Starter$0/mo
- Teams$250/mo
- EnterpriseContact sales
From the vendor pricing page, 2026-10-12

















