---
name: mastra-core
description: Documentation for @mastra/core. Use when working with @mastra/core APIs, configuration, or implementation.
metadata:
  package: "@mastra/core"
  version: "1.85.0"
---

## When to use

Use this skill whenever you are working with @mastra/core to obtain the domain-specific knowledge.

## How to use

Read the individual reference documents for detailed explanations and code examples.

### Docs

- [Code mode](references/docs-agents-code-mode.md) - Configure Mastra code mode so agents can run multi-tool computations in isolated local or remote sandboxes and return one accurate, consolidated response.
- [Guardrails](references/docs-agents-guardrails.md) - Protect Mastra agents with built-in guardrail processors for prompt injection, content moderation, PII redaction, Unicode normalization, and output safety.
- [Human-in-the-loop](references/docs-agents-human-in-the-loop.md) - Add human-in-the-loop controls to Mastra agents with tool approval and suspended execution, so people can provide input before a run resumes or stops.
- [Agent networks](references/docs-agents-networks.md) - Understand deprecated Mastra agent networks, including multi-agent routing, structured output, tool approvals, and migration to supervisor agents.
- [Agents](references/docs-agents-overview.md) - Build Mastra agents that use LLMs, tools, memory, workflows, and subagents to reason through open-ended tasks and return structured or streamed responses.
- [Processors](references/docs-agents-processors.md) - Use Mastra input and output processors to transform, validate, filter, and control agent messages at defined points in the execution pipeline.
- [Resumable streams](references/docs-agents-resumable-streams.md) - Publish agent runs on a stream topic so clients can reconnect, other readers can follow a run with observe(), and any reader can stop it.
- [Structured output](references/docs-agents-structured-output.md) - Generate validated, typed structured output from Mastra agents with JSON Schema, Zod, or Valibot, including streaming and tool-enabled responses.
- [Tools](references/docs-agents-tools.md) - Create schema-validated Mastra tools that let agents call APIs, query databases, run functions, and invoke agents, workflows, or remote MCP servers.
- [Composite Auth](references/docs-auth-composite-auth.md) - Combine multiple Mastra authentication providers with CompositeAuth, control provider order, and support fallback across JWT, OAuth, and custom identity systems.
- [Custom auth provider](references/docs-auth-custom-auth-provider.md) - Create a custom Mastra authentication provider by extending MastraAuthProvider, with token validation and user authorization protecting selected server routes.
- [Fine-Grained Authorization (FGA)](references/docs-auth-fga.md) - Configure Mastra Fine-Grained Authorization for resource-level permissions that map routes to actions and scope stored resources for enterprise users.
- [JSON Web Token](references/docs-auth-jwt.md) - Secure Mastra APIs with MastraJwtAuth and a shared secret, then create JSON Web Tokens and send authenticated requests through MastraClient.
- [Simple Auth](references/docs-auth-simple-auth.md) - Use Mastra SimpleAuth for token-to-user authentication, API key scenarios, custom headers, and lightweight authorization in development environments.
- [Workers](references/docs-auth-workers.md) - Secure communication between standalone Mastra workers and the API server with bearer tokens, API key headers, or custom authentication credentials.
- [Browser](references/docs-browser.md) - Give Mastra agents browser automation through native SDK providers, CLI tools, CDP connections, or cloud services such as Browserbase and Firecrawl.
- [Channels](references/docs-channels.md) - Connect Mastra agents to Slack, Discord, Telegram, and other messaging channels with webhooks, thread context, tool approvals, and formatted replies.
- [Classifier](references/docs-classifier.md) - Ask a decision model typed questions about your application state and act on structured answers instead of parsing generated text.
- [A2A (Agent-to-Agent)](references/docs-connections-a2a.md) - Expose Mastra agents through the Agent-to-Agent protocol and consume remote A2A agents as subagents or call them directly with the client SDK.
- [Agent Client Protocol (ACP)](references/docs-connections-acp.md) - Connect ACP-compatible coding agents to Mastra as tools or subagents, with configured models and sessions that stream Agent Client Protocol interactions.
- [Connections](references/docs-connections-overview.md) - Connect Mastra to remote agents, coding agents, SDK runtimes, MCP servers, and external tools by choosing the protocol that fits your application.
- [SDK agents](references/docs-connections-sdk-agents.md) - Use Claude Agent SDK, Cursor Agent SDK, and OpenAI Agents SDK agents inside Mastra as delegated agents with their native tools and model options.
- [Workers](references/docs-deployment-workers.md) - Run Mastra workflow orchestration, schedules, and long-running background tasks in dedicated workers to keep API processes responsive under load.
- [Develop](references/docs-develop.md) - Develop and test Mastra agents locally with mastra dev, Studio, file-based agents, the Mastra CLI, and AI coding tools that understand your project.
- [Custom scorers](references/docs-evals-custom-scorers.md) - Build custom Mastra scorers with createScorer using JavaScript functions or LLM prompts across preprocess, analyze, generateScore, and generateReason steps.
- [Datasets](references/docs-evals-datasets.md) - Create versioned Mastra datasets, define item schemas, manage test data through code or Studio, and track experiments against agents and workflows.
- [Evals with memory](references/docs-evals-evals-with-memory.md) - Run Mastra evals against memory-enabled agents using shared or per-item threads, observational memory, runEvals, and dataset experiments.
- [Experiments](references/docs-evals-experiments.md) - Run Mastra dataset experiments against registered agents or workflows, apply scorers, compare results, and inspect experiment output in Studio.
- [Gates and verdicts](references/docs-evals-gates-and-verdicts.md) - Define mandatory gates and score thresholds for Mastra evals, compute passed, scored, or failed verdicts, and enforce quality requirements in CI.
- [Multi-turn evals](references/docs-evals-multi-turn.md) - Evaluate Mastra agents across multi-turn conversations by sending sequential inputs on one memory thread and scoring individual turns or the full exchange.
- [Evals](references/docs-evals-overview.md) - Evaluate Mastra agents and workflows with model-graded, rule-based, and programmatic scorers through live evaluations, trace scoring, and Quick Checks.
- [Running scorers in CI](references/docs-evals-running-in-ci.md) - Run Mastra scorer experiments in CI with runEvals, define test cases for agents or workflows, inspect aggregate results, and track quality over time.
- [Agent lifecycle](references/docs-guides-agent-lifecycle.md) - Follow an agent run from input preparation through repeated model and tool calls to the final result, for both regular and durable execution.
- [Authentication and identity](references/docs-guides-authentication-identity.md) - Design secure identity flows for Mastra that protect endpoints and carry trusted user context through agents and tools while enforcing data boundaries.
- [Build an eval loop](references/docs-guides-build-an-eval-loop.md) - Use datasets, LLM judges, and Mastra Studio experiments to compare agent changes, investigate failures, and build regression checks.
- [Context engineering](references/docs-guides-context-engineering.md) - Engineer the context Mastra agents receive by combining instructions, inline data, tools, RAG, filesystems, memory, and observational memory.
- [MCP authentication and authorization](references/docs-guides-mcp-authentication-authorization.md) - Choose credentials for MCP connections, protect a Mastra MCP server, and separate delegated access from tool and data permissions.
- [Multi-agent systems](references/docs-guides-multi-agent-systems.md) - Choose a Mastra multi-agent architecture by comparing handoffs, workflows, supervisors, and council patterns for delegation, control, and collaboration.
- [Guides](references/docs-guides-overview.md) - Explore guides to designing, building, and evaluating Mastra applications, from agent architecture and context to authentication and streaming.
- [Streaming](references/docs-guides-streaming.md) - Stream incremental responses from Mastra agents and workflows, consume text and structured output, handle events, and integrate with AI SDK interfaces.
- [Agent Controller](references/docs-harness-agent-controller.md) - Build interactive Mastra agent applications with Agent Controller sessions, persistent threads, modes, approvals, subagents, channels, and runtime state.
- [Background tasks](references/docs-harness-background-tasks.md) - Run long-lived Mastra tool calls and subagents as background tasks while streams remain open, with per-call dispositions, cancellation, and completion events.
- [Durable agents](references/docs-harness-durable-agents.md) - Wrap Mastra agents in durable execution so streams and long-running turns survive client disconnects and process restarts across supported runtimes.
- [Goals](references/docs-harness-goals.md) - Set a durable goal for a Mastra agent so an execution loop evaluates progress and continues working until the objective completes or its run budget ends.
- [Harness](references/docs-harness-overview.md) - Use the Mastra harness to start, continue, update, and preserve agent work beyond one request with durable execution, goals, schedules, and signals.
- [Schedules](references/docs-harness-schedules.md) - Schedule Mastra agents with cron expressions, recurring prompts, optional thread delivery, lifecycle hooks, and APIs for managing scheduled runs.
- [Agents and tools](references/docs-knowledge-agents-and-tools.md) - Turn on the Knowledge tools for an agent, and what agents can do with them.
- [Load your content](references/docs-knowledge-load-your-content.md) - Load your own content, such as product docs or policies, into Knowledge so agents can search and read it.
- [Knowledge](references/docs-knowledge-overview.md) - Give agents shared pages and notes they search, read and write, with access decided by your configuration rather than by the model.
- [What you can build with Knowledge](references/docs-knowledge-patterns.md) - What you can build with Knowledge: a docs agent, one agent for many customers, pinned policies, coding conventions, organizing pages, runbooks, department scopes, personal notes and agent hand-offs.
- [Pinned context](references/docs-knowledge-pinned-context.md) - Keep Knowledge pages in an agent's context every turn, pinned in config for every run of a scope or by agents at runtime.
- [Scopes and access](references/docs-knowledge-scopes-and-access.md) - Declare the scopes Knowledge content lives in, set which scopes each run holds, and check what a run can reach.
- [Search](references/docs-knowledge-search.md) - How Knowledge search ranks results, and how to add search by meaning.
- [Observability](references/docs-mastra-platform-observability-overview.md) - Collect, import, and query hosted traces, logs, metrics, scores, and feedback from Mastra applications with Mastra Platform Observability and local fallback storage.
- [Memory processors](references/docs-memory-memory-processors.md) - Configure Mastra memory processors to filter, trim, transform, and deduplicate messages before they reach the model while managing context limits.
- [Message history](references/docs-memory-message-history.md) - Store and retrieve recent Mastra conversation messages, configure history limits and thread titles, and query threads for chat interfaces.
- [Multi-user threads](references/docs-memory-multi-user-threads.md) - Share one Mastra memory thread across multiple users by sending each message as a signal with the speaker in its attributes.
- [Observational Memory](references/docs-memory-observational-memory.md) - Give agents long-running memory with a small, stable, cache-friendly context. Observational Memory turns older messages into dense observations as a thread grows.
- [Memory](references/docs-memory-overview.md) - Add memory to Mastra agents with message history, observational memory, and working memory across threads and multi-agent delegation.
- [Semantic recall](references/docs-memory-semantic-recall.md) - Retrieve relevant messages from past Mastra conversations with semantic recall, vector search, embeddings, metadata filters, and configurable storage.
- [Working memory](references/docs-memory-working-memory.md) - Persist user profiles, preferences, and application data with Mastra working memory using resource- or thread-scoped templates and storage adapters.
- [Feedback](references/docs-observability-feedback.md) - Create, list, delete, aggregate, and export human feedback records in Mastra observability, with ratings and comments linked to specific traces and spans.
- [Computer](references/docs-sandbox-computer.md) - Give Mastra agents screenshot, mouse, and keyboard control in supported desktop sandboxes.
- [Filesystem](references/docs-sandbox-filesystem.md) - Give Mastra agents local or remote filesystem access, configure persistent storage and mounts, and work with files through workspace tools.
- [LSP inspection](references/docs-sandbox-lsp.md) - Configure Language Server Protocol support in Mastra workspaces so agents can inspect symbols, definitions, references, diagnostics, and project structure.
- [Sandboxes](references/docs-sandbox-overview.md) - Run Mastra agents in isolated local or remote sandboxes with filesystem access, shell commands, code execution, and optional computer-use tools.
- [Search and indexing](references/docs-sandbox-search.md) - Index filesystem or application content in Mastra workspaces and search it with BM25 keyword, vector semantic, or hybrid retrieval modes.
- [Skills](references/docs-sandbox-skills.md) - Create filesystem-backed Mastra skills with SKILL.md instructions, supporting files, configurable discovery paths, and Agent Skills compatibility.
- [Custom adapters](references/docs-server-custom-adapters.md) - Implement a custom Mastra server adapter for unsupported web frameworks by mapping routes, middleware, request parameters, responses, and streams.
- [Custom API routes](references/docs-server-custom-api-routes.md) - Add custom HTTP endpoints to a Mastra server with schema validation, middleware, authentication, OpenAPI documentation, and control over disconnect behavior.
- [Mastra client](references/docs-server-mastra-client.md) - Use the type-safe Mastra Client SDK from browser applications to call agents, workflows, tools, memory, and server APIs with streaming support.
- [Built-in MCP server](references/docs-server-mcp.md) - Let MCP clients such as Claude Code, Cursor, and the MCP Inspector call your agents, workflows, and tools through the built-in /api/mcp endpoint, with the same auth, RBAC, and FGA as the HTTP API.
- [Middleware](references/docs-server-middleware.md) - Add Mastra server middleware for authentication, authorization, CORS, request logging, route blocking, and request-specific context injection.
- [Server](references/docs-server-overview.md) - Configure the Mastra HTTP server to expose agents and workflows through REST APIs with middleware, authentication, streaming, and OpenAI-compatible routes.
- [PubSub](references/docs-server-pubsub.md) - Configure Mastra PubSub event delivery for components, resumable streams, workers, and schedules across one process, multiple processes, or distributed instances.
- [Request context](references/docs-server-request-context.md) - Pass request-specific runtime values through Mastra RequestContext to configure agents, workflows, tools, models, storage, and instructions for each request.
- [Notifications](references/docs-signals-notifications.md) - Create durable Mastra notification records, resolve delivery policy, and deliver notifications or summaries to an agent thread.
- [Signals](references/docs-signals-overview.md) - Send asynchronous input into a Mastra agent thread while Mastra manages whether the agent is active or idle.
- [Running across processes](references/docs-signals-running-across-processes.md) - Run Mastra agent threads across multiple processes with a shared PubSub backend and thread leases.
- [Sending signals](references/docs-signals-sending-signals.md) - Send input to an agent thread and let Mastra decide whether to deliver it or wake the thread.
- [Signal providers](references/docs-signals-signal-providers.md) - Build Mastra signal providers that monitor external systems through polling or webhooks and deliver notifications into long-running agent threads.
- [State signals](references/docs-signals-state-signals.md) - Keep durable, named state on a Mastra thread and send snapshots or deltas that the model sees as context.
- [Thread streams](references/docs-signals-thread-streams.md) - Subscribe to a Mastra agent thread to read stored history, live output, and lifecycle events as a single ordered stream.
- [Agent skills](references/docs-skills.md) - Attach reusable Agent Skills directly to Mastra agents using inline definitions, filesystem paths, dynamic loaders, and programmatic skill access.
- [Storage](references/docs-storage.md) - Configure Mastra storage to persist memory, workflow state, observability data, evals, schedules, and long-running agent state across restarts.
- [Auth](references/docs-studio-auth.md) - Secure Mastra Studio and API routes with login flows, token forwarding, role-based access control, default roles, and permission-aware UI rendering.
- [Deployment](references/docs-studio-deployment.md) - Deploy Mastra Studio on Mastra platform, alongside your API, or as a static SPA on your own infrastructure or content delivery network.
- [Editor](references/docs-studio-editor.md) - Use Mastra Studio Editor so collaborators can change agent instructions and tools without modifying source code, from draft testing through publication.
- [Knowledge](references/docs-studio-knowledge.md) - Browse the Knowledge instances registered on your Mastra server from Studio, as a page tree and a graph.
- [Observability](references/docs-studio-observability.md) - Monitor Mastra agents, workflows, tools, and model calls in Studio with metrics dashboards, hierarchical traces, and searchable correlated logs.
- [Studio](references/docs-studio-overview.md) - Use Mastra Studio to build, test, and manage agents, workflows, processors, tools, and MCP servers while inspecting traces and runtime behavior.
- [Subagents](references/docs-subagents.md) - Build Mastra supervisor agents that delegate work to specialized subagents with hooks, request context, message filtering, and completion scoring.
- [Agents and tools](references/docs-workflows-agents-and-tools.md) - Call Mastra agents and tools from workflow steps, compose them directly with createStep, and choose between execute functions and typed step composition.
- [Control flow](references/docs-workflows-control-flow.md) - Control Mastra workflow execution with sequential steps, parallel branches, conditional logic, loops, nested workflows, mapping, and output merging.
- [Dynamic workflows](references/docs-workflows-dynamic-workflows.md) - Create, persist, update, and execute Mastra workflows from JSON definitions while registering dependencies and managing definitions through APIs.
- [Error handling](references/docs-workflows-error-handling.md) - Handle Mastra workflow failures with retries, result status checks, lifecycle callbacks, conditional branches, step errors, and monitoring in Studio.
- [Human-in-the-loop](references/docs-workflows-human-in-the-loop.md) - Pause Mastra workflows for approvals, reviews, or user input, then resume with supplied data, reject with bail, or support repeated human interactions.
- [Workflows](references/docs-workflows-overview.md) - Build deterministic Mastra workflows with typed steps, agents, tools, branching, parallel execution, loops, suspension, state, and Studio visualization.
- [Scheduled workflows](references/docs-workflows-scheduled-workflows.md) - Run Mastra workflows on one or more cron schedules, inspect trigger history in Studio, and pause or resume scheduled execution at runtime.
- [Snapshots](references/docs-workflows-snapshots.md) - Store and retrieve Mastra workflow snapshots so suspended executions preserve step results and state and can resume reliably across processes.
- [Suspend and resume](references/docs-workflows-suspend-and-resume.md) - Suspend Mastra workflows while waiting for external input, resources, or time, then resume saved runs with data and recover interrupted executions.
- [Time travel](references/docs-workflows-time-travel.md) - Debug Mastra workflows by re-executing from a selected step with new execution context, including nested steps addressed by reference or ID.
- [Workflow state](references/docs-workflows-workflow-state.md) - Share typed global state across Mastra workflow steps, initialize and update values, preserve state through suspension, and pass it into nested workflows.

