
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.
Profile checked
Works with AI agents:llms.txtCLIHow 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
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%).
| Option | Makers' products | Open source | |
|---|---|---|---|
| 66 57% | Yes | Compare → | |
| 24 21% | Yes | ||
| 16 14% | Yes | ||
| 5 4% | Yes | Compare → | |
| 3 3% | Yes | ||
| 1 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
- 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: 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.
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
- TypeScript-first with type safety, so it fits teams whose product stack is already TypeScript. mastra.aiPHmastra.ai 2HN
- Workflows, agents, memory, RAG and evals come in one package, replacing half-built in-house frameworks. mastra.aimastra.ai 2mastra.ai 3HN
- Multi-agent setups such as supervisor agents and runtime routing networks are supported out of the box. mastra.aimastra.ai 2mastra.ai 3HN
- Good docs and developer experience make it a practical way to learn how agents work. HNHN 2HN 3
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.
LangGraph → Mastra5 PRs
- feat(mastra): migrate v2 LangGraph chat extension to Mastra v3sourcefuse/loopback4-llm-chat-extension · 2026-05-22
- feat(migration): migrate lb4-llm-chat-extension from LangGraph to Mastra sourcefuse/loopback4-llm-chat-extension · 2026-05-13
- Migrate agent from LangGraph to MastraQuenumGerald/NudgeBot · 2026-05-07
- feat(migration): migrate lb4-llm-chat-extension from LangGraph to Mastra [WIP]sourcefuse/loopback4-llm-chat-extension · 2026-05-04
- Plan langgraph to mastra migrationConnorbelez/open-canvas · 2025-09-01
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).
“Mastra powers our chat infrastructure and makes developing a coding agent seamless”
AI SDK & Agent FrameworkMaker says so · source ↗“Mastra, the agent framework that let us go from idea to shipping agents fast.”
AI SDK & Agent FrameworkMaker says so · source ↗“We use Mastra as our foundational agent framework.”
AI SDK & Agent FrameworkMaker says so · source ↗“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 ↗“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 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 ↗None of these in makers' own words.
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 ↗