页面简介
Ship AI agents that reason, remember, and act in TypeScript. Mastra provides memory, tools, MCP, and observability to go from prototype to production.
正文摘录
Build AI agentsBuild, observe, and improve agents that run for days with Mastra, the leading TypeScript agent frameworkmastra-projectagentstoolsworkflowsscorersindex.tsObservabilityTracesMetricsLogsEvalsExperimentsScorersDatasetsGet a demoQuickstartRead →Read →Read →Read →Read →Read →Read →Read →Read →Read →Read →Read →Workflows. Memory. Harness. Mastra agents have the tools you need to ship fast.factory.tsimport { MastraFactory } from "@mastra/factory"; import { LibSQLFactoryStorage } from "@mastra/libsql"; export const factory = new MastraFactory({ storage: new LibSQLFactoryStorage({ id: "factory-storage", url: "file:./factory.db", }), auth: null, });FactoryA system of specialized AI agents that takes software from issue to production.FactoryAgentsWorkflowsHarnessMemoryServerfactory.tsimport { MastraFactory } from "@mastra/factory"; import { LibSQLFactoryStorage } from "@mastra/libsql"; export const factory = new MastraFactory({ storage: new LibSQLFactoryStorage({ id: "factory-storage", url: "file:./factory.db", }), auth: null, });FactoryA system of specialized AI agents that takes software from issue to production.Best-in-class, built-in observability. You can always see exactly what your Mastra agents are doing.Get a demoQuickstartEvalsScore agent runs against repeatable checks before changes reach production.EvalsMetricsDatasetsTracesSignalsEvalsScore 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.How Range Built an AI-Native Investment Adviser Managing $17BRead storyHow Salesforce Built Their Harness for 100k Developers on MastraRead storyHow Sanity Built a Content Agent for a CMS Used by 1M+ UsersRead storyHow WorkOS Went From Evaluating Mastra to Using It in Prod in ~1 MonthRead storyHow MongoDB Built Sage, Its Internal Agent Platform for 20+ Eng TeamsRead storyEmpower your customers, turbo-charge your company. Mastra agents can do it all.Get a demoQuickstartReal-world agentsBuild a company brain, Slack/Teams agents, or automate important business processesCustomer-facing agentsAnswer users, complete tasks, hand off to your product flowsDeveloper InfraBuild AI SREs or give product teams shared agent primitivesResourcesResourcesAgent BooksLatest ReleasesPrinciplesof Building AI Agents240K+ copies distributedPatternsof Building AI Agents100K+ copies distributedIntroducing Custom Dashboards for the Mastra PlatformSurface the signals that matter the most.Dec 2. 2026Introducing Custom Metrics for Mastra ObservabilityEmit your own metrics for tools, workflows, processors, and scorers.Dec 1. 2026Introducing Encrypted Secrets for Mastra PlatformStore environment variables as encrypted secrets that are only decrypted when your server starts.Nov 27. 2026Introducing Generative UI in Slack for Mastra AgentsYour agents can now reply with tables, charts, and other Slack-native UI elements.Nov 24. 2026Frequently asked questionsFrequently asked questionsFrequently asked questionsWhat 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.Start building with Mastra todayQuickstart