### Integrations

- [Integrations](references/integrations.md) - Explore Mastra integrations for UI frameworks, authentication, databases, deployment platforms, observability, channels, sandboxes, tools, and voice.
- [Assistant UI](references/integrations-agentic-ui-assistant-ui.md) - Integrate Assistant UI with Mastra to build a polished React chat interface backed by Mastra agents, streaming responses, and tool interactions.
- [CopilotKit](references/integrations-agentic-ui-copilotkit.md) - Connect CopilotKit to Mastra through AG-UI for generative UI, shared application state, frontend tools, human approval, and messaging channels.
- [OpenUI](references/integrations-agentic-ui-openui.md) - Stream Mastra agent output into OpenUI through AG-UI, render generative interfaces with built-in components, and customize the component library.
- [Auth0](references/integrations-auth-auth0.md) - Authenticate Mastra servers with Auth0 JWTs, configure credentials and authorization, and connect client applications with authenticated requests.
- [Clerk](references/integrations-auth-clerk.md) - Give Mastra agents Clerk tools through Mastra Connect, and authenticate Mastra server requests with the @mastra/auth-clerk provider and MastraClient.
- [Firebase](references/integrations-auth-firebase.md) - Authenticate Mastra applications with Firebase ID tokens, configure service credentials and authorization, and send secured client requests.
- [Neon](references/integrations-auth-neon.md) - Authenticate Mastra server requests and Studio users with Neon Auth, map Neon Auth organization roles to Mastra permissions, and connect MastraClient with a Neon Auth JWT.
- [Supabase](references/integrations-auth-supabase.md) - Give Mastra agents Supabase tools through Mastra Connect, and authenticate Mastra server requests with Supabase Auth and MastraClient.
- [WorkOS](references/integrations-auth-workos.md) - Give Mastra agents WorkOS tools through Mastra Connect, and authenticate Mastra with WorkOS access tokens, fine-grained authorization, and JWT templates.
- [Discord](references/integrations-channels-discord.md) - Connect a Mastra agent to Discord interactions and bot messages by installing the adapter, configuring the agent, and exposing a webhook route.
- [GitHub](references/integrations-channels-github.md) - Subscribe Mastra agents to GitHub pull requests with @mastra/github-signals, polling modes, notification signals, and subscription management tools.
- [iMessage](references/integrations-channels-imessage.md) - Connect a Mastra agent to iMessage direct and group conversations with Photon or BlueBubbles adapters, agent configuration, and webhook routing.
- [Ring](references/integrations-channels-ring.md) - Send Ring doorbell and camera events to Mastra agents as notification signals with @mastra/ring-signals, and fetch snapshots and video clips with agent tools.
- [Slack](references/integrations-channels-slack.md) - Connect a Mastra agent to Slack channels and direct messages, configure the Slack app and webhook route, and test threaded agent conversations.
- [Microsoft Teams](references/integrations-channels-teams.md) - Connect a Mastra agent to Microsoft Teams mentions and conversation events by installing the adapter and configuring agent webhook handling.
- [Telegram](references/integrations-channels-telegram.md) - Connect a Mastra agent to Telegram direct messages, groups, and bot mentions by installing the adapter and configuring the webhook route.
- [WhatsApp](references/integrations-channels-whatsapp.md) - Connect a Mastra agent to WhatsApp Business Cloud customer messages by installing the adapter and configuring agent webhook handling.
- [Angular](references/integrations-frameworks-angular.md) - Build an Angular chat interface for a tool-calling Mastra agent, configure the standalone server, and stream responses with AI SDK's Angular bindings.
- [Astro](references/integrations-frameworks-astro.md) - Build a tool-calling Mastra agent in Astro, create server and chat routes, add AI SDK UI and AI Elements, and test the interactive chat experience.
- [Electron](references/integrations-frameworks-electron.md) - Build a tool-calling Mastra agent for an Electron desktop app, configure CSP and server routes, add AI SDK UI, and test the chat experience.
- [Express](references/integrations-frameworks-express.md) - Integrate Mastra with an Express application using the server adapter to expose agent and workflow HTTP routes and test a tool-calling agent.
- [Hono](references/integrations-frameworks-hono.md) - Integrate Mastra with a Hono application using the server adapter to expose agent and workflow HTTP routes and test a tool-calling agent.
- [NestJS](references/integrations-frameworks-nestjs.md) - Integrate Mastra with NestJS using the server adapter module, expose agent and workflow routes, inject MastraService, and test the application.
- [Next.js](references/integrations-frameworks-next-js.md) - Build a tool-calling Mastra agent in Next.js, create an API route and chat page, add AI SDK UI and AI Elements, and test streaming responses.
- [Nuxt](references/integrations-frameworks-nuxt.md) - Build a tool-calling Mastra agent in Nuxt, create a server route and Vue chat interface with AI SDK UI, and test streamed agent responses.
- [SvelteKit](references/integrations-frameworks-sveltekit.md) - Build a tool-calling Mastra agent in SvelteKit, create server and chat routes, add AI SDK UI, and test the interactive streaming experience.
- [TanStack Start](references/integrations-frameworks-tanstack-start.md) - Build a tool-calling Mastra agent in TanStack Start and use the server adapter to expose Mastra's HTTP API from a catch-all route.
- [React + Vite](references/integrations-frameworks-vite-react.md) - Build a React and Vite chat interface for a tool-calling Mastra agent, configure the standalone server, AI SDK UI, Tailwind, and AI Elements.
- [Arthur](references/integrations-observability-arthur.md) - Export Mastra traces to Arthur Engine or Arthur Cloud for AI observability, configure task routing and credentials, and monitor agent behavior.
- [Firecrawl](references/integrations-tools-firecrawl.md) - Build Mastra tools with Firecrawl so agents and workflows can search, scrape, and extract live web content as markdown or structured JSON.

