Updated

Mastra

TypeScript framework for building AI agents, workflows, and RAG applications with memory and observability built in.

24 makers' products we track use Mastra. For AI SDK & agent framework it's 2nd most chosen of 7 options: 24 of the 115 makers' products we know the AI SDK & agent framework of (21%). 19 open-source projects also declare it in their code. What makers like most: TypeScript-first with type safety, so it fits teams whose product stack is already TypeScript. Their most common complaint: Workflows with rule-based, non-LLM branching feel clunky, pushing some to write their own. On GitHub, 5 public pull requests moved projects to Mastra from tools we list, and 0 moved them away.

Open sourceSelf-hostableFree tierPaid from $250/mo

Profile checked

Works with AI agents:llms.txtCLI
Ask your AI about this, with this page as the source:ChatGPT ↗Claude ↗Perplexity ↗

How makers use Mastra

Makers' products we track use Mastra for AI SDK & agent framework (24), most often alongside Vercel (46%), Next.js (46%), Resend (42%).

What Mastra is used for

AI SDK & Agent Framework · TypeScript framework →TypeScript and Next.js apps that want agents, workflows, memory and RAG without a Python service.Trade-off: Younger ecosystem, and some enterprise features sit under a separate source-available license.
LangChain66Mastra24LlamaIndex16AI SDK5CrewAI3Makers' products on each, for AI SDK & agent framework

Mastra vs the alternatives makers chose

For AI SDK & agent framework, 24 of the 115 makers' products we know the choice of picked Mastra (21%), behind LangChain (57%).

OptionMakers' productsOpen source
LangChain66 57%YesCompare →
Mastra24 21%Yes
LlamaIndex16 14%Yes
AI SDK5 4%YesCompare →
CrewAI3 3%Yes
LangGraph1 1%Yes

For AI SDK & agent framework: how many of the 115 makers' products we know the AI SDK & agent framework of chose each option.

Often paired with

Share of the 24 makers' products on Mastra that show this choice.

When to use Mastra, and when not

Pick Mastra if

Something else fits better if

  • You want a small typed agent loop in Python, close to the raw API: Pydantic AI or OpenAI Agents SDK.
  • Your agent works on files and runs commands, like a coding or research agent: Claude Agent SDK.
  • You need many prebuilt connectors for models, tools and data sources: LangChain.
  • Your agent is a long-running workflow with branches, saved state and human approval steps: LangGraph.
  • The agent mostly retrieves and reasons over your own documents: LlamaIndex.
From each decision's guide, written from what makers' products chose and why.

Mastra is an open-source TypeScript framework for building AI agents and multi-step workflows inside a JavaScript or TypeScript codebase. It covers what an agent feature needs beyond a model call: tools, memory, workflows, evals and tracing.

More about Mastra

You register agents, tools and workflows on one Mastra instance. An agent is instructions plus a model, given as a provider/model string that Mastra's model router resolves using the matching API key from the environment, plus tools and optional memory. Workflows are typed steps with branching, parallel runs, loops, and suspend and resume backed by saved snapshots. State lives in pluggable storage adapters. Mastra runs on Node.js 22.13 or later, Bun, Deno and Cloudflare, either inside Next.js or Astro or as its own Hono-based server.

Running mastra dev opens Studio, a local UI for chatting with agents, running workflows and reading traces. Memory covers message history, semantic recall and working memory; agents can call MCP servers or expose tools to MCP clients; and @mastra/ai-sdk streams agents into AI SDK UI hooks such as useChat. You deploy with mastra build to any VM, container or PaaS, through built-in deployers for Vercel, Netlify and Cloudflare, or on the hosted Mastra platform.

It is TypeScript only. Persistent memory and resumable workflows need a database you choose and run, the default in-memory store loses data on exit, and the file-based libSQL store does not work on serverless hosts. Code under the repository's ee/ directories (auth, agent builder, editor) is under a separate license, not Apache 2.0.

How Mastra itself is built

74 tools, from its own code, website and Product Hunt page.

Mastra pros and cons

What makers like most: TypeScript-first with type safety, so it fits teams whose product stack is already TypeScript. Their most common complaint: Workflows with rule-based, non-LLM branching feel clunky, pushing some to write their own.

Pros

Cons and watch-outs

  • Workflows with rule-based, non-LLM branching feel clunky, pushing some to write their own. HN
  • The Elastic v2 license bars offering it as a hosted service, so it is not open source in the usual sense. HN
  • Several Mastra npm packages were compromised in a supply-chain attack. HN

Themes that recur in makers' words and Hacker News comments, each linked to what it summarises, with how Product Hunt tags its reviews.

4.9★ from 10 reviews on Product Hunt ↗

Who switches

More projects move to Mastra: 5 pull requests in, 0 out; the most come from LangGraph.

Moving to Mastra
Mastra
LangGraph → Mastra5 PRs

Public pull requests on GitHub since Oct 2024 whose title says "X to Y" — real code changes moving a project from one tool to another, by developers in general.

Who uses it

24 makers' products, each linked to the source that shows it, and 19 open-source projects that declare it in their code. The best known on Product Hunt: Revolte (1,330 followers), Medusa (1,231 followers), @O (1,091 followers), onlook (1,089 followers), Upsolve AI (799 followers).

