GILD verdict
Choose Mastra when a TypeScript team wants durable workflows, memory and evals built in, and the AI SDK for one model loop.
- The workflow
- A TypeScript team adding its first agent with tools and multi-step work to a web product, choosing between a framework and a toolkit.926
- The decisive evidence
- Reported2 of 5 named teams adopted one; What teams report below sets out each account.
- ReportedMaintainers who moved agents from Mastra to plain AI SDK calls in October 2026 cite dependency weight, one removing 69 of 72 open advisories, and a builder found a Mastra agent ending at its fifth step with empty text and no error.567
- DocumentedMastra names no default model and reads each provider's key from the environment, while the AI SDK routes plain model strings through AI Gateway by default. Mastra's agents stop at 5 steps by default and the ToolLoopAgent at 20.10152831
- DocumentedMastra bundles memory with storage adapters and workflows that suspend and resume. The AI SDK leaves memory storage to the app and offers durability through WorkflowAgent, and Mastra agents can drive AI SDK UI hooks through @mastra/ai-sdk.1113192930
- GILD analysisAt 10,000 runs a month with US$1,000 of tokens, Mastra Platform adds about US$61 on Starter or US$250 on Teams, and its gateway adds 5.5% to tokens. The AI SDK side adds no token markup, and its hosting cost depends on your own infrastructure, which the sources leave unpriced.
Named teams split by how much framework they want around the model. Mastra's customer story says durable execution on Inngest raised the workflow success rate of the agents Replit's Agent 3 builds from 80% to 96%, while openstatus runs its production Slack agent on the AI SDK with six tools. Mastra supplies workflows that suspend and resume, memory, scorers, a local Studio and an optional hosted platform; the AI SDK supplies model calls, tool loops, durable WorkflowAgent and chat UI hooks inside your own app, with AI Gateway at provider list prices.
What teams report
5 named accounts
Failures and incidents 1
Alipay, per the author's GitHub profile
With AI SDK v5's useChat calling Mastra's API, assistant messages came back with duplicated parts, reproducible in the official example when messages were sent quickly (GitHub issue, Oct 28, 2025).
“When using
useChatfrom@ai-sdk/reactto call Mastra's API, assistant messages may have duplicate parts.”Bo Kou (MrKou47), Developer filing a GitHub issue, Alipay, per the author's GitHub profileGitHub, mastra-ai/mastra, , post
Switched 1
BrainGridOn AI SDK
BrainGrid migrated its core AI infrastructure from AI SDK v4 to v5 in July 2025 and reports support tickets about a frozen UI falling to zero and tool execution 17% faster.
“We migrated BrainGrid's core AI infrastructure from AI SDK v4 to v5. Here's how it went.”
Felipe Cadavid, BrainGrid engineering, BrainGridBrainGrid, , write-up
Evaluated 1
APIClawOn Mastra
Testing @mastra/core 1.78.0 against a local OpenAI-compatible server, Aman Kumar found an agent stuck in tool calls ending at the default fifth step with empty text and no error, and two retry layers turning one failing upstream into 18 requests (Oct 18, 2026).
“The agent made five requests, ran the tool five times, and then returned normally. text was an empty string and finishReason was "tool-calls". It didn't throw an error or log a warning.”
Aman Kumar, Developer building the APIClaw gateway, APIClawDEV Community, , write-up
Adopted 2
ReplitOn Mastra
Mastra's customer story says the agents Replit Agent 3 generates are Mastra agents, and that durable execution on Inngest raised their workflow success rate from 80% to 96%.
“Using Mastra's durable execution with Inngest, Replit boosted success rates from 80% to 96%, ensuring workflows complete even if a servers fails mid-execution.”
Mastra customer story, citing Replit's CTO, Agent 3 team, ReplitMastra, , write-upVendor customer story openstatusOn AI SDK
openstatus built its production Slack agent, which reads status pages and drafts status reports a person confirms, on the AI SDK with Claude Sonnet and six tools (Feb 27, 2026).
“We use the Vercel AI SDK with Claude Sonnet. The agent has 6 tools:…”
Thibault Le Ouay Ducasse, openstatus engineering, openstatusopenstatus, , write-up
Choosing between Mastra and AI SDK
Choose Mastra if
- Unattended runs must finish when a server fails mid-run: Mastra workflows on Inngest retry and resume, which Mastra's customer story credits with raising Replit Agent 3's success rate from 80% to 96%.
- You want workflows, memory, and evals from one framework so you don't have to assemble them, with a local Studio to inspect agents.
- You want an optional hosted platform with us or eu residency and trace storage.
Choose AI SDK if
- One model loop with tools inside your own app covers the work, as openstatus's production Slack agent runs on the AI SDK with six tools (Feb 27, 2026).
- You want fewer packages to pin: one maintainer removed @mastra/core and 69 of its 72 open dependency advisories by moving three research agents to the AI SDK (Oct 16, 2026).
- Your product is a chat or streaming UI on useChat, with one gateway at provider list prices and no markup on tokens.
Side by side
| Dimension | Mastra | AI SDK |
|---|---|---|
| What teams reportNamed accounts GILD found. Each team describes its own side, and Kristian, who shipped apps on both, calls the AI SDK the model layer and Mastra the infrastructure layer above it (YouTube, Jun 17, 2026). | Mastra's customer story says Replit's Agent 3 generates Mastra agents and durable execution on Inngest lifted their workflow success rate from 80% to 96%. Aman Kumar found an agent ending silently at the fifth step with empty text (Oct 18, 2026), and Bo Kou saw duplicate message parts when useChat called Mastra's API (Oct 28, 2025).1468 | openstatus runs its production Slack agent on the AI SDK with Claude Sonnet and six tools (Feb 27, 2026), and BrainGrid moved its core AI infrastructure from v4 to v5 in July 2025. Two maintainers moved agents from Mastra to plain AI SDK calls in October 2026, one shedding 69 of 72 open dependency advisories.2357 |
| Design | A framework: agents with tools and memory, typed workflows built with createWorkflow that suspend and resume, subagents, scorers, and a Hono-based server91120 | A toolkit for AI-powered applications and agents: model calls, tools, and the ToolLoopAgent class, with UI hooks for React, Next.js, Vue, and Svelte2627 |
| License and releasesLatest releases on npm, checked Oct 28, 2026. | Apache 2.0 outside ee/ directories; ee/ features are source-available under the Mastra Enterprise Edition License 2.0 (effective Sep 22, 2026) and need a license key in production; @mastra/core 1.80.0, Oct 28, 2026; Node.js 22.13 or later20232425 | Apache 2.0; ai 7.0.156, Oct 28, 2026; Node.js 22 or later3435 |
| Models | No default model: each agent names a provider/model string from 8,187 models and 221 providers, Mastra reads each provider's API key from the environment, and fallbacks switch models on a 500 error, rate limit, or timeout1516 | AI Gateway is the default global provider, so a plain model string routes through it with an AI Gateway API key or OIDC31 |
| Agent loop limit | maxSteps defaults to 5 sequential LLM calls per agent run; a capped run returns empty text with finishReason tool-calls and no error, as Aman Kumar found on Oct 18, 2026610 | ToolLoopAgent stops after 20 steps by default; WorkflowAgent applies no default step limit28 |
| Durability | Workflows run on the built-in execution engine and suspend and resume; Inngest adds step memoization and retries, and the Temporal runner is labelled experimental1112 | ToolLoopAgent runs in memory and loses progress on a crash; WorkflowAgent from @ai-sdk/workflow runs durable, resumable agents that survive restarts29 |
| Memory | Observational Memory, working memory, and semantic recall, backed by a storage provider the app must configure13 | Memory through provider-defined tools, memory providers, or a custom tool, with the storage backend left to the app30 |
| Telemetry and tracing | Usage telemetry on by default, off with MASTRA_TELEMETRY_DISABLED=1; traces export to Langfuse, Datadog, Arize, or any OpenTelemetry platform1718 | OpenTelemetry spans through the @ai-sdk/otel package; once registered, supported calls emit telemetry by default32 |
| Chat UI | @mastra/ai-sdk connects Mastra agents to AI SDK UI's useChat(), useCompletion(), and useObject() hooks19 | AI SDK UI is a framework-agnostic toolkit with useChat, useCompletion, and useObject33 |
| Hosting and gateway priceList prices in US dollars, checked Oct 28, 2026. | Your own Node.js host, or Mastra Platform: Starter US$0 a month with 100K events and 24 CPU hours, Teams US$250 a month with 1M events and 250 CPU hours; tokens through Mastra's gateway bill at market rate plus 5.5%2021 | A free library you host yourself; AI Gateway charges no markup and no platform fee on tokens, at the provider's list price, with US$5 a month included on the free tier3436 |
| Cost at a stated workloadGILD's calculation from published rates, Oct 28, 2026. Inputs are stated, not measured; Mastra does not say how many events one run emits, and egress, memory tokens, and storage are left out. | GILD's calculation for 10,000 agent runs a month, each emitting 50 observability events and using 30 CPU-seconds, so 500,000 events and about 83.3 CPU hours, plus US$1,000 of model tokens at list price: Mastra Platform Starter adds about US$61 a month, US$40 for 400K events past the 100K included and US$20.77 for 59.3 CPU hours past the 24 included, or Teams covers it within US$250. Tokens through Mastra's gateway come to US$1,055; on your own provider keys they stay US$1,0002122 | GILD's calculation for the same 10,000 runs and US$1,000 of model tokens: the library is free and AI Gateway adds no markup, so tokens stay US$1,000; hosting and tracing run on your own infrastructure, which this calculation leaves out3436 |
| When to choose | Choose Mastra if you want workflows, memory, evals, and an optional hosted platform from one TypeScript framework921 | Choose the AI SDK if you want model calls, tool loops, and chat UI hooks inside your own app, with a gateway at provider list prices2636 |
What practitioners report, side by side
Each product's figures come from its own practitioners, for the group you pick.
Overall signal
All practitioners rate AI SDK +36, 50 points above Mastra at −14. Most of the gap is in complaints, with 27 of Mastra's 66 sources negative against 5 of AI SDK's 85.
The score counts the authors from all practitioners that take a side, one vote each with their latest view, and is how far positive votes lead negative ones, per 100 votes, so Mastra's −14 rests on votes split 18 positive, 20 mixed and 27 negative and AI SDK's +36 on 35, 43 and 5.
A lead of a fifth of the votes reads positive and a lead of half strong positive, with the same lines below zero. The dots show each source, positive, mixed, negative. Build one pilot agent to measure the glue code and debugging time the framework adds.
Footprint on the AI Application Platform stack
They differ on four of 9 layers. AI SDK owns one that Mastra does not. Coverage is each product's placement on this stack, as its product page shows it. Core is a job the product owns; Supports and Touches are jobs it helps with. Coverage says nothing about how well a product does them.
| Layer | Mastra | AI SDK |
|---|---|---|
| Build | ||
| Tool use | Supports | Core |
| Evaluate | ||
| Evaluation | Supports | Touches |
| Operate | ||
| Cloud deployment | Supports | Touches |
| Guardrails | Supports | Touches |
The 5 layers where they match
| Layer | Mastra | AI SDK |
|---|---|---|
| Model | ||
| Model APIs | Touches | Touches |
| Model gateway | Supports | Supports |
| Build | ||
| Orchestration | Core | Core |
| Data | ||
| Retrieval | Supports | Supports |
| Operate | ||
| Observability | Supports | Supports |
What practitioners praise
Among all practitioners, AI SDK alone has four praise themes that reach 5 sources from 3 authors. One API Across Providers and Streaming Chat & Generative UI lead, at 16 of 17 and 10 of 12. Mastra alone has three praise themes that reach 5 sources from 3 authors. Agents in Real Work and TypeScript-First Developer Experience lead, at 15 of 15 and 14 of 14.
| Praised for | Mastra | AI SDK |
|---|---|---|
| Agents in Real Work | 15 of 15 | Not a theme in its sources |
| TypeScript-First Developer Experience | 14 of 14 | Not a theme in its sources |
| Workflows, Memory & Evals Included | 8 of 8 | Not a theme in its sources |
| One API Across Providers | Not a theme in its sources | 16 of 17 |
| Streaming Chat & Generative UI | Not a theme in its sources | 10 of 12 |
| TypeScript Design & Types | Not a theme in its sources | 6 of 10 |
| Agent Loop, Tools & Approvals | Not a theme in its sources | 4 of 12 |
Each count is the sources that praise a theme, or raise it as a concern, out of those that discuss it. A row pairs the two products when both carry a theme under the same or an equivalent name.
A count ending in "so far" has under 5 sources from 3 authors among all practitioners. "Not a theme in its sources" means GILD found no theme of that name in that product's sources.
What practitioners raise as concerns
Among all practitioners, Mastra alone has five concern themes that reach 5 sources from 3 authors. Memory, Recovery & Loop Defects and Opinionated Patterns lead, at 17 of 17 and 8 of 8. AI SDK alone has five concern themes that reach 5 sources from 3 authors. Provider Translation Bugs and Breaking Changes Between Majors lead, at 14 of 15 and 9 of 9.
| Raised as a concern | Mastra | AI SDK |
|---|---|---|
| Memory, Recovery & Loop Defects | 17 of 17 | Not a theme in its sources |
| Opinionated Patterns | 8 of 8 | Not a theme in its sources |
| Builds, Bundles & Hosting Surprises | 7 of 7 | Not a theme in its sources |
| Upgrades, Dependencies & Supply Chain | 7 of 7 | Not a theme in its sources |
| License, Lock-In & Vendor Trust | 5 of 5 | Not a theme in its sources |
| Provider Translation Bugs | Not a theme in its sources | 14 of 15 |
| Breaking Changes Between Majors | Not a theme in its sources | 9 of 9 |
| UI Hook Reliability | Not a theme in its sources | 8 of 8 |
| Durability & Production Gaps | Not a theme in its sources | 8 of 10 |
| Memory & Performance | Not a theme in its sources | 5 of 5 |
36 sources
- Mastra customer story: How Replit's Agent 3 spins up thousands of Mastra agent sandboxes weekly (Sep 24, 2025)
- openstatus blog: How we built our Slack agent (Feb 27, 2026)
- BrainGrid blog: Migrating to AI SDK v5 (Jul 24, 2025)
- Mastra issue #9370: Mastra with AI SDK v5 may cause duplicate assistant messages (Oct 28, 2025)
- StreamDeckHabitTracker issue 98: drop @mastra/core and port the coach agent to the AI SDK (Oct 13, 2026)
- Aman Kumar on dev.to: Using Mastra agents with a custom OpenAI-compatible API, the silent 5-step limit (Oct 18, 2026)
- paulclarke.au pull request 49: research agents moved to the AI SDK, Mastra removed (Oct 16, 2026)
- Kristian: Mastra vs AI SDK, I built production apps with both (YouTube, Jun 17, 2026)
- Mastra docs: Agents overview
- Mastra reference: Agent.generate() (maxSteps default 5)
- Mastra docs: Workflows overview
- Mastra docs: Workflow runners (Inngest, Temporal)
- Mastra docs: Memory overview
- Mastra docs: Evals overview (scorers)
- Mastra model router (8,187 models from 221 providers)
- Mastra docs: Installation (provider API keys)
- Mastra docs: Observability overview (exporters)
- Mastra reference: CLI, including telemetry and MASTRA_TELEMETRY_DISABLED
- Mastra integrations: AI SDK UI (useChat, useCompletion, useObject)
- Mastra docs: Deployment overview (Node.js 22.13, Hono server, deployers)
- Mastra pricing (Platform Starter, Teams, Enterprise, and Self-Hosted)
- Mastra docs: Mastra Platform observability (what counts as an event)
- Mastra LICENSE.md on GitHub (Apache 2.0 outside ee/)
- Mastra Enterprise Edition License 2.0 on GitHub (effective Sep 22, 2026)
- @mastra/core on npm (release history)
- AI SDK docs: Introduction
- AI SDK docs: Agents overview (ToolLoopAgent)
- AI SDK docs: Loop control (20-step default)
- AI SDK docs: WorkflowAgent (durable, resumable agents)
- AI SDK docs: Agent memory
- AI SDK docs: Choosing a provider (AI Gateway as the default global provider)
- AI SDK docs: Telemetry
- AI SDK docs: AI SDK UI overview
- vercel/ai on GitHub (Apache 2.0, 27,573 stars on Oct 28, 2026)
- ai on npm (7.0.156, Oct 28, 2026)
- Vercel docs: AI Gateway pricing (no markup on tokens)

