@mastra/mcp-docs-server 1.3.15-alpha.1 → 1.3.15-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/agents/guardrails.md +1 -1
- package/.docs/docs/agents/human-in-the-loop.md +2 -2
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/overview.md +2 -2
- package/.docs/docs/agents/processors.md +2 -2
- package/.docs/docs/agents/tools.md +3 -3
- package/.docs/docs/auth/composite-auth.md +1 -1
- package/.docs/docs/auth/custom-auth-provider.md +5 -5
- package/.docs/docs/auth/fga.md +1 -1
- package/.docs/docs/auth/jwt.md +2 -2
- package/.docs/docs/auth/simple-auth.md +1 -1
- package/.docs/docs/browser.md +1 -1
- package/.docs/docs/channels.md +2 -2
- package/.docs/docs/connections/sdk-agents.md +1 -1
- package/.docs/docs/deployment/overview.md +2 -2
- package/.docs/docs/deployment/web-framework.md +3 -3
- package/.docs/docs/develop.md +1 -1
- package/.docs/docs/evals/built-in-scorers.md +1 -1
- package/.docs/docs/evals/custom-scorers.md +8 -8
- package/.docs/docs/evals/overview.md +1 -1
- package/.docs/docs/evals/quick-checks.md +1 -1
- package/.docs/docs/guides/authentication-identity.md +1 -1
- package/.docs/docs/guides/context-engineering.md +1 -1
- package/.docs/docs/guides/multi-agent-systems.md +2 -2
- package/.docs/docs/harness/agent-controller.md +5 -3
- package/.docs/docs/harness/background-tasks.md +7 -1
- package/.docs/docs/harness/durable-agents.md +1 -1
- package/.docs/docs/index.md +2 -2
- package/.docs/docs/license.md +1 -1
- package/.docs/docs/mastra-platform/server.md +1 -1
- package/.docs/docs/mastra-platform/trace-intelligence.md +3 -3
- package/.docs/docs/mastra-platform/workspaces.md +1 -1
- package/.docs/docs/memory/memory-processors.md +2 -2
- package/.docs/docs/memory/message-history.md +1 -1
- package/.docs/docs/memory/multi-user-threads.md +1 -1
- package/.docs/docs/memory/observational-memory.md +3 -3
- package/.docs/docs/memory/semantic-recall.md +4 -4
- package/.docs/docs/memory/working-memory.md +16 -16
- package/.docs/docs/observability/integrations/exporters/mastra-storage.md +12 -12
- package/.docs/docs/observability/tracing/overview.md +4 -2
- package/.docs/docs/sandbox/filesystem.md +1 -1
- package/.docs/docs/server/custom-api-routes.md +1 -1
- package/.docs/docs/server/middleware.md +1 -1
- package/.docs/docs/server/request-context.md +1 -1
- package/.docs/docs/signals/overview.md +1 -1
- package/.docs/docs/signals/sending-signals.md +1 -1
- package/.docs/docs/studio/deployment.md +2 -2
- package/.docs/docs/studio/editor.md +2 -2
- package/.docs/docs/studio/observability.md +1 -1
- package/.docs/docs/workflows/control-flow.md +4 -4
- package/.docs/docs/workflows/overview.md +3 -3
- package/.docs/docs/workflows/snapshots.md +2 -2
- package/.docs/integrations/agentic-ui/ai-sdk-ui.md +3 -3
- package/.docs/integrations/agentic-ui/assistant-ui.md +5 -5
- package/.docs/integrations/agentic-ui/copilotkit.md +4 -4
- package/.docs/integrations/agentic-ui/openui.md +2 -2
- package/.docs/integrations/auth/auth0.md +3 -3
- package/.docs/integrations/auth/better-auth.md +1 -1
- package/.docs/integrations/auth/clerk.md +1 -1
- package/.docs/integrations/auth/firebase.md +3 -3
- package/.docs/integrations/auth/google.md +2 -2
- package/.docs/integrations/auth/okta.md +3 -3
- package/.docs/integrations/auth/supabase.md +1 -1
- package/.docs/integrations/auth/workos.md +1 -1
- package/.docs/integrations/browsers/stagehand.md +1 -1
- package/.docs/integrations/channels/imessage.md +1 -1
- package/.docs/integrations/channels/ring.md +6 -6
- package/.docs/integrations/channels/slack.md +1 -1
- package/.docs/integrations/channels/whatsapp.md +1 -1
- package/.docs/integrations/databases/aurora-dsql.md +13 -13
- package/.docs/integrations/databases/clickhouse.md +2 -2
- package/.docs/integrations/databases/cloudflare-d1.md +4 -4
- package/.docs/integrations/databases/cloudflare-kv.md +10 -10
- package/.docs/integrations/databases/convex.md +6 -6
- package/.docs/integrations/databases/dynamodb.md +8 -8
- package/.docs/integrations/databases/elasticsearch.md +6 -6
- package/.docs/integrations/databases/lancedb.md +4 -4
- package/.docs/integrations/databases/mongodb.md +2 -2
- package/.docs/integrations/databases/mssql.md +2 -2
- package/.docs/integrations/databases/oracledb.md +2 -2
- package/.docs/integrations/databases/postgresql.md +14 -14
- package/.docs/integrations/databases/redis.md +7 -7
- package/.docs/integrations/databases/spanner.md +2 -2
- package/.docs/integrations/databases/upstash.md +5 -5
- package/.docs/integrations/databases/valkey.md +1 -1
- package/.docs/integrations/deploy/amazon-ec2.md +1 -1
- package/.docs/integrations/deploy/aws-bedrock-agentcore.md +1 -1
- package/.docs/integrations/deploy/aws-lambda.md +12 -12
- package/.docs/integrations/deploy/azure-app-services.md +2 -2
- package/.docs/integrations/deploy/cloudflare.md +2 -2
- package/.docs/integrations/deploy/digital-ocean.md +2 -2
- package/.docs/integrations/deploy/inngest.md +5 -5
- package/.docs/integrations/deploy/kubernetes-helm.md +20 -20
- package/.docs/integrations/deploy/neon.md +1 -1
- package/.docs/integrations/deploy/netlify.md +1 -1
- package/.docs/integrations/deploy/render.md +1 -1
- package/.docs/integrations/deploy/temporal.md +1 -1
- package/.docs/integrations/deploy/vercel.md +4 -4
- package/.docs/integrations/file-storage/google-cloud-storage.md +1 -1
- package/.docs/integrations/frameworks/angular.md +1 -1
- package/.docs/integrations/frameworks/astro.md +3 -3
- package/.docs/integrations/frameworks/electron.md +1 -1
- package/.docs/integrations/frameworks/express.md +1 -1
- package/.docs/integrations/frameworks/hono.md +1 -1
- package/.docs/integrations/frameworks/nestjs.md +2 -2
- package/.docs/integrations/frameworks/next-js.md +3 -3
- package/.docs/integrations/frameworks/nuxt.md +1 -1
- package/.docs/integrations/frameworks/sveltekit.md +1 -1
- package/.docs/integrations/frameworks/tanstack-start.md +3 -3
- package/.docs/integrations/frameworks/vite-react.md +3 -3
- package/.docs/integrations/observability/arize.md +9 -9
- package/.docs/integrations/observability/arthur.md +3 -3
- package/.docs/integrations/observability/braintrust.md +3 -3
- package/.docs/integrations/observability/confident-ai.md +5 -5
- package/.docs/integrations/observability/datadog.md +9 -9
- package/.docs/integrations/observability/laminar.md +2 -2
- package/.docs/integrations/observability/langfuse.md +13 -13
- package/.docs/integrations/observability/langsmith.md +9 -9
- package/.docs/integrations/observability/opentelemetry.md +23 -23
- package/.docs/integrations/observability/sentry.md +4 -4
- package/.docs/integrations/sandboxes/agentcore.md +1 -1
- package/.docs/integrations/sandboxes/apple-container.md +2 -2
- package/.docs/integrations/sandboxes/cloudflare-sandbox.md +6 -6
- package/.docs/integrations/sandboxes/daytona.md +5 -5
- package/.docs/integrations/sandboxes/docker.md +6 -6
- package/.docs/integrations/sandboxes/e2b-desktop.md +1 -1
- package/.docs/integrations/sandboxes/e2b.md +14 -14
- package/.docs/integrations/sandboxes/modal.md +1 -1
- package/.docs/integrations/sandboxes/railway.md +1 -1
- package/.docs/integrations/sandboxes/sprites.md +2 -2
- package/.docs/integrations/sandboxes/vercel.md +4 -4
- package/.docs/integrations/vectors/couchbase.md +1 -1
- package/.docs/integrations/vectors/duckdb.md +5 -5
- package/.docs/integrations/vectors/lance.md +3 -3
- package/.docs/integrations/vectors/mongodb.md +5 -5
- package/.docs/integrations/vectors/pg.md +11 -11
- package/.docs/integrations/vectors/qdrant.md +2 -2
- package/.docs/integrations/vectors/upstash.md +4 -4
- package/.docs/integrations/voice/azure.md +1 -1
- package/.docs/integrations/voice/cloudflare.md +1 -1
- package/.docs/integrations/voice/google.md +12 -12
- package/.docs/integrations/voice/inworld.md +2 -2
- package/.docs/integrations/voice/livekit.md +25 -25
- package/.docs/integrations/voice/openai.md +4 -4
- package/.docs/integrations/voice/sarvam.md +1 -1
- package/.docs/integrations/voice/speechify.md +1 -1
- package/.docs/integrations/voice/xai.md +1 -1
- package/.docs/models/environment-variables.md +92 -3
- package/.docs/models/gateways/merge-gateway.md +4 -1
- package/.docs/models/gateways/neon.md +1 -2
- package/.docs/models/gateways/netlify.md +7 -6
- package/.docs/models/gateways/openrouter.md +16 -11
- package/.docs/models/gateways/requesty.md +7 -17
- package/.docs/models/gateways/vercel.md +12 -16
- package/.docs/models/index.md +93 -30
- package/.docs/models/providers/302ai.md +2 -1
- package/.docs/models/providers/abacus.md +1 -1
- package/.docs/models/providers/abliteratedllm.md +95 -0
- package/.docs/models/providers/abliteration-ai.md +7 -6
- package/.docs/models/providers/adaption.md +87 -0
- package/.docs/models/providers/adzuki.md +92 -0
- package/.docs/models/providers/aigrow.md +89 -0
- package/.docs/models/providers/aimlapi.md +1 -7
- package/.docs/models/providers/aipg.md +82 -0
- package/.docs/models/providers/aistupidlevel.md +90 -0
- package/.docs/models/providers/aki-io.md +15 -13
- package/.docs/models/providers/ambient.md +13 -12
- package/.docs/models/providers/anonrouter.md +83 -0
- package/.docs/models/providers/anthropic.md +18 -20
- package/.docs/models/providers/apiko.md +83 -0
- package/.docs/models/providers/augure.md +86 -0
- package/.docs/models/providers/autarcho.md +81 -0
- package/.docs/models/providers/bailing.md +15 -12
- package/.docs/models/providers/bumo.md +100 -0
- package/.docs/models/providers/byteplus.md +94 -0
- package/.docs/models/providers/cedarllm.md +81 -0
- package/.docs/models/providers/cheapaimodel.md +85 -0
- package/.docs/models/providers/cheapest-token.md +99 -0
- package/.docs/models/providers/cheapllm.md +81 -0
- package/.docs/models/providers/chutes.md +8 -8
- package/.docs/models/providers/cline-pass.md +4 -3
- package/.docs/models/providers/cloudcode.md +86 -0
- package/.docs/models/providers/cloudflare-workers-ai.md +2 -1
- package/.docs/models/providers/commandcode.md +22 -1
- package/.docs/models/providers/confidential-ai.md +81 -0
- package/.docs/models/providers/cortecs.md +14 -14
- package/.docs/models/providers/crossmodel.md +7 -2
- package/.docs/models/providers/deepinfra.md +3 -1
- package/.docs/models/providers/digitalocean.md +5 -4
- package/.docs/models/providers/dothoosh.md +96 -0
- package/.docs/models/providers/doubleword.md +98 -0
- package/.docs/models/providers/edenai.md +52 -44
- package/.docs/models/providers/empiriolabs.md +2 -1
- package/.docs/models/providers/engy.md +2 -1
- package/.docs/models/providers/entrim.md +84 -0
- package/.docs/models/providers/ezkielyna.md +85 -0
- package/.docs/models/providers/fastrouter.md +21 -5
- package/.docs/models/providers/fiftyx.md +81 -0
- package/.docs/models/providers/fireworks-ai.md +1 -1
- package/.docs/models/providers/fortytwo.md +81 -0
- package/.docs/models/providers/frequency.md +81 -0
- package/.docs/models/providers/frogbot.md +30 -5
- package/.docs/models/providers/gisoo.md +96 -0
- package/.docs/models/providers/google.md +5 -4
- package/.docs/models/providers/graphn.md +87 -0
- package/.docs/models/providers/hetzner.md +1 -1
- package/.docs/models/providers/hostinger-router.md +88 -0
- package/.docs/models/providers/huawei-maas.md +88 -0
- package/.docs/models/providers/hubris.md +96 -0
- package/.docs/models/providers/huggingface.md +5 -1
- package/.docs/models/providers/humain.md +82 -0
- package/.docs/models/providers/hyper.md +24 -22
- package/.docs/models/providers/inceptron.md +4 -4
- package/.docs/models/providers/infer.md +17 -9
- package/.docs/models/providers/inferall.md +86 -0
- package/.docs/models/providers/inference-coop.md +88 -0
- package/.docs/models/providers/inferenceapis.md +91 -0
- package/.docs/models/providers/inferris.md +84 -0
- package/.docs/models/providers/infersia.md +86 -0
- package/.docs/models/providers/isoquant.md +82 -0
- package/.docs/models/providers/iteracompute.md +33 -16
- package/.docs/models/providers/jad-ai.md +83 -0
- package/.docs/models/providers/joingonka.md +83 -0
- package/.docs/models/providers/jzstoken.md +102 -0
- package/.docs/models/providers/keln.md +94 -0
- package/.docs/models/providers/kenari.md +47 -12
- package/.docs/models/providers/kilo.md +191 -100
- package/.docs/models/providers/kitani.md +89 -0
- package/.docs/models/providers/klavo.md +90 -0
- package/.docs/models/providers/korouter.md +99 -0
- package/.docs/models/providers/kunavo.md +96 -0
- package/.docs/models/providers/liquid.md +15 -8
- package/.docs/models/providers/lithosai.md +83 -0
- package/.docs/models/providers/llmgateway-providers.md +96 -43
- package/.docs/models/providers/llmgateway.md +33 -21
- package/.docs/models/providers/logits.md +82 -0
- package/.docs/models/providers/lowrouter.md +17 -4
- package/.docs/models/providers/lyceum.md +88 -0
- package/.docs/models/providers/mallard.md +81 -0
- package/.docs/models/providers/meragpt.md +81 -0
- package/.docs/models/providers/mistral.md +1 -1
- package/.docs/models/providers/moneo.md +92 -0
- package/.docs/models/providers/nan.md +11 -8
- package/.docs/models/providers/nano-gpt.md +77 -73
- package/.docs/models/providers/nearai.md +1 -1
- package/.docs/models/providers/nebius.md +3 -6
- package/.docs/models/providers/neuralwatt.md +28 -25
- package/.docs/models/providers/nodecode.md +81 -0
- package/.docs/models/providers/nokeep.md +83 -0
- package/.docs/models/providers/novita-ai.md +4 -1
- package/.docs/models/providers/oathbreaker.md +82 -0
- package/.docs/models/providers/obscurify.md +95 -0
- package/.docs/models/providers/ofox.md +7 -3
- package/.docs/models/providers/ollama-cloud.md +2 -1
- package/.docs/models/providers/openai.md +4 -2
- package/.docs/models/providers/opencode-go.md +3 -1
- package/.docs/models/providers/opencode.md +5 -3
- package/.docs/models/providers/opper.md +2 -1
- package/.docs/models/providers/outerlabs.md +98 -0
- package/.docs/models/providers/paraloncloud.md +81 -0
- package/.docs/models/providers/pareto.md +9 -7
- package/.docs/models/providers/phala.md +99 -0
- package/.docs/models/providers/phase.md +82 -0
- package/.docs/models/providers/powerspring.md +87 -0
- package/.docs/models/providers/prime.md +5 -5
- package/.docs/models/providers/proxystacks.md +84 -0
- package/.docs/models/providers/rayline.md +82 -0
- package/.docs/models/providers/refuseless.md +86 -0
- package/.docs/models/providers/ruapi.md +89 -0
- package/.docs/models/providers/runcrate.md +91 -0
- package/.docs/models/providers/runinfra.md +2 -1
- package/.docs/models/providers/sagg.md +81 -0
- package/.docs/models/providers/sambanova.md +10 -12
- package/.docs/models/providers/sandbase.md +90 -0
- package/.docs/models/providers/scx-ai.md +20 -10
- package/.docs/models/providers/sensenova.md +4 -4
- package/.docs/models/providers/siliconflow-cn.md +2 -1
- package/.docs/models/providers/sokkan.md +85 -0
- package/.docs/models/providers/sparrowcodes.md +99 -0
- package/.docs/models/providers/steadyrouter.md +101 -0
- package/.docs/models/providers/stepping-stone.md +95 -0
- package/.docs/models/providers/superbot-gg.md +82 -0
- package/.docs/models/providers/synthetic.md +14 -14
- package/.docs/models/providers/synthorai.md +92 -0
- package/.docs/models/providers/teamorouter.md +90 -0
- package/.docs/models/providers/teapot-router.md +87 -0
- package/.docs/models/providers/tencent-token-plan.md +23 -11
- package/.docs/models/providers/tenstorrent.md +84 -0
- package/.docs/models/providers/therouter.md +81 -0
- package/.docs/models/providers/tinfoil.md +1 -1
- package/.docs/models/providers/toapis.md +83 -0
- package/.docs/models/providers/tokenify.md +85 -0
- package/.docs/models/providers/tokenlab.md +81 -0
- package/.docs/models/providers/tokenwatt.md +81 -0
- package/.docs/models/providers/trustedtokens.md +90 -0
- package/.docs/models/providers/umans-ai-coding-plan.md +2 -5
- package/.docs/models/providers/umans-ai.md +5 -7
- package/.docs/models/providers/unbiased.md +81 -0
- package/.docs/models/providers/uncensuredai.md +83 -0
- package/.docs/models/providers/unrestricted.md +84 -0
- package/.docs/models/providers/uplinkswitch.md +92 -0
- package/.docs/models/providers/verda.md +81 -0
- package/.docs/models/providers/volcengine-coding-plan.md +16 -9
- package/.docs/models/providers/volcengine.md +2 -2
- package/.docs/models/providers/wafer.ai.md +20 -10
- package/.docs/models/providers/wallaby.md +7 -5
- package/.docs/models/providers/wally.md +9 -8
- package/.docs/models/providers/watt.md +98 -0
- package/.docs/models/providers/xxapi.md +96 -0
- package/.docs/models/providers/zenifra.md +22 -10
- package/.docs/models/providers/zerogpu.md +89 -0
- package/.docs/models/providers/zro.md +85 -0
- package/.docs/models/providers.md +92 -3
- package/.docs/reference/agents/agent.md +1 -1
- package/.docs/reference/agents/durable-agent.md +2 -2
- package/.docs/reference/agents/generateLegacy.md +4 -4
- package/.docs/reference/agents/network.md +2 -2
- package/.docs/reference/ai-sdk/overview.md +2 -2
- package/.docs/reference/build-with-ai.md +3 -3
- package/.docs/reference/channels/slack-provider.md +1 -1
- package/.docs/reference/classifier/classifier.md +1 -1
- package/.docs/reference/cli/mastra.md +2 -2
- package/.docs/reference/client-js/agent-controller.md +1 -1
- package/.docs/reference/client-js/memory.md +10 -10
- package/.docs/reference/client-js/observability.md +1 -1
- package/.docs/reference/client-js/responses.md +1 -1
- package/.docs/reference/client-js/tools.md +2 -2
- package/.docs/reference/client-js/vectors.md +6 -6
- package/.docs/reference/configuration.md +1 -1
- package/.docs/reference/connect/tools.md +1 -1
- package/.docs/reference/deployer.md +4 -4
- package/.docs/reference/evals/answer-relevancy.md +2 -2
- package/.docs/reference/evals/bias.md +2 -2
- package/.docs/reference/evals/checks.md +1 -1
- package/.docs/reference/evals/completeness.md +4 -4
- package/.docs/reference/evals/content-similarity.md +4 -4
- package/.docs/reference/evals/context-precision.md +6 -6
- package/.docs/reference/evals/context-recall.md +1 -1
- package/.docs/reference/evals/context-relevance.md +9 -9
- package/.docs/reference/evals/create-scorer.md +3 -3
- package/.docs/reference/evals/faithfulness.md +1 -1
- package/.docs/reference/evals/hallucination.md +6 -6
- package/.docs/reference/evals/keyword-coverage.md +2 -2
- package/.docs/reference/evals/multi-turn-judge.md +1 -1
- package/.docs/reference/evals/noise-sensitivity.md +16 -16
- package/.docs/reference/evals/prompt-alignment.md +25 -25
- package/.docs/reference/evals/run-evals.md +2 -2
- package/.docs/reference/evals/summarization.md +1 -1
- package/.docs/reference/evals/textual-difference.md +2 -2
- package/.docs/reference/evals/tone-consistency.md +2 -2
- package/.docs/reference/evals/tool-call-accuracy.md +10 -10
- package/.docs/reference/evals/toxicity.md +2 -2
- package/.docs/reference/evals/trajectory-accuracy.md +2 -2
- package/.docs/reference/manual-install.md +2 -2
- package/.docs/reference/memory/listThreads.md +1 -1
- package/.docs/reference/migrations/agentnetwork.md +1 -1
- package/.docs/reference/migrations/mastra-cloud.md +4 -4
- package/.docs/reference/migrations/mcp-v2.md +1 -1
- package/.docs/reference/migrations/upgrade-to-v1/deployment.md +1 -1
- package/.docs/reference/migrations/upgrade-to-v1/overview.md +8 -8
- package/.docs/reference/migrations/upgrade-to-v1/tracing.md +3 -3
- package/.docs/reference/observability/tracing/bridges/datadog.md +4 -4
- package/.docs/reference/observability/tracing/bridges/otel.md +4 -4
- package/.docs/reference/observability/tracing/exporters/arize.md +4 -4
- package/.docs/reference/observability/tracing/exporters/arthur.md +3 -3
- package/.docs/reference/observability/tracing/exporters/braintrust.md +2 -2
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +2 -2
- package/.docs/reference/observability/tracing/exporters/confident-ai.md +2 -2
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/datadog.md +3 -3
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +5 -5
- package/.docs/reference/observability/tracing/exporters/laminar.md +2 -2
- package/.docs/reference/observability/tracing/exporters/langfuse.md +3 -3
- package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/mastra-storage-exporter.md +5 -5
- package/.docs/reference/observability/tracing/exporters/otel.md +4 -4
- package/.docs/reference/observability/tracing/exporters/posthog.md +2 -2
- package/.docs/reference/observability/tracing/exporters/sentry.md +4 -4
- package/.docs/reference/observability/tracing/instances.md +1 -1
- package/.docs/reference/processors/model-selection-processor.md +2 -2
- package/.docs/reference/processors/processor-interface.md +3 -3
- package/.docs/reference/processors/stream-error-retry-processor.md +1 -1
- package/.docs/reference/processors/system-prompt-scrubber.md +1 -1
- package/.docs/reference/processors/token-limiter-processor.md +1 -1
- package/.docs/reference/processors/unicode-normalizer.md +1 -1
- package/.docs/reference/project-structure.md +2 -2
- package/.docs/reference/pubsub/google-cloud-pubsub.md +1 -1
- package/.docs/reference/pubsub/lease-provider.md +1 -1
- 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 +1 -1
- package/.docs/reference/rag/chunking-and-embedding.md +4 -4
- package/.docs/reference/rag/database-config.md +4 -4
- package/.docs/reference/rag/graph-rag-guide.md +3 -3
- package/.docs/reference/rag/metadata-filters.md +4 -4
- package/.docs/reference/rag/overview.md +4 -0
- package/.docs/reference/rag/rerank.md +1 -1
- package/.docs/reference/rag/rerankWithScorer.md +1 -1
- package/.docs/reference/rag/retrieval.md +8 -6
- package/.docs/reference/rag/vector-databases.md +7 -7
- package/.docs/reference/server/nestjs-adapter.md +1 -1
- package/.docs/reference/server/register-api-route.md +5 -5
- package/.docs/reference/storage/composite.md +1 -1
- package/.docs/reference/storage/overview.md +1 -1
- package/.docs/reference/storage/retention.md +2 -2
- package/.docs/reference/storage/turso.md +1 -1
- package/.docs/reference/streaming/agents/MastraModelOutput.md +5 -5
- package/.docs/reference/streaming/agents/stream.md +5 -5
- package/.docs/reference/streaming/agents/streamLegacy.md +4 -4
- package/.docs/reference/templates/overview.md +1 -1
- package/.docs/reference/tools/bedrock-kb-tool.md +8 -8
- package/.docs/reference/tools/mcp-client.md +9 -9
- package/.docs/reference/tools/mcp-server.md +17 -17
- package/.docs/reference/tools/vector-query-tool.md +6 -6
- package/.docs/reference/voice/composite-voice.md +3 -3
- package/.docs/reference/voice/overview.md +5 -5
- package/.docs/reference/voice/speech-to-speech.md +2 -2
- package/.docs/reference/voice/voice.close.md +1 -1
- package/.docs/reference/voice/voice.connect.md +1 -1
- package/.docs/reference/voice/voice.listen.md +1 -1
- package/.docs/reference/voice/voice.speak.md +1 -1
- package/.docs/reference/workspace/local-sandbox.md +1 -1
- package/package.json +2 -2
|
@@ -200,7 +200,7 @@ Visit [`PIIDetector()`](https://mastra.ai/reference/processors/pii-detector) ref
|
|
|
200
200
|
|
|
201
201
|
### Enforce cost limits
|
|
202
202
|
|
|
203
|
-
The `TokenCostControl()` monitors cumulative estimated cost across the agentic loop, blocking or warning when a monetary limit is exceeded. It queries cost data from observability storage before each LLM call. Cost checks are approximate, metrics are persisted asynchronously, so fast-running agents may
|
|
203
|
+
The `TokenCostControl()` monitors cumulative estimated cost across the agentic loop, blocking or warning when a monetary limit is exceeded. It queries cost data from observability storage before each LLM call. Cost checks are approximate, metrics are persisted asynchronously, so fast-running agents may exceed the configured limit before the guard triggers.
|
|
204
204
|
|
|
205
205
|
```typescript
|
|
206
206
|
import { TokenCostControl } from '@mastra/core/processors'
|
|
@@ -94,7 +94,7 @@ for await (const chunk of stream.fullStream) {
|
|
|
94
94
|
|
|
95
95
|
#### Explaining a decline
|
|
96
96
|
|
|
97
|
-
`declineToolCall()`, `declineToolCallGenerate()`, and `declineNetworkToolCall()` accept an optional `reason`. The reason is returned to the model in place of the tool result, so the model can adjust instead of retrying
|
|
97
|
+
`declineToolCall()`, `declineToolCallGenerate()`, and `declineNetworkToolCall()` accept an optional `reason`. The reason is returned to the model in place of the tool result, so the model can adjust instead of retrying the same way. It's also stored on the tool call's `approval` metadata, so it's still there when the conversation is recalled.
|
|
98
98
|
|
|
99
99
|
```typescript
|
|
100
100
|
const declined = await agent.declineToolCall({
|
|
@@ -162,7 +162,7 @@ The runtime then combines that result with the tool's `requireApproval` setting.
|
|
|
162
162
|
|
|
163
163
|
For sensitive tools, bind the approval to the exact tool name and arguments that were shown to the reviewer. If those arguments drift before execution, the tool shouldn't run under the old approval.
|
|
164
164
|
|
|
165
|
-
The `tool-call-approval` chunk already includes `toolName`, `toolCallId`, and `args`. You can fingerprint those fields when the approval request is shown. The example below uses a JSON string as the fingerprint, but in production
|
|
165
|
+
The `tool-call-approval` chunk already includes `toolName`, `toolCallId`, and `args`. You can fingerprint those fields when the approval request is shown. The example below uses a JSON string as the fingerprint, but in production, use a stable hash of the tool name and arguments:
|
|
166
166
|
|
|
167
167
|
```typescript
|
|
168
168
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -159,7 +159,7 @@ for await (const chunk of resumedStream) {
|
|
|
159
159
|
|
|
160
160
|
### Automatic resumption
|
|
161
161
|
|
|
162
|
-
Set `autoResumeSuspendedTools` to `true` so the network resumes suspended primitives based on the user's next message. This creates a conversational flow where users provide the required information
|
|
162
|
+
Set `autoResumeSuspendedTools` to `true` so the network resumes suspended primitives based on the user's next message. This creates a conversational flow where users provide the required information in conversation.
|
|
163
163
|
|
|
164
164
|
```typescript
|
|
165
165
|
const stream = await routingAgent.network('Delete the old records', {
|
|
@@ -8,7 +8,7 @@ Agents use LLMs and tools to solve open-ended tasks. They reason about goals and
|
|
|
8
8
|
|
|
9
9
|
Agents produce structured responses you can render in your UI or process programmatically. Use agents directly or compose them into workflows or multi-agent systems.
|
|
10
10
|
|
|
11
|
-
## Quickstart for
|
|
11
|
+
## Quickstart for agents
|
|
12
12
|
|
|
13
13
|
**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-6.1-sol`. For OpenAI, use `openai/<model>`, not `openai:<model>`, and don't import or pass a provider object.
|
|
14
14
|
|
|
@@ -117,7 +117,7 @@ export const mastra = new Mastra({
|
|
|
117
117
|
})
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
You're now able to run the agent directly. For this, import the Mastra instance and call the agent.generate() after retrieving the agent by its id. Node.js 22.18.0 and later are able to run TypeScript files directly.
|
|
120
|
+
You're now able to run the agent directly. For this, import the Mastra instance and call the agent.generate() after retrieving the agent by its id. Node.js 22.18.0 and later are able to run TypeScript files directly. Ensure you add file extensions when importing local files. Example:
|
|
121
121
|
|
|
122
122
|
```ts
|
|
123
123
|
// run.mjs
|
|
@@ -145,7 +145,7 @@ const agent = new Agent({
|
|
|
145
145
|
})
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
-
The `StreamErrorRetryProcessor` above is the only stream-retry processor on the agent, and it resolves in its usual position: last, behind the `ProviderHistoryCompat`, `PrefillErrorHandler`, and `UnsupportedFileHandler` defaults your list never names. Pass all four ids to run a
|
|
148
|
+
The `StreamErrorRetryProcessor` above is the only stream-retry processor on the agent, and it resolves in its usual position: last, behind the `ProviderHistoryCompat`, `PrefillErrorHandler`, and `UnsupportedFileHandler` defaults your list never names. Pass all four ids to run a custom set.
|
|
149
149
|
|
|
150
150
|
A processor's `maxRetries` can't raise the agent's limit. Without `maxProcessorRetries`, error-processor retries stop after `3` (see [Error processor retry limits](#error-processor-retry-limits)), so set it when a processor needs more.
|
|
151
151
|
|
|
@@ -833,7 +833,7 @@ for await (const chunk of stream.fullStream) {
|
|
|
833
833
|
|
|
834
834
|
Custom chunk types must use the `data-` prefix (e.g., `data-moderation-update`, `data-status`).
|
|
835
835
|
|
|
836
|
-
By default, `processOutputStream()` skips `data-*` chunks so it doesn't
|
|
836
|
+
By default, `processOutputStream()` skips `data-*` chunks so it doesn't operate on tool telemetry by mistake or other processors' output. To inspect, modify, or block these chunks in a processor, set `processDataParts = true` on that processor:
|
|
837
837
|
|
|
838
838
|
```typescript
|
|
839
839
|
class ModerationCollector implements Processor {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Tools
|
|
6
6
|
|
|
7
|
-
Agents use tools to call APIs or query databases. They can also run custom functions from your codebase. Tools give agents capabilities beyond language generation by providing structured access to data and performing
|
|
7
|
+
Agents use tools to call APIs or query databases. They can also run custom functions from your codebase. Tools give agents capabilities beyond language generation by providing structured access to data and performing defined operations. You can also load tools from remote [MCP servers](https://mastra.ai/docs/connections/mcp) to expand an agent's capabilities. For services like Linear, Slack, and GitHub, [Connect](https://mastra.ai/docs/mastra-platform/connect) on Mastra platform supplies ready-made tools with managed credentials, which you can combine with your own.
|
|
8
8
|
|
|
9
9
|
**For AI agents:** `execute` has exactly one signature: `execute(inputData, context)`. The first parameter is validated against `inputSchema`. The runtime always provides the second parameter with `requestContext`, `tracingContext`, `abortSignal`, and other execution metadata. You may omit it when unused. Other shapes are outdated. Run `npx mastra api tool execute weather-tool '{"location":"San Francisco"}'` to test this tool directly instead of writing a temporary script. The command requires a running Mastra server; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api tool execute --schema` before constructing different input. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
10
10
|
|
|
@@ -448,7 +448,7 @@ Tools support lifecycle hooks that allow you to monitor different stages of tool
|
|
|
448
448
|
|
|
449
449
|
For generic `writer` API usage, see [Streaming](https://mastra.ai/docs/guides/streaming).
|
|
450
450
|
|
|
451
|
-
### Available
|
|
451
|
+
### Available hooks
|
|
452
452
|
|
|
453
453
|
- **onInputStart**: Called when tool call input streaming begins
|
|
454
454
|
- **onInputDelta**: Called for each chunk of input as it streams in
|
|
@@ -598,7 +598,7 @@ export const researchAgent = new Agent({
|
|
|
598
598
|
|
|
599
599
|
The resolved tool ID comes from the provider: `openai.web_search`, `anthropic.web_search_20250305`, `google.google_search`, or `xai.web_search`.
|
|
600
600
|
|
|
601
|
-
Models served through
|
|
601
|
+
Models served through Mastra Gateway, such as `mastra/openai/gpt-5.6-sol`, use the gateway's own web search (`openrouter.web_search`) instead. Results from gateway web search arrive in the model's text response, without separate tool-call or source chunks. Other provider-native tools aren't available through the gateway, so passing one makes the agent run fail with a `MastraError`.
|
|
602
602
|
|
|
603
603
|
The `search` key is only the agent-local tool name. Use any key. The `webSearchTool` value tells Mastra to use provider web search.
|
|
604
604
|
|
|
@@ -204,7 +204,7 @@ To debug authentication issues, add logging to your custom providers or check in
|
|
|
204
204
|
- User types may differ between providers (use discriminated unions if needed)
|
|
205
205
|
- No built-in way to identify which provider authenticated a request
|
|
206
206
|
|
|
207
|
-
### Handling
|
|
207
|
+
### Handling different user types
|
|
208
208
|
|
|
209
209
|
When providers return different user types, use a discriminated union:
|
|
210
210
|
|
|
@@ -215,7 +215,7 @@ The `MastraAuthProviderOptions` interface supports these options:
|
|
|
215
215
|
| `protected` | `(RegExp \| string \| [string, Methods \| Methods[]])[]` | Paths that require authentication |
|
|
216
216
|
| `public` | `(RegExp \| string \| [string, Methods \| Methods[]])[]` | Paths that bypass authentication, unless the route sets `requiresAuth: true` |
|
|
217
217
|
|
|
218
|
-
### Path
|
|
218
|
+
### Path patterns
|
|
219
219
|
|
|
220
220
|
Configure which paths require authentication using pattern matching:
|
|
221
221
|
|
|
@@ -259,7 +259,7 @@ export const mastra = new Mastra({
|
|
|
259
259
|
|
|
260
260
|
The `@mastra/auth` package provides utilities for common token verification patterns:
|
|
261
261
|
|
|
262
|
-
### JWT
|
|
262
|
+
### JWT verification
|
|
263
263
|
|
|
264
264
|
```typescript
|
|
265
265
|
import { verifyHmac, verifyJwks, decodeToken, getTokenIssuer } from '@mastra/auth'
|
|
@@ -277,7 +277,7 @@ const decoded = await decodeToken(token)
|
|
|
277
277
|
const issuer = getTokenIssuer(decoded)
|
|
278
278
|
```
|
|
279
279
|
|
|
280
|
-
### Example: JWKS-based
|
|
280
|
+
### Example: JWKS-based provider
|
|
281
281
|
|
|
282
282
|
```typescript
|
|
283
283
|
import { MastraAuthProvider } from '@mastra/core/server'
|
|
@@ -353,7 +353,7 @@ const auth = new MyAuthProvider({
|
|
|
353
353
|
})
|
|
354
354
|
```
|
|
355
355
|
|
|
356
|
-
### Role-based
|
|
356
|
+
### Role-based authorization
|
|
357
357
|
|
|
358
358
|
```typescript
|
|
359
359
|
import { getWebRequest } from '@mastra/core/server'
|
|
@@ -570,7 +570,7 @@ export class MyAuthProvider extends MastraAuthProvider<MyUser> {
|
|
|
570
570
|
|
|
571
571
|
Mastra includes these auth providers as reference implementations:
|
|
572
572
|
|
|
573
|
-
- **MastraJwtAuth**:
|
|
573
|
+
- **MastraJwtAuth**: JWT verification with HMAC secrets (`@mastra/auth`)
|
|
574
574
|
- **MastraAuthClerk**: Clerk authentication (`@mastra/auth-clerk`)
|
|
575
575
|
- **MastraAuthAuth0**: Auth0 authentication (`@mastra/auth-auth0`)
|
|
576
576
|
- **MastraAuthSupabase**: Supabase authentication (`@mastra/auth-supabase`)
|
package/.docs/docs/auth/fga.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
4
4
|
|
|
5
|
-
# Fine-
|
|
5
|
+
# Fine-grained authorization (FGA)
|
|
6
6
|
|
|
7
7
|
> **Note:** FGA requires a Mastra Enterprise Edition (EE) license in production. It works without a license in development. See [what requires an EE license](https://mastra.ai/docs/license). [Contact sales](https://mastra.ai/contact) for more information.
|
|
8
8
|
|
package/.docs/docs/auth/jwt.md
CHANGED
|
@@ -43,7 +43,7 @@ The easiest way to generate one is using [jwt.io](https://www.jwt.io/):
|
|
|
43
43
|
1. Select **JWT Encoder**.
|
|
44
44
|
2. Scroll down to the **Sign JWT: Secret** section.
|
|
45
45
|
3. Enter your secret (for example: `supersecretdevkeythatishs256safe!`).
|
|
46
|
-
4.
|
|
46
|
+
4. Select **Generate example** to create a valid JWT.
|
|
47
47
|
5. Copy the generated token and set it as `MASTRA_JWT_TOKEN` in your `.env` file.
|
|
48
48
|
|
|
49
49
|
## Usage example
|
|
@@ -65,7 +65,7 @@ export const mastra = new Mastra({
|
|
|
65
65
|
|
|
66
66
|
Visit [MastraJwtAuth](https://mastra.ai/reference/auth/jwt) for all available configuration options.
|
|
67
67
|
|
|
68
|
-
Inside [Studio](https://mastra.ai/docs/studio/overview), go to **Settings** and under **Headers** select
|
|
68
|
+
Inside [Studio](https://mastra.ai/docs/studio/overview), go to **Settings** and under **Headers** select **Add Header**. Enter `Authorization` as the header name and `Bearer <your-jwt>` as the value.
|
|
69
69
|
|
|
70
70
|
## Configuring `MastraClient`
|
|
71
71
|
|
|
@@ -65,7 +65,7 @@ export const mastra = new Mastra({
|
|
|
65
65
|
| `protected` | `(RegExp \| string)[]` | No | Paths that require authentication |
|
|
66
66
|
| `public` | `(RegExp \| string)[]` | No | Paths that bypass authentication |
|
|
67
67
|
|
|
68
|
-
### Default
|
|
68
|
+
### Default headers
|
|
69
69
|
|
|
70
70
|
SimpleAuth checks these headers by default:
|
|
71
71
|
|
package/.docs/docs/browser.md
CHANGED
|
@@ -93,7 +93,7 @@ The agent automatically receives all browser tools from the provider.
|
|
|
93
93
|
|
|
94
94
|
All SDK providers support connecting to cloud browser services instead of launching a local browser.
|
|
95
95
|
|
|
96
|
-
### Firecrawl
|
|
96
|
+
### Firecrawl browser sandbox (FirecrawlBrowser native)
|
|
97
97
|
|
|
98
98
|
FirecrawlBrowser provisions hosted sessions through the Firecrawl API:
|
|
99
99
|
|
package/.docs/docs/channels.md
CHANGED
|
@@ -57,7 +57,7 @@ export const yourAgent = new Agent({
|
|
|
57
57
|
|
|
58
58
|
> **Note:** Channel adapters require provider-specific environment variables for credentials and request verification, such as bot tokens, signing secrets, app IDs, and webhook verification tokens. Check the guide for your platform or the [Chat SDK adapter catalog](https://chat-sdk.dev/adapters) for the exact variable names.
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
Configure [storage](https://mastra.ai/docs/storage) for channels. Storage preserves channel and memory state across restarts, including thread subscriptions and tool approvals:
|
|
61
61
|
|
|
62
62
|
```typescript
|
|
63
63
|
import { Mastra } from '@mastra/core'
|
|
@@ -260,7 +260,7 @@ In group conversations, Mastra prefixes each message with the sender's name and
|
|
|
260
260
|
[Bob (@U456DEF)]: I have a question too.
|
|
261
261
|
```
|
|
262
262
|
|
|
263
|
-
## Per-message
|
|
263
|
+
## Per-message signal metadata
|
|
264
264
|
|
|
265
265
|
Use `signalMetadata` in a custom Channel handler to attach structured context to one inbound message. The metadata follows the message when it starts an idle run or joins an active run.
|
|
266
266
|
|
|
@@ -234,7 +234,7 @@ export const cursorSDKAgent = new CursorSDKAgent({
|
|
|
234
234
|
})
|
|
235
235
|
```
|
|
236
236
|
|
|
237
|
-
## OpenAI
|
|
237
|
+
## OpenAI agents SDK
|
|
238
238
|
|
|
239
239
|
Use `@mastra/openai` to register an OpenAI Agents SDK agent in Mastra while keeping OpenAI-specific agent settings in OpenAI SDK options.
|
|
240
240
|
|
|
@@ -39,7 +39,7 @@ The [Mastra platform](https://mastra.ai/docs/mastra-platform/overview) provides
|
|
|
39
39
|
|
|
40
40
|
Learn more in the [Mastra platform overview](https://mastra.ai/docs/mastra-platform/overview).
|
|
41
41
|
|
|
42
|
-
### Cloud
|
|
42
|
+
### Cloud providers
|
|
43
43
|
|
|
44
44
|
Mastra applications can be deployed to cloud providers and serverless platforms. Mastra includes optional built-in deployers for Vercel, Netlify, and Cloudflare that build your application for each platform. You then deploy the build output through the platform itself.
|
|
45
45
|
|
|
@@ -66,7 +66,7 @@ Deploy a Mastra server into an ephemeral workspace sandbox (such as Vercel Sandb
|
|
|
66
66
|
|
|
67
67
|
Use this option for instant previews, deploys from your CI pipeline, verifying agent-built apps, or running untrusted per-user instances. Read the [sandbox deployment guide](https://mastra.ai/docs/deployment/sandbox).
|
|
68
68
|
|
|
69
|
-
### Web
|
|
69
|
+
### Web framework
|
|
70
70
|
|
|
71
71
|
When Mastra is integrated with a web framework, it deploys alongside your application using the framework's standard deployment process. The guides below cover framework-specific configuration requirements for deployment.
|
|
72
72
|
|
|
@@ -15,7 +15,7 @@ Integration guides:
|
|
|
15
15
|
|
|
16
16
|
## With Next.js on Vercel
|
|
17
17
|
|
|
18
|
-
If you've integrated Mastra with Next.js and plan to deploy to Vercel,
|
|
18
|
+
If you've integrated Mastra with Next.js and plan to deploy to Vercel, ensure your `next.config.ts` sets `serverExternalPackages: ["@mastra/*"]`. The [Next.js guide](https://mastra.ai/integrations/frameworks/next-js) adds it during setup. If your config doesn't have it, add it:
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
import type { NextConfig } from 'next'
|
|
@@ -29,7 +29,7 @@ export default nextConfig
|
|
|
29
29
|
|
|
30
30
|
## With Astro on Vercel
|
|
31
31
|
|
|
32
|
-
If you've integrated Mastra with Astro [by following
|
|
32
|
+
If you've integrated Mastra with Astro [by following the Astro integration guide](https://mastra.ai/integrations/frameworks/astro) and plan to deploy to Vercel, add the Vercel adapter and server output to your `astro.config.mjs`:
|
|
33
33
|
|
|
34
34
|
```javascript
|
|
35
35
|
import { defineConfig } from 'astro/config'
|
|
@@ -43,7 +43,7 @@ export default defineConfig({
|
|
|
43
43
|
|
|
44
44
|
## With Astro on Netlify
|
|
45
45
|
|
|
46
|
-
If you've integrated Mastra with Astro [by following
|
|
46
|
+
If you've integrated Mastra with Astro [by following the Astro integration guide](https://mastra.ai/integrations/frameworks/astro) and plan to deploy to Netlify, add the Netlify adapter and server output to your `astro.config.mjs`:
|
|
47
47
|
|
|
48
48
|
```javascript
|
|
49
49
|
import { defineConfig } from 'astro/config'
|
package/.docs/docs/develop.md
CHANGED
|
@@ -117,7 +117,7 @@ Remember to install the [Mastra skills](#mastra-skills) to teach your coding age
|
|
|
117
117
|
|
|
118
118
|
## Project structure
|
|
119
119
|
|
|
120
|
-
One of the first decisions when adopting a framework is how to structure the project.
|
|
120
|
+
One of the first decisions when adopting a framework is how to structure the project. Keep framework code under `src/mastra/`, with related primitives grouped into their own files or folders. Use `src/mastra/index.ts` as the central place to configure and register them.
|
|
121
121
|
|
|
122
122
|
A minimal project can look like this:
|
|
123
123
|
|
|
@@ -52,7 +52,7 @@ These scorers evaluate adherence to format, style, and safety requirements:
|
|
|
52
52
|
- [`bias`](https://mastra.ai/reference/evals/bias): Detects potential biases in the output (`0-1`, lower is better)
|
|
53
53
|
- [`keyword-coverage`](https://mastra.ai/reference/evals/keyword-coverage): Assesses technical terminology usage (`0-1`, higher is better)
|
|
54
54
|
|
|
55
|
-
### Quick
|
|
55
|
+
### Quick checks
|
|
56
56
|
|
|
57
57
|
Zero-LLM micro-scorers for fast, deterministic assertions. See the [Quick Checks](https://mastra.ai/docs/evals/quick-checks) guide for usage details.
|
|
58
58
|
|
|
@@ -104,7 +104,7 @@ console.log(result.score) // 1
|
|
|
104
104
|
console.log(result.analyzeStepResult) // { hasSources: true, sources: ["Wikipedia"] }
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
### Agent
|
|
107
|
+
### Agent type for agent evaluation
|
|
108
108
|
|
|
109
109
|
For type safety and compatibility with both live agent scoring and trace scoring, use `type: 'agent'` when creating scorers for agent evaluation. The same scorer can evaluate an agent and score traces:
|
|
110
110
|
|
|
@@ -119,7 +119,7 @@ const myScorer = createScorer({
|
|
|
119
119
|
|
|
120
120
|
## Step-by-step breakdown
|
|
121
121
|
|
|
122
|
-
### preprocess
|
|
122
|
+
### `preprocess` step (optional)
|
|
123
123
|
|
|
124
124
|
Prepares input/output data when you need to extract specific elements or filter content, or alternatively transform complex data structures.
|
|
125
125
|
|
|
@@ -161,7 +161,7 @@ const glutenCheckerScorer = createScorer(...)
|
|
|
161
161
|
|
|
162
162
|
**Data Flow:** Results are available to subsequent steps as `results.preprocessStepResult`
|
|
163
163
|
|
|
164
|
-
### analyze
|
|
164
|
+
### `analyze` step (optional)
|
|
165
165
|
|
|
166
166
|
Performs core evaluation analysis, gathering insights that will inform the scoring decision.
|
|
167
167
|
|
|
@@ -487,7 +487,7 @@ export const glutenCheckerScorer = createScorer({
|
|
|
487
487
|
})
|
|
488
488
|
```
|
|
489
489
|
|
|
490
|
-
### Judge
|
|
490
|
+
### Judge configuration
|
|
491
491
|
|
|
492
492
|
Sets up the LLM model and defines its role as a domain expert.
|
|
493
493
|
|
|
@@ -498,7 +498,7 @@ judge: {
|
|
|
498
498
|
}
|
|
499
499
|
```
|
|
500
500
|
|
|
501
|
-
### Analysis
|
|
501
|
+
### Analysis step
|
|
502
502
|
|
|
503
503
|
Defines how the LLM should analyze the input and what structured output to return.
|
|
504
504
|
|
|
@@ -522,7 +522,7 @@ The analysis step uses a prompt object to:
|
|
|
522
522
|
- Define expected output structure with a Standard JSON Schema (both boolean result and list of gluten sources)
|
|
523
523
|
- Generate runtime prompts based on the input content
|
|
524
524
|
|
|
525
|
-
### Score
|
|
525
|
+
### Score generation
|
|
526
526
|
|
|
527
527
|
Converts the LLM's structured analysis into a numerical score.
|
|
528
528
|
|
|
@@ -532,9 +532,9 @@ Converts the LLM's structured analysis into a numerical score.
|
|
|
532
532
|
})
|
|
533
533
|
```
|
|
534
534
|
|
|
535
|
-
The score generation function takes the analysis results and applies business logic to produce a score. In this case, the LLM directly determines if the recipe is gluten-free, so
|
|
535
|
+
The score generation function takes the analysis results and applies business logic to produce a score. In this case, the LLM directly determines if the recipe is gluten-free, so the scorer uses that boolean result: 1 for gluten-free, 0 for contains gluten.
|
|
536
536
|
|
|
537
|
-
### Reason
|
|
537
|
+
### Reason generation
|
|
538
538
|
|
|
539
539
|
Provides human-readable explanations for the score using another LLM call.
|
|
540
540
|
|
|
@@ -216,7 +216,7 @@ const mastra = new Mastra({
|
|
|
216
216
|
Once registered, you can score traces interactively within Studio under the **Observability** section. Open Studio to manage scorers and review scores, plus run experiments.
|
|
217
217
|
|
|
218
218
|
- **Scorers list**: Browse all registered scorers with their description, and the number of agents and workflows each scorer is attached to.
|
|
219
|
-
- **Score results**: Select a scorer to see a paginated list of every score it has produced.
|
|
219
|
+
- **Score results**: Select a scorer to see a paginated list of every score it has produced. Select 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.
|
|
220
220
|
- **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.
|
|
221
221
|
- **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.
|
|
222
222
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Quick Checks are composable micro-scorers for common assertions like "output contains X" or "agent called tool Y." They run instantly without an LLM and plug into the same `scorers: [...]` array as any other scorer.
|
|
8
8
|
|
|
9
|
-
## When to use
|
|
9
|
+
## When to use quick checks
|
|
10
10
|
|
|
11
11
|
Use Quick Checks when you need fast, deterministic assertions:
|
|
12
12
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Authentication and identity
|
|
6
6
|
|
|
7
|
-
Learn how to protect API endpoints, Studio, and agent calls in your application. Restricting access programmatically is essential as LLMs can
|
|
7
|
+
Learn how to protect API endpoints, Studio, and agent calls in your application. Restricting access programmatically is essential as LLMs can bypass superficial checks you might add to your system prompt.
|
|
8
8
|
|
|
9
9
|
Authentication verifies who is calling your Mastra server. Identity is the verified user or service account associated with that request. Mastra passes this identity through runtime code so each component can make trusted access decisions.
|
|
10
10
|
|
|
@@ -266,7 +266,7 @@ If you've used Claude Code, you may have seen compaction happen during a long se
|
|
|
266
266
|
|
|
267
267
|
Compaction waits until a conversation reaches a token threshold. It then summarizes the transcript and replaces earlier messages. It's a blunt fallback. The compaction turn adds latency, and a single summary has to represent everything that came before. Repeated summaries can flatten chronology or lose details that later become important.
|
|
268
268
|
|
|
269
|
-
Prefer [Observational Memory](#observational-memory) for long-running conversations. It can process history asynchronously in the background while preserving temporal context. Reflection revisits accumulated memories and
|
|
269
|
+
Prefer [Observational Memory](#observational-memory) for long-running conversations. It can process history asynchronously in the background while preserving temporal context. Reflection revisits accumulated memories and prunes details that no longer matter. Mastra doesn't provide compaction out of the box, though you could implement it with a custom [processor](https://mastra.ai/docs/agents/processors).
|
|
270
270
|
|
|
271
271
|
### Processors
|
|
272
272
|
|
|
@@ -20,7 +20,7 @@ This is often the case when:
|
|
|
20
20
|
- Different stages need different prompts, models, or guardrails.
|
|
21
21
|
- You want clear boundaries between routing, execution, and synthesis.
|
|
22
22
|
|
|
23
|
-
Start with one agent when possible. Add more agents when the added structure
|
|
23
|
+
Start with one agent when possible. Add more agents when the added structure improves quality, speed, or reliability.
|
|
24
24
|
|
|
25
25
|
Multi-agent patterns are useful when the system needs a clear way to divide context, decisions, and responsibilities across components. In practice, the key design question is which component stays in control as the task moves forward.
|
|
26
26
|
|
|
@@ -44,7 +44,7 @@ In Mastra, [workflows](https://mastra.ai/docs/workflows/overview) can implement
|
|
|
44
44
|
|
|
45
45
|
A supervisor pattern keeps one lead agent in control for the full task. The supervisor decides when to delegate, which specialist to call, what context to pass, and how to combine the result.
|
|
46
46
|
|
|
47
|
-
Use this pattern when the task is open-ended and the full sequence isn't known in advance. For example, a research task may require different lines of inquiry based on what earlier steps uncover. A supervisor can adapt as the task unfolds. The tradeoff is that the supervisor becomes the main coordination point. That makes the pattern flexible, but it also means the result depends
|
|
47
|
+
Use this pattern when the task is open-ended and the full sequence isn't known in advance. For example, a research task may require different lines of inquiry based on what earlier steps uncover. A supervisor can adapt as the task unfolds. The tradeoff is that the supervisor becomes the main coordination point. That makes the pattern flexible, but it also means the result depends on good delegation behavior and clear subagent boundaries.
|
|
48
48
|
|
|
49
49
|
In Mastra, this pattern maps directly to [supervisor agents](https://mastra.ai/docs/subagents). A supervisor defines subagents through the `agents` property, then coordinates them with `stream()` or `generate()`. Mastra helps control this pattern through delegation hooks and message filtering, with memory isolation between agents.
|
|
50
50
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
4
4
|
|
|
5
|
-
# Agent
|
|
5
|
+
# Agent controller
|
|
6
6
|
|
|
7
7
|
`AgentController` is a shared runtime host for interactive agent applications. It coordinates modes, models, storage, workspaces, tool approvals, subagents, and channels. Each user or active task works through an isolated [`Session`](https://mastra.ai/reference/agent-controller/session).
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
When the agent you host works in a codebase, build it with [`createCodingAgent()`](https://mastra.ai/reference/coding-agent/create-coding-agent) instead of `new Agent()`. It returns a standard `Agent` that already has a workspace, task tracking, and retries for transient model errors, which are the defaults Mastra Code runs on.
|
|
12
12
|
|
|
13
|
-
## When to use the
|
|
13
|
+
## When to use the agent controller
|
|
14
14
|
|
|
15
15
|
Use the Agent Controller when your application needs:
|
|
16
16
|
|
|
@@ -216,7 +216,7 @@ await session.model.switch('anthropic/claude-sonnet-5-5')
|
|
|
216
216
|
console.log(session.model.get())
|
|
217
217
|
```
|
|
218
218
|
|
|
219
|
-
### Select
|
|
219
|
+
### Select observational Memory models
|
|
220
220
|
|
|
221
221
|
Observer and reflector model choices are independent. Each role can use an explicit model or an automatic selection that the host resolves from the active main model and session state.
|
|
222
222
|
|
|
@@ -516,6 +516,8 @@ subscription.unsubscribe()
|
|
|
516
516
|
|
|
517
517
|
The server doesn't replay events missed while the stream was down, so read `session.state()` from `onReconnect` for the current mode, model, and thread. The client surface has no `session.displayState.get()`.
|
|
518
518
|
|
|
519
|
+
A client that reads slower than the session emits, for example on a poor network, gets every event in order but only the newest `display_state_changed` snapshot, because each snapshot holds the full display state. When 5,000 events are waiting for the client, or one has waited more than 60 seconds, the server closes the stream. With `reconnect: true` the client reconnects and receives the current display state first. Mastra reports both through `mastra.metrics` as `mastra_agent_controller_sse_snapshots_dropped_total` and `mastra_agent_controller_sse_slow_client_closes_total`, which has a `reason` label set to `max_pending` or `max_wait`.
|
|
520
|
+
|
|
519
521
|
Send work with `session.sendMessage(content)`, or `session.sendMessage({ content, files })` to attach base64-encoded files. The reply arrives as `message_*` events on the subscription, not as the return value of the call. Answer a `tool_approval_required` event with `session.approveTool(toolCallId, approved)`, and a `tool_suspended` event with `session.respondToToolSuspension(toolCallId, resumeData)`.
|
|
520
522
|
|
|
521
523
|
`onEvent` receives every event the session emits. See the [Agent Controller API](https://mastra.ai/reference/client-js/agent-controller) reference for the event types and how to narrow them.
|
|
@@ -16,7 +16,7 @@ Use background tasks when a tool call may take long enough that the user shouldn
|
|
|
16
16
|
- Tool calls that hit slow external services, queues, or large data jobs.
|
|
17
17
|
- Workflows triggered from a tool call that may take minutes to complete.
|
|
18
18
|
|
|
19
|
-
For tool calls that return
|
|
19
|
+
For tool calls that return fast, foreground execution using `agent.stream()` and `agent.generate()` is simpler.
|
|
20
20
|
|
|
21
21
|
> **Note:** Background tasks require a configured [storage](https://mastra.ai/docs/storage) backend on the Mastra instance. Tasks are persisted so they survive process restarts.
|
|
22
22
|
|
|
@@ -341,6 +341,12 @@ await mastra.backgroundTaskManager?.resume(taskId, {
|
|
|
341
341
|
|
|
342
342
|
On the resumed run, `context.agent.suspendPayload` holds the `data` the tool suspended with. Use it to tell which request an answer belongs to without encoding that in `resumeData`.
|
|
343
343
|
|
|
344
|
+
### Suspend after a durable agent's run finished
|
|
345
|
+
|
|
346
|
+
On a [durable agent](https://mastra.ai/docs/harness/durable-agents), a background tool can call `suspend()` after the agent has replied and its run has finished. The task is marked `suspended` and resumes as usual when the storage adapter supports [run fencing](https://mastra.ai/docs/harness/durable-agents), for example `InMemoryStore`, `@mastra/libsql`, or `@mastra/pg`. These adapters record each claim on the run, so Mastra can check that no other execution claimed the run in the meantime.
|
|
347
|
+
|
|
348
|
+
The task still fails with a storage adapter that lacks run fencing, because run ownership is then only a PubSub lease, and a released lease can't show whether another execution claimed and finished the run since. On an agent from `createEventedAgent()`, the task also fails when an approval for another tool call resumed the run in the same turn, because the resume's claim counts as another execution.
|
|
349
|
+
|
|
344
350
|
### Answer a suspended task from a client
|
|
345
351
|
|
|
346
352
|
While an agent's background tool call is suspended, the assistant message that holds the call records the open request under `metadata.suspendedTools[toolCallId]`. The entry carries `toolName`, `args`, `suspendPayload`, `taskId`, `runId`, and `suspendedAt`, so a chat that reloads the thread can still show the request. The entry is removed when the task resumes or is cancelled.
|
|
@@ -298,7 +298,7 @@ The `shouldPersistSnapshot` option on `createDurableAgent()` (also accepted in t
|
|
|
298
298
|
- Persists `running` checkpoints at every step when `recovery.durableAgents` is `'auto'`. These per-step writes exist solely to make in-flight runs recoverable after a crash, so with recovery off they're skipped until shutdown.
|
|
299
299
|
- Persists a `running` checkpoint at each step boundary a run reaches after `mastra.shutdown()` starts, even with recovery off. A run that reaches a step boundary before the drain window ends can then be resumed later with `recover()` or `recoverActiveRuns()`. A run blocked in a single LLM or tool call for the whole drain gets no shutdown checkpoint.
|
|
300
300
|
|
|
301
|
-
When the agent is configured with a fixed memory instance (`memory: new Memory(...)`), a `running` checkpoint doesn't repeat messages memory already stores. Messages recalled from memory and messages the run saved itself (for example with `savePerStep: true`) are stored as small references to their memory rows instead of their full contents, as long as they still match the stored row (a message changed after saving stays inline). This applies to every copy of the conversation a checkpoint holds, including the run input and step results. A long run's checkpoints grow much more
|
|
301
|
+
When the agent is configured with a fixed memory instance (`memory: new Memory(...)`), a `running` checkpoint doesn't repeat messages memory already stores. Messages recalled from memory and messages the run saved itself (for example with `savePerStep: true`) are stored as small references to their memory rows instead of their full contents, as long as they still match the stored row (a message changed after saving stays inline). This applies to every copy of the conversation a checkpoint holds, including the run input and step results. A long run's checkpoints grow much more gradually as a result. Agents that resolve memory with a function keep the full transcript in each checkpoint, because the memory a resumed run resolves may differ.
|
|
302
302
|
|
|
303
303
|
To keep crash-recovery checkpoints without enabling automatic recovery (for example, when you call `recoverActiveRuns()` yourself behind a leader election), pass a predicate that includes `running`:
|
|
304
304
|
|
package/.docs/docs/index.md
CHANGED
|
@@ -14,7 +14,7 @@ npx skills add mastra-ai/skills
|
|
|
14
14
|
|
|
15
15
|
The agent quickstart below gives you instructions for the fastest, most streamlined way to build a minimal Mastra project from scratch. The skills will teach you how to extend and enhance your agents with additional capabilities.
|
|
16
16
|
|
|
17
|
-
## Quickstart for
|
|
17
|
+
## Quickstart for agents
|
|
18
18
|
|
|
19
19
|
**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-6.1-sol`. For OpenAI, use `openai/<model>`, not `openai:<model>`, and don't import or pass a provider object.
|
|
20
20
|
|
|
@@ -123,7 +123,7 @@ export const mastra = new Mastra({
|
|
|
123
123
|
})
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
You're now able to run the agent directly. For this, import the Mastra instance and call the agent.generate() after retrieving the agent by its id. Node.js 22.18.0 and later are able to run TypeScript files directly.
|
|
126
|
+
You're now able to run the agent directly. For this, import the Mastra instance and call the agent.generate() after retrieving the agent by its id. Node.js 22.18.0 and later are able to run TypeScript files directly. Ensure you add file extensions when importing local files. Example:
|
|
127
127
|
|
|
128
128
|
```ts
|
|
129
129
|
// run.mjs
|
package/.docs/docs/license.md
CHANGED
|
@@ -56,7 +56,7 @@ See the License for the specific language governing permissions and
|
|
|
56
56
|
limitations under the License.
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
## Mastra Enterprise
|
|
59
|
+
## Mastra Enterprise license
|
|
60
60
|
|
|
61
61
|
Code in any directory called `ee/` (e.g., `@mastra/core/auth/ee`) is source-available under the Mastra Enterprise License. These features require a valid enterprise license for production use but can be freely used for development and testing. [Contact sales](https://mastra.ai/contact) for more information.
|
|
62
62
|
|
|
@@ -64,7 +64,7 @@ Each project runs one build at a time as its deploy transitions through **queued
|
|
|
64
64
|
|
|
65
65
|
## Idle behavior
|
|
66
66
|
|
|
67
|
-
Server on Mastra platform can sleep a service after a period of inactivity to save resources. Inactivity is measured by outbound network traffic. A service is considered idle only after
|
|
67
|
+
Server on Mastra platform can sleep a service after a period of inactivity to save resources. Inactivity is measured by outbound network traffic. A service is considered idle only after about 10 minutes with no outbound packets. Any recurring outbound traffic resets this timer and keeps the service awake.
|
|
68
68
|
|
|
69
69
|
A server that never sleeps usually has a background task or a long-lived connection sending traffic on a timer. Check for the following common causes.
|
|
70
70
|
|
|
@@ -58,7 +58,7 @@ The flow chart connects themes in adjacent trace signal columns:
|
|
|
58
58
|
|
|
59
59
|
The flow shows association, not causation or execution order. For example, a ribbon between a Goal and an Outcome means that both themes occurred in the same traces. It doesn't show that the goal caused the outcome.
|
|
60
60
|
|
|
61
|
-
### Other and
|
|
61
|
+
### Other and noise
|
|
62
62
|
|
|
63
63
|
Each node shows its trace count: the number of distinct traces assigned to that theme in the selected snapshot. A theme's details also state its share, for example "28 of 70 traces in this snapshot (40%)".
|
|
64
64
|
|
|
@@ -72,7 +72,7 @@ A snapshot is a moving analysis window over a set of traces. Snapshots can overl
|
|
|
72
72
|
|
|
73
73
|
A theme can persist, disappear, split, merge, or return across snapshots. Treat theme names and descriptions as generated summaries, not fixed taxonomies.
|
|
74
74
|
|
|
75
|
-
## Use the
|
|
75
|
+
## Use the trace intelligence page
|
|
76
76
|
|
|
77
77
|
1. Open **Intelligence** to see the entity index. Search or sort the index, then select an entity to open its analysis.
|
|
78
78
|
2. Select a theme in the flow to open its details and filter every column to traces containing that theme.
|
|
@@ -115,7 +115,7 @@ Confirm that its completed traces are listed under **Traces** and that the proje
|
|
|
115
115
|
|
|
116
116
|
The flow requires themes for at least two trace signal types. Continue sending representative traffic and allow processing to finish.
|
|
117
117
|
|
|
118
|
-
### Most summaries are
|
|
118
|
+
### Most summaries are noise
|
|
119
119
|
|
|
120
120
|
Collect more representative traffic and compare a later snapshot. Varied or rare interactions are harder to group, while repeated test prompts can produce an unrepresentative distribution.
|
|
121
121
|
|
|
@@ -15,7 +15,7 @@ Workspaces are scoped to a single [environment](https://mastra.ai/docs/mastra-pl
|
|
|
15
15
|
|
|
16
16
|
## When workspaces are provisioned
|
|
17
17
|
|
|
18
|
-
New projects have workspaces enabled by default. When you create an environment, the platform provisions a bucket for it automatically. The sandbox base image is warmed in the background so the first `PlatformSandbox` call starts
|
|
18
|
+
New projects have workspaces enabled by default. When you create an environment, the platform provisions a bucket for it automatically. The sandbox base image is warmed in the background so the first `PlatformSandbox` call starts fast.
|
|
19
19
|
|
|
20
20
|
Existing projects that haven't opted in show an **Enable workspaces** action in the Workspaces tab. Enabling provisions a bucket for every environment on the project.
|
|
21
21
|
|
|
@@ -209,7 +209,7 @@ const agent = new Agent({
|
|
|
209
209
|
|
|
210
210
|
Understanding the execution order is important when combining guardrails with memory:
|
|
211
211
|
|
|
212
|
-
### Input
|
|
212
|
+
### Input processors
|
|
213
213
|
|
|
214
214
|
```text
|
|
215
215
|
[Memory Processors] → [Your inputProcessors]
|
|
@@ -220,7 +220,7 @@ Understanding the execution order is important when combining guardrails with me
|
|
|
220
220
|
|
|
221
221
|
As a result, memory loads message history before your processors can validate or filter the input.
|
|
222
222
|
|
|
223
|
-
### Output
|
|
223
|
+
### Output processors
|
|
224
224
|
|
|
225
225
|
```text
|
|
226
226
|
[Your outputProcessors] → [Memory Processors]
|