Show HN: Mastra 1.0, open-source JavaScript agent framework from the Gatsby devs
95 points
10 hours ago
| 15 comments
| github.com
| HN
Hi HN, we're Sam, Shane, and Abhi.

Almost a year ago, we first shared Mastra here (https://news.ycombinator.com/item?id=43103073). It’s kind of fun looking back since we were only a few months into building at the time. The HN community gave a lot of enthusiasm and some helpful feedback.

Today, we released Mastra 1.0 in stable, so we wanted to come back and talk about what’s changed.

If you’re new to Mastra, it's an open-source TypeScript agent framework that also lets you create multi-agent workflows, run evals, inspect in a local studio, and emit observability.

Since our last post, Mastra has grown to over 300k weekly npm downloads and 19.4k GitHub stars. It’s now Apache 2.0 licensed and runs in prod at companies like Replit, PayPal, and Sanity.

Agent development is changing quickly, so we’ve added a lot since February:

- Native model routing: You can access 600+ models from 40+ providers by specifying a model string (e.g., `openai/gpt-5.2-codex`) with TS autocomplete and fallbacks.

- Guardrails: Low-latency input and output processors for prompt injection detection, PII redaction, and content moderation. The tricky thing here was the low-latency part.

- Scorers: An async eval primitive for grading agent outputs. Users were asking how they should do evals. We wanted to make it easy to attach to Mastra agents, runnable in Mastra studio, and save results in Mastra storage.

- Plus a few other features like AI tracing (per-call costing for Langfuse, Braintrust, etc), memory processors, a `.network()` method that turns any agent into a routing agent, and server adapters to integrate Mastra within an existing Express/Hono server.

(That last one took a bit of time, we went down the ESM/CJS bundling rabbithole, ran into lots of monorepo issues, and ultimately opted for a more explicit approach.)

Anyway, we'd love for you to try Mastra out and let us know what you think. You can get started with `npm create mastra@latest`.

We'll be around and happy to answer any questions!

swyx
6 hours ago
[-]
> That last one took a bit of time, we went down the ESM/CJS bundling rabbithole, ran into lots of monorepo issues, and ultimately opted for a more explicit approach.

shudders in vietnam war flashbacks congrats on launch guys!!!

for those who want an independent third party endorsement, here's Brex CTO talking about Mastra in their AI engineering stack http://latent.space/p/brex

reply
calcsam
5 hours ago
[-]
LOL thanks swyx. Yeah we realized although we _could_ fight that war again...it would be better for everyone if we didn't...
reply
calcsam
5 hours ago
[-]
And I actually hadn't seen that Brex piece so thanks for sharing!!
reply
magicmicah85
1 hour ago
[-]
Ran through quickstart, created my first agent "Friendo" that acts as my best friend, chatted a bit. Nice UI, cool systems, hope to play with it more and build something, but I'm just not sure what yet.
reply
dataviz1000
2 hours ago
[-]
I worked with Mastra for three months and it is awesome. Thank you for making a great product.

One thing to consider is that it felt clunky working with workflows and branching logic with non LLM agents. I have a strong preference for using rules based logic and heuristics first. That way, if I do need to bring in the big gun LLM models, I already have the context engineering solved. To me, an agent means anything with agency. After a couple weeks of frustration, I started using my own custom branching workflows.

One reason to use rules, they are free and 10,000x faster, with an LLM agent fallback if validation rules were not passing. Instead of running an LLM agent to solve a problem every single time, I can have the LLM write the rules once. The whole thing got messy.

Otherwise, Mastra is best in class for working with TypeScript.

reply
calcsam
1 hour ago
[-]
Thank you for using us, and for the feedback!

Do you have code snippets you can share about how you wanted to write the rules? Want to understand desired grammar / syntax better.

reply
esperent
3 hours ago
[-]
I've been building with Mastra for a couple of weeks now and loving it, so congratulations on reaching 1.0!

It's built on top of Vercel AI elements/SDK and it seems to me that was a good decision.

My mental heuristic is:

Vercel AI SDK = library, low level

Mastra = framework

Then Vercel AI Elements gives you an optional pre built UI.

However, I read the blog post for the upcoming AI SDK 6.0 release last week, and it seems like it's shifting more towards being a framework as well. What are your thoughts on this? Are these two tools going to align further in the future?

https://vercel.com/blog/ai-sdk-6

reply
calcsam
2 hours ago
[-]
Have a ton of respect for the AI SDK team. Initially we only used AI SDK model routing, but now we also have our own built-in model routing as well.

I see each of us having different architectures. AI SDK is more low-level, and Mastra is more integrated with storage powering our studio, evals, memory, workflow suspend/resume etc.

reply
deepdarkforest
2 hours ago
[-]
Never ask a woman her age, a man his salary, and an agent framework developer his long term plans
reply
owebmaster
2 hours ago
[-]
If it uses Vercel, I'm out.
reply
solarkraft
4 hours ago
[-]
Congratulations! I’m a fan of the publicity work and general out-of-the-box DX! That stuff matters a lot and I’m happy you’re aware.

I wonder: Are there any large general purpose agent harnesses developed using Mastra? From what I can tell OpenCode chose not to use it.

A lot of people on here repeat that rolling your own is more powerful than using Langchain or other frameworks and I wonder how Mastra relates to this sentiment.

reply
calcsam
3 hours ago
[-]
When Langchain was the only option rolling your own made a lot of sense!

These days we see things going the other way, where teams that started rolling their own shift over to Mastra so they can focus on the agent vs having to maintain an internal framework.

The Latent Space article swyx linked earlier includes a quote from the Brex CTO talking about how they did that.

reply
pancomplex
6 hours ago
[-]
We use typescript for all our entire stack and it's super dope to see a production-grade framework (with no vendor lock in) launch!
reply
calcsam
6 hours ago
[-]
Thanks! That's a lot of why we built Mastra. We wanted something that felt like it was made for us.
reply
simlevesque
6 hours ago
[-]
Congrats on the launch ! Someone told me that you have an excellent product but I don't have a need for it yet.
reply
calcsam
6 hours ago
[-]
Thanks! And of course hope you try Mastra out when you do.
reply
microflash
6 hours ago
[-]
Why should I use this over say Strands Agents [1] or Spring AI [2]?

[1]: https://strandsagents.com

[2]: https://spring.io/projects/spring-ai

reply
calcsam
6 hours ago
[-]
You should use whatever framework you feel like has the best DX / fits your stack best!

We're TypeScript-first, TypeScript-only so a lot of the teams who use us are full-stack TypeScript devs and want an agent framework that feels TS-native, easy to use, and feature-complete.

reply
pancomplex
6 hours ago
[-]
seems non of these are typescript-based? Strand appears to have a typescript sdk available but not natively ts.
reply
microflash
6 hours ago
[-]
Language, although an important factor, should not be the only factor to decide using a tool. I'm curious is there something unique Mastra is bringing to the table, compared to other alternatives.
reply
bradledford
6 hours ago
[-]
Been using Mastra for some side projects for months and it's just phenomenal. Congrats to the team!
reply
calcsam
6 hours ago
[-]
Thanks, great to hear!
reply
anditherobot
6 hours ago
[-]
From punch cards to assembly, to C, to modern languages and web frameworks, each generation raised the abstraction. Agentic frameworks are the next one.
reply
calcsam
6 hours ago
[-]
I mean we're framework guys so I would agree!
reply
swyx
4 hours ago
[-]
> a `.network()` method that turns any agent into a routing agent

say more pls?

reply
calcsam
3 hours ago
[-]
We've always supported letting folks specify their agent hierarchy, eg agent supervisor, workflow orchestrator, mix and match, etc.

But people kept asking us for a multi-agent primitive out of the box so we shipped `agent.network()`, which is basically dynamic hierarchy decided at runtime, pass in an array of workflows and agents to the routing agent and let it decide what to do, how long to execute for, etc!

https://mastra.ai/docs/agents/networks

reply
swyx
2 hours ago
[-]
ty! btw your docs search is broken, as i tweeted to Ward.
reply
calcsam
1 hour ago
[-]
ah crap, thanks for heads-up. looking into it.
reply
admiralrohan
3 hours ago
[-]
Congratulations on the launch. The landing page looks dope.
reply
calcsam
2 hours ago
[-]
Thank you! We have an incredible designer and we love obsessing about this stuff.
reply
mrcwinn
6 hours ago
[-]
You’re not locked into a model, but you likely are locked in to a platform. This DX and convenience just shifts within the stack where the lock in occurs. Not criticizing - just a choice people should be conscious of.

Another useful question to ask: since you’re likely using 1 of 3 frontier models anyway, do you believe Claude Agent SDK will increasingly become the workflow and runtime of agentic work? Or if not Claude itself, will that set the pattern for how the work is executed? If you do, why use a wrapper?

reply
calcsam
5 hours ago
[-]
Re: lessons from coding agents, we're building some of the key abstractions like sandboxes, filesystem, skills/knowledge as Mastra primitives in over the next month.

For any agent you're shipped to production though you probably want a harness that's open-source so you more fully control / can customize the experience.

reply
mrcwinn
5 hours ago
[-]
I think that’s fair, totally, but I also think a Skill would be considered a primitive in and of itself by Anthropic. So to me it’s still wrapping an open primitive. Anyway, trade offs.
reply
holoduke
7 hours ago
[-]
Offtopic but how much is AI used these days for generating code at your place? Curious because we see a major shift last months where almost everything is generated. Still human checked and human quality gates. Big difference compared to last year.
reply
calcsam
6 hours ago
[-]
There's the normal stuff you'd expect -- we're all Opus-pilled, use Claude Code, a PR review bot etc. But it's been especially helpful with highly templatized code like our storage adapters, we already have 10-15 working examples which makes the n+1st adapter almost trivial to write.
reply
tamimio
3 hours ago
[-]
So the ultimate real life use case of this is having a bubble on your site that you click to chat with a bot?! Most users prefer to chat with an actual human being 99% of the times or immediately ask the bot to chat with one.
reply
calcsam
3 hours ago
[-]
Less frequently sites and more frequently a SaaS app, for example Sanity released a content agent in their CMS, Factorial released an agent inside their HR/payroll product.

But tons of other use cases too, eg dev teams at Workday and PayPal have built an agentic SRE to triage their alerts, etc etc

reply