Article —
Mastra builds AI agents and workflows in TypeScript
Mastra is an open-source TypeScript framework for building AI agents and workflows. It fits into the web stack many teams already run, which makes agent work easier to adopt.
Mastra is an open-source TypeScript framework for building AI agents and workflows. Its pitch is to “Ship AI agents that reason, remember, and act in TypeScript.”
What it is
The core framework is licensed under Apache 2.0. Enterprise features are source-available under a separate Mastra Enterprise License. The site says it is free to start, with no seat or usage tiers.
The main pieces are:
- Agents: pick a model, write instructions and connect tools.
- Workflows: typed steps with branching, parallel execution, retries and pauses for human input that resume from stored state.
- Memory: conversation history, semantic recall and observational memory.
- Server: expose agents and workflows as API endpoints.
- Observability: tracing, metrics for latency, tokens and cost, and evals.
- Integrations: one interface to more than 90 model providers, MCP server authoring and guardrails against prompt injection.
Mastra runs on any Node.js environment. It has deployers for Vercel, Netlify and Cloudflare, or it can run as a standalone Hono server. You can also embed it in React, Next.js or Node apps.
What it is not
- It is not a hosted agent product. It is a library you build with and run yourself.
- It is not a model. You bring the providers and keys.
- It is not a shortcut around design. You still decide what your agents may do and where a human approves.
What it is good for
If your services and apps are already written in TypeScript, Mastra lets you add agent orchestration without introducing another language or runtime. The agent code lives next to the rest of your application.
That makes it a good fit for support agents, internal knowledge search, research assistants and document processing. If you have not looked at Mastra yet, it is worth an afternoon to see how its agents, workflows and memory fit together.
Contains AI-generated content