Mastra

Mastra

The open-source TypeScript framework for building AI agents, from the team behind Gatsby.

Mastra launch demo · YC W25[10]

25k+

GitHub stars

Apache-2.0 · 1.5k → 25k in 12 months

90+

Model providers

Routed through one interface

$5M

Prior Gatsby ARR

Same team · sold to Netlify, 2023

In production at

Replit

AI coding agent · listed on mastra.ai

Sanity

Headless CMS · enterprise OSS

WorkOS

Enterprise auth infra

Fireworks AI

Agentic workflows · launch post

SoftBank

Enterprise reference

Plus broad adoption across the W25, S25, and F25 YC AI cohort — Mastra is the JS-first default for agents.[1] [2]

Thesis

Python won AI research. JavaScript already won product. The next ten million developers building agents won't open a notebook — they'll open the Next.js project they're already in and reach for the framework that feels native to it.[6] [7] Mastra is that framework — and the team running it is the team that wrote Gatsby. [2] [4] The longer-term bet: the OSS playbook that turned React into the default rendering layer is being rerun on agent orchestration, by the same operators.
  1. 01

    JavaScript is where the next ten million agent developers will build. 72% of full-stack developers already use TypeScript; only 29% of web teams claim Python proficiency.[5] Point72 Ventures puts it bluntly: TypeScript is "becoming the language of choice for AI application development," and web developers — not ML engineers — will lead AI app implementation at scale.[6] Mastra is the framework built for the audience that's already there.

  2. 02

    The framework wars are now about agents, not pages. React, Next.js, and Gatsby fought over rendering and routing. The next round is steps, tools, memory, and RAG. Mastra ships those as TypeScript-native primitives — agents, workflows, memory, rag, evals — not a Python port stitched into the JS world.[3] [11]

  3. 03

    The founders shipped Gatsby. They know how to win OSS distribution. Sam Bhagwat (CEO, co-founder of Gatsby), Abhi Aiyer (CTO, ex-Netlify principal eng), and Shane Thomas (CPO, ex-Gatsby head of product) scaled Gatsby to 55k+ stars, 4k+ contributors, and $5M ARR before the Netlify acquisition.[2] [4] They're running the same OSS playbook on a category that's an order of magnitude larger than static site generators ever were.

  4. 04

    Coding agents are the new distribution layer. ChatGPT, Cursor, and Claude Code recommend whatever has the cleanest OSS repo, the most idiomatic SDK, and the simplest install. Apache-2.0, npm create mastra@latest, 25k+ stars in twelve months, and TypeScript-native by default is exactly the shape coding agents reach for.[3] [13]

Problem

Building a production agent in JavaScript today means stitching together five OSS libraries written for someone else.

Vercel's AI SDK is a thin streaming wrapper. LangChain.js is a port of a Python framework with the wrong idioms — chains instead of typed graphs, callbacks instead of suspend/resume. Memory, RAG, evals, and orchestration each live in their own repo, each with its own opinions, each with its own bug list.

Sam Bhagwat's framing of the gap is direct: "We noticed our friends building AI applications getting stuck debugging prompts, figuring out why their agents called (or didn't call) tools, and writing lots of custom memory retrieval logic."[10] Every senior JS engineer at every YC AI company today wants to ship an agent. The friction is real — and the only existing frameworks are either Python-shaped or too thin to matter.

The cost isn't the stitching. It's the chilling effect on what gets shipped. The team that has to integrate four libraries and write its own memory layer ships an agent in a quarter. The team that runs npm create mastra@latest ships one in an afternoon.

72%

of full-stack devs use TypeScript

vs. 29% who claim Python proficiency in web teams

98%

YoY growth in genAI projects

GitHub Octoverse 2024 · application layer is exploding

15%

YoY npm consumption growth

JavaScript ecosystem still expanding faster than any other

PureCode TS/Python comparison[5] · GitHub Octoverse 2024[7]

Why Now

Three preconditions converged in the same eighteen months.

