Live Workshop

Build more
capable agents

Mastra is the modern TypeScript framework for AI-powered applications and agents.

Workflows. Memory. Harness. Mastra agents have the tools you need to ship fast.

Agents

Define typed agents with instructions, models, tools, and runtime behavior in one place.

Best-in-class, built-in observability. You can always see exactly what your Mastra agents are doing.

Evals

Score agent runs against repeatable checks before changes reach production.

Great AI teams move fast. From fast-scaling startups to large global organizations, you're in good company:

Empower your customers, turbo-charge your company. Mastra agents can do it all.

Internal agents

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

Customer-facing agents

Answer users, complete tasks, hand off to your product flows

Developer platform agents

Build AI SREs or give product teams shared agent primitives

Frequently asked questions

What is Mastra?

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.

Is Mastra an agent builder?

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.

What can you build with Mastra?

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.

What AI models and providers does Mastra support?

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.

What are Mastra workflows?

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.

How does Mastra handle agent memory and context?

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.

Does Mastra support MCP servers?

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.

How does Mastra handle testing and observability?

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.

How do you deploy Mastra applications?

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.

Why use Mastra instead of a Python AI framework?

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.

Is Mastra open source?

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.

Ship better agents