@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
|
# Sentry exporter
|
|
4
4
|
|
|
5
|
-
[Sentry](https://sentry.io/) is an application monitoring platform with AI-specific tracing capabilities. The Sentry exporter sends your traces to Sentry using OpenTelemetry semantic conventions, providing insights into model performance
|
|
5
|
+
[Sentry](https://sentry.io/) is an application monitoring platform with AI-specific tracing capabilities. The Sentry exporter sends your traces to Sentry using OpenTelemetry semantic conventions, providing insights into model performance and token usage, plus tool executions.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -31,7 +31,7 @@ Exporters send observability data to a destination:
|
|
|
31
31
|
Bridges connect Mastra to an existing distributed tracing context:
|
|
32
32
|
|
|
33
33
|
- [OpenTelemetry bridge](https://mastra.ai/docs/observability/integrations/bridges/otel): Integrate Mastra with an existing OpenTelemetry trace.
|
|
34
|
-
- [Datadog bridge](https://mastra.ai/docs/observability/integrations/bridges/datadog):
|
|
34
|
+
- [Datadog bridge](https://mastra.ai/docs/observability/integrations/bridges/datadog): Send Mastra traces to Datadog and its LLM Observability product.
|
|
35
35
|
|
|
36
36
|
## Processors
|
|
37
37
|
|
|
@@ -295,7 +295,7 @@ If the filter encounters an error while processing a field, it replaces the fiel
|
|
|
295
295
|
}
|
|
296
296
|
```
|
|
297
297
|
|
|
298
|
-
|
|
298
|
+
As a result, processing errors don't prevent traces from being exported or cause application crashes.
|
|
299
299
|
|
|
300
300
|
## Related
|
|
301
301
|
|
|
@@ -89,7 +89,7 @@ Mastra provides access to a logger instance via the `mastra.getLogger()` method,
|
|
|
89
89
|
|
|
90
90
|
### Logging from workflow steps
|
|
91
91
|
|
|
92
|
-
Within a workflow step, access the logger via the `mastra` parameter inside the `execute` function.
|
|
92
|
+
Within a workflow step, access the logger via the `mastra` parameter inside the `execute` function. You can log messages relevant to the step's execution.
|
|
93
93
|
|
|
94
94
|
```typescript
|
|
95
95
|
import { createWorkflow, createStep } from "@mastra/core/workflows";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Mastra automatically emits performance and usage metrics from traced execution. There's no manual instrumentation needed. Metrics are derived from spans as they complete.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
These categories of metrics are emitted automatically:
|
|
8
8
|
|
|
9
9
|
- **Duration metrics**: Execution time for agents, workflows, tools, model calls, and processors.
|
|
10
10
|
- **Token usage metrics**: Input and output token counts broken down by type (text, cache, audio, image, reasoning).
|
|
@@ -91,7 +91,7 @@ By default the CLI targets hosted Mastra observability (`https://observability.m
|
|
|
91
91
|
|
|
92
92
|
### `getMetricAggregate`
|
|
93
93
|
|
|
94
|
-
Returns a single scalar
|
|
94
|
+
Returns a single scalar, the building block for KPI cards.
|
|
95
95
|
|
|
96
96
|
Inputs:
|
|
97
97
|
|
|
@@ -119,7 +119,7 @@ console.log(cost.value, cost.estimatedCost, cost.costUnit, cost.changePercent)
|
|
|
119
119
|
|
|
120
120
|
### `getMetricBreakdown`
|
|
121
121
|
|
|
122
|
-
Groups rows by one or more dimensions and aggregates each group
|
|
122
|
+
Groups rows by one or more dimensions and aggregates each group, the building block for top-N tables (e.g. "tokens by agent").
|
|
123
123
|
|
|
124
124
|
Inputs:
|
|
125
125
|
|
|
@@ -144,14 +144,14 @@ const byAgent = await observability!.getMetricBreakdown({
|
|
|
144
144
|
|
|
145
145
|
### `getMetricTimeSeries`
|
|
146
146
|
|
|
147
|
-
Buckets values by a fixed interval
|
|
147
|
+
Buckets values by a fixed interval, the building block for line and bar charts.
|
|
148
148
|
|
|
149
149
|
Inputs:
|
|
150
150
|
|
|
151
151
|
- `name`: Array of metric names.
|
|
152
152
|
- `interval`: One of `'1m' | '5m' | '15m' | '1h' | '1d'`.
|
|
153
153
|
- `aggregation`: Same enum.
|
|
154
|
-
- `groupBy`: Optional. When omitted, multiple metric names are summed into one series
|
|
154
|
+
- `groupBy`: Optional. When omitted, multiple metric names are summed into one series. Use one call per metric to keep them separate.
|
|
155
155
|
- `filters`: Optional.
|
|
156
156
|
|
|
157
157
|
Response: `series[]`, each with `name`, `costUnit`, and `points[]` of `{ timestamp, value, estimatedCost }`.
|
|
@@ -169,7 +169,7 @@ const inputTokens = await observability!.getMetricTimeSeries({
|
|
|
169
169
|
|
|
170
170
|
### `getMetricPercentiles`
|
|
171
171
|
|
|
172
|
-
Returns percentile values bucketed by time
|
|
172
|
+
Returns percentile values bucketed by time, the building block for latency charts.
|
|
173
173
|
|
|
174
174
|
Inputs:
|
|
175
175
|
|
|
@@ -214,8 +214,8 @@ Use these endpoints to populate dropdowns or to give an agent the menu of values
|
|
|
214
214
|
|
|
215
215
|
Every query accepts the same `filters` object. The most useful fields:
|
|
216
216
|
|
|
217
|
-
- `name`: Restrict to specific metric names. (Top-level `name` already does this for aggregate/breakdown/timeseries
|
|
218
|
-
- `timestamp`: `{ start, end, startExclusive, endExclusive }`. Both bounds are optional
|
|
217
|
+
- `name`: Restrict to specific metric names. (Top-level `name` already does this for aggregate/breakdown/timeseries. Use `filters.name` when you want to mix multiple metrics under a single query.)
|
|
218
|
+
- `timestamp`: `{ start, end, startExclusive, endExclusive }`. Both bounds are optional. Omit `end` for "until now".
|
|
219
219
|
- `provider`, `model`, `costUnit`: For token and cost metrics.
|
|
220
220
|
- `labels`: Exact key-value match on metric labels, for example `{ status: 'error' }` for duration metrics.
|
|
221
221
|
- Correlation fields: `entityType`, `entityName`, `parentEntityName`, `rootEntityName`, `userId`, `organizationId`, `resourceId`, `runId`, `sessionId`, `threadId`, `requestId`, `executionSource`, `environment`, `serviceName`, `experimentId`, `tags`.
|
|
@@ -247,7 +247,7 @@ curl -sS -X POST http://localhost:4111/api/observability/metrics/aggregate \
|
|
|
247
247
|
|
|
248
248
|
### Always provide a time range
|
|
249
249
|
|
|
250
|
-
`filters.timestamp` is optional, but you should treat it as required for any query that runs against a production store. Observability tables are typically partitioned (or chunked, for TimescaleDB) by event time. When you supply `timestamp.start` (and ideally `end`), the backend can prune to the partitions that overlap the range
|
|
250
|
+
`filters.timestamp` is optional, but you should treat it as required for any query that runs against a production store. Observability tables are typically partitioned (or chunked, for TimescaleDB) by event time. When you supply `timestamp.start` (and ideally `end`), the backend can prune to the partitions that overlap the range, usually one or two. Without a time range, the planner has to scan every partition, which can be hundreds of segments over a year of retention and is the most common cause of slow OLAP queries on Postgres-backed stores.
|
|
251
251
|
|
|
252
252
|
A safe default for ad-hoc queries is the last 24 hours; alerts and dashboards should match their actual evaluation window:
|
|
253
253
|
|
|
@@ -8,7 +8,7 @@ Mastra's observability system gives you visibility into every agent run, workflo
|
|
|
8
8
|
- [**Storage**](https://mastra.ai/docs/observability/storage): Choose storage backends for persisted traces, logs, metrics aggregation, and feedback queries.
|
|
9
9
|
- [**Tracing**](https://mastra.ai/docs/observability/tracing/overview): Records every operation as a hierarchical timeline of spans, capturing inputs, outputs, token usage, and timing.
|
|
10
10
|
- [**Logging**](https://mastra.ai/docs/observability/logging): Forwards structured log entries from your application and Mastra internals to observability storage, correlated to traces automatically.
|
|
11
|
-
- [**Metrics**](https://mastra.ai/docs/observability/metrics/overview): Extracts
|
|
11
|
+
- [**Metrics**](https://mastra.ai/docs/observability/metrics/overview): Extracts trace usage and cost data. No additional instrumentation is required.
|
|
12
12
|
- [**Feedback**](https://mastra.ai/docs/observability/feedback): Stores ratings, comments, corrections, and other review signals linked to traces and spans.
|
|
13
13
|
- [**Integrations**](https://mastra.ai/docs/observability/integrations/overview): Choose exporters, bridges, and span processors for Studio, hosted, or external observability workflows.
|
|
14
14
|
|
|
@@ -26,11 +26,11 @@ Tracing is the foundation. When observability is configured, every agent run, wo
|
|
|
26
26
|
|
|
27
27
|
Metrics are derived from traces automatically. When a span ends, Mastra extracts duration, token counts, and cost estimates without any extra code. These metrics power the dashboards in [Studio](https://mastra.ai/docs/studio/observability).
|
|
28
28
|
|
|
29
|
-
Logs are correlated to traces automatically. Every `logger.info()`, `logger.warn()`, or `logger.error()` call within a traced context is tagged with the current trace and span IDs. You can
|
|
29
|
+
Logs are correlated to traces automatically. Every `logger.info()`, `logger.warn()`, or `logger.error()` call within a traced context is tagged with the current trace and span IDs. You can move through from a log entry directly to the trace that produced it.
|
|
30
30
|
|
|
31
31
|
Feedback records human review signals such as ratings, comments, and corrections. Feedback can be linked to traces and spans, then queried with the same observability store used for metrics.
|
|
32
32
|
|
|
33
|
-
These signals share correlation IDs
|
|
33
|
+
These signals share correlation IDs such as trace ID, span ID, entity type, and entity name. You can use them to move from a metric spike to its traces, logs, and related feedback.
|
|
34
34
|
|
|
35
35
|
## Quickstart
|
|
36
36
|
|
|
@@ -102,7 +102,7 @@ export const mastra = new Mastra({
|
|
|
102
102
|
})
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
It enables tracing, log forwarding, and metrics. Mastra also supports external tracing providers like Langfuse, Datadog, and any OpenTelemetry-compatible platform. Use [Configuration](https://mastra.ai/docs/observability/config), [Storage](https://mastra.ai/docs/observability/storage), and [Integrations overview](https://mastra.ai/docs/observability/integrations/overview) to set up observability.
|
|
106
106
|
|
|
107
107
|
## Mastra platform
|
|
108
108
|
|
|
@@ -19,13 +19,17 @@ This page focuses on trace-specific concepts: span hierarchy, sampling, metadata
|
|
|
19
19
|
|
|
20
20
|
To get started with tracing, configure observability in your Mastra instance and run an agent or workflow. You can configure behavior through the following features:
|
|
21
21
|
|
|
22
|
-
- [Configuration](https://mastra.ai/docs/observability/config): Base observability config
|
|
22
|
+
- [Configuration](https://mastra.ai/docs/observability/config): Base observability config and multiple configs, plus serverless flushing
|
|
23
23
|
- [Storage](https://mastra.ai/docs/observability/storage): Storage routing for traces, logs, and metrics
|
|
24
24
|
- [Integrations overview](https://mastra.ai/docs/observability/integrations/overview): Exporters, bridges, and processors
|
|
25
25
|
|
|
26
26
|
## Sampling strategies
|
|
27
27
|
|
|
28
|
-
Sampling allows you to control which traces are collected, helping you balance between observability needs and resource costs.
|
|
28
|
+
Sampling allows you to control which traces are collected, helping you balance between observability needs and resource costs.
|
|
29
|
+
|
|
30
|
+
In production environments with high traffic, collecting every trace can be expensive and unnecessary.
|
|
31
|
+
|
|
32
|
+
Sampling strategies let you capture a representative subset of traces while ensuring you don't miss critical information about errors or important operations.
|
|
29
33
|
|
|
30
34
|
You can configure sampling at the observability config level:
|
|
31
35
|
|
|
@@ -93,7 +97,9 @@ The `sampling` option allows you to control which traces are collected, helping
|
|
|
93
97
|
|
|
94
98
|
## Adding custom metadata
|
|
95
99
|
|
|
96
|
-
Custom metadata allows you to attach additional context to your traces, making it easier to debug issues and understand system behavior in production.
|
|
100
|
+
Custom metadata allows you to attach additional context to your traces, making it easier to debug issues and understand system behavior in production.
|
|
101
|
+
|
|
102
|
+
Metadata can include business logic and performance metrics. It can also carry user context or any other information that explains what happened during execution.
|
|
97
103
|
|
|
98
104
|
You can add metadata to any span using the tracing context:
|
|
99
105
|
|
|
@@ -312,7 +318,7 @@ const result = await agent.generate([{ role: 'user', content: 'Handle confidenti
|
|
|
312
318
|
|
|
313
319
|
#### How it works
|
|
314
320
|
|
|
315
|
-
- **Trace-wide effect**: When set on the root span
|
|
321
|
+
- **Trace-wide effect**: When set on the root span and these options apply to all child spans in the trace (tool calls, plus model generations, etc.)
|
|
316
322
|
- **Export-time filtering**: The data remains available internally during execution but is excluded when spans are exported to observability platforms
|
|
317
323
|
- **Combinable with other options**: You can use `hideInput`/`hideOutput` alongside `tags`, `metadata`, and other `tracingOptions`
|
|
318
324
|
|
|
@@ -327,7 +333,7 @@ const result = await agent.generate([{ role: 'user', content: 'Sensitive operati
|
|
|
327
333
|
})
|
|
328
334
|
```
|
|
329
335
|
|
|
330
|
-
For more
|
|
336
|
+
For more fine-grained control over sensitive data, consider using the [Sensitive Data Filter](https://mastra.ai/docs/observability/integrations/processors/sensitive-data-filter) processor, which can redact specific fields (like passwords, tokens, and keys) while preserving the rest of the input/output.
|
|
331
337
|
|
|
332
338
|
#### Child spans and metadata extraction
|
|
333
339
|
|
|
@@ -356,7 +362,7 @@ execute: async (inputData, context) => {
|
|
|
356
362
|
}
|
|
357
363
|
```
|
|
358
364
|
|
|
359
|
-
|
|
365
|
+
You get fine-grained control over which child spans include RequestContext metadata. Root spans (agent/workflow executions) always extract metadata automatically, while child spans only extract when you explicitly pass `requestContext`.
|
|
360
366
|
|
|
361
367
|
## Creating child spans
|
|
362
368
|
|
|
@@ -699,11 +705,11 @@ serializationOptions: {
|
|
|
699
705
|
}
|
|
700
706
|
```
|
|
701
707
|
|
|
702
|
-
All options are optional
|
|
708
|
+
All options are optional, if not specified, they fall back to the defaults shown above.
|
|
703
709
|
|
|
704
710
|
## Retrieving trace IDs
|
|
705
711
|
|
|
706
|
-
When you execute agents or workflows with tracing enabled, the response includes a `traceId` that you can use to look up the full trace in your observability platform. This is useful for debugging
|
|
712
|
+
When you execute agents or workflows with tracing enabled, the response includes a `traceId` that you can use to look up the full trace in your observability platform. This is useful for debugging or customer support, or alternatively correlating traces with other events in your system.
|
|
707
713
|
|
|
708
714
|
### Agent trace IDs
|
|
709
715
|
|
|
@@ -783,7 +789,7 @@ const result = await agent.generate('Analyze this data', {
|
|
|
783
789
|
|
|
784
790
|
### OpenTelemetry integration
|
|
785
791
|
|
|
786
|
-
Integration with OpenTelemetry allows Mastra traces to appear
|
|
792
|
+
Integration with OpenTelemetry allows Mastra traces to appear directly in your existing observability platform:
|
|
787
793
|
|
|
788
794
|
```ts
|
|
789
795
|
import { trace } from '@opentelemetry/api'
|
|
@@ -826,12 +832,12 @@ Mastra validates trace and span IDs to ensure compatibility:
|
|
|
826
832
|
- **Trace IDs**: 1-32 hexadecimal characters (OpenTelemetry uses 32)
|
|
827
833
|
- **Span IDs**: 1-16 hexadecimal characters (OpenTelemetry uses 16)
|
|
828
834
|
|
|
829
|
-
Invalid IDs are handled gracefully
|
|
835
|
+
Invalid IDs are handled gracefully, Mastra logs an error and continues:
|
|
830
836
|
|
|
831
837
|
- Invalid trace ID → generates a new trace ID
|
|
832
838
|
- Invalid parent span ID → ignores the parent relationship
|
|
833
839
|
|
|
834
|
-
|
|
840
|
+
As a result, tracing never crashes your application, even with malformed input.
|
|
835
841
|
|
|
836
842
|
### Example: Express middleware
|
|
837
843
|
|
|
@@ -889,4 +895,4 @@ Mastra automatically creates spans for:
|
|
|
889
895
|
- [Tracing Classes](https://mastra.ai/reference/observability/tracing/instances): Core classes and methods
|
|
890
896
|
- [Span Interfaces](https://mastra.ai/reference/observability/tracing/spans): Span types and lifecycle
|
|
891
897
|
- [Type Definitions](https://mastra.ai/reference/observability/tracing/interfaces): Complete interface reference
|
|
892
|
-
- [Span filtering](https://mastra.ai/reference/observability/tracing/span-filtering): Filtering behavior
|
|
898
|
+
- [Span filtering](https://mastra.ai/reference/observability/tracing/span-filtering): Filtering behavior and span types, plus examples
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Chunking and embedding documents
|
|
4
4
|
|
|
5
|
-
Before processing, create a MDocument instance from your content. You can initialize it from
|
|
5
|
+
Before processing, create a MDocument instance from your content. You can initialize it from different formats:
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
const docFromText = MDocument.fromText('Your plain text content...')
|
|
@@ -49,7 +49,7 @@ const graphQueryTool = createGraphRAGTool({
|
|
|
49
49
|
|
|
50
50
|
The `graphOptions` parameter controls how the knowledge graph is built and traversed:
|
|
51
51
|
|
|
52
|
-
- `threshold`: Similarity threshold (0-1) for determining which chunks are related. Higher values create sparser graphs with stronger connections
|
|
52
|
+
- `threshold`: Similarity threshold (0-1) for determining which chunks are related. Higher values create sparser graphs with stronger connections. Lower values create denser graphs with more potential relationships.
|
|
53
53
|
- `dimension`: Vector embedding dimension. Must match the embedding model's output dimension (e.g., 1536 for OpenAI's text-embedding-3-small).
|
|
54
54
|
|
|
55
55
|
```ts
|
|
@@ -77,7 +77,7 @@ const ragAgent = new Agent({
|
|
|
77
77
|
instructions: `You are a helpful assistant that answers questions based on the provided context.
|
|
78
78
|
When answering questions, use the graph query tool to find relevant information and relationships.
|
|
79
79
|
Base your answers on the context provided by the tool, and clearly state if the context doesn't contain enough information.`,
|
|
80
|
-
model: 'openai/gpt-5.
|
|
80
|
+
model: 'openai/gpt-5.6-sol',
|
|
81
81
|
tools: {
|
|
82
82
|
graphQueryTool,
|
|
83
83
|
},
|
|
@@ -138,15 +138,15 @@ The agent uses the graph query tool to:
|
|
|
138
138
|
2. Find semantically similar chunks in the vector store
|
|
139
139
|
3. Build a knowledge graph from related chunks
|
|
140
140
|
4. Traverse the graph to find connected information
|
|
141
|
-
5. Return
|
|
141
|
+
5. Return complete context for generating the response
|
|
142
142
|
|
|
143
143
|
## Choosing the right threshold
|
|
144
144
|
|
|
145
|
-
The threshold parameter
|
|
145
|
+
The threshold parameter substantially impacts retrieval quality:
|
|
146
146
|
|
|
147
|
-
- **High threshold (0.8-0.9)**: Strict connections
|
|
147
|
+
- **High threshold (0.8-0.9)**: Strict connections and fewer relationships, plus more precise but potentially incomplete results
|
|
148
148
|
- **Medium threshold (0.6-0.8)**: Balanced approach, good for most use cases
|
|
149
|
-
- **Low threshold (0.4-0.6)**: More connections
|
|
149
|
+
- **Low threshold (0.4-0.6)**: More connections and broader context, plus risk of including less relevant information
|
|
150
150
|
|
|
151
151
|
Start with 0.7 and adjust based on your specific use case:
|
|
152
152
|
|
|
@@ -199,7 +199,7 @@ const agent = new Agent({
|
|
|
199
199
|
name: 'RAG Agent',
|
|
200
200
|
instructions: `Use vector search for simple fact-finding queries.
|
|
201
201
|
Use graph search when you need to understand relationships or find connected information.`,
|
|
202
|
-
model: 'openai/gpt-5.
|
|
202
|
+
model: 'openai/gpt-5.6-sol',
|
|
203
203
|
tools: {
|
|
204
204
|
vectorQueryTool,
|
|
205
205
|
graphQueryTool,
|
|
@@ -59,11 +59,11 @@ const results = await pgVector.query({
|
|
|
59
59
|
console.log('Similar chunks:', results)
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
This example shows the essentials
|
|
62
|
+
This example shows the essentials. Initialize a document and create chunks, then generate and store embeddings before querying for similar content.
|
|
63
63
|
|
|
64
64
|
## Document processing
|
|
65
65
|
|
|
66
|
-
The basic building block of RAG is document processing. Documents can be chunked using
|
|
66
|
+
The basic building block of RAG is document processing. Documents can be chunked using strategies (recursive, sliding window, etc.) and enriched with metadata. See the [chunking and embedding doc](https://mastra.ai/docs/rag/chunking-and-embedding).
|
|
67
67
|
|
|
68
68
|
## Vector storage
|
|
69
69
|
|
|
@@ -160,15 +160,15 @@ When creating the tool, pay special attention to the tool's name and description
|
|
|
160
160
|
|
|
161
161
|
This is particularly useful when:
|
|
162
162
|
|
|
163
|
-
- Your agent needs to
|
|
163
|
+
- Your agent needs to decide at runtime what information to retrieve
|
|
164
164
|
- The retrieval process requires complex decision-making
|
|
165
165
|
- You want the agent to combine multiple retrieval strategies based on context
|
|
166
166
|
|
|
167
167
|
#### Database-Specific Configurations
|
|
168
168
|
|
|
169
|
-
The Vector Query Tool supports database-specific configurations that enable you to
|
|
169
|
+
The Vector Query Tool supports database-specific configurations that enable you to use unique features and optimizations of different vector stores.
|
|
170
170
|
|
|
171
|
-
> **Note:** These configurations are for **query-time options** like namespaces, performance tuning, and filtering
|
|
171
|
+
> **Note:** These configurations are for **query-time options** like namespaces, performance tuning, and filtering, not for database connection setup.
|
|
172
172
|
>
|
|
173
173
|
> Connection credentials (URLs, auth tokens) are configured when you instantiate the vector store class (e.g., `new LibSQLVector({ url: '...' })`).
|
|
174
174
|
|
|
@@ -235,7 +235,7 @@ const lanceQueryTool = createVectorQueryTool({
|
|
|
235
235
|
- **pgVector optimization**: Control search accuracy and speed with ef/probes parameters
|
|
236
236
|
- **Quality filtering**: Set minimum similarity thresholds to improve result relevance
|
|
237
237
|
- **LanceDB tables**: Separate data into tables for better organization and performance
|
|
238
|
-
- **Runtime flexibility**: Override configurations
|
|
238
|
+
- **Runtime flexibility**: Override configurations at runtime based on context
|
|
239
239
|
|
|
240
240
|
**Common Use Cases:**
|
|
241
241
|
|
|
@@ -274,7 +274,7 @@ import { PGVECTOR_PROMPT } from '@mastra/pg'
|
|
|
274
274
|
export const ragAgent = new Agent({
|
|
275
275
|
id: 'rag-agent',
|
|
276
276
|
name: 'RAG Agent',
|
|
277
|
-
model: 'openai/gpt-5.
|
|
277
|
+
model: 'openai/gpt-5.6-sol',
|
|
278
278
|
instructions: `
|
|
279
279
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
280
280
|
${PGVECTOR_PROMPT}
|
|
@@ -291,7 +291,7 @@ import { PINECONE_PROMPT } from '@mastra/pinecone'
|
|
|
291
291
|
export const ragAgent = new Agent({
|
|
292
292
|
id: 'rag-agent',
|
|
293
293
|
name: 'RAG Agent',
|
|
294
|
-
model: 'openai/gpt-5.
|
|
294
|
+
model: 'openai/gpt-5.6-sol',
|
|
295
295
|
instructions: `
|
|
296
296
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
297
297
|
${PINECONE_PROMPT}
|
|
@@ -308,7 +308,7 @@ import { QDRANT_PROMPT } from '@mastra/qdrant'
|
|
|
308
308
|
export const ragAgent = new Agent({
|
|
309
309
|
id: 'rag-agent',
|
|
310
310
|
name: 'RAG Agent',
|
|
311
|
-
model: 'openai/gpt-5.
|
|
311
|
+
model: 'openai/gpt-5.6-sol',
|
|
312
312
|
instructions: `
|
|
313
313
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
314
314
|
${QDRANT_PROMPT}
|
|
@@ -325,7 +325,7 @@ import { CHROMA_PROMPT } from '@mastra/chroma'
|
|
|
325
325
|
export const ragAgent = new Agent({
|
|
326
326
|
id: 'rag-agent',
|
|
327
327
|
name: 'RAG Agent',
|
|
328
|
-
model: 'openai/gpt-5.
|
|
328
|
+
model: 'openai/gpt-5.6-sol',
|
|
329
329
|
instructions: `
|
|
330
330
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
331
331
|
${CHROMA_PROMPT}
|
|
@@ -342,7 +342,7 @@ import { ASTRA_PROMPT } from '@mastra/astra'
|
|
|
342
342
|
export const ragAgent = new Agent({
|
|
343
343
|
id: 'rag-agent',
|
|
344
344
|
name: 'RAG Agent',
|
|
345
|
-
model: 'openai/gpt-5.
|
|
345
|
+
model: 'openai/gpt-5.6-sol',
|
|
346
346
|
instructions: `
|
|
347
347
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
348
348
|
${ASTRA_PROMPT}
|
|
@@ -359,7 +359,7 @@ import { LIBSQL_PROMPT } from '@mastra/libsql'
|
|
|
359
359
|
export const ragAgent = new Agent({
|
|
360
360
|
id: 'rag-agent',
|
|
361
361
|
name: 'RAG Agent',
|
|
362
|
-
model: 'openai/gpt-5.
|
|
362
|
+
model: 'openai/gpt-5.6-sol',
|
|
363
363
|
instructions: `
|
|
364
364
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
365
365
|
${LIBSQL_PROMPT}
|
|
@@ -376,7 +376,7 @@ import { UPSTASH_PROMPT } from '@mastra/upstash'
|
|
|
376
376
|
export const ragAgent = new Agent({
|
|
377
377
|
id: 'rag-agent',
|
|
378
378
|
name: 'RAG Agent',
|
|
379
|
-
model: 'openai/gpt-5.
|
|
379
|
+
model: 'openai/gpt-5.6-sol',
|
|
380
380
|
instructions: `
|
|
381
381
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
382
382
|
${UPSTASH_PROMPT}
|
|
@@ -393,7 +393,7 @@ import { VECTORIZE_PROMPT } from '@mastra/vectorize'
|
|
|
393
393
|
export const ragAgent = new Agent({
|
|
394
394
|
id: 'rag-agent',
|
|
395
395
|
name: 'RAG Agent',
|
|
396
|
-
model: 'openai/gpt-5.
|
|
396
|
+
model: 'openai/gpt-5.6-sol',
|
|
397
397
|
instructions: `
|
|
398
398
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
399
399
|
${VECTORIZE_PROMPT}
|
|
@@ -410,7 +410,7 @@ import { MONGODB_PROMPT } from '@mastra/mongodb'
|
|
|
410
410
|
export const ragAgent = new Agent({
|
|
411
411
|
id: 'rag-agent',
|
|
412
412
|
name: 'RAG Agent',
|
|
413
|
-
model: 'openai/gpt-5.
|
|
413
|
+
model: 'openai/gpt-5.6-sol',
|
|
414
414
|
instructions: `
|
|
415
415
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
416
416
|
${MONGODB_PROMPT}
|
|
@@ -427,7 +427,7 @@ import { OPENSEARCH_PROMPT } from '@mastra/opensearch'
|
|
|
427
427
|
export const ragAgent = new Agent({
|
|
428
428
|
id: 'rag-agent',
|
|
429
429
|
name: 'RAG Agent',
|
|
430
|
-
model: 'openai/gpt-5.
|
|
430
|
+
model: 'openai/gpt-5.6-sol',
|
|
431
431
|
instructions: `
|
|
432
432
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
433
433
|
${OPENSEARCH_PROMPT}
|
|
@@ -444,7 +444,7 @@ import { S3VECTORS_PROMPT } from '@mastra/s3vectors'
|
|
|
444
444
|
export const ragAgent = new Agent({
|
|
445
445
|
id: 'rag-agent',
|
|
446
446
|
name: 'RAG Agent',
|
|
447
|
-
model: 'openai/gpt-5.
|
|
447
|
+
model: 'openai/gpt-5.6-sol',
|
|
448
448
|
instructions: `
|
|
449
449
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
450
450
|
${S3VECTORS_PROMPT}
|
|
@@ -455,10 +455,10 @@ export const ragAgent = new Agent({
|
|
|
455
455
|
|
|
456
456
|
### Re-ranking
|
|
457
457
|
|
|
458
|
-
Initial vector similarity search can sometimes miss
|
|
458
|
+
Initial vector similarity search can sometimes miss detailed relevance. Re-ranking is a more computationally expensive process, but more accurate algorithm that improves results by:
|
|
459
459
|
|
|
460
460
|
- Considering word order and exact matches
|
|
461
|
-
- Applying more
|
|
461
|
+
- Applying more advanced relevance scoring
|
|
462
462
|
- Using a method called cross-attention between query and documents
|
|
463
463
|
|
|
464
464
|
Here's how to use re-ranking:
|
|
@@ -476,7 +476,7 @@ const initialResults = await pgVector.query({
|
|
|
476
476
|
// Create a relevance scorer
|
|
477
477
|
const relevanceProvider = new MastraAgentRelevanceScorer(
|
|
478
478
|
'relevance-scorer',
|
|
479
|
-
'openai/gpt-5.
|
|
479
|
+
'openai/gpt-5.6-sol',
|
|
480
480
|
)
|
|
481
481
|
|
|
482
482
|
// Re-rank the results
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Storing embeddings in a vector database
|
|
4
4
|
|
|
5
|
-
After generating embeddings, you need to store them in a database that supports vector similarity search. Mastra provides a consistent interface for storing and querying embeddings across
|
|
5
|
+
After generating embeddings, you need to store them in a database that supports vector similarity search. Mastra provides a consistent interface for storing and querying embeddings across vector databases.
|
|
6
6
|
|
|
7
7
|
## Supported databases
|
|
8
8
|
|
|
@@ -571,7 +571,7 @@ The upsert operation:
|
|
|
571
571
|
|
|
572
572
|
Vector stores support rich metadata (any JSON-serializable fields) for filtering and organization. Since metadata is stored with no fixed schema, use consistent field naming to avoid unexpected query results.
|
|
573
573
|
|
|
574
|
-
> **Warning:** Metadata is
|
|
574
|
+
> **Warning:** Metadata is important for vector storage. Without it, you'd only have numerical embeddings with no way to return the original text or filter results. Always store at least the source text as metadata.
|
|
575
575
|
|
|
576
576
|
```ts
|
|
577
577
|
// Store embeddings with rich metadata for better organization and filtering
|
|
@@ -13,7 +13,7 @@ The `CompositeAuth` class allows you to combine multiple authentication provider
|
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
-
CompositeAuth is included in `@mastra/core
|
|
16
|
+
CompositeAuth is included in `@mastra/core` and requires no additional packages.
|
|
17
17
|
|
|
18
18
|
```typescript
|
|
19
19
|
import { CompositeAuth } from '@mastra/core/server'
|
|
@@ -83,7 +83,7 @@ async authenticateToken(token, request) {
|
|
|
83
83
|
|
|
84
84
|
## Provider order
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
Place the most common authentication method first because provider order affects performance:
|
|
87
87
|
|
|
88
88
|
```typescript
|
|
89
89
|
// If most requests use Clerk, put it first
|
|
@@ -74,10 +74,10 @@ resourceMapping: {
|
|
|
74
74
|
|
|
75
75
|
`deriveId()` receives:
|
|
76
76
|
|
|
77
|
-
- `user
|
|
78
|
-
- `resourceId
|
|
79
|
-
- `requestContext
|
|
80
|
-
- `metadata
|
|
77
|
+
- `user`: the authenticated user
|
|
78
|
+
- `resourceId`: the owning Mastra resource ID when available (for example, a thread's `resourceId`)
|
|
79
|
+
- `requestContext`: the current request context for advanced tenant resolution
|
|
80
|
+
- `metadata`: provider-specific metadata for the attempted action
|
|
81
81
|
|
|
82
82
|
Return `undefined` from `deriveId()` to fall back to the original Mastra resource ID.
|
|
83
83
|
|
|
@@ -263,7 +263,7 @@ Autonomous and scheduled agents run without an end user. Mark these calls with a
|
|
|
263
263
|
- `true` or `{ actorKind: 'system' }` identifies an anonymous system actor.
|
|
264
264
|
- The object form can also carry `agentId`, `permissions`, and `scope` to identify and constrain the acting agent.
|
|
265
265
|
|
|
266
|
-
By default, a trusted actor skips the user-centric `require()` check after a tenant-scope check. To enforce per-agent least privilege, implement the optional `requireActor` method on your provider. It receives the actor and the same `FGACheckParams` as `require`, and throws `FGADeniedError` to deny. When your provider doesn't implement `requireActor`, the trusted-actor bypass is preserved, so adding it
|
|
266
|
+
By default, a trusted actor skips the user-centric `require()` check after a tenant-scope check. To enforce per-agent least privilege, implement the optional `requireActor` method on your provider. It receives the actor and the same `FGACheckParams` as `require`, and throws `FGADeniedError` to deny. When your provider doesn't implement `requireActor`, the trusted-actor bypass is preserved, so adding it's backward compatible.
|
|
267
267
|
|
|
268
268
|
```typescript
|
|
269
269
|
import { FGADeniedError } from '@mastra/core/auth/ee'
|
|
@@ -293,7 +293,7 @@ The actor signal is trusted input, so construct it server-side:
|
|
|
293
293
|
- Establish tenant scope server-side. Built-in agent HTTP routes ignore a client-supplied `organizationId` in the request context, and the trusted-actor path requires an `organizationId` to be set.
|
|
294
294
|
- Durable resume keeps its existing request-context recovery and merge behavior. This doesn't make a persisted actor trusted for a later workflow segment.
|
|
295
295
|
- The tenant-scope check confirms that a trusted `organizationId` exists. It doesn't verify that `actor.agentId` belongs to that organization. When that relationship matters, verify it in `requireActor` using authoritative provider data.
|
|
296
|
-
- Treat `actor.permissions` as
|
|
296
|
+
- Treat `actor.permissions` as an unverified claim. Resolve authoritative grants from a trusted source. A provider that enforces least privilege resolves the agent's authoritative permissions from a trusted source, for example a manifest or your FGA backend keyed by `agentId`, rather than trusting the inline values.
|
|
297
297
|
- Once a provider implements `requireActor`, errors from that method stop execution. Mastra doesn't fall back to organization-only authorization.
|
|
298
298
|
|
|
299
299
|
## Related
|
|
@@ -93,11 +93,11 @@ The `MastraAuthFirebase` class can be configured through constructor options or
|
|
|
93
93
|
- `FIREBASE_SERVICE_ACCOUNT`: Path to Firebase service account JSON file
|
|
94
94
|
- `FIRESTORE_DATABASE_ID` or `FIREBASE_DATABASE_ID`: Firestore database ID
|
|
95
95
|
|
|
96
|
-
> **Note:** When constructor options aren't provided, the class automatically reads these environment variables.
|
|
96
|
+
> **Note:** When constructor options aren't provided, the class automatically reads these environment variables. As a result, you can call `new MastraAuthFirebase()` without any arguments if your environment variables are properly configured.
|
|
97
97
|
|
|
98
98
|
### User Authorization
|
|
99
99
|
|
|
100
|
-
By default, `MastraAuthFirebase` uses Firestore to manage user access. It expects a
|
|
100
|
+
By default, `MastraAuthFirebase` uses Firestore to manage user access. It expects a `user_access` collection with documents keyed by user UIDs. The presence of a document in this collection determines whether a user is authorized.
|
|
101
101
|
|
|
102
102
|
```text
|
|
103
103
|
user_access/
|
|
@@ -13,7 +13,7 @@ The `SimpleAuth` class provides token-based authentication using a basic token-t
|
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
-
`SimpleAuth` is included in `@mastra/core
|
|
16
|
+
`SimpleAuth` is included in `@mastra/core` and requires no additional packages.
|
|
17
17
|
|
|
18
18
|
```typescript
|
|
19
19
|
import { SimpleAuth } from '@mastra/core/server'
|