Internal agents
Internal automation agents that live in Slack and talk to your team

Mastra is the modern TypeScript framework for
AI-powered applications and agents.
Define typed agents with instructions, models, tools, and runtime behavior in one place.
Score agent runs against repeatable checks before changes reach production.

Agent 3 runs thousands of Mastra sandboxes daily.
$5.1B
Brex's Capital One acquisition: driven by agentic finance, powered by Mastra
100K employees
Marsh's globally distributed workforce uses LenAI agentic search, powered by Mastra

Scaling a content agent to 30K+ orgs
10TB
CI logs processed daily by Mastra agents within MongoDB infra

From 0 to $400M AUM with Mastra
1-2 min
Satto turns document work that took hours into finished presentations.

From evaluation to prod in under 4 weeks
Internal automation agents that live in Slack and talk to your team
Answer users, complete tasks, hand off to your product flows
Build AI SREs or give product teams shared agent primitives
Bookswe wrote the book on agents
Jun 16, 2026
Partnering with Mastra
How technology partners integrate with Mastra — from shipping an integration PR, to co-marketing, to going to market together — with examples from MongoDB, Elastic, Render, CopilotKit, Bright Data, and more.
Jun 15, 2026
Introducing Claude Code, Cursor, and Codex agents in Mastra
Build your own coding agents using Claude, Cursor, or OpenAI's agent SDKs.
Docs
Guides, references, and examples
Mastra is an open-source TypeScript framework for building AI-powered applications and agents. Mastra provides agents, workflows, memory, workspaces and observability, letting developers go from idea to implementation. Mastra integrates with frontend and backend frameworks like React, Next.js and Node, or can be deployed anywhere as a standalone server.
Mastra is a TypeScript framework for building AI agents and AI-powered applications. Mastra agents use LLMs and tools to solve open-ended tasks, reasoning about goals, deciding which tools to use and iterating internally until the model emits a final answer or an optional stopping condition is met. Mastra also provides workflows, memory, workspaces and observability to support the full agent development lifecycle.
Mastra supports building AI-powered applications that combine language understanding, reasoning and action to solve real-world tasks. Mastra use cases include conversational agents for customer support, onboarding or internal queries, domain-specific copilots for coding, legal, finance, research or creative work, workflow automations that trigger, route and complete multi-step processes, and decision-support tools that analyze data and provide actionable recommendations.
Mastra's model routing connects to 90+ providers through one standard interface. Mastra supports models from OpenAI, Anthropic, Gemini and more, allowing developers to use different AI providers through a single API.
Mastra's graph-based workflow engine orchestrates complex multi-step processes with explicit control over execution. Mastra workflows use an intuitive syntax for control flow including .then(), .branch() and .parallel() methods. Mastra workflows also support human-in-the-loop functionality, allowing developers to suspend a workflow and await user input or approval before resuming. Mastra uses storage to remember execution state, so workflows can pause indefinitely and resume where they left off.
Mastra's memory system provides conversation history, data retrieval from APIs, databases and files, and human-like working and semantic memory so agents behave coherently. Developers can give Mastra agents the right context at the right time by combining message history with retrieval from external data sources.
Mastra supports authoring Model Context Protocol (MCP) servers, exposing agents, tools and other structured resources via the MCP interface. MCP servers built with Mastra can be accessed by any system or agent that supports the protocol.
Mastra includes built-in scorers and observability tools to observe, measure and refine agent performance continuously. Mastra supports evaluating agent output using model-graded, rule-based and statistical methods, with custom evals to track agent performance over time. Mastra's observability features trace agent calls and token usage with support for external observability platforms. Mastra also provides guardrails to process inputs and outputs, helping prevent prompt injection and sanitize responses.
Mastra applications can be deployed to any Node.js-compatible environment. Mastra includes optional built-in deployers for Vercel, Netlify and Cloudflare to automate the deployment process. Developers can also deploy Mastra as a standalone server powered by Hono, integrate it with existing web frameworks like Next.js, or use their existing Hono, Express, Fastify or any other server app.
Mastra is purpose-built for TypeScript and designed around established AI patterns, giving TypeScript developers everything they need to build AI applications out of the box. Mastra bundles agents and workflows directly into existing React, Next.js and Node.js apps, or ships them as standalone endpoints. Mastra provides a complete set of AI primitives including workflows, agents, workspaces and observability in one modular framework.
Mastra's core framework is open source under the Apache 2.0 license. Enterprise features are source-available under the Mastra Enterprise License. Mastra is free to start with no seats or usage tiers.