# Mastra — The TypeScript-native agent framework — agents, durable workflows, memory and observability in one Apache-2.0 package, with an optional managed cloud platform.

> Source: The Agents Index — https://theagentsindex.com/mastra (structured, researched, re-verified)
> Facts last verified: 2026-07-23

Mastra is an open-source, TypeScript-first framework for building AI agents — founded in San Francisco in 2024 by Sam Bhagwat (co-founder of Gatsby) as a Y Combinator company. Unlike the other frameworks in this category, which are Python-first with JavaScript bindings layered on, Mastra is written for the JS/TypeScript full-stack ecosystem from the ground up — designed to drop into a Next.js or Node app rather than a Python service. The core framework (agents, workflows, memory) is Apache 2.0-licensed and free to self-host; a separate, optional Mastra Cloud platform adds hosting, a visual Studio playground and observability on a metered/subscription basis. It raised a $22M Series A led by Spark Capital in mid-2026, bringing total funding to $35M (seed backers included Y Combinator and Gradient Ventures), and is used in production by named customers including Replit, Sanity, MongoDB, Brex and Marsh.

| Fact | Value |
| --- | --- |
| Website | https://mastra.ai |
| API | Yes |
| Best for | Full-stack JavaScript/TypeScript teams (especially Next.js/Node shops) who want agents, durable workflows and memory unified in one framework without adopting a Python-first stack. |
| Not for | Python-first teams and anyone needing a mature, multi-year-proven ecosystem with the largest tutorial/integration surface — LangChain remains the deeper-established choice there. |

## Verdict

Mastra is the one genuinely TypeScript-native entrant in a category otherwise built Python-first with JS bindings layered on — a real, defensible niche for full-stack JS and Next.js teams who don’t want to stand up a separate Python service just to add an agent. It unifies agents, durable typed workflows, memory and observability in one Apache-2.0 package that is free to self-host, backed by real commercial traction ($35M raised, a Spark Capital-led Series A, and named production customers including Replit, Sanity, MongoDB, Brex and Marsh). The tradeoffs are real too: it is TypeScript-only with no Python path at all, its ecosystem is a fraction of LangChain’s size and age, its deepest enterprise controls sit behind a separate source-available license rather than the open core, and its optional Mastra Cloud platform bills across several metered dimensions rather than one flat number. Pick it if you are building in the JS/TS stack and want an integrated framework designed for that world from day one; pick something with a longer track record if Python is your default or you need the widest possible integration ecosystem today.

## Strengths and weaknesses

- ✓ The only framework in this category built TypeScript-first rather than as a Python port with JS bindings — a genuine fit for teams already building in Next.js/Node who don’t want a separate Python service.
- ✓ Real commercial backing and production usage: a $22M Series A led by Spark Capital ($35M total raised) and named customers including Replit, Sanity, MongoDB, Brex and Marsh.
- ✓ Agents, durable typed workflows, memory, evals/observability and a server layer are unified in one framework rather than composed from several separate packages.
- ✗ TypeScript-only — teams standardized on Python get no first-party support at all, unlike LangChain, LlamaIndex or the OpenAI Agents SDK, which all ship a Python variant.
- ✗ Enterprise-grade controls (RBAC, SSO, IAM, audit logs) are gated behind a source-available Enterprise license, not the Apache-2.0 core — teams needing those controls are not fully open-source the way the rest of the framework is.
- ✗ Founded in 2024 — a much younger ecosystem and community than LangChain’s multi-year head start (26.5K GitHub stars vs. LangChain’s 142K+), so fewer tutorials, integrations and battle-tested production patterns exist today.
- ✗ Mastra Cloud pricing has several separately-metered dimensions (observability events, CPU-hours, egress, per-project persistent-server fees) rather than one flat number, making cost harder to predict up front than a simple per-seat SaaS price.
- ⚠ No Python variant — TypeScript/JavaScript only, unlike several rivals in this category that ship both languages.
- ⚠ Enterprise controls (RBAC/SSO/IAM) require the separately-licensed Enterprise tier, not the free Apache-2.0 core.

## Key features

- **TypeScript-native, not a Python port** — Built for the JS/TS full-stack ecosystem from the ground up — the one framework in this category with no Python variant at all, versus the Python-first-with-JS-bindings design of every other listed framework.
- **Unified agents + workflows + memory** — Agents, durable typed workflows (retries, branching) and long-term/semantic memory ship as one integrated framework rather than separate libraries you compose yourself.
- **Mastra Cloud (optional managed platform)** — A hosted Studio playground, observability (evals, metrics, traces) and deployment layer, priced separately from the free, self-hostable core framework.
- **90+ model providers, one interface** — Model routing abstracts OpenAI, Anthropic, Gemini and 90+ other providers behind one standard interface, so swapping models is a config change.

## Use cases

- **Full-stack JS/Next.js agent app** — A team already building in Next.js or Node adds an agent directly into the same codebase and deploys it with Mastra’s built-in Vercel/Netlify/Cloudflare deployers, instead of standing up a separate Python service.
- **Production workflow with durable state** — A team builds a multi-step agentic workflow (retries, branching, long-running steps) and uses Mastra’s typed workflow engine plus observational memory to keep it debuggable and resumable in production.
- **Self-hosted, no vendor metering** — A team runs the Apache-2.0 core entirely on its own infrastructure for free, opting into Mastra Cloud’s metered observability/hosting only once it needs a managed dashboard.

## Integrations

90+ LLM providers via one model-routing interface (OpenAI, Anthropic, Gemini and more) · Built-in deployers for Vercel, Netlify and Cloudflare, or any Node.js-compatible environment · Direct integration into existing Next.js apps · Mastra Cloud (optional hosted Studio, observability, deployment)

## Sources

- https://mastra.ai/
- https://mastra.ai/pricing
- https://mastra.ai/blog/series-a
- https://github.com/mastra-ai/mastra
- https://app.dealroom.co/news/feed/mastra-raises-22m-series-a-to-help-developers-build-ai-agents
