· 5 min read
Mastra: The TypeScript Agent Framework That Doesn't Apologize for Not Being Python
The Python-default era of agent frameworks is ending, and the framework most likely to end it lives on npm.
The default assumption in 2026 is still that serious AI infrastructure lives in Python. Every framework spotlight in this publication's May lineup before today has been a Python project. Every tutorial in your feed assumes a pip install. The cost of that assumption, if your product runs on Node, is real and accumulating. You either context-switch your engineers between two stacks, or you stand up a Python sidecar whose only job is to wrap LLM calls that your TypeScript code already knows how to make. The friction is permanent, and it shows up in code reviews, deployment pipelines, and on-call rotations where the agent service belongs to nobody in particular.
Mastra is the framework betting that the second half of the agent decade gets written in TypeScript. The team behind Gatsby built it as an open-source, TS-first agent framework with workflows, RAG, evaluations, memory, and deployment baked into a single package. By the 1.0 release in January 2026, weekly npm downloads had passed 300,000, GitHub stars had cleared 22,000, and enterprise teams at Replit, PayPal, and Adobe were running it in production. The pitch is not that TypeScript developers should settle for a worse experience to stay on their stack. The pitch is that they should not have to settle at all, and after months of teams putting that claim to work in shipping code, the evidence is starting to back it up.
The workflow primitive is where Mastra makes its sharpest argument. You compose multi-step processes with .then(), .branch(), and .parallel(), and the resulting graph is fully typed end to end. If you've been waiting for the LangGraph control-flow story to feel native instead of imported, this is closer to what that should have looked like from the start. Branches enforce schema agreement at compile time. Parallel steps share state explicitly through typed channels rather than through implicit dictionary mutations. When a step fails, the failure is a typed event at a known location in the graph, not a stack trace three retries deep in a logging dashboard. The TypeScript compiler does the work LangGraph asks you to do at runtime through Pydantic, which is the kind of trade most TS shops would take in their sleep.
The agents themselves sit on top of the Vercel AI SDK, which means tool calling, structured outputs, and provider switching arrive without ceremony. You define a tool with a Zod schema, and the schema does double duty as the prompt contract and the runtime validator. There is no separate tool-registration abstraction layer to debug, no decorator soup, no provider-specific tool format to translate. You hand the agent the tools, the system prompt, and the model, and the framework gets out of the way. The bet Mastra is making here is that most of the abstractions other frameworks ship are paper over a primitive that is already good enough, and on production code, that bet is holding.
RAG ships in the box, and this is the part that closes the most stubborn argument for sticking with Python. The retrieval pipeline covers chunking, embedding generation, vector storage, similarity search, and reranking, with first-class adapters for Pinecone, Qdrant, ChromaDB, and pgvector. The Python ecosystem's RAG advantage was always one of integration count rather than fundamental capability, and Mastra closing that gap means the "we have to use Python because LlamaIndex" position is now a preference rather than a requirement. You can stand up a hybrid retrieval stack against your existing Postgres in an afternoon, in the language your application already speaks, with the same dependency tree your platform team already maintains.
Evals are the part that surprises me most, and the part the Python frameworks should be paying attention to. Most agent frameworks treat evaluation as a separate concern, something you bolt on with Promptfoo or Braintrust after the fact. Mastra ships a model-graded, rule-based, and statistical evaluation system inside the framework itself. You can score relevance, faithfulness, toxicity, and tone consistency on the same agents you are shipping, in the same project, against the same datasets you are already collecting in production. This is the practitioner gap I keep flagging in this publication. If the evals live where the agent lives, they actually get written. If they require a second tool and a second mental model, they do not.
Memory in Mastra splits into three layers that mirror how production agents actually behave. There is conversation history for short-term context, semantic recall for retrieval against past sessions, and a compression layer the team calls observational memory that condenses old conversations into structured facts. Working memory holds the explicit state the agent needs to keep across turns, validated by Zod schemas you control. The result is that "remember this user prefers metric units" stops being a hand-rolled middleware feature and starts being a framework primitive. Most teams I've watched build this themselves get it wrong twice before they ship something they trust, and the second wrong version is the expensive one.
Observability is OpenTelemetry-native, which is the answer most TypeScript shops already wanted. You point traces at whatever you already use for the rest of your stack, and the agent telemetry shows up in the same dashboards as your HTTP requests and database queries. The local development playground is the other piece worth calling out by name. It runs alongside your code, lets you exercise agents and workflows without writing scaffolding, and surfaces traces in real time. The Python frameworks are catching up here, with Langfuse and Arize Phoenix doing serious work on the open-source side. Mastra arrived with this story already complete, which matters when you are trying to ship in May rather than wait for someone else's roadmap to catch up.
Where it falls short is honest to name. The model provider matrix is narrower than the Python ecosystem at the long tail. If you are running Bedrock against a fine-tuned in-house model with a custom inference server, the integration story is rougher than it would be in a Python shop with LiteLLM in the loop. The plugin ecosystem is younger, which means fewer pre-built community tools and a higher chance you write the integration yourself. The framework opinions can chafe if you have already built your own agent loop and want primitives to compose rather than a workflow model to adopt. Mastra rewards teams that pick up the workflow abstraction wholesale. It punishes teams that try to use half of it.
The real argument is not TypeScript versus Python. The real argument is whether your agent layer should run in the same stack as the rest of your application or in a separate service maintained by a separate team. If the answer is the former and your application stack is Node, Mastra is now the default I would reach for. The framework has caught up on capability, pulled ahead on developer ergonomics, and built the eval and observability story that the Python frameworks are still bolting on after the fact. If you have been running a sidecar Python service to host your agents because nothing TypeScript-native felt production-ready, the assumption that justified that decision is no longer holding. That is worth a Friday afternoon to revisit, which, conveniently, is today.