llms.txt
# Mastra
> Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack. It includes everything you need to go from early prototypes to production-ready applications. Mastra integrates with frontend and backend frameworks like React, Next.js, and Node, or you can deploy it anywhere as a standalone server. It's the easiest way to build, tune, and scale reliable AI products.
Use this index to find machine-readable documentation for building with Mastra. Follow the linked pages when you need detail on a specific API, integration, or model.
## When to use Mastra
- Build AI agents in TypeScript with tools, structured output, memory, and human-in-the-loop approvals.
- Orchestrate multi-step workflows with branching, snapshots, suspend and resume, and scheduled runs.
- Add AI capabilities to an existing app and expose them over HTTP with server adapters or Mastra Client.
- Run agents in an isolated sandbox with a filesystem, shell commands, and code execution.
- Connect agents to external systems with MCP, A2A, and ACP, or to people through channels like Slack, Discord, and Telegram.
- Add memory, tracing, and evals so agents stay reliable as they scale.
## How agents should use Mastra
- Treat these pages as the current reference instead of relying on training data. Model IDs, package names, and APIs shown here are real.
- Fetch any page as Markdown by appending `.md` to its URL, such as `https://mastra.ai/docs/agents/overview.md`, or add `/llms.txt` for the same page as a standalone file.
- Read the [Reference](https://mastra.ai/reference) for exact configuration keys, method signatures, and defaults before writing code.
- Choose a model from the [Models](https://mastra.ai/models) directory and pass it to Mastra as a `provider/model` string.
- Prefer running agents, workflows, and tools through the CLI and reading traces over writing throwaway scripts.
## Common starting points
- [Get started](https://mastra.ai/docs.md): Create a Mastra project and build your first agent.
- [Agents](https://mastra.ai/docs/agents/overview.md): Agents that use LLMs, tools, memory, and subagents, and return structured or streamed responses.
- [Workflows](https://mastra.ai/docs/workflows/overview.md): Workflows with typed steps, branching, parallel execution, loops, suspension, and state.
- [Memory](https://mastra.ai/docs/memory/overview.md): Message history, semantic recall, working memory, and observational memory.
- [Harness](https://mastra.ai/docs/harness/overview.md): Durable execution, goals, schedules, and signals for agent work that outlives one request.
- [Sandboxes](https://mastra.ai/docs/sandbox/overview.md): Isolated environments with filesystem access, shell commands, and code execution.
- [MCP](https://mastra.ai/docs/connections/mcp.md): Connect agents to MCP servers, or expose Mastra tools to MCP clients.
- [Evals](https://mastra.ai/docs/evals/overview.md): Model-graded, rule-based, and programmatic scorers for agents and workflows.
- [Tracing](https://mastra.ai/docs/observability/tracing/overview.md): Hierarchical spans across agents, workflows, tools, and model calls.
- [Deployment](https://mastra.ai/docs/deployment/overview.md): Deploy as a server, framework integration, monorepo service, cloud deployment, or sandbox.
- [Reference](https://mastra.ai/reference.md): API parameters, types, method signatures, and defaults.
- [Models](https://mastra.ai/models.md): The model router, gateways, and every supported provider.
## Local coding agents
If you are working in a local project with filesystem access, install the Mastra skills before changing code:
```sh
npx skills add mastra-ai/skills
```
The skill carries implementation guidance and instructions for fetching the latest documentation.
Below is a list of all available documentation pages.
## Docs
- [Get Started](https://mastra.ai/docs.md)
- [Develop](https://mastra.ai/docs/develop.md)
- Build
- [Agents](https://mastra.ai/docs/agents/overview.md)
- [Tools](https://mastra.ai/docs/agents/tools.md)
- [Structured Output](https://mastra.ai/docs/agents/structured-output.md)
- [Human-in-the-Loop](https://mastra.ai/docs/agents/human-in-the-loop.md)
- [Guardrails](https://mastra.ai/docs/agents/guardrails.md)
- [Processors](https://mastra.ai/docs/agents/processors.md)
- [Code Mode](https://mastra.ai/docs/agents/code-mode.md)
- [Workflows](https://mastra.ai/docs/workflows/overview.md)
- [Workflow State](https://mastra.ai/docs/workflows/workflow-state.md)
- [Control Flow](https://mastra.ai/docs/workflows/control-flow.md)
- [Agents and Tools](https://mastra.ai/docs/workflows/agents-and-tools.md)
- [Dynamic Workflows](https://mastra.ai/docs/workflows/dynamic-workflows.md)
- [Snapshots](https://mastra.ai/docs/workflows/snapshots.md)
- [Suspend and Resume](https://mastra.ai/docs/workflows/suspend-and-resume.md)
- [Human-in-the-Loop](https://mastra.ai/docs/workflows/human-in-the-loop.md)
- [Time Travel](https://mastra.ai/docs/workflows/time-travel.md)
- [Error Handling](https://mastra.ai/docs/workflows/error-handling.md)
- [Scheduled Workflows](https://mastra.ai/docs/workflows/scheduled-workflows.md)
- [Harness](https://mastra.ai/docs/harness/overview.md)
- [Durable Agents](https://mastra.ai/docs/harness/durable-agents.md)
- [Background Tasks](https://mastra.ai/docs/harness/background-tasks.md)
- [Goals](https://mastra.ai/docs/harness/goals.md)
- [Schedules](https://mastra.ai/docs/harness/schedules.md)
- [Signals](https://mastra.ai/docs/harness/signals.md)
- [Signal Providers](https://mastra.ai/docs/harness/signal-providers.md)
- [Agent Controller](https://mastra.ai/docs/harness/agent-controller.md)
- [Memory](https://mastra.ai/docs/memory/overview.md)
- [Message History](https://mastra.ai/docs/memory/message-history.md)
- [Observational Memory](https://mastra.ai/docs/memory/observational-memory.md)
- [Working Memory](https://mastra.ai/docs/memory/working-memory.md)
- [Semantic Recall](https://mastra.ai/docs/memory/semantic-recall.md)
- [Memory Processors](https://mastra.ai/docs/memory/memory-processors.md)
- [Multi-User Threads](https://mastra.ai/docs/memory/multi-user-threads.md)
- Extend
- [Subagents](https://mastra.ai/docs/subagents.md)
- [Skills](https://mastra.ai/docs/skills.md)
- [Channels](https://mastra.ai/docs/channels.md)
- [Sandboxes](https://mastra.ai/docs/sandbox/overview.md)
- [Filesystem](https://mastra.ai/docs/sandbox/filesystem.md)
- [Search](https://mastra.ai/docs/sandbox/search.md)
- [Skills](https://mastra.ai/docs/sandbox/skills.md)
- [Computer](https://mastra.ai/docs/sandbox/computer.md)
- [LSP](https://mastra.ai/docs/sandbox/lsp.md)
- [Browser](https://mastra.ai/docs/browser.md)
- [Connections](https://mastra.ai/docs/connections/overview.md)
- [MCP](https://mastra.ai/docs/connections/mcp.md)
- [A2A](https://mastra.ai/docs/connections/a2a.md)
- [ACP](https://mastra.ai/docs/connections/acp.md)
- [SDK Agents](https://mastra.ai/docs/connections/sdk-agents.md)
- Develop / Deploy
- [Storage](https://mastra.ai/docs/storage.md)
- [Server](https://mastra.ai/docs/server/overview.md)
- [Server Adapters](https://mastra.ai/docs/server/server-adapters.md)
- [Custom Adapters](https://mastra.ai/docs/server/custom-adapters.md)
- [Middleware](https://mastra.ai/docs/server/middleware.md)
- [Request Context](https://mastra.ai/docs/server/request-context.md)
- [PubSub](https://mastra.ai/docs/server/pubsub.md)
- [Custom API Routes](https://mastra.ai/docs/server/custom-api-routes.md)
- [Mastra Client](https://mastra.ai/docs/server/mastra-client.md)
- [Studio](https://mastra.ai/docs/studio/overview.md)
- [Deployment](https://mastra.ai/docs/studio/deployment.md)
- [Auth](https://mastra.ai/docs/studio/auth.md)
- [Observability](https://mastra.ai/docs/studio/observability.md)
- [Editor](https://mastra.ai/docs/studio/editor.md)
- [Auth](https://mastra.ai/docs/auth/overview.md)
- [Composite Auth](https://mastra.ai/docs/auth/composite-auth.md)
- [Custom Auth Provider](https://mastra.ai/docs/auth/custom-auth-provider.md)
- [Fine-Grained Authorization](https://mastra.ai/docs/auth/fga.md)
- [JSON Web Token](https://mastra.ai/docs/auth/jwt.md)
- [Simple Auth](https://mastra.ai/docs/auth/simple-auth.md)
- [Workers](https://mastra.ai/docs/auth/workers.md)
- [Deploy](https://mastra.ai/docs/deployment/overview.md)
- [Mastra Server](https://mastra.ai/docs/deployment/mastra-server.md)
- [Monorepo](https://mastra.ai/docs/deployment/monorepo.md)
- [Cloud Providers](https://mastra.ai/docs/deployment/cloud-providers.md)
- [Sandbox](https://mastra.ai/docs/deployment/sandbox.md)
- [Web Framework](https://mastra.ai/docs/deployment/web-framework.md)
- [Workflow Runners](https://mastra.ai/docs/deployment/workflow-runners.md)
- [Workers](https://mastra.ai/docs/deployment/workers.md)
- Observe
- [Traces](https://mastra.ai/docs/observability/overview.md)
- [Usage](https://mastra.ai/docs/observability/tracing/overview.md)
- [Logging](https://mastra.ai/docs/observability/logging.md)
- [Feedback](https://mastra.ai/docs/observability/feedback.md)
- [Storage](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage.md)
- [Metrics](https://mastra.ai/docs/observability/metrics/overview.md)
- [Evals](https://mastra.ai/docs/evals/overview.md)
- [Built-in Scorers](https://mastra.ai/docs/evals/built-in-scorers.md)
- [Quick Checks](https://mastra.ai/docs/evals/quick-checks.md)
- [Gates and Verdicts](https://mastra.ai/docs/evals/gates-and-verdicts.md)
- [Multi-turn Evals](https://mastra.ai/docs/evals/multi-turn.md)
- [Custom Scorers](https://mastra.ai/docs/evals/custom-scorers.md)
- [Running in CI](https://mastra.ai/docs/evals/running-in-ci.md)
- [Vitest Integration](https://mastra.ai/docs/evals/vitest-integration.md)
- [Evals with Memory](https://mastra.ai/docs/evals/evals-with-memory.md)
- [Datasets](https://mastra.ai/docs/evals/datasets.md)
- [Experiments](https://mastra.ai/docs/evals/experiments.md)
- More
- [Guides](https://mastra.ai/docs/guides/overview.md)
- [Multi-agent systems](https://mastra.ai/docs/guides/multi-agent-systems.md)
- [Context engineering](https://mastra.ai/docs/guides/context-engineering.md)
- [Agent lifecycle](https://mastra.ai/docs/guides/agent-lifecycle.md)
- [Authentication](https://mastra.ai/docs/guides/authentication-identity.md)
- [MCP authentication](https://mastra.ai/docs/guides/mcp-authentication-authorization.md)
- [Streaming](https://mastra.ai/docs/guides/streaming.md)
- [Build an eval loop](https://mastra.ai/docs/guides/build-an-eval-loop.md)
- [Overview](https://mastra.ai/docs/mastra-platform/overview.md)
- [Deploy](https://mastra.ai/docs/mastra-platform/deploy.md)
- [Environments](https://mastra.ai/docs/mastra-platform/environments.md)
- [System environment variables](https://mastra.ai/docs/mastra-platform/system-environment-variables.md)
- [Regions](https://mastra.ai/docs/mastra-platform/regions.md)
- [Connect](https://mastra.ai/docs/mastra-platform/connect/overview.md)
- [Providers](https://mastra.ai/docs/mastra-platform/connect/providers.md)
- [Tools](https://mastra.ai/docs/mastra-platform/connect/tools.md)
- [Channels](https://mastra.ai/docs/mastra-platform/connect/channels.md)
- [Observability](https://mastra.ai/docs/mastra-platform/observability.md)
- [Alerts](https://mastra.ai/docs/mastra-platform/alerts.md)
- [Trace Intelligence](https://mastra.ai/docs/mastra-platform/trace-intelligence.md)
- [Studio](https://mastra.ai/docs/mastra-platform/studio.md)
- [Server](https://mastra.ai/docs/mastra-platform/server.md)
- [GitHub integration](https://mastra.ai/docs/mastra-platform/github.md)
- [Hosted databases](https://mastra.ai/docs/mastra-platform/database.md)
- [Workspaces](https://mastra.ai/docs/mastra-platform/workspaces.md)
- [Configuration](https://mastra.ai/docs/mastra-platform/configuration.md)
- [API Reference](https://mastra.ai/docs/mastra-platform/api.md)
## Models
- [Overview](https://mastra.ai/models.md)
- [Embeddings](https://mastra.ai/models/embeddings.md)
- [Environment Variables](https://mastra.ai/models/environment-variables.md)
- [Gateways](https://mastra.ai/models/gateways.md)
- [Providers](https://mastra.ai/models/providers.md)
## Integrations
- [Overview](https://mastra.ai/integrations.md)
- Channels
- [Discord](https://mastra.ai/integrations/channels/discord.md)
- [GitHub](https://mastra.ai/integrations/channels/github.md)
- [iMessage](https://mastra.ai/integrations/channels/imessage.md)
- [Microsoft Teams](https://mastra.ai/integrations/channels/teams.md)
- [Slack](https://mastra.ai/integrations/channels/slack.md)
- [Telegram](https://mastra.ai/integrations/channels/telegram.md)
- [WhatsApp](https://mastra.ai/integrations/channels/whatsapp.md)
- Frameworks
- [Astro](https://mastra.ai/integrations/frameworks/astro.md)
- [Electron](https://mastra.ai/integrations/frameworks/electron.md)
- [Express](https://mastra.ai/integrations/frameworks/express.md)
- [Hono](https://mastra.ai/integrations/frameworks/hono.md)
- [NestJS](https://mastra.ai/integrations/frameworks/nestjs.md)
- [Next.js](https://mastra.ai/integrations/frameworks/next-js.md)
- [Nuxt](https://mastra.ai/integrations/frameworks/nuxt.md)
- [React + Vite](https://mastra.ai/integrations/frameworks/vite-react.md)
- [SvelteKit](https://mastra.ai/integrations/frameworks/sveltekit.md)
- [TanStack Start](https://mastra.ai/integrations/frameworks/tanstack-start.md)
- Agentic UI
- [AI SDK UI](https://mastra.ai/integrations/agentic-ui/ai-sdk-ui.md)
- [Assistant UI](https://mastra.ai/integrations/agentic-ui/assistant-ui.md)
- [CopilotKit](https://mastra.ai/integrations/agentic-ui/copilotkit.md)
- [OpenUI](https://mastra.ai/integrations/agentic-ui/openui.md)
- Sandboxes
- [AgentCore](https://mastra.ai/integrations/sandboxes/agentcore.md)
- [Apple Container](https://mastra.ai/integrations/sandboxes/apple-container.md)
- [Blaxel](https://mastra.ai/integrations/sandboxes/blaxel.md)
- [Cloudflare Sandbox](https://mastra.ai/integrations/sandboxes/cloudflare-sandbox.md)
- [Daytona](https://mastra.ai/integrations/sandboxes/daytona.md)
- [Docker](https://mastra.ai/integrations/sandboxes/docker.md)
- [E2B](https://mastra.ai/integrations/sandboxes/e2b.md)
- [E2B Desktop](https://mastra.ai/integrations/sandboxes/e2b-desktop.md)
- [Modal](https://mastra.ai/integrations/sandboxes/modal.md)
- [Railway](https://mastra.ai/integrations/sandboxes/railway.md)
- [Fly.io Sprites](https://mastra.ai/integrations/sandboxes/sprites.md)
- [Vercel](https://mastra.ai/integrations/sandboxes/vercel.md)
- Observability
- [Arize](https://mastra.ai/integrations/observability/arize.md)
- [Arthur](https://mastra.ai/integrations/observability/arthur.md)
- [Braintrust](https://mastra.ai/integrations/observability/braintrust.md)
- [Confident AI](https://mastra.ai/integrations/observability/confident-ai.md)
- [Datadog](https://mastra.ai/integrations/observability/datadog.md)
- [Laminar](https://mastra.ai/integrations/observability/laminar.md)
- [Langfuse](https://mastra.ai/integrations/observability/langfuse.md)
- [LangSmith](https://mastra.ai/integrations/observability/langsmith.md)
- [OpenTelemetry](https://mastra.ai/integrations/observability/opentelemetry.md)
- [PostHog](https://mastra.ai/integrations/observability/posthog.md)
- [Sentry](https://mastra.ai/integrations/observability/sentry.md)
- Databases
- [Aurora DSQL](https://mastra.ai/integrations/databases/aurora-dsql.md)
- [ClickHouse](https://mastra.ai/integrations/databases/clickhouse.md)
- [ClickHouse Managed Postgres](https://mastra.ai/integrations/databases/clickhouse-managed-postgres.md)
- [Cloudflare D1](https://mastra.ai/integrations/databases/cloudflare-d1.md)
- [Cloudflare KV](https://mastra.ai/integrations/databases/cloudflare-kv.md)
- [Convex](https://mastra.ai/integrations/databases/convex.md)
- [DuckDB](https://mastra.ai/integrations/databases/duckdb.md)
- [DynamoDB](https://mastra.ai/integrations/databases/dynamodb.md)
- [Elasticsearch](https://mastra.ai/integrations/databases/elasticsearch.md)
- [Google Cloud Spanner](https://mastra.ai/integrations/databases/spanner.md)
- [LanceDB](https://mastra.ai/integrations/databases/lancedb.md)
- [libSQL](https://mastra.ai/integrations/databases/libsql.md)
- [MongoDB](https://mastra.ai/integrations/databases/mongodb.md)
- [MySQL](https://mastra.ai/integrations/databases/mysql.md)
- [MSSQL](https://mastra.ai/integrations/databases/mssql.md)
- [Neon Postgres](https://mastra.ai/integrations/databases/neon.md)
- [OracleDB](https://mastra.ai/integrations/databases/oracledb.md)
- [PostgreSQL](https://mastra.ai/integrations/databases/postgresql.md)
- [Redis](https://mastra.ai/integrations/databases/redis.md)
- [Valkey](https://mastra.ai/integrations/databases/valkey.md)
- [Upstash](https://mastra.ai/integrations/databases/upstash.md)
- Deploy
- [Amazon Bedrock AgentCore](https://mastra.ai/integrations/deploy/aws-bedrock-agentcore.md)
- [Amazon EC2](https://mastra.ai/integrations/deploy/amazon-ec2.md)
- [AWS Lambda](https://mastra.ai/integrations/deploy/aws-lambda.md)
- [Azure App Services](https://mastra.ai/integrations/deploy/azure-app-services.md)
- [Cloudflare](https://mastra.ai/integrations/deploy/cloudflare.md)
- [Digital Ocean](https://mastra.ai/integrations/deploy/digital-ocean.md)
- [Inngest](https://mastra.ai/integrations/deploy/inngest.md)
- [Kubernetes](https://mastra.ai/integrations/deploy/kubernetes.md)
- [Kubernetes (Helm)](https://mastra.ai/integrations/deploy/kubernetes-helm.md)
- [Neon](https://mastra.ai/integrations/deploy/neon.md)
- [Netlify](https://mastra.ai/integrations/deploy/netlify.md)
- [Render](https://mastra.ai/integrations/deploy/render.md)
- [Temporal](https://mastra.ai/integrations/deploy/temporal.md)
- [Vercel](https://mastra.ai/integrations/deploy/vercel.md)
- Tools
- [Bright Data](https://mastra.ai/integrations/tools/brightdata.md)
- [Firecrawl](https://mastra.ai/integrations/tools/firecrawl.md)
- [Parallel](https://mastra.ai/integrations/tools/parallel.md)
- [Perplexity](https://mastra.ai/integrations/tools/perplexity.md)
- [Tavily](https://mastra.ai/integrations/tools/tavily.md)
- Voice
- [AWS Nova Sonic](https://mastra.ai/integrations/voice/aws-nova-sonic.md)
- [Azure](https://mastra.ai/integrations/voice/azure.md)
- [Cloudflare](https://mastra.ai/integrations/voice/cloudflare.md)
- [Deepgram](https://mastra.ai/integrations/voice/deepgram.md)
- [ElevenLabs](https://mastra.ai/integrations/voice/elevenlabs.md)
- [Gladia](https://mastra.ai/integrations/voice/gladia.md)
- [Google](https://mastra.ai/integrations/voice/google.md)
- [Inworld](https://mastra.ai/integrations/voice/inworld.md)
- [LiveKit](https://mastra.ai/integrations/voice/livekit.md)
- [Mistral](https://mastra.ai/integrations/voice/mistral.md)
- [ModelsLab](https://mastra.ai/integrations/voice/modelslab.md)
- [Murf](https://mastra.ai/integrations/voice/murf.md)
- [OpenAI](https://mastra.ai/integrations/voice/openai.md)
- [Sarvam](https://mastra.ai/integrations/voice/sarvam.md)
- [Speechify](https://mastra.ai/integrations/voice/speechify.md)
- [xAI](https://mastra.ai/integrations/voice/xai.md)
- Auth
- [Auth0](https://mastra.ai/integrations/auth/auth0.md)
- [Better Auth](https://mastra.ai/integrations/auth/better-auth.md)
- [Clerk](https://mastra.ai/integrations/auth/clerk.md)
- [Firebase](https://mastra.ai/integrations/auth/firebase.md)
- [Google](https://mastra.ai/integrations/auth/google.md)
- [Okta](https: