Ma

Mastra – Open-source JS agent framework, by the developers of Gatsby

Hacker News

Mastra – Open-source JS agent framework, by the developers of Gatsby

Hi HN, we’re Sam, Shane, and Abhi, and we’re building Mastra ( https://mastra.ai ), an open-source JavaScript SDK for building agents on top of Vercel’s AI SDK. You can start a Mastra project with `npm create mastra` and create workflow graphs that can suspend/resume, build a RAG pipeline and write evals, give agents memory, create multi-agent workflows, and view it all in a local playground. Previously, we built Gatsby, the open-source React web framework. Later, we worked on an AI-powered CRM but it felt like we were having to roll all the AI bits (agentic workflows, evals, RAG) ourselves. We also noticed our friends building AI applications suffering from long iteration cycles: they were getting stuck debugging prompts, figuring out why their agents called (or didn’t call) tools, and writing lots of custom memory retrieval logic. At some point we just looked at each other and were like, why aren't we trying to make this part easier, and decided to work on Mastra. Demo video: https://www.youtube.com/watch?v=8o_Ejbcw5s8 One thing we heard from folks is that seeing input/output of every step, of every run of every workflow, is very useful. So we took XState and built a workflow graph primitive on top with OTel tracing. We wrote the APIs to make control flow explicit: `.step()` for branching, `.then()` for chaining, and `.after()` for merging. We also added .`.suspend()/.resume()` for human-in-the-loop. We abstracted the main RAG verbs like `.chunk()`, `embed()`, `.upsert(),’ `.query()`, and `rerank()` across document types and vector DBs. We shipped an eval runner with evals like completeness and relevance, plus the ability to write your own. Then we read the MemGPT paper and implemented agent memory on top of AI SDK with a `lastMessages` key, `topK` retrieval, and a `messageRange` for surrounding context (think `grep -C`). But we still weren’t sure whether our agents were behaving as expected, so we built a local dev playground that lets you curl agents/workflows, chat with agents, view evals and traces across runs, and iterate on prompts with an assistant. The playground uses a local storage layer powered by libsql (thanks Turso team!) and runs on localhost with `npm run dev` (no Docker). Mastra agents originally ran inside a Next.js app. But we noticed that AI teams’ development was increasingly decoupled from the rest of their organization, so we built Mastra so that you can also run it as a standalone endpoint or service. Some things people have been building so far: one user automates support for an iOS app he owns with tens of thousands of paying users. Another bundled Mastra inside an Electron app that ingests aerospace PDFs and outputs CAD diagrams. Another is building WhatsApp bots that let you chat with objects like your house. We did (for now) adopt an Elastic v2 license. The agent space is pretty new, and we wanted to let users do whatever they want with Mastra but prevent, eg, AWS from grabbing it. If you want to get started: - On npm: npm create mastra@latest - Github repo: https://github.com/mastra-ai/mastra - Demo video: https://www.youtube.com/watch?v=8o_Ejbcw5s8 - Our website homepage: https://mastra.ai (includes some nice diagrams and code samples on agents, RAG, and links to examples) - And our docs: https://mastra.ai/docs Excited to share Mastra with everyone here – let us know what you think!

Share card

Actual performance

442points
154comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: agents, agent, agentic · Missing: mac, macos, cursor
99%99% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Strong signals: started, ios · Missing: supports, reddit linkedin, podcasting
93%93% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: excited, ide, pipe · Missing: https docs, just released, exist
79%79% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Strong signals: ios, video, users · Missing: mobile apps, personal, entrepreneurs
40%40% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Strong signals: plus, host, users · Missing: platform, intuitive, reviews
30%30% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
24%24% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Strong signals: chat · Missing: web3, crypto, cryptocurrency
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Ca
Cample.js: Open-Source framework based on reactivity without VDOM72%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cample.js: Open-Source framework based on reactivity without VDOM

Hacker News6
Ev
Evvo – an open source framework for distributed evolutionary algorithms75%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Evvo – an open source framework for distributed evolutionary algorithms

Hacker News3
Me
MetricFlow – open-source metric framework81%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

MetricFlow – open-source metric framework

Hacker News98
Di
Dissect – An open source DFIR framework73%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Dissect – An open source DFIR framework

Hacker News8
RedBlue
RedBlue48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Open-Source Hypervideo Framework

Indie Hackers1apis
ZenML
ZenML50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

extensible, open-source MLOps framework

Indie Hackers4$1/moai
The Frigg Framework
The Frigg Framework48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Open Source Integration framework for developers

Indie Hackerscommitment-full-time
Mi
MithChosen, a basic select dropdown for mithril js framework48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

MithChosen, a basic select dropdown for mithril js framework

Hacker News1
Pi
Pipoca.js, a Fullstack WebApp Framework53%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Pipoca.js, a Fullstack WebApp Framework

Hacker News3
Ca
Cample.js – Framework Without VDOM58%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cample.js – Framework Without VDOM

Hacker News5