@mastra/mcp-docs-server 1.2.11 → 1.2.12-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/docs/agent-builder/access-control.md +3 -3
- package/.docs/docs/agent-builder/browser.md +1 -1
- package/.docs/docs/agent-builder/channels.md +1 -1
- package/.docs/docs/agent-builder/configuration.md +3 -3
- package/.docs/docs/agent-builder/deploying.md +2 -2
- package/.docs/docs/agent-builder/integrations.md +8 -8
- package/.docs/docs/agent-builder/memory.md +2 -2
- package/.docs/docs/agent-builder/overview.md +1 -1
- package/.docs/docs/agent-controller/channels.md +8 -6
- package/.docs/docs/agent-controller/modes.md +6 -6
- package/.docs/docs/agent-controller/overview.md +13 -9
- package/.docs/docs/agent-controller/session.md +27 -9
- package/.docs/docs/agent-controller/subagents.md +9 -6
- package/.docs/docs/agent-controller/threads-and-state.md +12 -8
- package/.docs/docs/agent-controller/tool-approvals.md +7 -3
- package/.docs/docs/agents/a2a.md +4 -2
- package/.docs/docs/agents/acp.md +5 -5
- package/.docs/docs/agents/agent-approval.md +13 -11
- package/.docs/docs/agents/code-mode.md +29 -6
- package/.docs/docs/agents/guardrails.md +8 -8
- package/.docs/docs/agents/networks.md +2 -2
- package/.docs/docs/agents/overview.md +9 -7
- package/.docs/docs/agents/processors.md +15 -15
- package/.docs/docs/agents/skills.md +6 -6
- package/.docs/docs/agents/structured-output.md +6 -6
- package/.docs/docs/agents/supervisor-agents.md +19 -13
- package/.docs/docs/agents/using-tools.md +48 -21
- package/.docs/docs/browser/agent-browser.md +4 -4
- package/.docs/docs/browser/browser-viewer.md +2 -2
- package/.docs/docs/browser/firecrawl.md +1 -1
- package/.docs/docs/browser/overview.md +2 -2
- package/.docs/docs/browser/recording.md +1 -1
- package/.docs/docs/browser/stagehand.md +7 -7
- package/.docs/docs/capabilities/channels/discord.md +1 -1
- package/.docs/docs/capabilities/channels/other-adapters.md +1 -1
- package/.docs/docs/capabilities/channels/overview.md +9 -5
- package/.docs/docs/capabilities/channels/slack.md +2 -2
- package/.docs/docs/capabilities/channels/teams.md +1 -1
- package/.docs/docs/capabilities/channels/telegram.md +1 -1
- package/.docs/docs/capabilities/channels/whatsapp.md +1 -1
- package/.docs/docs/deployment/mastra-server.md +1 -1
- package/.docs/docs/deployment/overview.md +6 -2
- package/.docs/docs/deployment/sandbox.md +3 -1
- package/.docs/docs/deployment/workers.md +137 -0
- package/.docs/docs/editor/overview.md +37 -31
- package/.docs/docs/editor/prompts.md +8 -4
- package/.docs/docs/editor/tools.md +3 -3
- package/.docs/docs/evals/built-in-scorers.md +4 -4
- package/.docs/docs/evals/custom-scorers.md +5 -5
- package/.docs/docs/evals/datasets/running-experiments.md +7 -7
- package/.docs/docs/evals/evals-with-memory.md +4 -4
- package/.docs/docs/evals/gates-and-verdicts.md +4 -4
- package/.docs/docs/evals/multi-turn.md +12 -12
- package/.docs/docs/evals/overview.md +6 -4
- package/.docs/docs/evals/quick-checks.md +2 -2
- package/.docs/docs/getting-started/build-with-ai.md +6 -4
- package/.docs/docs/getting-started/file-based-agents.md +6 -4
- package/.docs/docs/getting-started/manual-install.md +1 -1
- package/.docs/docs/index.md +9 -90
- package/.docs/docs/long-running-agents/background-tasks.md +10 -10
- package/.docs/docs/long-running-agents/durable-agents.md +46 -5
- package/.docs/docs/long-running-agents/goals.md +15 -11
- package/.docs/docs/long-running-agents/schedules.md +3 -3
- package/.docs/docs/long-running-agents/signal-providers.md +8 -6
- package/.docs/docs/long-running-agents/signals.md +9 -5
- package/.docs/docs/mastra-platform/configuration.md +3 -3
- package/.docs/docs/mastra-platform/database.md +8 -8
- package/.docs/docs/mastra-platform/deploy.md +8 -4
- package/.docs/docs/mastra-platform/environments.md +8 -4
- package/.docs/docs/mastra-platform/github.md +3 -1
- package/.docs/docs/mastra-platform/server.md +1 -1
- package/.docs/docs/mastra-platform/studio.md +2 -2
- package/.docs/docs/mastra-platform/workspace.md +6 -6
- package/.docs/docs/mcp/mcp-apps.md +1 -1
- package/.docs/docs/mcp/overview.md +9 -9
- package/.docs/docs/memory/memory-processors.md +10 -10
- package/.docs/docs/memory/message-history.md +11 -5
- package/.docs/docs/memory/multi-user-threads.md +6 -6
- package/.docs/docs/memory/observational-memory.md +27 -25
- package/.docs/docs/memory/overview.md +10 -10
- package/.docs/docs/memory/semantic-recall.md +3 -3
- package/.docs/docs/memory/working-memory.md +8 -8
- package/.docs/docs/observability/integrations/bridges/datadog.md +6 -6
- package/.docs/docs/observability/integrations/bridges/otel.md +5 -5
- package/.docs/docs/observability/integrations/exporters/datadog.md +1 -1
- package/.docs/docs/observability/integrations/exporters/laminar.md +1 -1
- package/.docs/docs/observability/integrations/exporters/langfuse.md +3 -3
- package/.docs/docs/observability/integrations/exporters/langsmith.md +4 -4
- package/.docs/docs/observability/integrations/exporters/mastra-platform.md +1 -1
- package/.docs/docs/observability/integrations/exporters/mastra-storage.md +1 -1
- package/.docs/docs/observability/integrations/exporters/otel.md +26 -4
- package/.docs/docs/observability/integrations/exporters/sentry.md +1 -1
- package/.docs/docs/observability/integrations/overview.md +1 -1
- package/.docs/docs/observability/integrations/processors/sensitive-data-filter.md +1 -1
- package/.docs/docs/observability/logging.md +1 -1
- package/.docs/docs/observability/metrics/overview.md +1 -1
- package/.docs/docs/observability/metrics/querying.md +8 -8
- package/.docs/docs/observability/overview.md +4 -4
- package/.docs/docs/observability/tracing/overview.md +18 -12
- package/.docs/docs/rag/chunking-and-embedding.md +1 -1
- package/.docs/docs/rag/graph-rag.md +7 -7
- package/.docs/docs/rag/overview.md +2 -2
- package/.docs/docs/rag/retrieval.md +18 -18
- package/.docs/docs/rag/vector-databases.md +2 -2
- package/.docs/docs/server/auth/composite-auth.md +2 -2
- package/.docs/docs/server/auth/fga.md +6 -6
- package/.docs/docs/server/auth/firebase.md +2 -2
- package/.docs/docs/server/auth/simple-auth.md +1 -1
- package/.docs/docs/server/auth/workers.md +133 -0
- package/.docs/docs/server/custom-adapters.md +4 -4
- package/.docs/docs/server/mastra-client.md +3 -3
- package/.docs/docs/server/mastra-server.md +2 -2
- package/.docs/docs/server/middleware.md +1 -1
- package/.docs/docs/server/pubsub.md +7 -4
- package/.docs/docs/server/request-context.md +11 -11
- package/.docs/docs/server/server-adapters.md +2 -2
- package/.docs/docs/storage/overview.md +2 -2
- package/.docs/docs/studio/auth.md +5 -5
- package/.docs/docs/studio/deployment.md +1 -1
- package/.docs/docs/studio/observability.md +2 -2
- package/.docs/docs/studio/overview.md +11 -9
- package/.docs/docs/voice/overview.md +26 -26
- package/.docs/docs/voice/realtime-voice.md +8 -8
- package/.docs/docs/voice/speech-to-speech.md +9 -9
- package/.docs/docs/voice/speech-to-text.md +3 -3
- package/.docs/docs/voice/text-to-speech.md +6 -6
- package/.docs/docs/what-is-mastra.md +161 -0
- package/.docs/docs/workflows/agents-and-tools.md +3 -3
- package/.docs/docs/workflows/control-flow.md +10 -8
- package/.docs/docs/workflows/error-handling.md +2 -2
- package/.docs/docs/workflows/overview.md +7 -6
- package/.docs/docs/workflows/scheduled-workflows.md +12 -12
- package/.docs/docs/workflows/snapshots.md +3 -3
- package/.docs/docs/workflows/suspend-and-resume.md +1 -1
- package/.docs/docs/workflows/time-travel.md +3 -1
- package/.docs/docs/workflows/workflow-state.md +1 -1
- package/.docs/docs/workspace/filesystem.md +10 -10
- package/.docs/docs/workspace/lsp.md +1 -1
- package/.docs/docs/workspace/overview.md +12 -12
- package/.docs/docs/workspace/sandbox.md +9 -7
- package/.docs/docs/workspace/search.md +3 -3
- package/.docs/docs/workspace/skills.md +7 -7
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +6 -6
- package/.docs/guides/build-your-ui/copilotkit/generative-ui.md +9 -9
- package/.docs/guides/build-your-ui/copilotkit/overview.md +2 -2
- package/.docs/guides/build-your-ui/openui.md +2 -2
- package/.docs/guides/concepts/multi-agent-systems.md +5 -5
- package/.docs/guides/concepts/streaming.md +10 -10
- package/.docs/guides/deployment/amazon-ec2.md +1 -1
- package/.docs/guides/deployment/aws-lambda.md +1 -1
- package/.docs/guides/deployment/azure-app-services.md +1 -1
- package/.docs/guides/deployment/cloudflare.md +1 -1
- package/.docs/guides/deployment/inngest.md +6 -6
- package/.docs/guides/deployment/kubernetes.md +1 -1
- package/.docs/guides/deployment/mastra-workers.md +232 -0
- package/.docs/guides/deployment/temporal.md +1 -1
- package/.docs/guides/deployment/vercel.md +1 -1
- package/.docs/guides/getting-started/astro.md +1 -1
- package/.docs/guides/getting-started/electron.md +1 -1
- package/.docs/guides/getting-started/nestjs.md +5 -5
- package/.docs/guides/getting-started/vite-react.md +1 -1
- package/.docs/guides/guide/ai-recruiter.md +1 -1
- package/.docs/guides/guide/chef-michel.md +2 -2
- package/.docs/guides/guide/code-review-bot.md +2 -2
- package/.docs/guides/guide/coding-agent.md +5 -5
- package/.docs/guides/guide/dev-assistant.md +2 -2
- package/.docs/guides/guide/docs-manager.md +4 -4
- package/.docs/guides/guide/firecrawl.md +1 -1
- package/.docs/guides/guide/github-actions-pr-description.md +5 -5
- package/.docs/guides/guide/research-assistant.md +4 -4
- package/.docs/guides/guide/research-coordinator.md +5 -5
- package/.docs/guides/guide/signal-provider.md +1 -1
- package/.docs/guides/guide/slack-assistant.md +1 -1
- package/.docs/guides/guide/stock-agent.md +3 -3
- package/.docs/guides/guide/web-search.md +4 -4
- package/.docs/guides/guide/whatsapp-chat-bot.md +2 -2
- package/.docs/guides/index.md +1 -1
- package/.docs/guides/migrations/agentnetwork.md +4 -4
- package/.docs/guides/migrations/ai-sdk-v4-to-v5.md +1 -1
- package/.docs/guides/migrations/mastra-cloud.md +6 -6
- package/.docs/guides/migrations/network-to-supervisor.md +9 -9
- package/.docs/guides/migrations/upgrade-to-v1/agent.md +6 -6
- package/.docs/guides/migrations/upgrade-to-v1/cli.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/client.md +3 -3
- package/.docs/guides/migrations/upgrade-to-v1/evals.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/memory.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/overview.md +3 -3
- package/.docs/guides/migrations/upgrade-to-v1/processors.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/storage.md +11 -11
- package/.docs/guides/migrations/upgrade-to-v1/tools.md +3 -3
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/voice.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/workflows.md +1 -1
- package/.docs/guides/migrations/vnext-to-standard-apis.md +2 -2
- package/.docs/models/environment-variables.md +1 -0
- package/.docs/models/gateways/custom-gateways.md +3 -3
- package/.docs/models/gateways/openrouter.md +1 -3
- package/.docs/models/gateways/vercel.md +2 -1
- package/.docs/models/index.md +6 -6
- package/.docs/models/providers/baseten.md +1 -1
- package/.docs/models/providers/chutes.md +2 -1
- package/.docs/models/providers/crossmodel.md +2 -2
- package/.docs/models/providers/deepinfra.md +1 -1
- package/.docs/models/providers/hyper.md +3 -3
- package/.docs/models/providers/llmgateway.md +4 -3
- package/.docs/models/providers/modal.md +73 -0
- package/.docs/models/providers/wandb.md +2 -1
- package/.docs/models/providers.md +1 -0
- package/.docs/reference/acp/acp-agent.md +4 -4
- package/.docs/reference/acp/create-acp-tool.md +3 -3
- package/.docs/reference/agent-controller/agent-controller-class.md +36 -36
- package/.docs/reference/agent-controller/session.md +6 -6
- package/.docs/reference/agents/agent.md +14 -14
- package/.docs/reference/agents/channels.md +29 -13
- package/.docs/reference/agents/durable-agent.md +54 -5
- package/.docs/reference/agents/generate.md +3 -3
- package/.docs/reference/agents/generateLegacy.md +1 -1
- package/.docs/reference/agents/getDefaultOptions.md +1 -1
- package/.docs/reference/agents/getDefaultStreamOptions.md +1 -1
- package/.docs/reference/agents/getLLM.md +2 -2
- package/.docs/reference/agents/getMetadata.md +2 -2
- package/.docs/reference/agents/inngest-agent.md +1 -1
- package/.docs/reference/agents/listScorers.md +1 -1
- package/.docs/reference/agents/listSkills.md +1 -1
- package/.docs/reference/agents/listSuspendedRuns.md +2 -2
- package/.docs/reference/agents/network.md +1 -1
- package/.docs/reference/ai-sdk/chat-route.md +1 -1
- package/.docs/reference/ai-sdk/network-route.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +1 -1
- package/.docs/reference/ai-sdk/workflow-route.md +1 -1
- package/.docs/reference/ai-sdk/workflow-snapshot-to-stream.md +2 -2
- package/.docs/reference/auth/auth0.md +1 -1
- package/.docs/reference/auth/fga.md +2 -2
- package/.docs/reference/auth/google.md +2 -2
- package/.docs/reference/auth/okta.md +1 -1
- package/.docs/reference/auth/workos.md +2 -2
- package/.docs/reference/browser/agent-browser.md +3 -3
- package/.docs/reference/browser/browser-viewer.md +4 -4
- package/.docs/reference/browser/firecrawl-browser.md +1 -1
- package/.docs/reference/browser/mastra-browser.md +4 -4
- package/.docs/reference/browser/stagehand-browser.md +8 -8
- package/.docs/reference/channels/slack-provider.md +2 -2
- package/.docs/reference/cli/create-mastra.md +1 -1
- package/.docs/reference/cli/mastra.md +155 -24
- package/.docs/reference/client-js/agents.md +26 -9
- package/.docs/reference/client-js/memory.md +2 -2
- package/.docs/reference/client-js/workflows.md +1 -1
- package/.docs/reference/coding-agent/build-base-prompt.md +2 -2
- package/.docs/reference/coding-agent/create-coding-agent.md +2 -2
- package/.docs/reference/configuration.md +7 -7
- package/.docs/reference/core/getAgentById.md +1 -1
- package/.docs/reference/core/getMCPServer.md +1 -1
- package/.docs/reference/core/getScorer.md +1 -1
- package/.docs/reference/core/mastra-class.md +48 -1
- package/.docs/reference/core/mastra-model-gateway.md +1 -1
- package/.docs/reference/datasets/addItem.md +1 -1
- package/.docs/reference/datasets/listItems.md +1 -1
- package/.docs/reference/deployer/netlify.md +4 -4
- package/.docs/reference/deployer/vercel.md +7 -7
- package/.docs/reference/editor/agent-builder/agent-builder-options.md +4 -4
- package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +6 -6
- package/.docs/reference/editor/agent-builder/builder-models.md +3 -3
- package/.docs/reference/editor/blob-store-provider.md +1 -1
- package/.docs/reference/editor/browser-provider.md +3 -3
- package/.docs/reference/editor/filesystem-provider.md +4 -4
- package/.docs/reference/editor/mastra-editor.md +5 -5
- package/.docs/reference/editor/processor-provider.md +3 -3
- package/.docs/reference/editor/sandbox-provider.md +4 -4
- package/.docs/reference/editor/storage-browser-ref.md +6 -6
- package/.docs/reference/editor/storage-workspace-ref.md +4 -4
- package/.docs/reference/editor/tool-provider.md +1 -1
- package/.docs/reference/evals/answer-relevancy.md +5 -5
- package/.docs/reference/evals/answer-similarity.md +1 -1
- package/.docs/reference/evals/bias.md +4 -4
- package/.docs/reference/evals/checks.md +3 -3
- package/.docs/reference/evals/completeness.md +5 -5
- package/.docs/reference/evals/content-similarity.md +5 -5
- package/.docs/reference/evals/context-precision.md +5 -5
- package/.docs/reference/evals/context-recall.md +11 -11
- package/.docs/reference/evals/context-relevance.md +15 -15
- package/.docs/reference/evals/create-scorer.md +1 -1
- package/.docs/reference/evals/faithfulness.md +4 -4
- package/.docs/reference/evals/filter-run.md +2 -2
- package/.docs/reference/evals/hallucination.md +11 -11
- package/.docs/reference/evals/keyword-coverage.md +6 -6
- package/.docs/reference/evals/mastra-scorer.md +2 -2
- package/.docs/reference/evals/noise-sensitivity.md +15 -15
- package/.docs/reference/evals/prompt-alignment.md +20 -20
- package/.docs/reference/evals/rubric.md +2 -2
- package/.docs/reference/evals/run-evals.md +3 -3
- package/.docs/reference/evals/scorer-utils.md +4 -4
- package/.docs/reference/evals/textual-difference.md +4 -4
- package/.docs/reference/evals/tool-call-accuracy.md +4 -4
- package/.docs/reference/evals/toxicity.md +5 -5
- package/.docs/reference/evals/trajectory-accuracy.md +10 -10
- package/.docs/reference/file-based-agents/config.md +3 -3
- package/.docs/reference/file-based-agents/instructions.md +3 -3
- package/.docs/reference/file-based-agents/logger.md +1 -1
- package/.docs/reference/file-based-agents/observability.md +1 -1
- package/.docs/reference/file-based-agents/processors.md +1 -1
- package/.docs/reference/file-based-agents/skills.md +1 -1
- package/.docs/reference/file-based-agents/storage.md +1 -1
- package/.docs/reference/file-based-agents/studio.md +1 -1
- package/.docs/reference/file-based-agents/subagents.md +4 -4
- package/.docs/reference/file-based-agents/tools.md +1 -1
- package/.docs/reference/file-based-agents/workspace.md +1 -1
- package/.docs/reference/index.md +2 -0
- package/.docs/reference/logging/pino-logger.md +3 -3
- package/.docs/reference/memory/clone-utilities.md +1 -1
- package/.docs/reference/memory/cloneThread.md +3 -3
- package/.docs/reference/memory/listThreads.md +1 -1
- package/.docs/reference/memory/memory-class.md +4 -4
- package/.docs/reference/memory/observational-memory.md +15 -15
- package/.docs/reference/memory/recall.md +2 -2
- package/.docs/reference/memory/serialized-memory-config.md +4 -4
- package/.docs/reference/memory/summarizeConversation.md +3 -3
- package/.docs/reference/memory/summarizeThread.md +3 -3
- package/.docs/reference/observability/feedback.md +1 -1
- package/.docs/reference/observability/metrics/automatic-metrics.md +7 -7
- package/.docs/reference/observability/tracing/bridges/datadog.md +2 -2
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +3 -3
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/langfuse.md +1 -1
- package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +4 -4
- package/.docs/reference/observability/tracing/exporters/mastra-storage-exporter.md +1 -1
- package/.docs/reference/observability/tracing/interfaces.md +1 -1
- package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +1 -1
- package/.docs/reference/observability/tracing/span-filtering.md +1 -1
- package/.docs/reference/processors/batch-parts-processor.md +1 -1
- package/.docs/reference/processors/cost-guard-processor.md +1 -1
- package/.docs/reference/processors/language-detector.md +1 -1
- package/.docs/reference/processors/message-history-processor.md +1 -1
- package/.docs/reference/processors/moderation-processor.md +2 -2
- package/.docs/reference/processors/pii-detector.md +3 -3
- package/.docs/reference/processors/processor-interface.md +13 -13
- package/.docs/reference/processors/prompt-injection-detector.md +2 -2
- package/.docs/reference/processors/provider-history-compat.md +1 -1
- package/.docs/reference/processors/regex-filter-processor.md +1 -1
- package/.docs/reference/processors/response-cache.md +8 -8
- package/.docs/reference/processors/semantic-recall-processor.md +1 -1
- package/.docs/reference/processors/skill-search-processor.md +1 -1
- package/.docs/reference/processors/system-prompt-scrubber.md +2 -2
- package/.docs/reference/processors/token-limiter-processor.md +4 -4
- package/.docs/reference/processors/tool-call-filter.md +2 -2
- package/.docs/reference/processors/tool-search-processor.md +9 -9
- package/.docs/reference/processors/unicode-normalizer.md +2 -2
- package/.docs/reference/processors/working-memory-processor.md +1 -1
- package/.docs/reference/project-structure.md +1 -1
- package/.docs/reference/pubsub/base.md +4 -4
- package/.docs/reference/pubsub/google-cloud-pubsub.md +2 -2
- package/.docs/reference/pubsub/lease-provider.md +4 -4
- package/.docs/reference/pubsub/redis-streams.md +1 -1
- package/.docs/reference/pubsub/unix-socket-pubsub.md +1 -1
- package/.docs/reference/rag/chunk.md +5 -5
- package/.docs/reference/rag/database-config.md +2 -2
- package/.docs/reference/rag/metadata-filters.md +2 -2
- package/.docs/reference/rag/rerank.md +1 -1
- package/.docs/reference/schedules/overview.md +1 -1
- package/.docs/reference/server/register-api-route.md +1 -1
- package/.docs/reference/server/routes.md +7 -7
- package/.docs/reference/signals/create-notification-inbox-tool.md +1 -1
- package/.docs/reference/signals/signal-provider.md +8 -8
- package/.docs/reference/storage/clickhouse.md +4 -4
- package/.docs/reference/storage/cloudflare-d1.md +4 -4
- package/.docs/reference/storage/convex.md +4 -4
- package/.docs/reference/storage/dsql.md +3 -3
- package/.docs/reference/storage/dynamodb.md +7 -7
- package/.docs/reference/storage/lance.md +1 -1
- package/.docs/reference/storage/mongodb.md +2 -2
- package/.docs/reference/storage/mssql.md +1 -1
- package/.docs/reference/storage/postgresql.md +2 -2
- package/.docs/reference/storage/redis.md +1 -1
- package/.docs/reference/storage/retention.md +33 -33
- package/.docs/reference/storage/spanner.md +8 -8
- package/.docs/reference/storage/upstash.md +1 -1
- package/.docs/reference/streaming/ChunkType.md +2 -2
- package/.docs/reference/streaming/agents/MastraModelOutput.md +1 -1
- package/.docs/reference/streaming/agents/stream.md +2 -2
- package/.docs/reference/streaming/agents/streamUntilIdle.md +2 -2
- package/.docs/reference/streaming/workflows/observeStream.md +1 -1
- package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
- package/.docs/reference/streaming/workflows/stream.md +1 -1
- package/.docs/reference/streaming/workflows/timeTravelStream.md +2 -2
- package/.docs/reference/templates/overview.md +1 -1
- package/.docs/reference/tools/brightdata.md +1 -1
- package/.docs/reference/tools/create-code-mode.md +3 -3
- package/.docs/reference/tools/create-tool.md +1 -1
- package/.docs/reference/tools/graph-rag-tool.md +1 -1
- package/.docs/reference/tools/isolated-vm-transport.md +74 -0
- package/.docs/reference/tools/mcp-client.md +15 -15
- package/.docs/reference/tools/mcp-server.md +21 -21
- package/.docs/reference/tools/submit-plan-tool.md +1 -1
- package/.docs/reference/tools/tavily.md +1 -1
- package/.docs/reference/tools/vector-query-tool.md +5 -5
- package/.docs/reference/vectors/astra.md +1 -1
- package/.docs/reference/vectors/chroma.md +2 -2
- package/.docs/reference/vectors/convex.md +2 -2
- package/.docs/reference/vectors/couchbase.md +4 -4
- package/.docs/reference/vectors/libsql.md +2 -2
- package/.docs/reference/vectors/mongodb.md +3 -3
- package/.docs/reference/vectors/pg.md +5 -5
- package/.docs/reference/vectors/qdrant.md +2 -2
- package/.docs/reference/vectors/s3vectors.md +4 -4
- package/.docs/reference/vectors/turbopuffer.md +1 -1
- package/.docs/reference/vectors/upstash.md +1 -1
- package/.docs/reference/voice/aws-nova-sonic.md +1 -1
- package/.docs/reference/voice/azure.md +1 -1
- package/.docs/reference/voice/google-gemini-live.md +4 -4
- package/.docs/reference/voice/inworld-realtime.md +7 -7
- package/.docs/reference/voice/livekit.md +13 -13
- package/.docs/reference/voice/mistral.md +1 -1
- package/.docs/reference/voice/openai-realtime.md +1 -1
- package/.docs/reference/voice/sarvam.md +1 -1
- package/.docs/reference/voice/voice.addInstructions.md +1 -1
- package/.docs/reference/voice/voice.addTools.md +1 -1
- package/.docs/reference/voice/voice.events.md +1 -1
- package/.docs/reference/voice/voice.getSpeakers.md +2 -2
- package/.docs/reference/voice/voice.on.md +2 -2
- package/.docs/reference/voice/xai-realtime.md +2 -2
- package/.docs/reference/workers/overview.md +85 -0
- package/.docs/reference/workflows/run-methods/cancel.md +1 -1
- package/.docs/reference/workflows/run-methods/startAsync.md +1 -1
- package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
- package/.docs/reference/workflows/workflow-methods/foreach.md +1 -1
- package/.docs/reference/workflows/workflow-methods/sleep.md +1 -1
- package/.docs/reference/workflows/workflow-state-reader.md +2 -2
- package/.docs/reference/workspace/agentfs-filesystem.md +1 -1
- package/.docs/reference/workspace/apple-container-sandbox.md +2 -2
- package/.docs/reference/workspace/daytona-sandbox.md +3 -3
- package/.docs/reference/workspace/docker-sandbox.md +2 -2
- package/.docs/reference/workspace/e2b-sandbox.md +2 -2
- package/.docs/reference/workspace/files-sdk-filesystem.md +3 -3
- package/.docs/reference/workspace/google-drive-filesystem.md +4 -4
- package/.docs/reference/workspace/local-filesystem.md +3 -3
- package/.docs/reference/workspace/local-sandbox.md +3 -3
- package/.docs/reference/workspace/modal-sandbox.md +1 -1
- package/.docs/reference/workspace/platform-filesystem.md +3 -3
- package/.docs/reference/workspace/platform-sandbox.md +2 -2
- package/.docs/reference/workspace/process-manager.md +1 -1
- package/.docs/reference/workspace/railway-sandbox.md +4 -4
- package/.docs/reference/workspace/s3-filesystem.md +1 -1
- package/.docs/reference/workspace/sandbox.md +1 -1
- package/.docs/reference/workspace/vercel-sandbox.md +1 -1
- package/.docs/reference/workspace/workspace-class.md +10 -10
- package/CHANGELOG.md +21 -0
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Scorers overview
|
|
4
4
|
|
|
5
|
-
While traditional software tests have clear pass/fail conditions, AI outputs are non-deterministic
|
|
5
|
+
While traditional software tests have clear pass/fail conditions, AI outputs are non-deterministic, they can vary with the same input. **Scorers** help bridge this gap by providing quantifiable metrics for measuring agent quality.
|
|
6
6
|
|
|
7
7
|
Scorers are automated tests that evaluate Agents outputs using model-graded, rule-based, and statistical methods. Scorers return **scores**: numerical values (typically between 0 and 1) that quantify how well an output meets your evaluation criteria. These scores enable you to objectively track performance, compare different approaches, and identify areas for improvement in your AI systems. Scorers can be customized with your own prompts and scoring functions.
|
|
8
8
|
|
|
@@ -114,7 +114,9 @@ export const contentWorkflow = createWorkflow({ ... })
|
|
|
114
114
|
|
|
115
115
|
## Trace evaluations
|
|
116
116
|
|
|
117
|
-
In addition to live evaluations, you can use scorers to evaluate historical traces from your agent interactions and workflows.
|
|
117
|
+
In addition to live evaluations, you can use scorers to evaluate historical traces from your agent interactions and workflows.
|
|
118
|
+
|
|
119
|
+
This is particularly useful for analyzing past performance or debugging issues, or alternatively running batch evaluations.
|
|
118
120
|
|
|
119
121
|
> **Observability required:** To score traces, you must first configure observability in your Mastra instance to collect trace data. See [Tracing documentation](https://mastra.ai/docs/observability/tracing/overview) for setup instructions.
|
|
120
122
|
|
|
@@ -131,11 +133,11 @@ const mastra = new Mastra({
|
|
|
131
133
|
})
|
|
132
134
|
```
|
|
133
135
|
|
|
134
|
-
Once registered, you can score traces interactively within Studio under the **Observability** section. Open Studio to manage scorers
|
|
136
|
+
Once registered, you can score traces interactively within Studio under the **Observability** section. Open Studio to manage scorers and review scores, plus run experiments.
|
|
135
137
|
|
|
136
138
|
- **Scorers list**: Browse all registered scorers with their description, and the number of agents and workflows each scorer is attached to.
|
|
137
139
|
- **Score results**: Select a scorer to see a paginated list of every score it has produced. Click a row to open the detail panel, which shows the score value, reason, input, output, and the prompts used by the judge. From this panel, save any result as a dataset item for future experiments.
|
|
138
|
-
- **Agent Evaluate tab**: Open the Evaluate tab on any agent to
|
|
140
|
+
- **Agent Evaluate tab**: Open the Evaluate tab on any agent to manage scorers and datasets. You can also run experiments there. Experiment results display per-item scores alongside pass/fail status and version tags.
|
|
139
141
|
- **Trace scoring**: In the Observability section, run a scorer against any historical trace or span to evaluate past interactions. Filter scores by agent or workflow.
|
|
140
142
|
|
|
141
143
|
## Next steps
|
|
@@ -35,7 +35,7 @@ console.log(result.scores)
|
|
|
35
35
|
|
|
36
36
|
## Available checks
|
|
37
37
|
|
|
38
|
-
Quick Checks fall into
|
|
38
|
+
Quick Checks fall into these categories:
|
|
39
39
|
|
|
40
40
|
### Text checks
|
|
41
41
|
|
|
@@ -105,7 +105,7 @@ export const weatherAgent = new Agent({
|
|
|
105
105
|
id: 'weather-agent',
|
|
106
106
|
name: 'Weather Agent',
|
|
107
107
|
instructions: 'Answer weather questions using the get_weather tool.',
|
|
108
|
-
model: 'openai/gpt-5.
|
|
108
|
+
model: 'openai/gpt-5.6-sol',
|
|
109
109
|
tools: { get_weather: weatherTool },
|
|
110
110
|
scorers: {
|
|
111
111
|
noErrors: {
|
|
@@ -8,7 +8,7 @@ To give your agent access to Mastra's documentation, we recommend using **skills
|
|
|
8
8
|
|
|
9
9
|
## Mastra skills
|
|
10
10
|
|
|
11
|
-
Agent Skills are folders of instructions, scripts, and resources that agents can discover and use to do things
|
|
11
|
+
Agent Skills are folders of instructions, scripts, and resources that agents can discover and use to do things accurately and efficiently. Mastra skills contain setup instructions, best practices, CLI commands, and instructions on how to fetch up-to-date information from Mastra's documentation.
|
|
12
12
|
|
|
13
13
|
To install all available Mastra skills, run the following command:
|
|
14
14
|
|
|
@@ -70,7 +70,9 @@ bun x skills update mastra
|
|
|
70
70
|
|
|
71
71
|
## Mastra CLI
|
|
72
72
|
|
|
73
|
-
The [Mastra CLI](https://mastra.ai/reference/cli/mastra) gives your coding agent a direct line to your Mastra runtime.
|
|
73
|
+
The [Mastra CLI](https://mastra.ai/reference/cli/mastra) gives your coding agent a direct line to your Mastra runtime.
|
|
74
|
+
|
|
75
|
+
Agents can invoke other agents and run workflows. They can execute tools and inspect memory. They can also run evals or query traces and logs.
|
|
74
76
|
|
|
75
77
|
**npm**:
|
|
76
78
|
|
|
@@ -107,7 +109,7 @@ Install the [Mastra skills](#mastra-skills) to teach your agent how to use the C
|
|
|
107
109
|
|
|
108
110
|
## Embedded package docs
|
|
109
111
|
|
|
110
|
-
Mastra packages
|
|
112
|
+
Mastra packages come with embedded documentation in `dist/docs`. When you install a Mastra package, your AI agent can read these files directly from `node_modules` to understand the package's APIs and patterns.
|
|
111
113
|
|
|
112
114
|
Each `dist/docs` includes:
|
|
113
115
|
|
|
@@ -136,7 +138,7 @@ In addition to the [context files](#context-files) each documentation page also
|
|
|
136
138
|
|
|
137
139
|
The `@mastra/mcp-docs-server` package provides direct local access to Mastra’s full documentation via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro). It works with Cursor, Windsurf, Cline, Claude Code, VS Code, Codex or any tool that supports MCP.
|
|
138
140
|
|
|
139
|
-
These tools are designed to help agents retrieve precise, task-specific information, whether you're adding a feature to an agent
|
|
141
|
+
These tools are designed to help agents retrieve precise, task-specific information, whether you're adding a feature to an agent or scaffolding a new project, or alternatively exploring how something works.
|
|
140
142
|
|
|
141
143
|
If you're unable to use a local MCP server and need to connect to a remote server, use this URL: `https://mastra.mcp.kapa.ai`. You need to authenticate with your Google Account (only an anonymous ID is transmitted) for rate-limiting purposes. If possible, Mastra recommends using a local MCP server for better performance and reliability.
|
|
142
144
|
|
|
@@ -12,7 +12,7 @@ This approach reduces glue code and makes the file system itself a direct repres
|
|
|
12
12
|
|
|
13
13
|
You can build your entire project with file-based agents or combine this approach with agents and other primitives defined directly in code for incremental adoption.
|
|
14
14
|
|
|
15
|
-
File-based agents have some limitations while in beta.
|
|
15
|
+
File-based agents have some limitations while in beta. They don't support every Mastra feature yet. Runtime configuration and wiring are usually better defined directly in code, along with any related primitives.
|
|
16
16
|
|
|
17
17
|
> **Note:** All Mastra documentation currently shows agents and primitives defined directly in code. File-based agents use the same underlying concepts and APIs, so the guidance elsewhere in the docs still applies. As file-based agents mature, more examples may use this structure where appropriate.
|
|
18
18
|
|
|
@@ -49,7 +49,7 @@ Create a folder at `src/mastra/agents/weather`. Inside, add a `config.ts` and an
|
|
|
49
49
|
import { agentConfig } from '@mastra/core/agent'
|
|
50
50
|
|
|
51
51
|
export default agentConfig({
|
|
52
|
-
model: 'openai/gpt-5.
|
|
52
|
+
model: 'openai/gpt-5.6-sol',
|
|
53
53
|
})
|
|
54
54
|
```
|
|
55
55
|
|
|
@@ -80,7 +80,7 @@ Map each primitive or feature to its file convention:
|
|
|
80
80
|
| [Logger](https://mastra.ai/reference/file-based-agents/logger) | `src/mastra/logger.ts` |
|
|
81
81
|
| [Server config](https://mastra.ai/reference/file-based-agents/server) | `src/mastra/server.ts` |
|
|
82
82
|
| [Studio config](https://mastra.ai/reference/file-based-agents/studio) | `src/mastra/studio.ts` |
|
|
83
|
-
| [Schedules](https://mastra.ai/docs/long-running-agents/schedules) | Not yet file-based
|
|
83
|
+
| [Schedules](https://mastra.ai/docs/long-running-agents/schedules) | Not yet file-based, create at runtime with `mastra.schedules.create()` |
|
|
84
84
|
|
|
85
85
|
## Discovery lifecycle
|
|
86
86
|
|
|
@@ -88,7 +88,9 @@ File-based primitives are discovered by the Mastra bundler under `mastra dev` an
|
|
|
88
88
|
|
|
89
89
|
After discovery, a file-based agent runs as a normal [`Agent`](https://mastra.ai/reference/agents/agent). Calling it from the Agent API, Studio, workflows, or your application code uses the same runtime as a code-defined agent.
|
|
90
90
|
|
|
91
|
-
Discovery is source-based and conservative.
|
|
91
|
+
Discovery is source-based and conservative.
|
|
92
|
+
|
|
93
|
+
It skips symlinks, test files, and directories that aren't agent directories. Workflows and singleton project files are file-routed only when they have a default export.
|
|
92
94
|
|
|
93
95
|
Start your app through the Mastra CLI so discovery runs:
|
|
94
96
|
|
|
@@ -165,7 +165,7 @@ If you prefer not to use our automatic CLI tool, you can set up your project you
|
|
|
165
165
|
mkdir -p src/mastra/agents && touch src/mastra/agents/weather-agent.ts
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
Use `import { Agent } from "@mastra/core/agent"`. Constructor takes `{ id, name, instructions, model: 'openai/gpt-5.
|
|
168
|
+
Use `import { Agent } from "@mastra/core/agent"`. Constructor takes `{ id, name, instructions, model: 'openai/gpt-5.6-sol' }`. The model string is Mastra's model router format ('provider/model'; use / and not : to separate provider and model). Do not install any ai-sdk packages.
|
|
169
169
|
|
|
170
170
|
Add the following code:
|
|
171
171
|
|
package/.docs/docs/index.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Get started
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Mastra is a TypeScript framework for building AI agents and applications. Create your first agent with a single command and start building.
|
|
6
6
|
|
|
7
|
-
**For AI agents:** If you're tasked to build a Mastra project from scratch, follow the condensed instructions until the next heading. Adjust the example code for the agent & tool to your needs. Important for later: Define `model` as a string in `provider/model` format, for example `openai/gpt-5.
|
|
7
|
+
**For AI agents:** If you're tasked to build a Mastra project from scratch, follow the condensed instructions until the next heading. Adjust the example code for the agent & tool to your needs. Important for later: Define `model` as a string in `provider/model` format, for example `openai/gpt-5.6-sol`. For OpenAI, use `openai/<model>`, not `openai:<model>`, and don't import or pass a provider object.
|
|
8
8
|
|
|
9
9
|
Create a `package.json` file with `{ "type": "module" }`. Install the required dependencies: `npm install @mastra/core@latest zod@latest typescript@latest @types/node@latest mastra@latest`
|
|
10
10
|
|
|
@@ -60,11 +60,11 @@ export const weatherTool = createTool({
|
|
|
60
60
|
|
|
61
61
|
If you need to create an agent, create a new file and use `import { Agent } from "@mastra/core/agent"`. The constructor takes `{ id, name, instructions, model }`. The `model` property is a string in Mastra's model router format. No provider import is needed for this format. Don't install any AI SDK package unless Mastra's documentation says otherwise.
|
|
62
62
|
|
|
63
|
-
By defining the model using `provider/model` format Mastra automatically looks for environment variables for the
|
|
63
|
+
By defining the model using `provider/model` format Mastra automatically looks for environment variables for the provider. The defined model requires an environment variable to be set for the provider. OpenAI: `OPENAI_API_KEY`. Anthropic: `ANTHROPIC_API_KEY`. Google: `GOOGLE_API_KEY`. Example: Any `openai/<model>` requires the `OPENAI_API_KEY` environment variable. Go to <https://mastra.ai/models/environment-variables> for a full list of supported providers and their environment variable names.
|
|
64
64
|
|
|
65
65
|
Short list of known model IDs are:
|
|
66
66
|
|
|
67
|
-
- `openai/gpt-5.
|
|
67
|
+
- `openai/gpt-5.6-sol`, `openai/gpt-5-mini`
|
|
68
68
|
- `anthropic/claude-sonnet-4-6`, `anthropic/claude-opus-4-7`, `anthropic/claude-haiku-4-5`
|
|
69
69
|
- `google/gemini-2.5-flash`
|
|
70
70
|
|
|
@@ -92,7 +92,7 @@ export const weatherAgent = new Agent({
|
|
|
92
92
|
Use the weatherTool to fetch current weather data.
|
|
93
93
|
`,
|
|
94
94
|
// Use a string in provider/model format, not provider:model or a provider object.
|
|
95
|
-
model: 'openai/gpt-5.
|
|
95
|
+
model: 'openai/gpt-5.6-sol',
|
|
96
96
|
tools: { weatherTool },
|
|
97
97
|
})
|
|
98
98
|
```
|
|
@@ -121,7 +121,7 @@ console.log(response.text)
|
|
|
121
121
|
|
|
122
122
|
## Quickstart
|
|
123
123
|
|
|
124
|
-
Run this command to create a
|
|
124
|
+
Run this command to create a general-purpose agent harness with a local workspace, shell tools, memory, task tracking, web access, and recurring schedules. It also installs Mastra skills for your installed coding agent, so you can start prompting and editing it:
|
|
125
125
|
|
|
126
126
|
**npm**:
|
|
127
127
|
|
|
@@ -162,89 +162,8 @@ Add Mastra to an existing project, or create a new app with your preferred frame
|
|
|
162
162
|
|
|
163
163
|
For other frameworks, see the [framework integration guides](https://mastra.ai/guides/getting-started/next-js).
|
|
164
164
|
|
|
165
|
-
##
|
|
165
|
+
## Templates
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
Browse [templates](https://mastra.ai/templates) for complete Mastra projects you can clone and adapt.
|
|
168
168
|
|
|
169
|
-
|
|
170
|
-
**Embed agents in your product**
|
|
171
|
-
|
|
172
|
-
Add AI capabilities to your platform so your users can build or interact with agents.
|
|
173
|
-
|
|
174
|
-
Used by [Replit](https://mastra.ai/blog/replitagent3), [Fireworks](https://mastra.ai/blog/fireworks-xml-prompting), [Medusa](https://mastra.ai/blog/medusa-ecommerce)
|
|
175
|
-
|
|
176
|
-
</details>
|
|
177
|
-
|
|
178
|
-
<details>
|
|
179
|
-
**Customer-facing assistants**
|
|
180
|
-
|
|
181
|
-
Build agents that handle inquiries, schedule appointments, send reminders, and answer questions via chat, WhatsApp, or voice.
|
|
182
|
-
|
|
183
|
-
Used by [Vetnio](https://mastra.ai/blog/vetnio), [Lua](https://mastra.ai/blog/lua-scaling)
|
|
184
|
-
|
|
185
|
-
Templates: [Docs Chatbot](https://mastra.ai/templates/docs-chatbot), [Slack Agent](https://mastra.ai/templates/slack-agent)
|
|
186
|
-
|
|
187
|
-
</details>
|
|
188
|
-
|
|
189
|
-
<details>
|
|
190
|
-
**Internal copilots**
|
|
191
|
-
|
|
192
|
-
Help employees work faster with AI that understands your domain—HR queries, clinical documentation, sales prep, or document generation.
|
|
193
|
-
|
|
194
|
-
Used by [Factorial](https://mastra.ai/blog/factorial-case-study), [Counsel Health](https://mastra.ai/blog/counsel-health), [Cedar](https://mastra.ai/blog/cedar-case-study), [SoftBank](https://mastra.ai/blog/softbank-productivity-mastra-2025-08-20)
|
|
195
|
-
|
|
196
|
-
Templates: [Chat with PDF](https://mastra.ai/templates/chat-with-pdf), [Google Sheet Analysis](https://mastra.ai/templates/google-sheets-analysis)
|
|
197
|
-
|
|
198
|
-
</details>
|
|
199
|
-
|
|
200
|
-
<details>
|
|
201
|
-
**Data analysis agents**
|
|
202
|
-
|
|
203
|
-
Let users query databases and dashboards in natural language. Connect to your data sources and return answers, charts, or reports.
|
|
204
|
-
|
|
205
|
-
Used by [Index](https://mastra.ai/blog/index-case-study), [PLAID Japan](https://mastra.ai/blog/plaid-jpn-gcp-agents)
|
|
206
|
-
|
|
207
|
-
Templates: [Chat with Database](https://mastra.ai/templates/text-to-sql), [CSV to Questions](https://mastra.ai/templates/csv-to-questions)
|
|
208
|
-
|
|
209
|
-
</details>
|
|
210
|
-
|
|
211
|
-
<details>
|
|
212
|
-
**Content automation**
|
|
213
|
-
|
|
214
|
-
Generate, transform, and manage structured content at scale—whether for a CMS, knowledge base, or documentation system.
|
|
215
|
-
|
|
216
|
-
Used by [Sanity](https://mastra.ai/blog/sanity)
|
|
217
|
-
|
|
218
|
-
Templates: [Chat with YouTube](https://mastra.ai/templates/chat-with-youtube), [Flash Cards from PDF](https://mastra.ai/templates/flash-cards-from-pdf)
|
|
219
|
-
|
|
220
|
-
</details>
|
|
221
|
-
|
|
222
|
-
<details>
|
|
223
|
-
**DevOps & engineering automation**
|
|
224
|
-
|
|
225
|
-
Automate deployments, debug production issues, manage infrastructure, and handle on-call workflows.
|
|
226
|
-
|
|
227
|
-
Used by [StarSling](https://mastra.ai/blog/starsling)
|
|
228
|
-
|
|
229
|
-
Templates: [GitHub PR Code Review](https://mastra.ai/templates/github-pr-code-review-agent), [Browser Agent](https://mastra.ai/templates/browsing-agent)
|
|
230
|
-
|
|
231
|
-
</details>
|
|
232
|
-
|
|
233
|
-
<details>
|
|
234
|
-
**Sales & GTM workflows**
|
|
235
|
-
|
|
236
|
-
Turn customer conversations into structured tasks, generate investment memos, or automate outreach sequences.
|
|
237
|
-
|
|
238
|
-
Used by [Kestral](https://mastra.ai/blog/kestral), [Orange Collective](https://mastra.ai/blog/orange-collective-vc-operating-system), [WorkOS](https://mastra.ai/blog/workos-teaching-mastra)
|
|
239
|
-
|
|
240
|
-
Templates: [Customer Feedback Summarization](https://mastra.ai/templates/customer-feedback-summarization)
|
|
241
|
-
|
|
242
|
-
</details>
|
|
243
|
-
|
|
244
|
-
Browse [templates](https://mastra.ai/templates) for working examples.
|
|
245
|
-
|
|
246
|
-
## Want to learn more?
|
|
247
|
-
|
|
248
|
-
Here's a quick introduction:
|
|
249
|
-
|
|
250
|
-
[YouTube video player](https://www.youtube-nocookie.com/embed/NosES9aJxCc)
|
|
169
|
+
> **Note:** New to Mastra? Read [What is Mastra?](https://mastra.ai/docs/what-is-mastra) for an overview of the framework, its capabilities, and what you can build with it.
|
|
@@ -74,7 +74,7 @@ export const researchTool = createTool({
|
|
|
74
74
|
|
|
75
75
|
### Agent-level
|
|
76
76
|
|
|
77
|
-
Use `backgroundTasks.tools` on the agent to opt in specific tools
|
|
77
|
+
Use `backgroundTasks.tools` on the agent to opt in specific tools or override timeouts for individual tools, or alternatively run all background-eligible tools in the background. Use `disabled: true` to short-circuit background dispatch for the agent entirely.
|
|
78
78
|
|
|
79
79
|
```typescript
|
|
80
80
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -82,7 +82,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
82
82
|
export const researcher = new Agent({
|
|
83
83
|
id: 'researcher',
|
|
84
84
|
instructions: 'You research topics and answer questions.',
|
|
85
|
-
model: 'openai/gpt-5.
|
|
85
|
+
model: 'openai/gpt-5.6-sol',
|
|
86
86
|
tools: { researchTool, summarizeTool },
|
|
87
87
|
backgroundTasks: {
|
|
88
88
|
tools: {
|
|
@@ -106,7 +106,7 @@ When a tool is registered on an agent that has background tasks enabled, the mod
|
|
|
106
106
|
}
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
The `_background` override is a _modifier_ on tools the developer has already opted in at the tool or agent layer
|
|
109
|
+
The `_background` override is a _modifier_ on tools the developer has already opted in at the tool or agent layer, it's not a standalone opt-in. If a tool hasn't been opted in, `_background.enabled: true` from the model is ignored and the tool runs in the foreground. This keeps deterministic, foreground-only tools (calculators, lookups, schema validators) from being silently dispatched as tasks.
|
|
110
110
|
|
|
111
111
|
### Resolution order
|
|
112
112
|
|
|
@@ -172,7 +172,7 @@ Visit [`Agent.stream()`](https://mastra.ai/reference/streaming/agents/stream) fo
|
|
|
172
172
|
|
|
173
173
|
### Aggregate properties
|
|
174
174
|
|
|
175
|
-
`stream()` with `untilIdle` returns a `MastraModelOutput` that looks like the one from a regular `stream()` call, but
|
|
175
|
+
`stream()` with `untilIdle` returns a `MastraModelOutput` that looks like the one from a regular `stream()` call, but `fullStream` alone spans the initial turn and any auto-continuations. Aggregate properties (`text`, `toolCalls`, `toolResults`, `finishReason`, `messageList`, `getFullOutput()`) still resolve against the **first turn's** internal buffer. If you need an aggregate view across continuations, consume `fullStream` yourself and accumulate.
|
|
176
176
|
|
|
177
177
|
## Subagents in the background
|
|
178
178
|
|
|
@@ -184,7 +184,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
184
184
|
const supervisor = new Agent({
|
|
185
185
|
id: 'supervisor',
|
|
186
186
|
instructions: 'Coordinate research and writing using the available agents.',
|
|
187
|
-
model: 'openai/gpt-5.
|
|
187
|
+
model: 'openai/gpt-5.6-sol',
|
|
188
188
|
agents: { researchAgent, writingAgent },
|
|
189
189
|
backgroundTasks: {
|
|
190
190
|
tools: {
|
|
@@ -260,7 +260,7 @@ export const reviewTool = createTool({
|
|
|
260
260
|
})
|
|
261
261
|
```
|
|
262
262
|
|
|
263
|
-
The first invocation of `execute` sees `resumeData === undefined` and calls `suspend`. After the task is resumed, the runtime restarts the tool with `resumeData` populated
|
|
263
|
+
The first invocation of `execute` sees `resumeData === undefined` and calls `suspend`. After the task is resumed, the runtime restarts the tool with `resumeData` populated. The `if` condition is false, so the tool returns its real result.
|
|
264
264
|
|
|
265
265
|
To resume the task once an approval arrives:
|
|
266
266
|
|
|
@@ -273,19 +273,19 @@ await mastra.backgroundTaskManager?.resume(taskId, {
|
|
|
273
273
|
|
|
274
274
|
### What happens to the agent loop
|
|
275
275
|
|
|
276
|
-
When a task suspends mid-`stream()` with `untilIdle`, the wrapper treats it as terminal for the current iteration and closes. To continue the agent immediately when the resume payload is in hand, call `agent.resumeStream(resumeData, { runId, toolCallId, memory, untilIdle: true })`: the resumed bg task runs to completion, its result
|
|
276
|
+
When a task suspends mid-`stream()` with `untilIdle`, the wrapper treats it as terminal for the current iteration and closes. To continue the agent immediately when the resume payload is in hand, call `agent.resumeStream(resumeData, { runId, toolCallId, memory, untilIdle: true })`: the resumed bg task runs to completion, its result is added to the message list, and the agent runs a follow-up turn, all on the same SSE connection. If you'd rather drive the resume out-of-band, call `mastra.backgroundTaskManager.resume(taskId, resumeData)` directly and the result still writes into the thread for the next user turn to pick up.
|
|
277
277
|
|
|
278
278
|
### Re-registering the executor on resume
|
|
279
279
|
|
|
280
|
-
The manager keeps tool executors in process memory. If the process restarts while a task is suspended, the executor closure is gone
|
|
280
|
+
The manager keeps tool executors in process memory. If the process restarts while a task is suspended, the executor closure is gone, the caller of `resume()` must re-register it first via `manager.registerTaskContext(taskId, ...)`. Tasks dispatched and resumed inside the same process don't need this.
|
|
281
281
|
|
|
282
282
|
### Cancelling a suspended task
|
|
283
283
|
|
|
284
|
-
`manager.cancel(taskId)` works against suspended tasks the same way it works for running ones
|
|
284
|
+
`manager.cancel(taskId)` works against suspended tasks the same way it works for running ones. The row changes to `cancelled` and the workflow snapshot is cleaned up. A `task.cancelled` event then fires.
|
|
285
285
|
|
|
286
286
|
## Lifecycle callbacks
|
|
287
287
|
|
|
288
|
-
Each layer can register terminal-state callbacks. They don't replace one another, and success/failure hooks fire for their
|
|
288
|
+
Each layer can register terminal-state callbacks. They don't replace one another, and success/failure hooks fire for their outcomes:
|
|
289
289
|
|
|
290
290
|
- Tool-level `background.onComplete` / `onFailed`: scoped to one tool.
|
|
291
291
|
- Agent-level `backgroundTasks.onTaskComplete` / `onTaskFailed`: scoped to all tasks dispatched by this agent.
|
|
@@ -31,7 +31,7 @@ const agent = new Agent({
|
|
|
31
31
|
id: 'researcher',
|
|
32
32
|
name: 'Researcher',
|
|
33
33
|
instructions: 'You research topics thoroughly.',
|
|
34
|
-
model: 'openai/gpt-5.
|
|
34
|
+
model: 'openai/gpt-5.6-sol',
|
|
35
35
|
})
|
|
36
36
|
|
|
37
37
|
export const durableResearcher = createDurableAgent({ agent })
|
|
@@ -95,7 +95,7 @@ import { createDurableAgent } from '@mastra/core/agent/durable'
|
|
|
95
95
|
const agent = new Agent({
|
|
96
96
|
id: 'helper',
|
|
97
97
|
instructions: 'You are a helpful assistant.',
|
|
98
|
-
model: 'openai/gpt-5.
|
|
98
|
+
model: 'openai/gpt-5.6-sol',
|
|
99
99
|
})
|
|
100
100
|
|
|
101
101
|
export const durableHelper = createDurableAgent({ agent })
|
|
@@ -112,7 +112,7 @@ import { createEventedAgent } from '@mastra/core/agent/durable'
|
|
|
112
112
|
const agent = new Agent({
|
|
113
113
|
id: 'writer',
|
|
114
114
|
instructions: 'You write articles.',
|
|
115
|
-
model: 'openai/gpt-5.
|
|
115
|
+
model: 'openai/gpt-5.6-sol',
|
|
116
116
|
})
|
|
117
117
|
|
|
118
118
|
export const eventedWriter = createEventedAgent({ agent })
|
|
@@ -132,7 +132,7 @@ const inngest = new Inngest({ id: 'my-app' })
|
|
|
132
132
|
const agent = new Agent({
|
|
133
133
|
id: 'analyst',
|
|
134
134
|
instructions: 'You analyze data.',
|
|
135
|
-
model: 'openai/gpt-5.
|
|
135
|
+
model: 'openai/gpt-5.6-sol',
|
|
136
136
|
})
|
|
137
137
|
|
|
138
138
|
export const inngestAnalyst = createInngestAgent({ agent, inngest })
|
|
@@ -223,10 +223,51 @@ Resume the suspended run after approval:
|
|
|
223
223
|
await durableAgent.resume(runId, { approved: true })
|
|
224
224
|
```
|
|
225
225
|
|
|
226
|
+
## Crash recovery
|
|
227
|
+
|
|
228
|
+
If the server process crashes while a durable agent run is in progress, that run remains in `running` status in storage with no automatic retry. On the next server start you can re-drive these orphaned runs so they pick up where they left off.
|
|
229
|
+
|
|
230
|
+
### Automatic recovery
|
|
231
|
+
|
|
232
|
+
Set `recovery.durableAgents` to `'auto'` in the Mastra config. The deployer calls `recoverAllDurableAgents()` on boot, right after restarting active workflow runs:
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
export const mastra = new Mastra({
|
|
236
|
+
agents: { myAgent: durableAgent },
|
|
237
|
+
storage: new PostgresStore({ connectionString: process.env.DATABASE_URL! }),
|
|
238
|
+
recovery: { durableAgents: 'auto' },
|
|
239
|
+
})
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
On startup, this discovers every registered durable agent with runs stuck in `running` status and re-drives them from the last persisted snapshot.
|
|
243
|
+
|
|
244
|
+
> **Warning:** Recovery re-runs the agentic loop from the last snapshot, which re-issues LLM calls (real cost) and re-executes tool calls. Make sure your tools are idempotent before enabling automatic recovery.
|
|
245
|
+
|
|
246
|
+
### Manual recovery
|
|
247
|
+
|
|
248
|
+
If you need finer control — for example gating recovery behind a leader election or running it on a schedule — call the methods directly:
|
|
249
|
+
|
|
250
|
+
```typescript
|
|
251
|
+
// Recover all durable agents
|
|
252
|
+
const result = await mastra.recoverAllDurableAgents()
|
|
253
|
+
console.log(`Recovered ${result.recovered} runs (${result.succeeded} ok, ${result.failed} failed)`)
|
|
254
|
+
|
|
255
|
+
// Recover a specific agent
|
|
256
|
+
const agentResult = await durableAgent.recoverActiveRuns()
|
|
257
|
+
|
|
258
|
+
// Recover a single known run
|
|
259
|
+
await durableAgent.recoverActiveRuns({ runId: 'run-abc-123' })
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Multi-instance deployments
|
|
263
|
+
|
|
264
|
+
There is no distributed lease or lock yet. In multi-replica deployments, every replica that starts with `recovery.durableAgents: 'auto'` will race to recover the same runs. For now, either gate recovery behind your own leader election or run it from a single replica.
|
|
265
|
+
|
|
226
266
|
## Related
|
|
227
267
|
|
|
228
268
|
- [DurableAgent reference](https://mastra.ai/reference/agents/durable-agent)
|
|
229
269
|
- [`createInngestAgent()` reference](https://mastra.ai/reference/agents/inngest-agent)
|
|
230
270
|
- [Background tasks](https://mastra.ai/docs/long-running-agents/background-tasks)
|
|
231
271
|
- [Inngest deployment guide](https://mastra.ai/guides/deployment/inngest)
|
|
232
|
-
- [Agent overview](https://mastra.ai/docs/agents/overview)
|
|
272
|
+
- [Agent overview](https://mastra.ai/docs/agents/overview)
|
|
273
|
+
- [Worker overview](https://mastra.ai/docs/deployment/workers)
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
> **Beta:** The Goals feature is in beta stage and subject to breaking changes in minor versions until it graduates from its beta status.
|
|
8
8
|
|
|
9
|
-
A goal is a durable, thread-scoped objective: a standing instruction the agent keeps working toward across loop iterations until a judge model decides it's satisfied or a run budget is exhausted.
|
|
9
|
+
A goal is a durable, thread-scoped objective: a standing instruction the agent keeps working toward across loop iterations until a judge model decides it's satisfied or a run budget is exhausted.
|
|
10
|
+
|
|
11
|
+
The objective is persisted in thread state, so it survives reloads and is evaluated in-loop, even when a new message arrives in the middle of an already-running turn.
|
|
10
12
|
|
|
11
13
|
Goals build on the same machinery as [`isTaskComplete`](https://mastra.ai/docs/agents/supervisor-agents): an LLM-as-judge scores the agent's output each iteration and gates the loop. The difference is that a goal is **durable** (stored in thread state, not passed per call) and is set and updated through `Agent` methods rather than per-`stream()` options.
|
|
12
14
|
|
|
@@ -22,7 +24,7 @@ For a one-off completion check within a single `stream()` call, use [`isTaskComp
|
|
|
22
24
|
|
|
23
25
|
## Quickstart
|
|
24
26
|
|
|
25
|
-
Goals require a configured [storage](https://mastra.ai/docs/storage/overview) backend and a memory-backed thread. Add a `goal` config to the agent
|
|
27
|
+
Goals require a configured [storage](https://mastra.ai/docs/storage/overview) backend and a memory-backed thread. Add a `goal` config to the agent, a judge model is required for the goal to do anything, then set an objective for a thread:
|
|
26
28
|
|
|
27
29
|
```typescript
|
|
28
30
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -31,7 +33,7 @@ const worker = new Agent({
|
|
|
31
33
|
id: 'worker',
|
|
32
34
|
name: 'worker',
|
|
33
35
|
instructions: 'You complete software tasks end to end.',
|
|
34
|
-
model: 'openai/gpt-5.
|
|
36
|
+
model: 'openai/gpt-5.6-sol',
|
|
35
37
|
memory,
|
|
36
38
|
goal: {
|
|
37
39
|
judge: 'openai/gpt-5-mini',
|
|
@@ -51,19 +53,21 @@ const stream = await worker.stream('Start working on the goal', {
|
|
|
51
53
|
})
|
|
52
54
|
```
|
|
53
55
|
|
|
54
|
-
The `goal` config auto-registers the state-signal projection, so the model always sees the current objective as `<current-objective>` in its context
|
|
56
|
+
The `goal` config auto-registers the state-signal projection, so the model always sees the current objective as `<current-objective>` in its context without extra setup.
|
|
55
57
|
|
|
56
58
|
## How the goal step works
|
|
57
59
|
|
|
58
60
|
A goal step runs inside the agentic execution loop, right after `isTaskComplete`. On a real candidate answer it scores the conversation against the objective and gates the loop:
|
|
59
61
|
|
|
60
|
-
- **Not satisfied, budget remaining** → the loop continues
|
|
62
|
+
- **Not satisfied, budget remaining** → the loop continues. Per-evaluation feedback is injected so the agent iterates.
|
|
61
63
|
- **Satisfied** → the loop stops and the objective is marked `done`.
|
|
62
64
|
- **Budget exhausted** (`runsUsed >= maxRuns`) → the loop stops and the objective is marked `paused`. Raise `maxRuns`, then resume the objective to continue.
|
|
63
65
|
|
|
64
|
-
The step is a no-op for background-task, mid-tool-loop, and working-memory-only iterations
|
|
66
|
+
The step is a no-op for background-task, mid-tool-loop, and working-memory-only iterations, the same gating as `isTaskComplete`.
|
|
67
|
+
|
|
68
|
+
**The judge model is the activation switch.** If no judge resolves (neither the per-objective override nor the agent's `goal.judge`), the goal step performs no scoring or budget consumption and emits no `goal` chunk.
|
|
65
69
|
|
|
66
|
-
|
|
70
|
+
Effective settings resolve as per-objective record value → agent `goal` config → built-in default (`maxRuns` `50`, a default judge prompt).
|
|
67
71
|
|
|
68
72
|
By default the step uses a built-in LLM-as-judge scorer that returns `1` when the objective is achieved and `0` otherwise. Supply your own scorer with `goal.scorer` to customize judging.
|
|
69
73
|
|
|
@@ -72,7 +76,7 @@ const worker = new Agent({
|
|
|
72
76
|
id: 'worker',
|
|
73
77
|
name: 'worker',
|
|
74
78
|
instructions: 'You complete software tasks end to end.',
|
|
75
|
-
model: 'openai/gpt-5.
|
|
79
|
+
model: 'openai/gpt-5.6-sol',
|
|
76
80
|
memory,
|
|
77
81
|
goal: {
|
|
78
82
|
// A resolver function lets you inject provider credentials and read the
|
|
@@ -109,6 +113,6 @@ Per-objective values written by `setObjective` / `updateObjectiveOptions` take p
|
|
|
109
113
|
|
|
110
114
|
## Related
|
|
111
115
|
|
|
112
|
-
- [Supervisor agents](https://mastra.ai/docs/agents/supervisor-agents)
|
|
113
|
-
- [Signal providers](https://mastra.ai/docs/long-running-agents/signal-providers)
|
|
114
|
-
- [Memory storage](https://mastra.ai/docs/storage/overview)
|
|
116
|
+
- [Supervisor agents](https://mastra.ai/docs/agents/supervisor-agents): `isTaskComplete` and the rubric scorer
|
|
117
|
+
- [Signal providers](https://mastra.ai/docs/long-running-agents/signal-providers): how the objective is projected into context
|
|
118
|
+
- [Memory storage](https://mastra.ai/docs/storage/overview): the storage backend goals require
|
|
@@ -25,7 +25,7 @@ const pinger = new Agent({
|
|
|
25
25
|
id: 'pinger',
|
|
26
26
|
name: 'Pinger',
|
|
27
27
|
instructions: 'Report the current system status in one sentence.',
|
|
28
|
-
model: 'openai/gpt-5.
|
|
28
|
+
model: 'openai/gpt-5.6-sol',
|
|
29
29
|
})
|
|
30
30
|
|
|
31
31
|
const mastra = new Mastra({
|
|
@@ -136,7 +136,7 @@ await mastra.schedules.create({
|
|
|
136
136
|
})
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
Workflow schedules created this way are independent of the declarative `schedule` field on `createWorkflow
|
|
139
|
+
Workflow schedules created this way are independent of the declarative `schedule` field on `createWorkflow`, see [scheduled workflows](https://mastra.ai/docs/workflows/scheduled-workflows) for the declarative form and Studio views.
|
|
140
140
|
|
|
141
141
|
### Custom IDs
|
|
142
142
|
|
|
@@ -187,7 +187,7 @@ The hooks are:
|
|
|
187
187
|
|
|
188
188
|
- `prepare`: runs before the fire. Return an object to override fire-time parameters such as `prompt` or `threadId`, `null` to skip the fire, or `undefined` to use the stored defaults.
|
|
189
189
|
- `onFinish`: runs once per trigger that reached a non-error, non-abort terminal state.
|
|
190
|
-
- `onError`: runs
|
|
190
|
+
- `onError`: runs after a failure in `prepare` or the signal. It also runs when the agent run fails.
|
|
191
191
|
- `onAbort`: runs when the run was aborted mid-stream.
|
|
192
192
|
|
|
193
193
|
Every hook context includes `agentId` (the agent the schedule fired for) alongside `schedule` and `trigger`.
|
|
@@ -14,7 +14,7 @@ Use a signal provider when an external system produces events that an agent shou
|
|
|
14
14
|
|
|
15
15
|
- The source emits events tied to a resource a thread cares about, such as a pull request, a channel, or a build.
|
|
16
16
|
- You want one place that tracks which threads watch which external resources.
|
|
17
|
-
- You want to receive events by polling
|
|
17
|
+
- You want to receive events by polling or by webhook, or alternatively both.
|
|
18
18
|
|
|
19
19
|
If you only need to push a one-off event into a thread, call [`agent.sendNotificationSignal()`](https://mastra.ai/reference/agents/agent) directly instead.
|
|
20
20
|
|
|
@@ -28,7 +28,9 @@ A signal provider combines three capabilities:
|
|
|
28
28
|
- **Ingestion:** You override `poll()` for pull-based sources or `handleWebhook()` for push-based sources.
|
|
29
29
|
- **Delivery:** When an event matches a subscription, call the protected `notify()` helper to forward a notification signal to the connected agent's thread.
|
|
30
30
|
|
|
31
|
-
Register a provider by passing it to an agent.
|
|
31
|
+
Register a provider by passing it to an agent.
|
|
32
|
+
|
|
33
|
+
The agent connects the provider and starts polling when a `pollInterval` is set. It also merges any processors or tools exposed by the provider.
|
|
32
34
|
|
|
33
35
|
```typescript
|
|
34
36
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -38,7 +40,7 @@ export const supportAgent = new Agent({
|
|
|
38
40
|
id: 'support-agent',
|
|
39
41
|
name: 'Support Agent',
|
|
40
42
|
instructions: 'Help the user triage updates.',
|
|
41
|
-
model: 'openai/gpt-5.
|
|
43
|
+
model: 'openai/gpt-5.6-sol',
|
|
42
44
|
signals: [new CiSignals()],
|
|
43
45
|
})
|
|
44
46
|
```
|
|
@@ -111,7 +113,7 @@ export const supportAgent = new Agent({
|
|
|
111
113
|
id: 'support-agent',
|
|
112
114
|
name: 'Support Agent',
|
|
113
115
|
instructions: 'Help the user triage CI updates.',
|
|
114
|
-
model: 'openai/gpt-5.
|
|
116
|
+
model: 'openai/gpt-5.6-sol',
|
|
115
117
|
signals: [ciSignals],
|
|
116
118
|
})
|
|
117
119
|
|
|
@@ -181,7 +183,7 @@ export const supportAgent = new Agent({
|
|
|
181
183
|
id: 'support-agent',
|
|
182
184
|
name: 'Support Agent',
|
|
183
185
|
instructions: 'Help the user triage updates.',
|
|
184
|
-
model: 'openai/gpt-5.
|
|
186
|
+
model: 'openai/gpt-5.6-sol',
|
|
185
187
|
signals: [webhooks],
|
|
186
188
|
})
|
|
187
189
|
|
|
@@ -208,7 +210,7 @@ export const devAgent = new Agent({
|
|
|
208
210
|
id: 'dev-agent',
|
|
209
211
|
name: 'Dev Agent',
|
|
210
212
|
instructions: 'Help triage pull request activity.',
|
|
211
|
-
model: 'openai/gpt-5.
|
|
213
|
+
model: 'openai/gpt-5.6-sol',
|
|
212
214
|
signals: [new GithubSignals()],
|
|
213
215
|
})
|
|
214
216
|
```
|