### Reference

- [Reference: Overview](references/reference.md) - The Reference section provides documentation of Mastra's API, including parameters, types and usage examples.
- [Reference: AcpAgent class](references/reference-acp-acp-agent.md) - The AcpAgent class wraps an Agent Client Protocol (ACP)-compatible coding agent as a Mastra subagent.
- [Reference: createACPTool()](references/reference-acp-create-acp-tool.md) - The createACPTool() function creates a Mastra tool that sends a task string to an Agent Client Protocol (ACP)-compatible coding agent and returns the final ACP response as output.
- [Reference: AgentController](references/reference-agent-controller-agent-controller-class.md) - Use the AgentController class as a shared host for Session instances, then create sessions and manage conversation state, events, and run control.
- [Reference: Session](references/reference-agent-controller-session.md) - Use AgentController Session to manage per-conversation identity, threads, mode, model, run state, grants, and display snapshots within an isolated runtime.
- [Reference: Agent class](references/reference-agents-agent.md) - The Agent class is the foundation for creating AI agents in Mastra. It provides methods for generating responses and streaming interactions.
- [Reference: Channels](references/reference-agents-channels.md) - Channels connect agents to messaging platforms. Configure them via the channels property on the Agent constructor.
- [Reference: createSkill()](references/reference-agents-createSkill.md) - Creates an inline skill that can be passed directly to an agent's skills config without a filesystem or workspace.
- [Reference: DurableAgent](references/reference-agents-durable-agent.md) - DurableAgent wraps an existing Agent with durable execution and resumable streams.
- [Reference: Agent.generate()](references/reference-agents-generate.md) - The .generate() method enables non-streaming response generation from an agent with enhanced capabilities.
- [Reference: Agent.generateLegacy() (Legacy)](references/reference-agents-generateLegacy.md) - The .generateLegacy() method is the legacy version of the agent generation API, used with legacy model adapters to produce text or structured responses.
- [Reference: Agent.getDefaultGenerateOptionsLegacy()](references/reference-agents-getDefaultGenerateOptions.md) - Agents can be configured with default generation options for controlling model behavior, output formatting and tool and workflow calls.
- [Reference: Agent.getDefaultOptions()](references/reference-agents-getDefaultOptions.md) - Agents can be configured with default options for memory usage and output format. Iteration steps can also be configured.
- [Reference: Agent.getDefaultStreamOptionsLegacy()](references/reference-agents-getDefaultStreamOptions.md) - Agents can be configured with default streaming options for memory usage and output format. Iteration steps can also be configured.
- [Reference: Agent.getDescription()](references/reference-agents-getDescription.md) - The .getDescription() method retrieves the description configured for an agent. This method returns a string description that describes the agent's purpose and capabilities.
- [Reference: Agent.getInstructions()](references/reference-agents-getInstructions.md) - The .getInstructions() method retrieves the instructions configured for an agent, resolving them if they're a function.
- [Reference: Agent.getLLM()](references/reference-agents-getLLM.md) - The .getLLM() method retrieves the language model instance configured for an agent, resolving it if it's a function.
- [Reference: Agent.getMemory()](references/reference-agents-getMemory.md) - Use Agent.getMemory() to retrieve the memory system configured for an agent, including request-context resolution when memory is supplied at runtime.
- [Reference: Agent.getMetadata()](references/reference-agents-getMetadata.md) - The .getMetadata() method retrieves the metadata configured for an agent, resolving it if it's a function.
- [Reference: Agent.getModel()](references/reference-agents-getModel.md) - The .getModel() method retrieves the language model configured for an agent, resolving it if it's a function.
- [Reference: .getSkill()](references/reference-agents-getSkill.md) - Retrieves a specific skill by name from the agent's configured skills (both agent-level and workspace skills).
- [Reference: Agent.getVoice()](references/reference-agents-getVoice.md) - The .getVoice() method retrieves the voice provider configured for an agent, resolving it if it's a function.
- [Reference: Agent.listAgents()](references/reference-agents-listAgents.md) - The .listAgents() method retrieves the subagents configured for an agent, resolving them if they're a function.
- [Reference: Agent.listScorers()](references/reference-agents-listScorers.md) - The .listScorers() method retrieves the scoring configuration configured for an agent, resolving it if it's a function.
- [Reference: .listSkills()](references/reference-agents-listSkills.md) - Use Agent.listSkills() to return metadata for every configured agent-level and workspace skill, including the names and descriptions available to the agent.
- [Reference: Agent.listSuspendedRuns()](references/reference-agents-listSuspendedRuns.md) - The .listSuspendedRuns() method lists suspended agent runs from workflow snapshot storage: runs waiting on a tool call requiring approval, or on a tool that called suspend().
- [Reference: Agent.listTools()](references/reference-agents-listTools.md) - The .listTools() method retrieves the tools configured for an agent, resolving them if they're a function.
- [Reference: Agent.listWorkflows()](references/reference-agents-listWorkflows.md) - The .listWorkflows() method retrieves the workflows configured for an agent, resolving them if they're a function.
- [Reference: Agent.network()](references/reference-agents-network.md) - The .network() method enables multi-agent collaboration and routing. This method accepts messages and optional execution options.
- [Reference: MastraAuthAuth0 class](references/reference-auth-auth0.md) - Configure MastraAuthAuth0 for Auth0 authentication, including access-token validation and authenticated user resolution from request headers.
- [Reference: MastraAuthClerk class](references/reference-auth-clerk.md) - The MastraAuthClerk class provides authentication for Mastra applications using Clerk.
- [Reference: IFGAProvider](references/reference-auth-fga.md) - Implement IFGAProvider to authorize users and system actors against Mastra resources with fine-grained authorization checks and provider-specific policies.
- [Reference: MastraAuthFirebase class](references/reference-auth-firebase.md) - The MastraAuthFirebase class provides authentication for Mastra using Firebase Authentication.
- [Reference: MastraAuthGoogle and MastraRBACGoogle](references/reference-auth-google.md) - The MastraAuthGoogle class provides authentication for Mastra using Google Workspace.
- [Reference: MastraJwtAuth class](references/reference-auth-jwt.md) - The MastraJwtAuth class provides a lightweight authentication mechanism for Mastra using JSON Web Tokens (JWTs).
- [Reference: MastraAuthNeon and MastraRBACNeon](references/reference-auth-neon.md) - API reference for the MastraAuthNeon authentication provider and MastraRBACNeon role-based access control provider.
- [Reference: MastraAuthOkta and MastraRBACOkta](references/reference-auth-okta.md) - Use MastraAuthOkta and MastraRBACOkta to authenticate users with Okta and enforce role-based access control for Mastra application resources.
- [Reference: MastraAuthSupabase class](references/reference-auth-supabase.md) - The MastraAuthSupabase class provides authentication for Mastra using Supabase Auth.
- [Reference: MastraAuthWorkos class](references/reference-auth-workos.md) - Configure MastraAuthWorkos for WorkOS authentication, including access-token validation and authenticated user resolution from requests.
- [Reference: MastraBrowser class](references/reference-browser-mastra-browser.md) - The MastraBrowser class is the abstract base class for browser automation providers.
- [Reference: ChannelProvider](references/reference-channels-channel-provider.md) - ChannelProvider is the interface that platform integrations implement to connect agents to a messaging platform.
- [Reference: Classifier](references/reference-classifier-classifier.md) - API reference for classifying JSON-compatible state with typed choice, score, and boolean questions.
- [Reference: buildBasePrompt()](references/reference-coding-agent-build-base-prompt.md) - buildBasePrompt() builds the shared base system prompt for a coding agent: the behavioral instructions that make the agent a good coding assistant.
- [Reference: createCodingAgent()](references/reference-coding-agent-create-coding-agent.md) - Use createCodingAgent() to build a coding agent with a local workspace, task signals, network retries, memory integration, and the goal-judge prompt.
- [Reference: Configuration](references/reference-configuration.md) - Configure a Mastra instance with agents, workflows, storage, logging, observability, server options, processors, deployers, and other supported services.
- [Reference: Mastra.addDynamicWorkflow()](references/reference-core-addDynamicWorkflow.md) - Use Mastra.addDynamicWorkflow() to validate, persist, and register a dynamic workflow definition as a live workflow on the current Mastra instance.
- [Reference: Mastra.addDynamicWorkflows()](references/reference-core-addDynamicWorkflows.md) - The .addDynamicWorkflows() method adds a bundle of dynamic workflow definitions that may reference each other.
- [Reference: Mastra.addGateway()](references/reference-core-addGateway.md) - Dynamically adds a gateway to the Mastra instance. Can be used during or after initialization.
- [Reference: Mastra.getAgent()](references/reference-core-getAgent.md) - The .getAgent() method is used to retrieve an agent. The method accepts the agent's name and an optional version selector.
- [Reference: Mastra.getAgentById()](references/reference-core-getAgentById.md) - The .getAgentById() method retrieves a registered agent by its id. It first searches registered agents by agent.id.
- [Reference: getClassifier()](references/reference-core-getClassifier.md) - The getClassifier() method retrieves a classifier that was registered with the Mastra instance using its registration key.
- [Reference: getClassifierById()](references/reference-core-getClassifierById.md) - The getClassifierById() method retrieves a classifier by its id property, falling back to the registration key.
- [Reference: Mastra.getDeployer()](references/reference-core-getDeployer.md) - The .getDeployer() method is used to retrieve the deployer instance that has been configured in the Mastra instance.
- [Reference: Mastra.getEditor()](references/reference-core-getEditor.md) - The .getEditor() method is used to retrieve the editor instance that has been configured on the Mastra instance.
- [Reference: Mastra.getGateway()](references/reference-core-getGateway.md) - Retrieves a gateway by its registration key (the key used when adding the gateway to Mastra).
- [Reference: Mastra.getGatewayById()](references/reference-core-getGatewayById.md) - Use Mastra.getGatewayById() to retrieve a registered model gateway by its unique gateway ID and handle missing gateway registrations.
- [Reference: Mastra.getLogger()](references/reference-core-getLogger.md) - The .getLogger() method is used to retrieve the logger instance that has been configured in the Mastra instance.
- [Reference: Mastra.getMCPServer()](references/reference-core-getMCPServer.md) - The .getMCPServer() method retrieves an MCP server instance by its registry key (the key used when registering the server in the mcpServers configuration).
- [Reference: Mastra.getMCPServerById()](references/reference-core-getMCPServerById.md) - The .getMCPServerById() method retrieves an MCP server instance by its intrinsic id property.
- [Reference: Mastra.getMemory()](references/reference-core-getMemory.md) - The .getMemory() method retrieves a memory instance from the Mastra registry by its key.
- [Reference: getScorer()](references/reference-core-getScorer.md) - The getScorer() method retrieves a specific scorer that was registered with the Mastra instance using its registration key.
- [Reference: getScorerById()](references/reference-core-getScorerById.md) - The getScorerById() method retrieves a scorer by searching for its id property (or name property as a fallback) rather than the registration key.
- [Reference: Mastra.getServer()](references/reference-core-getServer.md) - The .getServer() method is used to retrieve the server configuration that has been configured in the Mastra instance.
- [Reference: Mastra.getStorage()](references/reference-core-getStorage.md) - The .getStorage() method is used to retrieve the storage instance that has been configured in the Mastra instance.
- [Reference: Mastra.getTool()](references/reference-core-getTool.md) - The .getTool() method retrieves a tool from the Mastra-level registry by its registration key.
- [Reference: Mastra.getToolById()](references/reference-core-getToolById.md) - The .getToolById() method first searches the Mastra-level registry for a tool with a matching intrinsic id.
- [Reference: Mastra.getVector()](references/reference-core-getVector.md) - The .getVector() method is used to retrieve a vector store by its name. The method accepts a single string parameter for the vector store's name.
- [Reference: Mastra.getWorkflow()](references/reference-core-getWorkflow.md) - The .getWorkflow() method is used to retrieve a workflow by its registration key. The method provides full TypeScript type inference for workflow input and output schemas.
- [Reference: Mastra.listAgents()](references/reference-core-listAgents.md) - The .listAgents() method is used to retrieve all agents that have been configured in the Mastra instance.
- [Reference: listClassifiers()](references/reference-core-listClassifiers.md) - The listClassifiers() method returns all classifiers that have been registered with the Mastra instance.
- [Reference: Mastra.listGateways()](references/reference-core-listGateways.md) - Use Mastra.listGateways() to retrieve every registered model gateway as a record indexed by each gateway's registration key.
- [Reference: Mastra.listLogs()](references/reference-core-listLogs.md) - The .listLogs() method is used to retrieve all logs for a specific transport ID. This method requires a configured logger that supports the listLogs operation.
- [Reference: Mastra.listLogsByRunId()](references/reference-core-listLogsByRunId.md) - The .listLogsByRunId() method is used to retrieve logs for a specific run ID and transport ID. This method requires a configured logger that supports the listLogsByRunId operation.
- [Reference: Mastra.listMCPServers()](references/reference-core-listMCPServers.md) - The .listMCPServers() method is used to retrieve all MCP server instances that have been registered in the Mastra instance.
- [Reference: Mastra.listMemory()](references/reference-core-listMemory.md) - The .listMemory() method returns all memory instances registered with the Mastra instance.
- [Reference: listScorers()](references/reference-core-listScorers.md) - The listScorers() method returns all scorers that have been registered with the Mastra instance.
- [Reference: Mastra.listTools()](references/reference-core-listTools.md) - The .listTools() method returns the tools configured on a Mastra instance. The returned record uses Mastra registration keys and tool instances as values.
- [Reference: Mastra.listVectors()](references/reference-core-listVectors.md) - The .listVectors() method is used to retrieve all vector stores that have been configured in the Mastra instance.
- [Reference: Mastra.listWorkflows()](references/reference-core-listWorkflows.md) - The .listWorkflows() method is used to retrieve all workflows that have been configured in the Mastra instance.
- [Reference: Mastra class](references/reference-core-mastra-class.md) - The Mastra class is the central orchestrator in any Mastra application, managing agents, workflows, storage, logging, observability, and more.
- [Reference: MastraModelGateway](references/reference-core-mastra-model-gateway.md) - Extend MastraModelGateway to implement a custom model gateway with provider discovery, model resolution, authentication, and gateway-specific configuration.
- [Reference: Mastra.removeWorkspace()](references/reference-core-removeWorkspace.md) - The .removeWorkspace() method removes a workspace from the Mastra runtime registry. Pass to destroy the workspace before it's removed.
- [Reference: Mastra.setLogger()](references/reference-core-setLogger.md) - The .setLogger() method is used to set the logger for all components (agents, workflows, etc.) in the Mastra instance.
- [Reference: Mastra.setStorage()](references/reference-core-setStorage.md) - The .setStorage() method is used to set the storage instance for the Mastra instance. This method accepts a single MastraCompositeStore parameter.
- [Reference: dataset.addItem()](references/reference-datasets-addItem.md) - Adds a single item to the dataset. Each item has an input and optional ground truth.
- [Reference: dataset.addItems()](references/reference-datasets-addItems.md) - Use dataset.addItems() to add multiple items to a Mastra dataset in one bulk operation, with schema validation and version tracking for the inserted records.
- [Reference: DatasetsManager.compareExperiments()](references/reference-datasets-compareExperiments.md) - Compares two or more experiments, producing per-item and per-scorer comparisons. Requires at least two experiment IDs.
- [Reference: DatasetsManager.create()](references/reference-datasets-create.md) - Creates a new dataset. Use Standard JSON Schema (Zod, Valibot, ArkType, etc.) for defining schemas.
- [Reference: dataset.createExperiment()](references/reference-datasets-createExperiment.md) - Use dataset.createExperiment() to create a caller-driven experiment without starting a run, then submit results and finalize it from your own orchestrator.
- [Reference: Dataset class](references/reference-datasets-dataset.md) - The Dataset class provides methods for item CRUD, versioning, and experiment management on a single dataset.
- [Reference: DatasetsManager](references/reference-datasets-datasets-manager.md) - The DatasetsManager class provides the public API for managing datasets, including CRUD operations and cross-dataset experiment comparisons.
- [Reference: DatasetsManager.delete()](references/reference-datasets-delete.md) - Use DatasetsManager.delete() to remove a dataset by ID together with its items and versions, detaching any experiments that reference it.
- [Reference: deleteExperiment()](references/reference-datasets-deleteExperiment.md) - Use dataset.deleteExperiment() or DatasetsManager.deleteExperiment() to delete an experiment together with its results and observability traces.
- [Reference: dataset.deleteItem()](references/reference-datasets-deleteItem.md) - Use dataset.deleteItem() to remove one dataset item by ID and create the corresponding dataset version and history changes.
- [Reference: dataset.deleteItems()](references/reference-datasets-deleteItems.md) - Use dataset.deleteItems() to remove multiple dataset items in one bulk operation and record the resulting dataset version changes.
- [Reference: dataset.finalizeExperiment()](references/reference-datasets-finalizeExperiment.md) - Finalizes a caller-driven experiment created with createExperiment(), with or without a target.
- [Reference: DatasetsManager.get()](references/reference-datasets-get.md) - Retrieves an existing dataset by ID. Throws a MastraError if the dataset doesn't exist.
- [Reference: dataset.getDetails()](references/reference-datasets-getDetails.md) - Retrieves the full dataset record from storage, including metadata, schemas, and version information.
- [Reference: dataset.getExperiment()](references/reference-datasets-getExperiment.md) - Use dataset.getExperiment() to retrieve a specific experiment by ID, including its status, metadata, target, scorer configuration, and result summary.
- [Reference: dataset.getItem()](references/reference-datasets-getItem.md) - Retrieves a single dataset item by ID, optionally at a specific dataset version.
- [Reference: dataset.getItemHistory()](references/reference-datasets-getItemHistory.md) - Retrieves the full SCD-2 (Slowly Changing Dimension Type 2) history of a specific item across all dataset versions.
- [Reference: DatasetsManager.list()](references/reference-datasets-list.md) - Lists datasets with pagination and optional filters. Filters are applied at the storage layer, so callers don't need to post-filter results.
- [Reference: dataset.listExperimentResults()](references/reference-datasets-listExperimentResults.md) - Lists individual item results for a specific experiment with optional filters and pagination. Filters are applied at the storage layer.
- [Reference: dataset.listExperiments()](references/reference-datasets-listExperiments.md) - Lists experiments (runs) for this dataset with optional filters and pagination. Filters are applied at the storage layer, so results are always scoped to the current dataset.
- [Reference: dataset.listItems()](references/reference-datasets-listItems.md) - Lists items in the dataset. When only version is provided, returns a bare DatasetItem[] snapshot of every item at that version.
- [Reference: dataset.listVersions()](references/reference-datasets-listVersions.md) - Use dataset.listVersions() to retrieve a dataset's version history with pagination, including the version number and creation timestamp of each version.
- [Reference: dataset.purgeItem()](references/reference-datasets-purgeItem.md) - Documentation for the `dataset.purgeItem()` method, which permanently scrubs an item's stored content.
- [Reference: dataset.runExperimentItem()](references/reference-datasets-runExperimentItem.md) - Execute one experiment item server-side by running its target and resolved scorers, then upsert the result keyed by experimentId, itemId, and attempt.
- [Reference: dataset.startExperiment()](references/reference-datasets-startExperiment.md) - Runs an experiment on the dataset and waits for completion. Executes all items against a target (agent, workflow, or scorer) with optional scoring.
- [Reference: dataset.startExperimentAsync()](references/reference-datasets-startExperimentAsync.md) - Starts an experiment asynchronously (fire-and-forget). Returns immediately with the experiment ID and a 'pending' status.
- [Reference: dataset.submitExperimentResult()](references/reference-datasets-submitExperimentResult.md) - Submits (or re-submits) one externally computed item result for a target-less experiment created with createExperiment().
- [Reference: dataset.update()](references/reference-datasets-update.md) - Updates dataset metadata, name, description, and/or schemas. Use Standard JSON Schema (Zod, Valibot, ArkType, etc.) for defining schemas.
- [Reference: dataset.updateExperiment()](references/reference-datasets-updateExperiment.md) - Use dataset.updateExperiment() to rename an experiment or change its description and metadata after it has been created.
- [Reference: dataset.updateItem()](references/reference-datasets-updateItem.md) - Use dataset.updateItem() to change selected fields on an existing dataset item while validating data and preserving dataset version history.
- [Reference: BlobStoreProvider](references/reference-editor-blob-store-provider.md) - BlobStoreProvider is the interface a package implements to register a blob store with MastraEditor.
- [Reference: BrowserProvider](references/reference-editor-browser-provider.md) - BrowserProvider is the interface a package implements to register a browser with MastraEditor.
- [Reference: FilesystemProvider](references/reference-editor-filesystem-provider.md) - FilesystemProvider is the interface a package implements to register a filesystem with MastraEditor.
- [Reference: MastraEditor class](references/reference-editor-mastra-editor.md) - The MastraEditor class sets up the editor system. Pass it to the Mastra constructor to turn on editor features like prompt blocks, agent code override, versioning, and tool providers.
- [Reference: ProcessorProvider](references/reference-editor-processor-provider.md) - ProcessorProvider is the interface a package implements to register a configurable processor with MastraEditor.
- [Reference: Prompt blocks](references/reference-editor-prompt-blocks.md) - Use Editor prompt blocks to define reusable instruction templates, typed values, display conditions, version history, and agent prompt-block APIs.
- [Reference: SandboxProvider](references/reference-editor-sandbox-provider.md) - SandboxProvider is the interface a package implements to register a sandbox with MastraEditor.
- [Reference: StorageBrowserRef](references/reference-editor-storage-browser-ref.md) - StorageBrowserRef is the inline browser configuration attached to a stored agent.
- [Reference: StorageWorkspaceRef](references/reference-editor-storage-workspace-ref.md) - StorageWorkspaceRef is the discriminated union used to attach a workspace to a stored agent.
- [Reference: Tool configuration](references/reference-editor-tools.md) - Configure Editor agent tools from Mastra, MCP, workspace, and provider sources, including descriptions, display conditions, and resolution order.
- [Reference: Versioning](references/reference-editor-versioning.md) - Editor versions stored agents and prompt blocks. Database-backed resources use draft and publish operations.
- [Reference: createClassifierScorer](references/reference-evals-create-classifier-scorer.md) - Create a Mastra scorer that projects one configured Classifier question into a numeric score while preserving typed evidence.
- [Reference: createScorer](references/reference-evals-create-scorer.md) - Mastra provides a unified createScorer factory that allows you to define custom scorers for evaluating input/output pairs.
- [Reference: filterRun()](references/reference-evals-filter-run.md) - Creates a prepareRun function from declarative options. Pass the result to createScorer() to filter messages and limit context size.
- [Reference: MastraScorer](references/reference-evals-mastra-scorer.md) - Use the MastraScorer base class to understand the shared scorer contract, lifecycle, run inputs, outputs, tracing behavior, and custom scorer implementation.
- [Reference: notScorable()](references/reference-evals-not-scorable.md) - Return notScorable() from a scorer step when a run has nothing to evaluate. Remaining steps are skipped and the run stays out of aggregates.
- [Reference: runEvals](references/reference-evals-run-evals.md) - The runEvals function enables batch evaluation of agents and workflows by running multiple test cases against scorers concurrently.
- [config.ts](references/reference-file-based-agents-config.md) - An agent's config.ts sets its model and runtime options. Use it for options that belong to the Agent itself, while sibling files provide instructions, tools, skills, et cetera.
- [Instructions](references/reference-file-based-agents-instructions.md) - An agent's instructions hold its always-on system prompt: the model reads it on every turn. Use them to define the agent's identity, tone, role, and standing rules.
- [Logger](references/reference-file-based-agents-logger.md) - Mastra sets the project's logger from a logger.ts file directly under src/mastra/.
- [Memory](references/reference-file-based-agents-memory.md) - A file-based agent gets memory from a memory.ts file that default-exports a Memory instance.
- [Observability](references/reference-file-based-agents-observability.md) - Mastra configures observability from an observability.ts file directly under src/mastra/.
- [Processors](references/reference-file-based-agents-processors.md) - Add input and output processors to file-based agents under processors/input and processors/output, with module exports discovered during build.
- [Schedules](references/reference-file-based-agents-schedules.md) - A file-based agent discovers schedules from its schedules/ directory. Each file declares one recurring task: a cron expression plus what the agent should do when it fires.
- [Scorers](references/reference-file-based-agents-scorers.md) - A file-based agent discovers scorers from its scorers/ directory. Use this page for the file-based convention; use the scorers guide for built-in scorers, custom scorers, and sampling.
- [Server](references/reference-file-based-agents-server.md) - Mastra configures its HTTP server from a server.ts file directly under src/mastra/.
- [Skills](references/reference-file-based-agents-skills.md) - A file-based agent discovers skills from its skills/ directory and bundles them at build time.
- [Storage](references/reference-file-based-agents-storage.md) - Mastra sets the project's default storage from a storage.ts file directly under src/mastra/.
- [Studio](references/reference-file-based-agents-studio.md) - Configure Mastra Studio by exporting Studio options from src/mastra/studio.ts in a file-based Mastra project.
- [Subagents](references/reference-file-based-agents-subagents.md) - A file-based agent can declare subagents, specialist child agents it delegates to.
- [Tools](references/reference-file-based-agents-tools.md) - A file-based agent discovers tools from .ts and .js files directly under its tools/ directory.
- [Workflows](references/reference-file-based-agents-workflows.md) - Mastra discovers project-level workflows from .ts and .js files under src/mastra/workflows/.
- [Workspace](references/reference-file-based-agents-workspace.md) - A workspace assembles capabilities such as filesystem access and command execution. The configured backends determine which tools are available.
- [Reference: Knowledge class](references/reference-knowledge-knowledge-class.md) - Constructor options and methods of the Knowledge class.
- [Reference: knowledgeMemoryScopes()](references/reference-knowledge-knowledge-memory-scopes.md) - Declarations for Memory thread and resource scopes and a tenant scope, for the Knowledge scopes option.
- [Reference: Knowledge tools](references/reference-knowledge-knowledge-tools.md) - Arguments, operations, required roles and errors of the six Knowledge tools.
- [Reference: Limits](references/reference-knowledge-limits.md) - Size limits for notes, pages, searches and pinned context in Knowledge.
- [Reference: Scope declarations](references/reference-knowledge-scope-declarations.md) - The Knowledge scopes option: patterns and params, access rules, belongsTo, child scopes, template pages, labels, renaming, and the errors each raises.
- [Reference: Tool instructions](references/reference-knowledge-tool-instructions.md) - The usage instructions Knowledge adds to agents with its tools, and how to change or turn them off.
- [Reference: PinoLogger](references/reference-logging-pino-logger.md) - A Logger instance is created using new PinoLogger() and provides methods to record events at severity levels.
- [Manual install](references/reference-manual-install.md) - Create a runnable Mastra project without the CLI by installing the required packages and configuring TypeScript, then define an agent and Mastra entry point.
- [Reference: Memory.deleteMessages()](references/reference-memory-deleteMessages.md) - Use Memory.deleteMessages() to remove multiple messages by ID from a conversation thread and its configured storage provider.
- [Reference: Memory class](references/reference-memory-memory-class.md) - The Memory class provides a reliable system for managing conversation history and thread-based message storage in Mastra.
- [Reference: Observational Memory](references/reference-memory-observational-memory.md) - Observational Memory (OM) is Mastra's memory system for long-context agentic memory. An Observer watches conversations and creates observations.
- [Reference: SerializedMemoryConfig](references/reference-memory-serialized-memory-config.md) - SerializedMemoryConfig is the JSON-serializable subset of Memory configuration that lives on a stored agent record.
- [Reference: Memory.settled()](references/reference-memory-settled.md) - Use Memory.settled() to wait for asynchronous memory work, including working-memory updates and observational memory, before closing storage.
- [Reference: Feedback](references/reference-observability-feedback.md) - Feedback APIs store and query human-in-the-loop observability signals such as ratings, thumbs, comments, and corrections.
- [Reference: Metric queries](references/reference-observability-metrics-queries.md) - Metric queries read raw and aggregated metric data from the observability storage domain. For exporter and storage setup, see the Metrics overview.
- [Reference: DatadogBridge](references/reference-observability-tracing-bridges-datadog.md) - Configure DatadogBridge for bidirectional context propagation between Mastra tracing and Datadog APM spans, including trace and parent IDs.
- [Reference: OtelBridge](references/reference-observability-tracing-bridges-otel.md) - Enables bidirectional integration between Mastra tracing and OpenTelemetry infrastructure. Creates native OTEL spans for Mastra operations and inherits context from active OTEL spans.
- [Reference: Configuration](references/reference-observability-tracing-configuration.md) - Configure Mastra observability instances, tracing exporters, sampling, propagation, span filters, and the global observability registry.
- [Reference: ConsoleExporter](references/reference-observability-tracing-exporters-console-exporter.md) - Configure ConsoleExporter to print Mastra trace events, spans, attributes, and lifecycle updates to the console for local debugging.
- [Reference: DatadogExporter](references/reference-observability-tracing-exporters-datadog.md) - Configure DatadogExporter to send Mastra traces into Datadog LLM Observability, supporting application monitoring and analysis of spans and AI performance.
- [Reference: Tracing](references/reference-observability-tracing-instances.md) - Use ObservabilityInstance and its default implementation to create, manage, flush, and shut down Mastra tracing instances and exporters.
- [Reference: Interfaces](references/reference-observability-tracing-interfaces.md) - Use Mastra tracing interfaces to type spans, attributes, exporters, samplers, propagation context, and observability event payloads.
- [Reference: Span filtering](references/reference-observability-tracing-span-filtering.md) - Span filtering controls which spans are exported from an observability config. Use it to reduce noise or lower per-span costs.
- [Reference: Spans](references/reference-observability-tracing-spans.md) - Span interface, used internally for tracing. Extends BaseSpan with lifecycle methods and properties.
- [Reference: AgentsMDInjector](references/reference-processors-agents-md-injector.md) - Load directory instructions from completed tool calls and configure reader-owned path identities for deduplication.
- [Reference: BatchPartsProcessor](references/reference-processors-batch-parts-processor.md) - The BatchPartsProcessor is an output processor that batches multiple stream parts together to reduce the frequency of emissions during streaming.
- [Reference: ClassifierProcessor](references/reference-processors-classifier-processor.md) - Use ClassifierProcessor to run a typed Classifier over agent input, output, or stream chunks and abort or filter content based on the answers.
- [Reference: CyberRefusalHandler](references/reference-processors-cyber-refusal-handler.md) - The CyberRefusalHandler retries once when an OpenAI or Anthropic cybersecurity safeguard refuses a step.
- [Reference: FileUploadProcessor](references/reference-processors-file-upload-processor.md) - The FileUploadProcessor uploads the files a user sends to a workspace sandbox and gives the model the sandbox path instead of the file content.
- [Reference: LanguageDetector](references/reference-processors-language-detector.md) - The LanguageDetector is an input processor that identifies the language of input text and optionally translates it to a target language for consistent processing.
- [Reference: MemoryInputFilter](references/reference-processors-memory-input-filter.md) - The MemoryInputFilter is an input processor that filters client-echoed conversation history before memory loads stored messages.
- [Reference: MessageHistory](references/reference-processors-message-history-processor.md) - The MessageHistory is a hybrid processor that handles both retrieval and persistence of message history.
- [Reference: ModelSelectionProcessor](references/reference-processors-model-selection-processor.md) - Use ModelSelectionProcessor to classify an incoming request once and downgrade the agent to a cheaper model when the classifier is confident a cheaper model can handle the request.
- [Reference: ModerationProcessor](references/reference-processors-moderation-processor.md) - Use ModerationProcessor for LLM-based input and output moderation across configurable content categories, thresholds, strategies, and model settings.
- [Reference: PIIDetector](references/reference-processors-pii-detector.md) - The PIIDetector is a hybrid processor that can be used for both input and output processing to detect and redact personally identifiable information (PII) for privacy compliance.
- [Reference: PrefillErrorHandler](references/reference-processors-prefill-error-handler.md) - The PrefillErrorHandler is an error processor that handles assistant-response prefill errors.
- [Reference: Processor interface](references/reference-processors-processor-interface.md) - The Processor interface defines the contract for all processors in Mastra. Processors can implement one or more methods to handle different stages of the agent execution pipeline.
- [Reference: PromptInjectionDetector](references/reference-processors-prompt-injection-detector.md) - Use PromptInjectionDetector to block prompt injection, jailbreak, and system-manipulation attempts before messages reach the language model.
- [Reference: ProviderHistoryCompat](references/reference-processors-provider-history-compat.md) - The ProviderHistoryCompat processor handles provider-specific history incompatibilities.
- [Reference: RegexFilterProcessor](references/reference-processors-regex-filter-processor.md) - The RegexFilterProcessor uses regex pattern matching to filter, redact, or block content in agent messages.
- [Reference: ResponseCache](references/reference-processors-response-cache.md) - ResponseCache is an input processor that caches LLM responses on the request/response boundary inside the agentic loop.
- [Reference: SemanticRecall](references/reference-processors-semantic-recall-processor.md) - The SemanticRecall is a hybrid processor that enables semantic search over conversation history using vector embeddings.
- [Reference: SkillSearchProcessor](references/reference-processors-skill-search-processor.md) - The SkillSearchProcessor is an input processor that enables on-demand skill discovery and loading.
- [Reference: SkillsProcessor](references/reference-processors-skills-processor.md) - The SkillsProcessor is an input processor that lists the available skills in the system message, or points the agent at skill_search instead.
- [Reference: StreamErrorRetryProcessor](references/reference-processors-stream-error-retry-processor.md) - StreamErrorRetryProcessor is an error processor that retries transient LLM API and stream failures.
- [Reference: SystemPromptScrubber](references/reference-processors-system-prompt-scrubber.md) - The SystemPromptScrubber is an output processor that detects and handles system prompts, instructions, and other revealing information that could introduce security vulnerabilities.
- [Reference: TokenCostControl](references/reference-processors-token-cost-control.md) - The TokenCostControl enforces monetary cost limits across the agentic loop, blocking or warning when a configurable cost threshold is exceeded.
- [Reference: TokenLimiterProcessor](references/reference-processors-token-limiter-processor.md) - Use TokenLimiterProcessor to constrain message tokens during prompt, input, or output processing with configurable limits and strategies.
- [Reference: ToolCallFilter](references/reference-processors-tool-call-filter.md) - The ToolCallFilter is an input processor that filters out tool calls and their results from the prompt sent to the model.
- [Reference: ToolSearchProcessor](references/reference-processors-tool-search-processor.md) - The ToolSearchProcessor is an input processor that enables runtime-defined tool discovery and loading.
- [Reference: UnicodeNormalizer](references/reference-processors-unicode-normalizer.md) - Use UnicodeNormalizer to normalize input text to Unicode NFKC form, standardize whitespace, and optionally strip control characters before messages reach the language model.
- [Reference: UnsupportedFileHandler](references/reference-processors-unsupported-file-handler.md) - The UnsupportedFileHandler is an error processor that uploads or notes the files a model rejects and calls the model again.
- [Reference: WorkingMemory](references/reference-processors-working-memory-processor.md) - The WorkingMemory is an input processor that injects working memory data as a system message.
- [Project structure](references/reference-project-structure.md) - Your new Mastra project, created with the create mastra command, comes with a predefined set of files and folders to help you get started.
- [Reference: PubSub](references/reference-pubsub-base.md) - Extend the PubSub abstract class to implement Mastra event publishing, subscriptions, message delivery, and provider lifecycle behavior.
- [Reference: CachingPubSub](references/reference-pubsub-caching-pubsub.md) - CachingPubSub wraps any PubSub implementation and adds event caching and replay.
- [Reference: EventEmitterPubSub](references/reference-pubsub-event-emitter.md) - EventEmitterPubSub is the default PubSub implementation. It delivers events in-process using a Node.js EventEmitter, so it works without any external service.
- [Reference: GoogleCloudPubSub](references/reference-pubsub-google-cloud-pubsub.md) - Configure GoogleCloudPubSub to deliver Mastra events through Google Cloud Pub/Sub topics and subscriptions in distributed deployments.
- [Reference: LeaseProvider](references/reference-pubsub-lease-provider.md) - LeaseProvider is the distributed leasing contract, separate from event delivery (PubSub).
- [Reference: RedisStreamsPubSub](references/reference-pubsub-redis-streams.md) - RedisStreamsPubSub is a PubSub implementation backed by Redis Streams. It delivers events across processes and hosts, with persistence, consumer groups, and redelivery on failure.
- [Reference: UnixSocketPubSub](references/reference-pubsub-unix-socket-pubsub.md) - UnixSocketPubSub is a PubSub implementation that delivers events across processes on a single host using a Unix domain socket.
- [Reference: ValkeyStreamsPubSub](references/reference-pubsub-valkey-streams.md) - ValkeyStreamsPubSub is a PubSub and LeaseProvider implementation backed by Valkey Streams through Valkey GLIDE.
- [Chunking and embedding documents](references/reference-rag-chunking-and-embedding.md) - Chunk documents with MDocument, generate embeddings through the AI SDK, and prepare text and metadata for vector storage and RAG retrieval.
- [Reference: DatabaseConfig](references/reference-rag-database-config.md) - The DatabaseConfig type allows you to specify database-specific configurations when using vector query tools.
- [Reference: Embed](references/reference-rag-embeddings.md) - Mastra uses the AI SDK's embed and embedMany functions to generate vector embeddings for text inputs, enabling similarity search and RAG workflows.
- [GraphRAG](references/reference-rag-graph-rag-guide.md) - Graph-based retrieval enhances traditional vector search by following relationships between chunks of information.
- [RAG (Retrieval-Augmented Generation) in Mastra](references/reference-rag-overview.md) - RAG in Mastra helps you enhance LLM outputs by incorporating relevant context from your own data sources, improving accuracy and grounding responses in real information.
- [Retrieval, semantic search, reranking](references/reference-rag-retrieval.md) - After storing embeddings, you need to retrieve relevant chunks to answer user queries.
- [Storing embeddings in a vector database](references/reference-rag-vector-databases.md) - After generating embeddings, you need to store them in a database that supports vector similarity search.
- [Reference: mastra.schedules](references/reference-schedules-overview.md) - mastra.schedules is the CRUD service for persisted cron schedules. Use it to create, list, update, pause, resume, manually run, and delete schedules for agents or workflows.
- [Reference: MastraServer](references/reference-server-mastra-server.md) - The MastraServer abstract class is the base for all server adapters. Extend this class to create adapters for frameworks other than Hono or Express.
- [Reference: registerApiRoute()](references/reference-server-register-api-route.md) - The registerApiRoute() function creates custom HTTP routes that integrate with the Mastra server. Routes can include OpenAPI metadata to appear in the Swagger UI documentation.
- [Reference: createNotificationInboxTool()](references/reference-signals-create-notification-inbox-tool.md) - createNotificationInboxTool() creates a Mastra tool that lets an agent inspect and manage notification inbox records for the current thread.
- [Reference: Notifications](references/reference-signals-notifications.md) - Reference for notification inbox records, priorities, statuses, delivery decisions, delivery policies, dispatch configuration, and the signal metadata consumers receive.
- [Reference: SignalProvider](references/reference-signals-signal-provider.md) - Extend SignalProvider to monitor APIs, webhooks, or event streams and push external notifications into subscribed Mastra agent threads.
- [Reference: TaskSignalProvider](references/reference-signals-task-signal-provider.md) - Register TaskSignalProvider to add task_write, task_update, task_complete, and task_check tools with TaskStateProcessor-backed durable task state.
- [Reference: Thread events](references/reference-signals-thread-events.md) - Reference for subscribeThreadEvents(), its scope options, unsubscribe behavior, and the public queue-count-changed thread event.
- [Reference: WebhookSignalProvider](references/reference-signals-webhook-signal-provider.md) - Use WebhookSignalProvider for push-based signals that route incoming webhook payloads to subscribed agent threads and pending signal handlers.
- [Reference: Composite storage](references/reference-storage-composite.md) - MastraCompositeStore can compose storage domains from different providers. Use it when you need different databases for different purposes.
- [Reference: Storage](references/reference-storage-overview.md) - Mastra storage is organized into domains. Each domain owns a set of tables or collections.
- [Reference: Storage retention (prune)](references/reference-storage-retention.md) - prune() deletes rows. It caps growth and is safe to run against large tables (batched, bounded, resumable, cancellable).
- [Reference: MastraModelOutput](references/reference-streaming-agents-MastraModelOutput.md) - The MastraModelOutput class is returned by .stream() and provides both streaming and promise-based access to model outputs.
- [Reference: Agent.streamLegacy() (Legacy)](references/reference-streaming-agents-streamLegacy.md) - The .streamLegacy() method is the legacy version of the agent streaming API, used for real-time streaming of responses from V1 model agents.
- [Reference: Agent.streamUntilIdle()](references/reference-streaming-agents-streamUntilIdle.md) - streamUntilIdle() streams an agent's response and keeps the stream open until every background task dispatched during the run completes.
- [Reference: ChunkType](references/reference-streaming-ChunkType.md) - The ChunkType type defines the mastra format of stream chunks that can be emitted during streaming responses from agents.
- [Reference: smoothStream()](references/reference-streaming-smoothStream.md) - smoothStream() creates an experimental transform stream that buffers text and reasoning deltas before emitting them in consistent chunks.
- [Reference: Run.observeStream()](references/reference-streaming-workflows-observeStream.md) - Use Run.observeStream() to reopen a ReadableStream for an active workflow run and continue observing events after the original stream is unavailable.
- [Reference: Run.resumeStream()](references/reference-streaming-workflows-resumeStream.md) - The .resumeStream() method resumes a suspended workflow run with new data, allowing you to continue execution from a specific step and to observe the stream of events.
- [Reference: Run.stream()](references/reference-streaming-workflows-stream.md) - The .stream() method enables real-time streaming of responses from a workflow. It returns a ReadableStream of events directly.
- [Reference: Run.timeTravelStream()](references/reference-streaming-workflows-timeTravelStream.md) - The .timeTravelStream() method re-executes a workflow starting from any specific step with streaming events.
- [Reference: Templates](references/reference-templates-overview.md) - This reference explains how to use existing Mastra templates and create your own. It also covers contributing templates to the community ecosystem.
- [Reference: askUserTool](references/reference-tools-ask-user-tool.md) - A built-in, agent-agnostic tool that asks the user a question and waits for their response. The tool supports free-text questions, single-select prompts, and multi-select prompts.
- [Reference: createBedrockKBTool()](references/reference-tools-bedrock-kb-tool.md) - The createBedrockKBTool() function creates a tool that retrieves relevant documents from an Amazon Bedrock Knowledge Base.
- [Reference: createCodeMode()](references/reference-tools-create-code-mode.md) - The createCodeMode() function returns a tool and generated instructions that let an agent run multi-tool computations as one TypeScript function.
- [Reference: createTool()](references/reference-tools-create-tool.md) - The createTool() function is used to define custom tools that your Mastra agents can execute.
- [Reference: createGraphRAGTool()](references/reference-tools-graph-rag-tool.md) - Use createGraphRAGTool() to build semantic relationships between document chunks and retrieve connected context for graph-based RAG queries.
- [Reference: submitPlanTool](references/reference-tools-submit-plan-tool.md) - A built-in, agent-agnostic tool that submits an implementation plan for user review. The agent writes a plan to a markdown file and passes the file path to this tool.
- [Reference: Task tools](references/reference-tools-task-tools.md) - Four built-in, agent-agnostic tools that manage a structured task list for an agent run.
- [Reference: createVectorQueryTool()](references/reference-tools-vector-query-tool.md) - The createVectorQueryTool() function creates a tool for semantic search over vector stores.
- [Reference: CompositeVoice](references/reference-voice-composite-voice.md) - The CompositeVoice class allows you to combine different voice providers for text-to-speech and speech-to-text operations.
- [Reference: MastraVoice](references/reference-voice-mastra-voice.md) - The MastraVoice class is an abstract base class that defines the core interface for voice services in Mastra.
- [Voice in Mastra](references/reference-voice-overview.md) - Use Mastra Voice for text-to-speech, speech-to-text, and real-time speech-to-speech interactions through a unified provider interface.
- [Speech-to-Speech capabilities in Mastra](references/reference-voice-speech-to-speech.md) - Speech-to-Speech (STS) in Mastra provides a standardized interface for real-time interactions across multiple providers.
- [Speech-to-Text (STT)](references/reference-voice-speech-to-text.md) - Speech-to-Text (STT) in Mastra provides a standardized interface for converting audio input into text across multiple service providers.
- [Text-to-Speech (TTS)](references/reference-voice-text-to-speech.md) - Text-to-Speech (TTS) in Mastra offers a unified API for synthesizing spoken audio from text using providers.
- [Reference: voice.addInstructions()](references/reference-voice-voice.addInstructions.md) - The addInstructions() method equips a voice provider with instructions that guide the model's behavior during real-time interactions.
- [Reference: voice.addTools()](references/reference-voice-voice.addTools.md) - The addTools() method equips a voice provider with tools (functions) that the model can call during real-time interactions.
- [Reference: voice.connect()](references/reference-voice-voice.connect.md) - The connect() method establishes a WebSocket or WebRTC connection for real-time speech-to-speech communication.
- [Reference: Voice events](references/reference-voice-voice.events.md) - Handle events emitted by real-time Mastra voice providers for connection state, audio, transcripts, responses, errors, and tool calls.
- [Reference: voice.listen()](references/reference-voice-voice.listen.md) - The listen() method is a core function available in all Mastra voice providers that converts speech to text.
- [Reference: voice.on()](references/reference-voice-voice.on.md) - Use voice.on() to register listeners for real-time voice events, including audio, transcripts, responses, errors, and connection changes.
- [Reference: voice.speak()](references/reference-voice-voice.speak.md) - The speak() method is a core function available in all Mastra voice providers that converts text to speech.
- [Reference: Workers](references/reference-workers-overview.md) - Use Mastra workers as background processing units for workflow orchestration, cron scheduling, durable execution, and asynchronous tasks.
- [Reference: Dynamic workflow definition](references/reference-workflows-dynamic-workflow-definition.md) - A dynamic workflow definition is a JSON-compatible DynamicWorkflowGraph accepted by Mastra.addDynamicWorkflow(), the stored-workflow server routes, and the Client SDK workflows API.
- [Reference: Run class](references/reference-workflows-run.md) - The Run class represents a workflow execution instance, providing methods to start, resume, stream, and monitor workflow execution.
- [Reference: Run.cancel()](references/reference-workflows-run-methods-cancel.md) - The .cancel() method cancels a workflow run, stopping execution and cleaning up resources.
- [Reference: Run.restart()](references/reference-workflows-run-methods-restart.md) - The .restart() method restarts an active workflow run that lost connection to the server, allowing you to continue execution from the moment it lost connection (the last active step).
- [Reference: Run.resume()](references/reference-workflows-run-methods-resume.md) - The .resume() method resumes a suspended workflow run with new data, allowing you to continue execution from a specific step.
- [Reference: Run.start()](references/reference-workflows-run-methods-start.md) - The .start() method starts a workflow run with input data, allowing you to execute the workflow from the beginning.
- [Reference: Run.startAsync()](references/reference-workflows-run-methods-startAsync.md) - The .startAsync() method starts a workflow run without waiting for completion. It returns immediately with the runId, allowing the workflow to execute in the background.
- [Reference: Run.timeTravel()](references/reference-workflows-run-methods-timeTravel.md) - The .timeTravel() method re-executes a workflow starting from any specific step, using either stored snapshot data or custom context you provide.
- [Reference: Step class](references/reference-workflows-step.md) - The Step class defines individual units of work within a workflow, encapsulating execution logic, data validation, and input/output handling.
- [Reference: Workflow class](references/reference-workflows-workflow.md) - The Workflow class enables you to create state machines for complex sequences of operations with conditional branching and data validation.
- [Reference: Workflow.agent()](references/reference-workflows-workflow-methods-agent.md) - Use Workflow.agent() to add a portable agent step with prompt input, text or structured output, runtime agent lookup, retries, scorers, and metadata.
- [Reference: Workflow.branch()](references/reference-workflows-workflow-methods-branch.md) - The .branch() method creates conditional branches between workflow steps, allowing for different paths to be taken based on the result of a previous step.
- [Reference: Workflow.classifier()](references/reference-workflows-workflow-methods-classifier.md) - Use Workflow.classifier() to evaluate workflow data with a configured classifier and return typed answers and token usage.
- [Reference: Workflow.commit()](references/reference-workflows-workflow-methods-commit.md) - Use Workflow.commit() to validate and finalize a workflow definition, returning a committed graph that's ready to create runs.
- [Reference: Workflow.createRun()](references/reference-workflows-workflow-methods-create-run.md) - The .createRun() method creates a new workflow run instance, allowing you to execute the workflow with specific input data.
- [Reference: Workflow.dountil()](references/reference-workflows-workflow-methods-dountil.md) - The .dountil() method executes a step until a condition is met. It always runs the step at least once before evaluating the condition.
- [Reference: Workflow.dowhile()](references/reference-workflows-workflow-methods-dowhile.md) - The .dowhile() method executes a step while a condition is met. It always runs the step at least once before evaluating the condition.
- [Reference: Workflow.foreach()](references/reference-workflows-workflow-methods-foreach.md) - The .foreach() method creates a loop that executes a step for each item in an array. It always returns an array containing the output from each iteration, preserving the original order.
- [Reference: Workflow.map()](references/reference-workflows-workflow-methods-map.md) - The .map() method maps output data from a previous step to the input of a subsequent step, allowing you to transform data between steps.
- [Reference: Workflow.parallel()](references/reference-workflows-workflow-methods-parallel.md) - Use Workflow.parallel() to run multiple steps concurrently and wait for every branch before passing their combined results to later workflow steps.
- [Reference: Workflow.sleep()](references/reference-workflows-workflow-methods-sleep.md) - The .sleep() method pauses execution for a specified number of milliseconds. It accepts either a static number or a callback function for runtime-defined delays.
- [Reference: Workflow.sleepUntil()](references/reference-workflows-workflow-methods-sleepUntil.md) - Use Workflow.sleepUntil() to pause workflow execution until a specified date and resume the run through the configured execution engine.
- [Reference: Workflow.then()](references/reference-workflows-workflow-methods-then.md) - The .then() method creates a sequential dependency between workflow steps, ensuring steps execute in a specific order.
- [Reference: Workflow.tool()](references/reference-workflows-workflow-methods-tool.md) - The .tool() method adds a tool as a declarative step. The tool's own input and output schemas apply, so the previous step's output must satisfy the tool's input schema.
- [Reference: Workflow state reader](references/reference-workflows-workflow-state-reader.md) - Use workflow state reader helpers to inspect WorkflowState status, step inputs and outputs, suspended paths, and resume labels without parsing snapshots.
- [Reference: FactorySandbox](references/reference-workspace-factory-sandbox.md) - The host contract Mastra Factory uses to construct a session sandbox, build its repository template, validate environment settings and run template builds.
- [Reference: WorkspaceFilesystem](references/reference-workspace-filesystem.md) - The WorkspaceFilesystem interface defines how workspaces interact with file storage.
- [Reference: LocalFilesystem](references/reference-workspace-local-filesystem.md) - Stores files in a directory on the local filesystem. For interface details, see WorkspaceFilesystem Interface.
- [Reference: LocalSandbox](references/reference-workspace-local-sandbox.md) - Executes commands on the local system. For interface details, see WorkspaceSandbox interface.
- [Reference: SandboxProcessManager](references/reference-workspace-process-manager.md) - Abstract base class for managing background processes in sandboxes. Provides methods to spawn processes, list them, get handles by PID, and kill them.
- [Reference: WorkspaceSandbox](references/reference-workspace-sandbox.md) - The WorkspaceSandbox interface defines how workspaces execute commands and manage background processes.
- [Reference: Workspace class](references/reference-workspace-workspace-class.md) - The Workspace class combines a filesystem and sandbox to provide agents with file storage and command execution capabilities.


Read [assets/SOURCE_MAP.json](assets/SOURCE_MAP.json) for source code references.