TypeScript took the application layer, AI moved from research into product, and coding agents started picking the stack. The JS-native agent framework wasn't possible — or necessary — before now.

We noticed our friends building AI applications getting stuck debugging prompts, figuring out why their agents called (or didn't call) tools, and writing lots of custom memory retrieval logic.

Sam Bhagwat

Sam Bhagwat[10]

Co-founder & CEO · Mastra

There are at least as many JavaScript developers as Python developers, so now tools are increasingly catering to this widely expanded audience.

Shawn Wang

Shawn Wang[6]

swyx · Latent Space

TypeScript is becoming the language of choice for AI application development. Web developers — not ML engineers — will increasingly lead AI application implementation at scale.

P72

Point72 Ventures[6]

Perspectives · AI Application Layer

Each precondition on its own is interesting. Together they're a new category.

TypeScript took the application layer. TypeScript adoption tripled from 12% (2017) to 34% (2023) and overtook Java to enter GitHub's top three languages. npm consumption grew 15% YoY in 2024 — the JS ecosystem is still expanding faster than any other.[6] [7] Every modern dev tool ships TS types first.

AI moved from research into product. Generative AI projects grew 98% YoY on GitHub.[7] The dominant model is no longer "a researcher writes a notebook" — it's "a Next.js engineer ships an agent feature inside a SaaS app." The audience and the tooling have inverted.

Coding agents pick the stack. Developers ask ChatGPT how to ship an agent. ChatGPT, Cursor, and Claude Code recommend whatever has the cleanest OSS repo, the most idiomatic SDK, and the most-cited examples. Apache-2.0, a one-line install, and 25k stars is exactly the surface area coding agents are tuned to surface.[3] [13]

Web developers — not ML engineers — will increasingly lead AI application implementation at scale. TypeScript is the natural language for that work.
Point72 Ventures[6]

How It Works

One framework. Six primitives. The TypeScript stack a JS engineer reaches for to ship an agent in an afternoon.

Step 01

Agents + model routing

Autonomous loops with tool calling, persistent state, and built-in routing across 90+ model providers via the Vercel AI SDK. One typed configuration object replaces a half-day of LangChain.js boilerplate.

Step 02

Workflows + human-in-the-loop

Graph-based control flow with .then(), .branch(), .parallel(). First-class suspend/resume for human-in-the-loop steps and state persistence. Mirrors XState patterns the JS world already knows.

Step 03

Memory + RAG + evals

Working memory, semantic recall, vector retrieval, and built-in evaluation harnesses as first-class primitives. No four-library handshake to keep state — and no separate eval framework to bolt on at the end.

The local dev playground is where the addiction starts.

Install in one command. npm create mastra@latest scaffolds the project, drops a local dev server with traces and logs, and gives the developer an agent calling a model inside ninety seconds. That's the Vercel-era expectation — and the bar Python frameworks structurally can't meet.[13]

Production observability, day one. OpenTelemetry tracing, eval metrics, and a real-time dashboard shipped in the same package. Compatible with Datadog, New Relic, and the broader OTel ecosystem the rest of the JS world already uses.[11]

Deploy anywhere a Node runtime runs. Vercel, Cloudflare Workers, Netlify, AWS, self-hosted — whatever the team's existing JS deploy target is. The agent ships alongside the rest of the app, not as a separate Python microservice the JS engineer can't debug.

The Framework Wars Are Now About Agents

React won components. Next.js won rendering. Mastra is the bet on what comes next.

Every decade of web development has a defining framework war. The last decade's was about how a page got rendered. This decade's is about how an agent gets orchestrated — and the same OSS playbook that won the last round wins this one.

The framework primitives have changed. The distribution mechanics haven't.

The primitives are different. React shipped components. Next.js shipped routes and SSR. Gatsby shipped a build pipeline. Mastra ships steps, tools, memory, RAG, and evals. The category boundaries are different — but the framework shape is the same: a TypeScript-first DX, opinionated primitives, and a sharp opinion about what belongs inside the framework vs. outside it.[3]

The distribution is identical. OSS-first, MIT/Apache license, GitHub stars as the leading indicator, paid cloud runtime as the monetization vector. Gatsby ran this play to 55k stars and $5M ARR before the Netlify acquisition.[4] Vercel ran the same play with Next.js to a $3.25B valuation.[8] Mastra is running it again — and the addressable market this time is every web team building any AI feature.

The team has done this before. Gatsby was an organic OSS movement before it was a company — the team has the muscle memory for community management, contributor scaling, ecosystem building, and the painful inflection between "great OSS project" and "profitable framework company." That muscle is the actual moat.

The Gatsby team didn't win the last framework war on accident, and they're not picking the next one casually. When operators who shipped 55k stars run the same playbook on a 10× larger market, the prior is they get to a serious outcome again.
Orange Collective

Market

The densest buyer pool is every YC AI batch — and beyond that, every web team.

Inside YC, Mastra is already the JS-first default — adoption spans W25, S25, F25, and P26 batches, with companies like Autumn (S25), Fireworks AI, and dozens of others running Mastra-powered agents in production.[1] [15] The dense YC AI cohort is exactly the acquisition channel that compounds — every YC company in production is a forcing function for the next batch's choice.

Beyond YC, the addressable market is every web team building AI features. The TypeScript developer base is 17M+ globally and growing 15%+ YoY.[6] [7] Every web team eventually ships an agent feature; very few will context-switch their stack to Python to do it. The framework that wins JS wins the application layer.

Near term — JS-first AI startups and YC AI cohorts

YC current and recent AI cohorts plus the broader JS-native seed-to-Series-A pool. Dense network, technical buyers, OSS-friendly. Mastra is already the JS-first default for agents — and the YC cohort dynamic is the strongest distribution channel in software.[2] [15]

Long term — every web team building AI features

The 17M+ TypeScript developer base growing 15%+ YoY is the long pole.[7] Every web team eventually ships an agent feature. The AI infrastructure category is on a path to a $200B+ market by 2030 — and the framework layer is the one with developer leverage and ecosystem lock-in.

Every YC AI company is an agent framework decision in waiting. Mastra should be the answer by default — and that's how the next decade of AI application infrastructure gets written.
Orange Collective

Competitive landscape

Four categories of competition. Mastra is positioned against all of them.

Each category has a structural limitation — language idiom, scope depth, or vendor lock-in. Mastra's OSS + TypeScript-native + full-stack stance is the answer to all four.

LangChain

Python incumbent

100k+ GitHub stars, 5k+ companies, $25M Series A at $200M (Sequoia, Feb 2024).[8] Powerful and battle-tested, but Python-first; LangChain.js is a port with the wrong idioms and a worse DX. Mastra's bet: the JS audience is bigger, growing faster, and unserved by a Python port.

Vercel AI SDK

Streaming UI toolkit

11.8k+ stars, $250M Series E at $3.25B (Accel, May 2024).[8] Excellent for streaming chat UIs and frontend AI. Not a full-stack agent framework — no built-in RAG, no long-term memory, no workflow engine. Mastra is built on top, not against.

OpenAI Assistants / Anthropic SDKs

Vendor toolkits

Deep integrations with one model provider. Lock-in by design. Mastra routes across 90+ providers through one interface, so the same agent code runs on whatever model wins the quarter.[11]

LlamaIndex / Haystack / AutoGen

Python research stack

Strong for retrieval and multi-agent research. Wrong idiom for shipping a customer-facing product on a JS stack. The framework that wins the next decade has to feel native to the application layer — which is JS.

LangChain's gravity is Python's gravity. Vercel's scope is the UI layer. OpenAI's framework is model-vendor lock-in. The opening in the middle — TypeScript-native, full-stack, model-agnostic — is exactly where Mastra is building.
Orange Collective

Founder deep dive

Three founders, one prior framework with 55k stars, and a chip on the shoulder about what could have gone bigger.

Why Sam built it. Sam co-founded Gatsby in 2017 and spent eight years scaling it to 55k+ stars, 4k+ contributors, and $5M ARR before the Netlify acquisition.[2] [4] He learned every lesson the hard way: how to win a JS framework war on the merits, how to monetize an OSS community without alienating it, and — by his own framing — what the team didn't do well enough the first time. Self-described as "hungry with a chip on our shoulder." Mastra is the next at-bat on a 10× bigger market.[10]

Why Abhi built it. Abhi was principal engineer at Netlify post-acquisition, leading a 100+ person engineering org and running the Gatsby Cloud infrastructure that served billions of files and hundreds of TB of bandwidth a month. He knows what it takes to operate a developer framework at the scale where every regression is a public incident — and what kind of architecture survives that pressure.

Why Shane built it. Shane was staff engineer and head of product at Gatsby, with 15+ years in open source. He's also the founder who shipped Audiofeed, an AI podcasting tool — so he was inside the agent-building problem before the team formalized Mastra. State wrestling champion, which is unrelated to the framework but is the kind of detail that tells you what kind of operator he is.

Why this team is the right team. An OSS-framework CEO who has done the full GTM cycle from zero to acquisition. A CTO who has scaled framework infrastructure to billions of requests. A CPO who has shipped both the OSS contributor experience and an AI product. They cover every leg of the framework-company stool: distribution, infra, and DX. They've built one framework company together before; the second one is being built faster, on a bigger market, with the operating mistakes already paid for.

Why velocity is a feature. The framework went from 1.5k stars at launch (Nov 2024) to 25k+ stars by mid-2025 — Vercel AI SDK's adoption curve, on the back of pure community gravity.[3] The team is shipping new primitives every month, the docs surface is the cleanest in the category, and the community on Discord doubles every quarter. That velocity is the lead indicator of whether the OSS playbook compounds.[14]

The long arc. Mastra becomes the framework every JS engineer reaches for the moment "agent" enters the PRD. The OSS core wins the install. The cloud runtime powers the renewal. The enterprise observability and control plane absorb the next layer of spend. Every JS team building any AI feature ends up inside one platform — and the operational memory of how thousands of agents are built and shipped is the long-term moat.

Founder & team

Sam Bhagwat

Sam Bhagwat

Repeat FounderExited

Co-founder & CEO

Co-founder of Gatsby.js — open-source React framework, scaled to 55k+ stars and $5M ARR before the Netlify acquisition in 2023. Early engineer (<20) at Zenefits (W13) and PlanGrid (W12). Stanford '11. Spent two years door-knocking for political campaigns before tech. Self-described as "hungry with a chip on our shoulder" — Gatsby taught the team what works and what doesn't in OSS distribution, and Mastra is the next at-bat.

Abhi Aiyer

Abhi Aiyer

Repeat FounderExited

Co-founder & CTO

Principal engineer and lead of a 100+ person engineering org at Netlify, post-Gatsby acquisition. Built Gatsby Cloud infrastructure — tens of thousands of build nodes, billions of files served, hundreds of TB of monthly bandwidth. Knows what it takes to operate a developer framework at the scale where every regression is a public incident.

Shane Thomas

Shane Thomas

Repeat Founder

Co-founder & CPO

Staff engineer and head of product at Gatsby. 15+ years in open source. Previously built Audiofeed (AI podcasting). State wrestling champion — turns out, useful preparation for shipping an OSS framework into a category dominated by a Python incumbent with 100k stars.

Risks & mitigations

Risk

LangChain has a five-year head start, 100k+ stars, and is the answer when an AI engineer Googles "agent framework."

Mitigation

LangChain's gravity is real, but its center of mass is Python. LangChain.js is a port — not a primitive — and it carries the wrong idioms into JS (chains over workflows, callbacks over typed graphs). Mastra is winning the JS audience by being the only TypeScript-native option built around the patterns JS engineers already know: typed configuration objects, graph workflows, npm-native install. The 1.5k→25k stars trajectory in twelve months is the leading indicator: when ChatGPT recommends an agent framework to a Next.js developer, it increasingly says Mastra.

Risk

Vercel is the closest neighbor. If Vercel decides agents are core to the AI SDK, the wedge collapses.

Mitigation

Vercel's AI SDK is the streaming and UI layer — explicitly scoped to that surface. Mastra is built on top of it, not against it: model routing flows through the AI SDK, and the value-add is the agent/workflow/memory/RAG primitives Vercel has chosen not to ship. Vercel's structural incentive is to keep the AI SDK lightweight and let the ecosystem ship the heavy framework on top — the same shape that gave Gatsby room to grow on top of React.

Risk

OSS monetization risk — Gatsby itself never broke $10M ARR before the Netlify acquisition. Will the same playbook scale this time?

Mitigation

The Gatsby team built the company directly. They know which paid-tier features compound (cloud runtime, observability, enterprise control plane) and which get absorbed by the OSS core. Mastra's three-tier model — free framework, cloud agent runtime, enterprise observability — was designed with the Gatsby lessons baked in. The market is also fundamentally bigger: every AI application runs an agent eventually, and the runtime is a usage-based business in a way Gatsby's build platform never was.

Risk

The AI framework category is moving fast — primitives that look canonical today (agents, workflows, RAG) could be obsoleted by the next model generation.

Mitigation

Model providers keep absorbing capabilities, but agent orchestration, memory, observability, and human-in-the-loop are the layers that stay above the model line. Mastra is positioned at exactly the layer that doesn't get absorbed — and the team has already proven they can adapt fast (the framework has shipped new primitives every month since launch). The TypeScript-first audience plus the Gatsby team's OSS instincts is the moat, not any single primitive.

What we're watching

  • Continued GitHub star trajectory — 25k → 50k inside the next nine months would put Mastra on Vercel AI SDK's adoption curve.
  • Enterprise logos on the homepage converting to paid cloud runtime customers — the LangSmith-style upsell motion is the real revenue test.
  • Coding-agent recommendation share — when Cursor and Claude Code generate agent code, what fraction picks Mastra vs. LangChain.js or raw Vercel AI SDK.
  • Hiring velocity post-seed — the Gatsby team's bench knows how to scale an OSS framework org; how quickly they pull that talent in is the leading signal for the next 18 months.

References

  1. [1]Mastra — Product homepage
  2. [2]Y Combinator — Mastra company profile (W25, 30 employees, SF)
  3. [3]GitHub — mastra-ai/mastra (Apache-2.0, 25k+ stars, 2.2k+ forks)
  4. [4]GitHub — gatsbyjs/gatsby (55k+ stars, 4k+ contributors — prior OSS framework by the same team)
  5. [5]PureCode — TypeScript vs. Python developer demographics
  6. [6]Point72 Ventures — TypeScript: enterprise-ready and the ideal option for AI application development
  7. [7]GitHub Octoverse 2024 — TypeScript adoption, npm consumption +15% YoY, generative AI projects +98% YoY
  8. [8]TechCrunch / public filings — LangChain $25M Series A (Sequoia, Feb 2024); Vercel $250M Series E (Accel, May 2024)
  9. [9]Netlify — State of Web Development / framework popularity
  10. [10]Mastra Launch — YC Launch post ("If you hate Langchain, you'll love Mastra")
  11. [11]Mastra docs — Agents, workflows, RAG, memory, evals, model routing (90+ providers)
  12. [12]Netlify — State of the JAMstack 2020 (Gatsby usage at enterprises)
  13. [13]Mastra — npm create mastra@latest install (single-command setup)
  14. [14]Mastra Discord — community channel referenced in repo README
  15. [15]Orange Collective — internal portfolio (Mastra is in production at multiple OC portfolio companies, including Autumn)