The maker says so 7Customer story 17Declared in code 19How evidence is collected →
Superset
SupersetA desktop workspace for running many coding agents (Claude Code, Codex, OpenCode and oth…

“Mastra powers our chat infrastructure and makes developing a coding agent seamless”

AI SDK & Agent FrameworkMaker says so · source ↗
@O
@OYour AI coworker, in Slack. Just tag @O.

“Mastra, the agent framework that let us go from idea to shipping agents fast.”

AI SDK & Agent FrameworkMaker says so · source ↗
Upsolve AI
Upsolve AIAnalytics platform for deploying AI data agents that query, chart and explain a company'…

“We use Mastra as our foundational agent framework.”

AI SDK & Agent FrameworkMaker says so · source ↗
Imagine
ImagineBuild something real with the most complete AI builder

“Shoutout to the team at Mastra for building an excellent agent orchestration layer. Mastra is a key part of Imagine.dev’s agentic architecture, helping us coordinate specialized agents and reliably turn high-level intent into structured execution. Their focus on developer experience and composability made it possible for us to move fast without sacrificing correctness.”

AI SDK & Agent FrameworkMaker says so · source ↗
siift
siiftTurn AI noise into better business decisions

“Really like the depth of product here, very hard to make a product of this scale high quality, impressed!”

AI SDK & Agent FrameworkMaker says so · source ↗
Revolte
RevolteAI for Software Engineering

“Revolte runs a harness of specialized agents across the full dev lifecycle, so the framework underneath had to be production-grade, not a prototyping toy. Mastra's modern TypeScript stack gave us type safety, real workflow control, and structure we could actually build a platform on, without the sprawl and glue code that slows other frameworks down. A serious TypeScript foundation with clean agent orchestration is what set it apart.”

AI SDK & Agent FrameworkMaker says so · source ↗
moss
mossThe retrieval layer for production AI systems. Lightning-fast (<10ms) search without vec…AI SDK & Agent FrameworkIn its code · source ↗
Zep
ZepHosted context layer for agents that turns business data, documents and conversations in…AI SDK & Agent FrameworkIn its code · source ↗

Open source: a project that declares Mastra as a dependency in its public code — verifiable, but not necessarily a live product.

Alternatives to Mastra

All alternatives by situation →

Further reading

Questions makers ask about Mastra

Is Mastra good for production?

24 makers' products we track run on it. On GitHub, 5 public pull requests moved projects to Mastra from tools we list, and 0 moved them away. The watch-out makers raise most: Workflows with rule-based, non-LLM branching feel clunky, pushing some to write their own.

What is Mastra used for?

TypeScript framework for building AI agents, workflows, and RAG applications with memory and observability built in. Makers' products we track use it for AI SDK & agent framework (24).

What are the pros and cons of Mastra?

Pros makers name: TypeScript-first with type safety, so it fits teams whose product stack is already TypeScript. Workflows, agents, memory, RAG and evals come in one package, replacing half-built in-house frameworks. Multi-agent setups such as supervisor agents and runtime routing networks are supported out of the box. Cons: Workflows with rule-based, non-LLM branching feel clunky, pushing some to write their own. The Elastic v2 license bars offering it as a hosted service, so it is not open source in the usual sense. Several Mastra npm packages were compromised in a supply-chain attack.

What are the alternatives to Mastra?

For AI SDK & agent framework, the other options makers' products we track chose most are LangChain (66), LlamaIndex (16), AI SDK (5), CrewAI (3), LangGraph (1). Open source or self-hostable among them: LangChain, LlamaIndex, AI SDK, CrewAI, LangGraph. Each alternative, with the situation it fits, is on the Mastra alternatives page.

Do developers switch to or away from Mastra?

On GitHub, 5 public pull requests moved projects to Mastra from tools we list, most from LangGraph (5); 0 moved them away.

When should you use Mastra?

Your app is TypeScript and you want agents without adding a Python service (AI SDK & agent framework). Something else fits better if: you want a small typed agent loop in Python, close to the raw API, pick Pydantic AI or OpenAI Agents SDK; your agent works on files and runs commands, like a coding or research agent, pick Claude Agent SDK.

Does it work inside a Next.js app?

Yes. Mastra can live in a Next.js or Astro project and deploy with it; on Vercel you add @mastra/* to serverExternalPackages and drop the file-based LibSQLStore, which needs a filesystem. source ↗

Where can I deploy it?

Anywhere that runs Node.js 22.13 or later, Bun, Deno or Cloudflare. mastra build produces a standalone server for a VM, container or PaaS, and optional deployers handle Vercel, Netlify and Cloudflare. source ↗

What database does agent memory need?

A persistent storage adapter whenever state must survive restarts, such as libSQL, PostgreSQL or MongoDB for memory. The default in-memory store is for tests; a file-backed libSQL database works for local development. source ↗

Which model providers can I use?

Any provider in its model router, addressed as a provider/model string with the API key read from the environment. You can mix models across agents and configure fallbacks if a provider goes down. source ↗

Can I use it with AI SDK UI hooks like useChat?

Yes. The @mastra/ai-sdk package provides route handlers that stream Mastra agents and workflows in the format useChat, useCompletion and useObject expect. source ↗

Do I need the hosted platform to test agents and see traces?

No. Studio runs locally at localhost:4111 when you start mastra dev, and you can also deploy it yourself behind your own authentication. source ↗

Is Mastra free?

Yes — there is a free tier a small product can run on; paid use starts at $250/mo. source ↗

Is Mastra open source or self-hostable?

Open source, and you can self-host it. source ↗

Can AI coding agents work with Mastra?

It serves an llms.txt docs index; it has an official CLI (mastra).

Who uses Mastra?

24 makers' products we track, each with a source, and 19 open-source projects declare it in their code. The best known of them on Product Hunt: Revolte (1,330 followers), Medusa (1,231 followers), @O (1,091 followers), onlook (1,089 followers), Upsolve AI (799 followers). source ↗