@mastra/mcp-docs-server 1.3.9 → 1.3.10-alpha.10
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/code-mode.md +2 -2
- package/.docs/docs/agents/guardrails.md +13 -5
- package/.docs/docs/agents/human-in-the-loop.md +27 -5
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/overview.md +7 -7
- package/.docs/docs/agents/processors.md +69 -20
- package/.docs/docs/agents/structured-output.md +6 -6
- package/.docs/docs/agents/tools.md +15 -10
- package/.docs/docs/browser.md +13 -1
- package/.docs/docs/channels.md +48 -6
- package/.docs/docs/connections/a2a.md +1 -1
- package/.docs/docs/connections/acp.md +2 -2
- package/.docs/docs/connections/mcp.md +159 -50
- package/.docs/docs/connections/overview.md +1 -1
- package/.docs/docs/connections/sdk-agents.md +8 -8
- package/.docs/docs/deployment/mastra-server.md +2 -0
- package/.docs/docs/deployment/monorepo.md +2 -0
- package/.docs/docs/develop.md +1 -1
- package/.docs/docs/evals/custom-scorers.md +5 -5
- package/.docs/docs/evals/experiments.md +2 -2
- package/.docs/docs/evals/multi-turn.md +2 -2
- package/.docs/docs/evals/overview.md +6 -4
- package/.docs/docs/evals/quick-checks.md +2 -2
- package/.docs/docs/guides/build-an-eval-loop.md +3 -3
- package/.docs/docs/guides/context-engineering.md +13 -6
- package/.docs/docs/guides/mcp-authentication-authorization.md +2 -2
- package/.docs/docs/guides/streaming.md +1 -1
- package/.docs/docs/harness/agent-controller.md +7 -7
- package/.docs/docs/harness/background-tasks.md +7 -3
- package/.docs/docs/harness/durable-agents.md +11 -6
- package/.docs/docs/harness/goals.md +7 -5
- package/.docs/docs/harness/overview.md +2 -2
- package/.docs/docs/harness/schedules.md +10 -5
- package/.docs/docs/index.md +6 -6
- package/.docs/docs/mastra-platform/connect/channels.md +1 -1
- package/.docs/docs/mastra-platform/connect/providers.md +27 -26
- package/.docs/docs/mastra-platform/connect/tools.md +4 -4
- package/.docs/docs/mastra-platform/deploy.md +2 -0
- package/.docs/docs/mastra-platform/observability.md +1 -1
- package/.docs/docs/mastra-platform/server.md +10 -6
- package/.docs/docs/mastra-platform/studio.md +1 -1
- package/.docs/docs/mastra-platform/system-environment-variables.md +3 -0
- package/.docs/docs/mastra-platform/workspaces.md +1 -1
- package/.docs/docs/memory/memory-processors.md +7 -7
- package/.docs/docs/memory/message-history.md +8 -5
- package/.docs/docs/memory/multi-user-threads.md +1 -1
- package/.docs/docs/memory/observational-memory.md +24 -14
- package/.docs/docs/memory/overview.md +6 -0
- package/.docs/docs/memory/semantic-recall.md +7 -3
- package/.docs/docs/memory/working-memory.md +2 -2
- package/.docs/docs/observability/integrations/exporters/mastra-storage.md +2 -1
- package/.docs/docs/observability/logging.md +8 -5
- package/.docs/docs/observability/tracing/overview.md +17 -0
- package/.docs/docs/sandbox/filesystem.md +1 -0
- package/.docs/docs/sandbox/overview.md +1 -1
- package/.docs/docs/sandbox/search.md +11 -0
- package/.docs/docs/server/custom-adapters.md +53 -1
- package/.docs/docs/server/custom-api-routes.md +2 -0
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/middleware.md +1 -1
- package/.docs/docs/server/request-context.md +9 -3
- package/.docs/docs/server/server-adapters.md +12 -204
- package/.docs/docs/signals/notifications.md +233 -0
- package/.docs/docs/signals/overview.md +94 -0
- package/.docs/docs/signals/running-across-processes.md +132 -0
- package/.docs/docs/signals/sending-signals.md +166 -0
- package/.docs/docs/signals/signal-providers.md +278 -0
- package/.docs/docs/signals/state-signals.md +103 -0
- package/.docs/docs/signals/thread-streams.md +125 -0
- package/.docs/docs/skills.md +4 -4
- package/.docs/docs/storage.md +1 -1
- package/.docs/docs/studio/editor.md +39 -23
- package/.docs/docs/studio/overview.md +2 -0
- package/.docs/docs/subagents.md +13 -7
- package/.docs/docs/workflows/agents-and-tools.md +16 -1
- package/.docs/docs/workflows/control-flow.md +57 -0
- package/.docs/docs/workflows/human-in-the-loop.md +3 -0
- package/.docs/docs/workflows/overview.md +9 -1
- package/.docs/docs/workflows/scheduled-workflows.md +10 -2
- package/.docs/docs/workflows/suspend-and-resume.md +6 -0
- package/.docs/docs/workflows/workflow-state.md +12 -0
- package/.docs/integrations/agentic-ui/ai-sdk-ui.md +1 -1
- package/.docs/integrations/agentic-ui/copilotkit.md +3 -1
- package/.docs/integrations/agentic-ui/openui.md +1 -1
- package/.docs/integrations/auth/better-auth.md +2 -0
- package/.docs/integrations/auth/google.md +2 -0
- package/.docs/integrations/auth/okta.md +2 -0
- package/.docs/integrations/browsers/agent-browser.md +1 -1
- package/.docs/integrations/browsers/browser-viewer.md +1 -1
- package/.docs/integrations/browsers/firecrawl.md +1 -1
- package/.docs/integrations/browsers/stagehand.md +6 -6
- package/.docs/integrations/channels/discord.md +1 -1
- package/.docs/integrations/channels/github.md +2 -2
- package/.docs/integrations/channels/imessage.md +2 -50
- package/.docs/integrations/channels/slack.md +1 -1
- package/.docs/integrations/channels/teams.md +1 -1
- package/.docs/integrations/channels/telegram.md +1 -1
- package/.docs/integrations/channels/whatsapp.md +1 -1
- package/.docs/integrations/databases/aurora-dsql.md +3 -3
- package/.docs/integrations/databases/cloudflare-kv.md +4 -0
- package/.docs/integrations/databases/dynamodb.md +4 -4
- package/.docs/integrations/databases/elasticsearch.md +1 -1
- package/.docs/integrations/databases/mongodb.md +1 -1
- package/.docs/integrations/databases/oracledb.md +1 -1
- package/.docs/integrations/databases/postgresql.md +5 -5
- package/.docs/integrations/databases/redis.md +1 -1
- package/.docs/integrations/databases/upstash.md +1 -1
- package/.docs/integrations/deploy/inngest.md +1 -0
- package/.docs/integrations/deploy/kubernetes.md +1 -1
- package/.docs/integrations/deploy/neon.md +2 -1
- package/.docs/integrations/deploy/render.md +2 -2
- package/.docs/integrations/file-storage/agentfs.md +1 -1
- package/.docs/integrations/file-storage/amazon-s3.md +20 -3
- package/.docs/integrations/file-storage/archil.md +4 -4
- package/.docs/integrations/file-storage/azure-blob.md +1 -1
- package/.docs/integrations/file-storage/google-cloud-storage.md +1 -1
- package/.docs/integrations/file-storage/google-drive.md +1 -1
- package/.docs/integrations/file-storage/mesa.md +2 -2
- package/.docs/integrations/file-storage/neon.md +210 -0
- package/.docs/integrations/file-storage/vercel-files.md +5 -1
- package/.docs/integrations/frameworks/express.md +0 -64
- package/.docs/integrations/observability/datadog.md +5 -0
- package/.docs/integrations/observability/langfuse.md +1 -1
- package/.docs/integrations/observability/langsmith.md +35 -2
- package/.docs/integrations/observability/opentelemetry.md +32 -9
- package/.docs/integrations/observability/sentry.md +22 -22
- package/.docs/integrations/sandboxes/apple-container.md +1 -1
- package/.docs/integrations/sandboxes/blaxel.md +1 -1
- package/.docs/integrations/sandboxes/cloudflare-sandbox.md +1 -1
- package/.docs/integrations/sandboxes/daytona.md +4 -4
- package/.docs/integrations/sandboxes/docker.md +2 -2
- package/.docs/integrations/sandboxes/e2b-desktop.md +1 -1
- package/.docs/integrations/sandboxes/e2b.md +9 -7
- package/.docs/integrations/sandboxes/modal.md +4 -4
- package/.docs/integrations/sandboxes/railway.md +4 -4
- package/.docs/integrations/sandboxes/sprites.md +1 -1
- package/.docs/integrations/sandboxes/vercel.md +6 -6
- package/.docs/integrations/tools/brightdata.md +2 -2
- package/.docs/integrations/tools/firecrawl.md +1 -1
- package/.docs/integrations/tools/parallel.md +4 -4
- package/.docs/integrations/tools/perplexity.md +2 -2
- package/.docs/integrations/tools/tavily.md +2 -2
- package/.docs/integrations/voice/azure.md +4 -4
- package/.docs/integrations/voice/cloudflare.md +3 -3
- package/.docs/integrations/voice/deepgram.md +2 -2
- package/.docs/integrations/voice/elevenlabs.md +4 -4
- package/.docs/integrations/voice/gladia.md +10 -10
- package/.docs/integrations/voice/google.md +11 -11
- package/.docs/integrations/voice/inworld.md +23 -23
- package/.docs/integrations/voice/livekit.md +11 -8
- package/.docs/integrations/voice/mistral.md +2 -2
- package/.docs/integrations/voice/modelslab.md +1 -1
- package/.docs/integrations/voice/murf.md +1 -1
- package/.docs/integrations/voice/openai.md +5 -5
- package/.docs/integrations/voice/sarvam.md +6 -6
- package/.docs/integrations/voice/speechify.md +25 -12
- package/.docs/integrations/voice/xai.md +3 -3
- package/.docs/integrations.md +1 -0
- package/.docs/models/environment-variables.md +2 -2
- package/.docs/models/gateways/custom-gateways.md +3 -3
- package/.docs/models/gateways/merge-gateway.md +4 -14
- package/.docs/models/gateways/neon.md +2 -1
- package/.docs/models/gateways/netlify.md +3 -5
- package/.docs/models/gateways/openrouter.md +6 -6
- package/.docs/models/gateways/vercel.md +7 -9
- package/.docs/models/index.md +21 -15
- package/.docs/models/providers/302ai.md +7 -3
- package/.docs/models/providers/abacus.md +74 -110
- package/.docs/models/providers/abliteration-ai.md +4 -0
- package/.docs/models/providers/above.md +4 -0
- package/.docs/models/providers/agentrouter.md +4 -0
- package/.docs/models/providers/agnes.md +4 -0
- package/.docs/models/providers/ai-router.md +4 -0
- package/.docs/models/providers/ai21.md +4 -0
- package/.docs/models/providers/aiand.md +8 -7
- package/.docs/models/providers/aimlapi.md +172 -173
- package/.docs/models/providers/ainetcafe.md +4 -0
- package/.docs/models/providers/aixy.md +4 -0
- package/.docs/models/providers/aki-io.md +9 -6
- package/.docs/models/providers/alibaba-cn.md +6 -2
- package/.docs/models/providers/alibaba-coding-plan-cn.md +4 -0
- package/.docs/models/providers/alibaba-coding-plan.md +4 -0
- package/.docs/models/providers/alibaba-token-plan-cn.md +4 -0
- package/.docs/models/providers/alibaba-token-plan.md +4 -0
- package/.docs/models/providers/alibaba.md +6 -2
- package/.docs/models/providers/ambient.md +6 -2
- package/.docs/models/providers/amd.md +4 -0
- package/.docs/models/providers/anthropic.md +4 -0
- package/.docs/models/providers/anyapi.md +4 -0
- package/.docs/models/providers/arcee.md +4 -0
- package/.docs/models/providers/atomic-chat.md +4 -0
- package/.docs/models/providers/auriko.md +6 -2
- package/.docs/models/providers/bailing.md +4 -0
- package/.docs/models/providers/baseten.md +8 -4
- package/.docs/models/providers/bee.md +4 -0
- package/.docs/models/providers/berget.md +7 -4
- package/.docs/models/providers/blueclaw.md +4 -0
- package/.docs/models/providers/bothub.md +8 -4
- package/.docs/models/providers/boundless.md +4 -4
- package/.docs/models/providers/cerebras.md +4 -0
- package/.docs/models/providers/chutes.md +18 -11
- package/.docs/models/providers/clarifai.md +4 -0
- package/.docs/models/providers/claudinio.md +4 -0
- package/.docs/models/providers/cline-pass.md +6 -6
- package/.docs/models/providers/cloudferro-sherlock.md +4 -0
- package/.docs/models/providers/cloudflare-workers-ai.md +4 -0
- package/.docs/models/providers/commandcode.md +6 -2
- package/.docs/models/providers/coralbricks.md +5 -1
- package/.docs/models/providers/cortecs.md +9 -4
- package/.docs/models/providers/crof.md +4 -0
- package/.docs/models/providers/crossmodel.md +5 -3
- package/.docs/models/providers/crusoe.md +5 -7
- package/.docs/models/providers/daoxe.md +5 -1
- package/.docs/models/providers/databricks.md +4 -0
- package/.docs/models/providers/deepinfra.md +6 -2
- package/.docs/models/providers/deepseek.md +4 -0
- package/.docs/models/providers/digitalocean.md +11 -10
- package/.docs/models/providers/dinference.md +4 -3
- package/.docs/models/providers/drun.md +4 -0
- package/.docs/models/providers/ebcloud.md +4 -0
- package/.docs/models/providers/echo.md +4 -0
- package/.docs/models/providers/edenai.md +33 -9
- package/.docs/models/providers/empiriolabs.md +8 -5
- package/.docs/models/providers/engy.md +6 -2
- package/.docs/models/providers/evroc.md +6 -2
- package/.docs/models/providers/fastrouter.md +45 -50
- package/.docs/models/providers/firepass.md +4 -0
- package/.docs/models/providers/fireworks-ai.md +32 -23
- package/.docs/models/providers/firmware.md +4 -0
- package/.docs/models/providers/freemodel.md +4 -0
- package/.docs/models/providers/friendli.md +15 -13
- package/.docs/models/providers/frogbot.md +6 -7
- package/.docs/models/providers/github-models.md +4 -0
- package/.docs/models/providers/gmicloud.md +4 -0
- package/.docs/models/providers/google.md +6 -5
- package/.docs/models/providers/greenpt.md +18 -20
- package/.docs/models/providers/groq.md +5 -1
- package/.docs/models/providers/helicone.md +4 -0
- package/.docs/models/providers/hetzner.md +4 -0
- package/.docs/models/providers/hpc-ai.md +4 -0
- package/.docs/models/providers/huggingface.md +7 -0
- package/.docs/models/providers/hyper.md +4 -0
- package/.docs/models/providers/iflowcn.md +6 -18
- package/.docs/models/providers/impossibl.md +6 -9
- package/.docs/models/providers/inception.md +4 -0
- package/.docs/models/providers/inceptron.md +12 -6
- package/.docs/models/providers/inco.md +5 -1
- package/.docs/models/providers/infer.md +4 -0
- package/.docs/models/providers/inference.md +9 -11
- package/.docs/models/providers/inferx.md +4 -0
- package/.docs/models/providers/infomaniak.md +14 -12
- package/.docs/models/providers/io-net.md +15 -17
- package/.docs/models/providers/iteracompute.md +7 -3
- package/.docs/models/providers/jalapeno.md +18 -19
- package/.docs/models/providers/jiekou.md +57 -63
- package/.docs/models/providers/kenari.md +38 -53
- package/.docs/models/providers/kilo.md +31 -27
- package/.docs/models/providers/kimi-code-plan-cn.md +7 -1
- package/.docs/models/providers/kimi-code-plan-global.md +7 -1
- package/.docs/models/providers/kimi-for-coding.md +4 -0
- package/.docs/models/providers/kiro.md +4 -0
- package/.docs/models/providers/klokintegration.md +4 -0
- package/.docs/models/providers/kosmik.md +4 -0
- package/.docs/models/providers/kuae-cloud-coding-plan.md +4 -0
- package/.docs/models/providers/lilac.md +6 -8
- package/.docs/models/providers/liquid.md +4 -0
- package/.docs/models/providers/llama.md +6 -11
- package/.docs/models/providers/llmgateway-providers.md +25 -23
- package/.docs/models/providers/llmgateway.md +20 -13
- package/.docs/models/providers/llmtech.md +4 -0
- package/.docs/models/providers/llmtr.md +5 -6
- package/.docs/models/providers/lmstudio.md +4 -0
- package/.docs/models/providers/longcat.md +4 -0
- package/.docs/models/providers/lowrouter.md +7 -2
- package/.docs/models/providers/lucidquery.md +6 -2
- package/.docs/models/providers/lynkr.md +4 -0
- package/.docs/models/providers/meganova.md +10 -7
- package/.docs/models/providers/melious.md +6 -7
- package/.docs/models/providers/meta.md +4 -0
- package/.docs/models/providers/minimax-cn-coding-plan.md +4 -0
- package/.docs/models/providers/minimax-cn.md +4 -0
- package/.docs/models/providers/minimax-coding-plan.md +4 -0
- package/.docs/models/providers/minimax.md +4 -0
- package/.docs/models/providers/mistral.md +8 -3
- package/.docs/models/providers/mixlayer.md +4 -0
- package/.docs/models/providers/moark.md +4 -2
- package/.docs/models/providers/modal.md +4 -0
- package/.docs/models/providers/model-oracle-ai.md +4 -0
- package/.docs/models/providers/modelis.md +4 -0
- package/.docs/models/providers/modelscope.md +4 -0
- package/.docs/models/providers/moonshotai-cn.md +8 -2
- package/.docs/models/providers/moonshotai.md +8 -2
- package/.docs/models/providers/morph.md +18 -6
- package/.docs/models/providers/munito-eu.md +84 -0
- package/.docs/models/providers/munito.md +85 -0
- package/.docs/models/providers/nan.md +5 -1
- package/.docs/models/providers/nano-gpt.md +651 -613
- package/.docs/models/providers/nearai.md +7 -2
- package/.docs/models/providers/nebius.md +33 -27
- package/.docs/models/providers/neosmith.md +4 -0
- package/.docs/models/providers/neuralwatt.md +5 -4
- package/.docs/models/providers/nova.md +4 -0
- package/.docs/models/providers/novita-ai.md +8 -1
- package/.docs/models/providers/nvidia.md +19 -35
- package/.docs/models/providers/oci.md +4 -1
- package/.docs/models/providers/ofox.md +5 -1
- package/.docs/models/providers/ollama-cloud.md +6 -2
- package/.docs/models/providers/openai.md +6 -1
- package/.docs/models/providers/opencode-go.md +9 -4
- package/.docs/models/providers/opencode.md +88 -88
- package/.docs/models/providers/openreason.md +4 -0
- package/.docs/models/providers/opper.md +5 -4
- package/.docs/models/providers/orcarouter.md +18 -16
- package/.docs/models/providers/ovhcloud.md +4 -0
- package/.docs/models/providers/pareto.md +5 -1
- package/.docs/models/providers/pendra.md +4 -0
- package/.docs/models/providers/perplexity-agent.md +6 -12
- package/.docs/models/providers/perplexity.md +4 -0
- package/.docs/models/providers/pioneer.md +11 -7
- package/.docs/models/providers/poe.md +20 -70
- package/.docs/models/providers/poolside.md +4 -0
- package/.docs/models/providers/prime.md +8 -2
- package/.docs/models/providers/privatemode-ai.md +4 -0
- package/.docs/models/providers/qihang-ai.md +11 -11
- package/.docs/models/providers/qiniu-ai.md +13 -94
- package/.docs/models/providers/reflection.md +4 -0
- package/.docs/models/providers/regolo-ai.md +9 -7
- package/.docs/models/providers/requesty.md +10 -1
- package/.docs/models/providers/routing-run.md +4 -0
- package/.docs/models/providers/runinfra.md +5 -4
- package/.docs/models/providers/sakana.md +4 -0
- package/.docs/models/providers/sambanova.md +4 -0
- package/.docs/models/providers/sarvam.md +5 -2
- package/.docs/models/providers/scaleway.md +16 -11
- package/.docs/models/providers/scnet-token-plan.md +4 -0
- package/.docs/models/providers/scx-ai.md +4 -0
- package/.docs/models/providers/scx.md +4 -0
- package/.docs/models/providers/sensenova.md +4 -0
- package/.docs/models/providers/siliconflow-cn.md +39 -41
- package/.docs/models/providers/siliconflow.md +7 -6
- package/.docs/models/providers/snowflake-cortex.md +4 -0
- package/.docs/models/providers/stackit.md +6 -4
- package/.docs/models/providers/standardcompute.md +4 -0
- package/.docs/models/providers/stepfun-ai-step-plan.md +4 -0
- package/.docs/models/providers/stepfun-ai.md +8 -4
- package/.docs/models/providers/stepfun-step-plan.md +4 -0
- package/.docs/models/providers/stepfun.md +8 -4
- package/.docs/models/providers/subconscious.md +4 -0
- package/.docs/models/providers/submodel.md +5 -1
- package/.docs/models/providers/synthetic.md +4 -4
- package/.docs/models/providers/tempr.md +5 -4
- package/.docs/models/providers/tencent-coding-plan.md +7 -10
- package/.docs/models/providers/tencent-token-plan.md +4 -0
- package/.docs/models/providers/tencent-tokenhub.md +4 -0
- package/.docs/models/providers/tensorx.md +4 -13
- package/.docs/models/providers/the-grid-ai.md +6 -1
- package/.docs/models/providers/thinkingmachines.md +4 -0
- package/.docs/models/providers/tinfoil.md +4 -0
- package/.docs/models/providers/togetherai.md +4 -0
- package/.docs/models/providers/tokengo.md +5 -1
- package/.docs/models/providers/tokenrouter.md +4 -0
- package/.docs/models/providers/trustedrouter.md +4 -0
- package/.docs/models/providers/umans-ai-coding-plan.md +16 -11
- package/.docs/models/providers/umans-ai.md +15 -10
- package/.docs/models/providers/unorouter.md +4 -13
- package/.docs/models/providers/upstage.md +4 -0
- package/.docs/models/providers/vancine.md +4 -1
- package/.docs/models/providers/vispark.md +4 -0
- package/.docs/models/providers/vivgrid.md +30 -39
- package/.docs/models/providers/volcengine-coding-plan.md +12 -12
- package/.docs/models/providers/volcengine.md +16 -18
- package/.docs/models/providers/vultr.md +4 -2
- package/.docs/models/providers/wafer.ai.md +7 -7
- package/.docs/models/providers/wallaby.md +4 -0
- package/.docs/models/providers/wandb.md +9 -5
- package/.docs/models/providers/xai.md +23 -3
- package/.docs/models/providers/xiaomi-token-plan-ams.md +8 -4
- package/.docs/models/providers/xiaomi-token-plan-cn.md +8 -4
- package/.docs/models/providers/xiaomi-token-plan-sgp.md +8 -4
- package/.docs/models/providers/xiaomi.md +8 -4
- package/.docs/models/providers/xpersona.md +4 -1
- package/.docs/models/providers/zai-coding-plan.md +4 -0
- package/.docs/models/providers/zai.md +4 -0
- package/.docs/models/providers/zeldoc.md +4 -0
- package/.docs/models/providers/zenifra.md +4 -0
- package/.docs/models/providers/zenmux.md +109 -125
- package/.docs/models/providers/zhipuai-coding-plan.md +4 -0
- package/.docs/models/providers/zhipuai.md +4 -0
- package/.docs/models/providers.md +2 -2
- package/.docs/reference/acp/acp-agent.md +5 -5
- package/.docs/reference/acp/create-acp-tool.md +2 -2
- package/.docs/reference/agent-controller/agent-controller-class.md +3 -3
- package/.docs/reference/agent-controller/session.md +10 -10
- package/.docs/reference/agents/agent.md +28 -48
- package/.docs/reference/agents/channels.md +35 -14
- package/.docs/reference/agents/createSkill.md +1 -1
- package/.docs/reference/agents/durable-agent.md +31 -23
- package/.docs/reference/agents/generate.md +61 -4
- package/.docs/reference/agents/generateLegacy.md +4 -4
- package/.docs/reference/agents/getLLM.md +2 -2
- package/.docs/reference/agents/getMetadata.md +2 -2
- package/.docs/reference/agents/inngest-agent.md +3 -1
- package/.docs/reference/agents/network.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +1 -1
- package/.docs/reference/auth/auth0.md +2 -2
- package/.docs/reference/auth/better-auth.md +7 -3
- package/.docs/reference/auth/clerk.md +1 -1
- package/.docs/reference/auth/firebase.md +4 -4
- package/.docs/reference/auth/google.md +6 -6
- package/.docs/reference/auth/jwt.md +1 -1
- package/.docs/reference/auth/neon.md +6 -6
- package/.docs/reference/auth/okta.md +9 -8
- package/.docs/reference/auth/workos.md +3 -3
- package/.docs/reference/browser/agent-browser.md +2 -2
- package/.docs/reference/browser/browser-viewer.md +1 -1
- package/.docs/reference/browser/firecrawl-browser.md +2 -2
- package/.docs/reference/browser/mastra-browser.md +1 -1
- package/.docs/reference/browser/stagehand-browser.md +5 -5
- package/.docs/reference/channels/slack-provider.md +7 -2
- package/.docs/reference/channels/teams-provider.md +2 -2
- package/.docs/reference/channels/telegram-provider.md +2 -2
- package/.docs/reference/cli/mastra.md +26 -0
- package/.docs/reference/client-js/agent-controller.md +5 -2
- package/.docs/reference/client-js/agents.md +22 -2
- package/.docs/reference/client-js/conversations.md +3 -3
- package/.docs/reference/client-js/datasets.md +1 -1
- package/.docs/reference/client-js/observability.md +39 -15
- package/.docs/reference/client-js/responses.md +4 -4
- package/.docs/reference/client-js/workflows.md +2 -0
- package/.docs/reference/code-sdk/mount-agent-controller.md +2 -2
- package/.docs/reference/coding-agent/build-base-prompt.md +1 -1
- package/.docs/reference/coding-agent/create-coding-agent.md +9 -9
- package/.docs/reference/configuration.md +4 -4
- package/.docs/reference/connect/channels.md +2 -2
- package/.docs/reference/connect/credential.md +1 -1
- package/.docs/reference/connect/providers.md +166 -112
- package/.docs/reference/connect/tools.md +17 -19
- package/.docs/reference/core/getAgentById.md +1 -1
- package/.docs/reference/core/mastra-class.md +7 -5
- package/.docs/reference/core/mastra-model-gateway.md +7 -2
- package/.docs/reference/datasets/startExperiment.md +17 -2
- package/.docs/reference/deployer.md +6 -3
- package/.docs/reference/editor/blob-store-provider.md +2 -2
- package/.docs/reference/editor/mastra-editor.md +2 -2
- package/.docs/reference/editor/tool-provider.md +1 -1
- package/.docs/reference/evals/answer-relevancy.md +3 -3
- package/.docs/reference/evals/answer-similarity.md +5 -3
- package/.docs/reference/evals/bias.md +3 -3
- package/.docs/reference/evals/checks.md +1 -1
- package/.docs/reference/evals/content-similarity.md +2 -2
- package/.docs/reference/evals/context-precision.md +3 -3
- package/.docs/reference/evals/context-recall.md +3 -3
- package/.docs/reference/evals/context-relevance.md +11 -11
- package/.docs/reference/evals/faithfulness.md +1 -1
- package/.docs/reference/evals/hallucination.md +8 -8
- package/.docs/reference/evals/multi-turn-judge.md +2 -2
- package/.docs/reference/evals/noise-sensitivity.md +13 -13
- package/.docs/reference/evals/not-scorable.md +1 -1
- package/.docs/reference/evals/prompt-alignment.md +26 -25
- package/.docs/reference/evals/rubric.md +6 -6
- package/.docs/reference/evals/run-evals.md +1 -1
- package/.docs/reference/evals/scorer-utils.md +6 -4
- package/.docs/reference/evals/summarization.md +4 -4
- package/.docs/reference/evals/tone-consistency.md +5 -5
- package/.docs/reference/evals/tool-call-accuracy.md +8 -8
- package/.docs/reference/evals/toxicity.md +1 -1
- package/.docs/reference/evals/trajectory-accuracy.md +1 -1
- package/.docs/reference/file-based-agents/config.md +3 -3
- package/.docs/reference/file-based-agents/schedules.md +2 -2
- package/.docs/reference/file-based-agents/subagents.md +4 -4
- package/.docs/reference/file-based-agents/workspace.md +1 -1
- package/.docs/reference/index.md +2 -1
- package/.docs/reference/logging/pino-logger.md +1 -1
- package/.docs/reference/manual-install.md +2 -2
- package/.docs/reference/memory/memory-class.md +5 -5
- package/.docs/reference/memory/observational-memory.md +25 -25
- package/.docs/reference/memory/summarizeConversation.md +3 -3
- package/.docs/reference/memory/summarizeThread.md +3 -3
- package/.docs/reference/migrations/agentnetwork.md +4 -4
- package/.docs/reference/migrations/mcp-v2.md +1 -1
- package/.docs/reference/migrations/upgrade-to-v1/agent.md +1 -1
- package/.docs/reference/migrations/upgrade-to-v1/storage.md +1 -1
- package/.docs/reference/migrations/upgrade-to-v1/tools.md +7 -1
- package/.docs/reference/migrations/vnext-to-standard-apis.md +3 -3
- package/.docs/reference/observability/metrics/automatic-metrics.md +10 -8
- package/.docs/reference/observability/tracing/advanced-queries.md +92 -11
- package/.docs/reference/observability/tracing/bridges/otel.md +1 -1
- package/.docs/reference/observability/tracing/exporters/confident-ai.md +2 -2
- package/.docs/reference/observability/tracing/exporters/console-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/langsmith.md +8 -0
- package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +4 -0
- package/.docs/reference/observability/tracing/exporters/mastra-storage-exporter.md +5 -1
- package/.docs/reference/observability/tracing/exporters/sentry.md +5 -5
- package/.docs/reference/observability/tracing/interfaces.md +23 -1
- package/.docs/reference/processors/batch-parts-processor.md +2 -2
- package/.docs/reference/processors/classifier-processor.md +3 -3
- package/.docs/reference/processors/cyber-refusal-handler.md +1 -1
- package/.docs/reference/processors/file-upload-processor.md +9 -9
- package/.docs/reference/processors/language-detector.md +1 -1
- package/.docs/reference/processors/message-history-processor.md +2 -2
- package/.docs/reference/processors/model-selection-processor.md +7 -7
- package/.docs/reference/processors/moderation-processor.md +3 -3
- package/.docs/reference/processors/pii-detector.md +2 -2
- package/.docs/reference/processors/prefill-error-handler.md +2 -2
- package/.docs/reference/processors/processor-interface.md +71 -15
- package/.docs/reference/processors/prompt-injection-detector.md +1 -1
- package/.docs/reference/processors/provider-history-compat.md +13 -12
- package/.docs/reference/processors/regex-filter-processor.md +1 -1
- package/.docs/reference/processors/response-cache.md +2 -2
- package/.docs/reference/processors/semantic-recall-processor.md +2 -2
- package/.docs/reference/processors/skill-search-processor.md +1 -1
- package/.docs/reference/processors/stream-error-retry-processor.md +12 -8
- package/.docs/reference/processors/system-prompt-scrubber.md +2 -2
- package/.docs/reference/processors/token-cost-control.md +1 -1
- package/.docs/reference/processors/token-limiter-processor.md +4 -4
- package/.docs/reference/processors/tool-call-filter.md +3 -3
- package/.docs/reference/processors/tool-search-processor.md +6 -6
- package/.docs/reference/processors/unicode-normalizer.md +2 -2
- package/.docs/reference/processors/working-memory-processor.md +2 -2
- package/.docs/reference/pubsub/lease-provider.md +2 -2
- package/.docs/reference/pubsub/redis-streams.md +11 -1
- package/.docs/reference/pubsub/unix-socket-pubsub.md +1 -1
- package/.docs/reference/rag/chunking-and-embedding.md +2 -2
- package/.docs/reference/rag/database-config.md +20 -15
- package/.docs/reference/rag/extract-params.md +2 -2
- package/.docs/reference/rag/graph-rag-guide.md +2 -2
- package/.docs/reference/rag/metadata-filters.md +1 -1
- package/.docs/reference/rag/rerank.md +1 -1
- package/.docs/reference/rag/retrieval.md +24 -13
- package/.docs/reference/schedules/overview.md +17 -1
- package/.docs/reference/server/koa-adapter.md +2 -0
- package/.docs/reference/server/nestjs-adapter.md +1 -1
- package/.docs/reference/signals/create-notification-inbox-tool.md +4 -4
- package/.docs/reference/signals/notifications.md +249 -0
- package/.docs/reference/signals/task-signal-provider.md +2 -2
- package/.docs/reference/signals/thread-events.md +69 -0
- package/.docs/reference/storage/overview.md +30 -13
- package/.docs/reference/storage/retention.md +1 -1
- package/.docs/reference/streaming/ChunkType.md +86 -0
- package/.docs/reference/streaming/agents/MastraModelOutput.md +3 -3
- package/.docs/reference/streaming/agents/stream.md +6 -6
- package/.docs/reference/streaming/agents/streamLegacy.md +2 -2
- package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
- package/.docs/reference/tools/ask-user-tool.md +1 -1
- package/.docs/reference/tools/bedrock-kb-tool.md +2 -2
- package/.docs/reference/tools/create-code-mode.md +2 -2
- package/.docs/reference/tools/create-tool.md +19 -2
- package/.docs/reference/tools/document-chunker-tool.md +1 -1
- package/.docs/reference/tools/mcp-client.md +207 -16
- package/.docs/reference/tools/mcp-server.md +9 -7
- package/.docs/reference/tools/task-tools.md +4 -2
- package/.docs/reference/tools/vector-query-tool.md +2 -1
- package/.docs/reference/vectors/astra.md +3 -1
- package/.docs/reference/vectors/azure-ai-search.md +2 -2
- package/.docs/reference/vectors/chroma.md +2 -2
- package/.docs/reference/vectors/convex.md +1 -1
- package/.docs/reference/vectors/couchbase.md +12 -5
- package/.docs/reference/vectors/duckdb.md +5 -5
- package/.docs/reference/vectors/libsql.md +1 -1
- package/.docs/reference/vectors/mongodb.md +8 -8
- package/.docs/reference/vectors/oracledb.md +2 -2
- package/.docs/reference/vectors/pg.md +2 -2
- package/.docs/reference/vectors/pinecone.md +1 -1
- package/.docs/reference/vectors/qdrant.md +1 -1
- package/.docs/reference/vectors/s3vectors.md +3 -0
- package/.docs/reference/vectors/turbopuffer.md +1 -1
- package/.docs/reference/vectors/upstash.md +9 -5
- package/.docs/reference/vectors/vectorize.md +4 -2
- package/.docs/reference/vectors/weaviate.md +1 -1
- package/.docs/reference/voice/overview.md +24 -24
- package/.docs/reference/voice/speech-to-speech.md +6 -6
- package/.docs/reference/voice/speech-to-text.md +1 -1
- package/.docs/reference/voice/text-to-speech.md +1 -1
- package/.docs/reference/voice/voice.addInstructions.md +1 -1
- package/.docs/reference/voice/voice.send.md +1 -1
- package/.docs/reference/voice/voice.speak.md +1 -1
- package/.docs/reference/voice/voice.updateConfig.md +1 -1
- package/.docs/reference/workflows/run-methods/restart.md +1 -1
- package/.docs/reference/workflows/run-methods/resume.md +1 -1
- package/.docs/reference/workflows/run-methods/start.md +1 -1
- package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
- package/.docs/reference/workflows/run.md +2 -2
- package/.docs/reference/workflows/step.md +4 -0
- package/.docs/reference/workflows/workflow-methods/agent.md +2 -0
- package/.docs/reference/workflows/workflow-methods/classifier.md +5 -0
- package/.docs/reference/workflows/workflow-methods/dountil.md +1 -1
- package/.docs/reference/workflows/workflow-methods/map.md +2 -0
- package/.docs/reference/workflows/workflow.md +2 -2
- package/.docs/reference/workspace/factory-sandbox.md +11 -2
- package/.docs/reference/workspace/filesystem.md +2 -2
- package/.docs/reference/workspace/local-filesystem.md +1 -1
- package/.docs/reference/workspace/local-sandbox.md +4 -4
- package/.docs/reference/workspace/platform-filesystem.md +4 -4
- package/.docs/reference/workspace/platform-sandbox.md +31 -10
- package/.docs/reference/workspace/process-manager.md +13 -2
- package/.docs/reference/workspace/sandbox.md +1 -1
- package/.docs/reference/workspace/workspace-class.md +13 -13
- package/dist/index.js +1 -1
- package/dist/{src-DnH_jHt9.js → src-Cv7bX2-6.js} +10 -19
- package/dist/{src-DnH_jHt9.js.map → src-Cv7bX2-6.js.map} +1 -1
- package/dist/stdio.js +2 -3
- package/package.json +15 -15
- package/.docs/docs/guides/mcp-events.md +0 -306
- package/.docs/docs/harness/signal-providers.md +0 -212
- package/.docs/docs/harness/signals.md +0 -546
- package/.docs/docs/mastra-platform/connect/end-user-connections.md +0 -116
- package/.docs/reference/connect/user-connect-routes.md +0 -68
|
@@ -54,18 +54,19 @@ Registering in `errorProcessors` alone, as the example above does, covers both h
|
|
|
54
54
|
|
|
55
55
|
`ProviderHistoryCompat` includes these built-in compatibility rules:
|
|
56
56
|
|
|
57
|
-
| Rule | Provider | Timing
|
|
58
|
-
| ------------------------------------------------ | ---------------------------------------------- |
|
|
59
|
-
| `strip-foreign-provider-executed-tools` | Anthropic, OpenAI, Azure OpenAI, Google/Vertex | Preemptive prompt rewrite
|
|
60
|
-
| `anthropic-tool-id-format` | Anthropic | Preemptive prompt rewrite
|
|
61
|
-
| `cerebras-strip-reasoning-content` | Cerebras | Preemptive prompt rewrite
|
|
62
|
-
| `anthropic-strip-empty-signed-reasoning-content` | Anthropic |
|
|
63
|
-
| `anthropic-strip-foreign-reasoning-content` | Anthropic | Preemptive prompt rewrite
|
|
64
|
-
| `anthropic-strip-foreign-signed-reasoning` | Anthropic-compatible | Preemptive prompt rewrite
|
|
65
|
-
| `azure-system-reminder-transform` | Azure OpenAI | Preemptive prompt rewrite
|
|
66
|
-
| `openai-orphan-item-id` | OpenAI, Azure OpenAI (Responses) | Reactive API error recovery
|
|
67
|
-
| `anthropic-orphaned-thinking-step` | Anthropic | Reactive API error recovery
|
|
68
|
-
| `
|
|
57
|
+
| Rule | Provider | Timing | Behavior |
|
|
58
|
+
| ------------------------------------------------ | ---------------------------------------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| `strip-foreign-provider-executed-tools` | Anthropic, OpenAI, Azure OpenAI, Google/Vertex | Preemptive prompt rewrite | Removes provider-executed tool calls and their paired results from the outbound prompt when they came from a different provider family, since the receiving provider can't resolve another provider's tool IDs. Persisted history is left untouched. |
|
|
60
|
+
| `anthropic-tool-id-format` | Anthropic | Preemptive prompt rewrite | Rewrites tool call IDs that contain characters outside `[a-zA-Z0-9_-]` in the outbound prompt, on both the call and its result. A sanitized ID that would collide with one already in the prompt gets a `_2`, `_3`, … suffix. The provider's rejection never fires, and persisted history keeps the original IDs. A reactive fallback covers providers the preemptive check doesn't recognize, such as Vertex-hosted Claude. |
|
|
61
|
+
| `cerebras-strip-reasoning-content` | Cerebras | Preemptive prompt rewrite | Removes assistant `reasoning` parts from the outbound prompt so they're not serialized as unsupported `reasoning_content` fields. |
|
|
62
|
+
| `anthropic-strip-empty-signed-reasoning-content` | Anthropic | Reactive (matches Anthropic's 400 rejecting modified thinking blocks) | Removes assistant `reasoning` parts that carry an Anthropic signature but have empty text, which legacy records can contain, from earlier messages. Runs only after Anthropic rejects the history, because Claude 5.x returns empty-text signed blocks as normal output and they must be replayed unchanged to keep prompt caching. |
|
|
63
|
+
| `anthropic-strip-foreign-reasoning-content` | Anthropic | Preemptive prompt rewrite | Removes non-Anthropic assistant `reasoning` parts from the outbound prompt. Anthropic-native thinking history is preserved. |
|
|
64
|
+
| `anthropic-strip-foreign-signed-reasoning` | Anthropic-compatible | Preemptive prompt rewrite | Drops signed thinking from the outbound prompt when its origin turn was stamped with a different provider (for example Kimi For Coding ↔ `anthropic/claude-sonnet-5-5`), since the receiving provider can't verify another provider's signature. Turns emptied of all content by the drop are removed from the prompt. Unstamped history is left untouched. |
|
|
65
|
+
| `azure-system-reminder-transform` | Azure OpenAI | Preemptive prompt rewrite | Renames `<system-reminder>` wrappers in user text and system instructions to `<memory-context>` for the outbound request. Stored history remains unchanged. |
|
|
66
|
+
| `openai-orphan-item-id` | OpenAI, Azure OpenAI (Responses) | Reactive API error recovery | Recovers history that OpenAI rejects with `Item 'msg_…' of type 'message' was provided without its required 'reasoning' item`. Drops the Responses `itemId` from every item-bearing part of an assistant message that carries one but has no `reasoning` part, and retries. The message then replays by value instead of as an unsatisfiable `item_reference`. The repair is applied to the in-memory list for the current turn. |
|
|
67
|
+
| `anthropic-orphaned-thinking-step` | Anthropic | Reactive API error recovery | Recovers history that Anthropic rejects because `thinking` or `redacted_thinking` blocks in the latest assistant message can't be modified. Removes steps that contain only reasoning when more assistant content follows them, and retries. Covers history saved by older `@mastra/memory` releases ([#22798](https://github.com/mastra-ai/mastra/issues/22798)). |
|
|
68
|
+
| `tool-call-empty-input` | All providers | Preemptive prompt rewrite | Sends an assistant tool call whose stored input is missing (`undefined` or `null`) as `{}` in the outbound prompt, because providers reject a tool call without input (Anthropic: `tool_use.input: Field required`). A call whose arguments couldn't be parsed is stored this way. The call keeps its paired error result, and persisted history is left untouched. An empty-string input is a real stored value and is sent as is. |
|
|
69
|
+
| `ensure-user-first-turn` | Amazon Bedrock, Google/Vertex Gemini | Preemptive prompt rewrite | Inserts a minimal user turn (`.`) before a leading assistant turn, because these providers reject conversations whose first non-system turn is the assistant's. This happens when an agent greets first or `lastMessages` cuts into a thread. Runs last, so it sees the prompt after other rules have dropped emptied turns. |
|
|
69
70
|
|
|
70
71
|
Preemptive rules run through `processLLMRequest` after Mastra converts messages to the model prompt format and before the prompt is sent to the provider. These rewrites affect only the current provider call. Persisted history is never changed, so the IDs and content in memory and in the Studio stay exactly as written.
|
|
71
72
|
|
|
@@ -72,7 +72,7 @@ import { RegexFilterProcessor } from '@mastra/core/processors'
|
|
|
72
72
|
const agent = new Agent({
|
|
73
73
|
id: 'my-agent',
|
|
74
74
|
name: 'my-agent',
|
|
75
|
-
model: 'openai/gpt-
|
|
75
|
+
model: 'openai/gpt-6-luna',
|
|
76
76
|
inputProcessors: [
|
|
77
77
|
new RegexFilterProcessor({
|
|
78
78
|
presets: ['pii', 'secrets'],
|
|
@@ -25,7 +25,7 @@ const agent = new Agent({
|
|
|
25
25
|
id: 'search-agent',
|
|
26
26
|
name: 'Search Agent',
|
|
27
27
|
instructions: 'You answer questions concisely.',
|
|
28
|
-
model: 'openai/gpt-5',
|
|
28
|
+
model: 'openai/gpt-5.6',
|
|
29
29
|
inputProcessors: [new ResponseCache({ cache, ttl: 600 })],
|
|
30
30
|
})
|
|
31
31
|
|
|
@@ -49,7 +49,7 @@ See [Response caching](https://mastra.ai/docs/agents/processors) for the concept
|
|
|
49
49
|
|
|
50
50
|
**ttl** (`number`): Time-to-live (seconds) for entries written by this processor. Defaults to 300 seconds (5 minutes), matching OpenRouter's reference implementation. (Default: `300`)
|
|
51
51
|
|
|
52
|
-
**scope** (`string | null`): Tenant scope appended to the cache key. null opts out of scoping. When omitted, the processor falls back to the resource id resolved from the request context (
|
|
52
|
+
**scope** (`string | null`): Tenant scope appended to the cache key. null opts out of scoping. When omitted, the processor falls back to the resource id resolved from the request context (MASTRA_RESOURCE_ID_KEY) for automatic per-user isolation.
|
|
53
53
|
|
|
54
54
|
**key** (`string | (inputs: ResponseCacheKeyInputs) => string | Promise<string>`): Override the auto-derived cache key. Pass a string to pin a key, or a function that receives { agentId, scope, model, prompt, stepNumber } and returns a key. If the function throws, the processor falls back to the deterministic hash so the call still benefits from caching.
|
|
55
55
|
|
|
@@ -30,7 +30,7 @@ const processor = new SemanticRecall({
|
|
|
30
30
|
|
|
31
31
|
**options.vector** (`MastraVector`): Vector store for semantic search
|
|
32
32
|
|
|
33
|
-
**options.embedder** (`MastraEmbeddingModel<string>`): Embedder for generating query embeddings
|
|
33
|
+
**options.embedder** (`MastraEmbeddingModel<string>`): Embedder for generating query embeddings. Required unless the vector store embeds text itself (self-embedding)
|
|
34
34
|
|
|
35
35
|
**options.topK** (`number`): Number of most similar messages to retrieve
|
|
36
36
|
|
|
@@ -86,7 +86,7 @@ export const agent = new Agent({
|
|
|
86
86
|
id: 'semantic-memory-agent',
|
|
87
87
|
name: 'semantic-memory-agent',
|
|
88
88
|
instructions: 'You are a helpful assistant with semantic memory recall',
|
|
89
|
-
model: 'openai/gpt-
|
|
89
|
+
model: 'openai/gpt-6.1-sol',
|
|
90
90
|
inputProcessors: [semanticRecall, new MessageHistory({ storage, lastMessages: 50 })],
|
|
91
91
|
outputProcessors: [semanticRecall, new MessageHistory({ storage })],
|
|
92
92
|
})
|
|
@@ -81,7 +81,7 @@ const agent = new Agent({
|
|
|
81
81
|
name: 'skill-agent',
|
|
82
82
|
instructions:
|
|
83
83
|
'You are a helpful assistant. Use search_skills to find relevant skills, then load_skill to load their instructions.',
|
|
84
|
-
model: 'openai/gpt-
|
|
84
|
+
model: 'openai/gpt-6.1-sol',
|
|
85
85
|
workspace,
|
|
86
86
|
inputProcessors: [skillSearch],
|
|
87
87
|
})
|
|
@@ -20,7 +20,7 @@ export const agent = new Agent({
|
|
|
20
20
|
id: 'openai-agent',
|
|
21
21
|
name: 'openai-agent',
|
|
22
22
|
instructions: 'You are a helpful assistant.',
|
|
23
|
-
model: 'openai/gpt-5',
|
|
23
|
+
model: 'openai/gpt-5.6',
|
|
24
24
|
errorProcessors: [new StreamErrorRetryProcessor({ maxRetries: 5 })],
|
|
25
25
|
maxProcessorRetries: 5,
|
|
26
26
|
})
|
|
@@ -32,14 +32,18 @@ To run only the processors you configure, with none of the defaults merged in, s
|
|
|
32
32
|
|
|
33
33
|
## How it works
|
|
34
34
|
|
|
35
|
-
The processor checks the error and its cause chain for:
|
|
35
|
+
The processor checks the error and its cause chain, in this order, for:
|
|
36
36
|
|
|
37
|
-
- Provider retry metadata: `isRetryable === true`
|
|
38
|
-
- Built-in OpenAI Responses stream error matching
|
|
39
37
|
- Matcher results: Any configured matcher that returns `true`
|
|
38
|
+
- Built-in OpenAI Responses stream error matching
|
|
39
|
+
- Provider retry metadata: `isRetryable === true`
|
|
40
|
+
|
|
41
|
+
The first match decides the retry policy, so a configured matcher's `maxRetries`, `delayMs` and `onRetry` apply even when the built-in matcher would also match.
|
|
40
42
|
|
|
41
43
|
When the error is retryable, the processor returns `{ retry: true }`. It doesn't mutate messages.
|
|
42
44
|
|
|
45
|
+
Unless one of your own matchers matches it, the processor never retries a credential or quota refusal, even when provider metadata marks it retryable. The AI SDK marks every `429` retryable, including an exhausted quota.
|
|
46
|
+
|
|
43
47
|
When `delayMs` is set, the processor waits before signaling a retry. This is useful for transient network errors like `ECONNRESET` where immediately retrying is likely to fail again. The delay can be a fixed number of milliseconds or a function evaluated with the error args (for example, to implement exponential backoff).
|
|
44
48
|
|
|
45
49
|
### Retry limits
|
|
@@ -56,7 +60,7 @@ For retryable errors with a `Retry-After` response header, the processor reads c
|
|
|
56
60
|
|
|
57
61
|
## Retry unknown errors
|
|
58
62
|
|
|
59
|
-
Set `retryUnknownErrors` to retry errors that don't match provider metadata or the built-in OpenAI matcher, including a custom matcher. Unknown-error retries use the processor-level `maxRetries` and `delayMs` values. Known
|
|
63
|
+
Set `retryUnknownErrors` to retry errors that don't match provider metadata or the built-in OpenAI matcher, including a custom matcher. Unknown-error retries use the processor-level `maxRetries` and `delayMs` values. Known credential and quota refusals, including HTTP `401` and `403` responses, aren't retried:
|
|
60
64
|
|
|
61
65
|
```typescript
|
|
62
66
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -66,7 +70,7 @@ export const agent = new Agent({
|
|
|
66
70
|
id: 'resilient-agent',
|
|
67
71
|
name: 'Resilient agent',
|
|
68
72
|
instructions: 'You are a helpful assistant.',
|
|
69
|
-
model: 'openai/gpt-5',
|
|
73
|
+
model: 'openai/gpt-5.6',
|
|
70
74
|
errorProcessors: [
|
|
71
75
|
new StreamErrorRetryProcessor({
|
|
72
76
|
retryUnknownErrors: true,
|
|
@@ -99,7 +103,7 @@ export const agent = new Agent({
|
|
|
99
103
|
id: 'resilient-agent',
|
|
100
104
|
name: 'resilient-agent',
|
|
101
105
|
instructions: 'You are a helpful assistant.',
|
|
102
|
-
model: 'openai/gpt-5',
|
|
106
|
+
model: 'openai/gpt-5.6',
|
|
103
107
|
errorProcessors: [
|
|
104
108
|
new StreamErrorRetryProcessor({
|
|
105
109
|
maxRetries: 2,
|
|
@@ -112,7 +116,7 @@ export const agent = new Agent({
|
|
|
112
116
|
|
|
113
117
|
## Default OpenAI Responses matcher
|
|
114
118
|
|
|
115
|
-
`isRetryableOpenAIResponsesStreamError` matches OpenAI Responses stream error chunks with `type: 'error'` or `type: 'response.failed'`. It
|
|
119
|
+
`isRetryableOpenAIResponsesStreamError` matches OpenAI Responses stream error chunks with `type: 'error'` or `type: 'response.failed'`. It reads each chunk with the shared provider-failure reader from `@mastra/core/error` and retries chunks that report a rate limit, a provider outage, or a timeout. As a fallback, it retries errors with explicit retry guidance such as `You can retry your request`. It never retries a credential or quota refusal.
|
|
116
120
|
|
|
117
121
|
`StreamErrorRetryProcessor` includes this matcher by default. You can also import it and reuse it in custom retry logic.
|
|
118
122
|
|
|
@@ -56,7 +56,7 @@ const processor = new SystemPromptScrubber({
|
|
|
56
56
|
|
|
57
57
|
## Extended usage example
|
|
58
58
|
|
|
59
|
-
For production streaming, set `bufferSize` (for example `bufferSize: 200`) so `SystemPromptScrubber` makes one detection call per sentence instead of one per chunk. Buffering also catches content that
|
|
59
|
+
For production streaming, set `bufferSize` (for example `bufferSize: 200`) so `SystemPromptScrubber` makes one detection call per sentence instead of one per chunk. Buffering also catches content that's split across chunks. Text then reaches the client in sentence-sized pieces.
|
|
60
60
|
|
|
61
61
|
When using `SystemPromptScrubber` as an output processor, it's recommended to combine it with `BatchPartsProcessor` to optimize performance. The `BatchPartsProcessor` batches stream chunks together before passing them to the scrubber, reducing the number of LLM calls required for detection.
|
|
62
62
|
|
|
@@ -68,7 +68,7 @@ export const agent = new Agent({
|
|
|
68
68
|
id: 'scrubbed-agent',
|
|
69
69
|
name: 'scrubbed-agent',
|
|
70
70
|
instructions: 'You are a helpful assistant',
|
|
71
|
-
model: 'openai/gpt-
|
|
71
|
+
model: 'openai/gpt-6.1-sol',
|
|
72
72
|
outputProcessors: [
|
|
73
73
|
// Batch stream parts first to reduce LLM calls
|
|
74
74
|
new BatchPartsProcessor({
|
|
@@ -107,7 +107,7 @@ export const agent = new Agent({
|
|
|
107
107
|
id: 'context-limited-agent',
|
|
108
108
|
name: 'context-limited-agent',
|
|
109
109
|
instructions: 'You are a helpful assistant',
|
|
110
|
-
model: 'openai/gpt-
|
|
110
|
+
model: 'openai/gpt-6.1-sol',
|
|
111
111
|
memory: new Memory({/* ... */}),
|
|
112
112
|
inputProcessors: [
|
|
113
113
|
new TokenLimiterProcessor({ limit: 4000 }), // Limits historical messages to ~4000 tokens
|
|
@@ -117,7 +117,7 @@ export const agent = new Agent({
|
|
|
117
117
|
|
|
118
118
|
### As a per-step processor (limit multi-step token growth)
|
|
119
119
|
|
|
120
|
-
When an agent uses tools across multiple steps (e.g. `maxSteps > 1`), each step accumulates conversation history from all previous steps. `TokenLimiterProcessor` applies its limit at every step, measuring the prompt that's about to be sent after any earlier prompt processors have run.
|
|
120
|
+
When an agent uses tools across multiple steps (e.g. `maxSteps > 1`), each step accumulates conversation history from all previous steps. `TokenLimiterProcessor` applies its limit at every step, measuring the prompt that's about to be sent after any earlier prompt processors have run. To count the prompt the model actually receives, register the limiter after prompt-shrinking processors such as `ToolCallFilter`:
|
|
121
121
|
|
|
122
122
|
```typescript
|
|
123
123
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -127,7 +127,7 @@ export const agent = new Agent({
|
|
|
127
127
|
id: 'multi-step-agent',
|
|
128
128
|
name: 'multi-step-agent',
|
|
129
129
|
instructions: 'You are a helpful research assistant with access to tools',
|
|
130
|
-
model: 'openai/gpt-
|
|
130
|
+
model: 'openai/gpt-6.1-sol',
|
|
131
131
|
inputProcessors: [
|
|
132
132
|
new TokenLimiterProcessor({ limit: 8000 }), // Applied at every step
|
|
133
133
|
],
|
|
@@ -153,7 +153,7 @@ export const agent = new Agent({
|
|
|
153
153
|
id: 'response-limited-agent',
|
|
154
154
|
name: 'response-limited-agent',
|
|
155
155
|
instructions: 'You are a helpful assistant',
|
|
156
|
-
model: 'openai/gpt-
|
|
156
|
+
model: 'openai/gpt-6.1-sol',
|
|
157
157
|
outputProcessors: [
|
|
158
158
|
new TokenLimiterProcessor({
|
|
159
159
|
limit: 1000,
|
|
@@ -66,7 +66,7 @@ const filter = new ToolCallFilter({
|
|
|
66
66
|
|
|
67
67
|
## Preserve compact model output
|
|
68
68
|
|
|
69
|
-
Set `preserveModelOutput: true` to retain compact `toModelOutput` history for tool results that the filter removes.
|
|
69
|
+
Set `preserveModelOutput: true` to retain compact `toModelOutput` history for tool results that the filter removes. Replacing the removed tool call and result with a single text part in the prompt lets the model see the output without the raw tool arguments.
|
|
70
70
|
|
|
71
71
|
Tool results without model output that can be represented as text are removed entirely.
|
|
72
72
|
|
|
@@ -95,7 +95,7 @@ export const agent = new Agent({
|
|
|
95
95
|
id: 'filtered-agent',
|
|
96
96
|
name: 'filtered-agent',
|
|
97
97
|
instructions: 'You are a helpful assistant',
|
|
98
|
-
model: 'openai/gpt-
|
|
98
|
+
model: 'openai/gpt-6.1-sol',
|
|
99
99
|
tools: {
|
|
100
100
|
searchDatabase,
|
|
101
101
|
sendEmail,
|
|
@@ -121,7 +121,7 @@ export const agent = new Agent({
|
|
|
121
121
|
id: 'no-tools-context-agent',
|
|
122
122
|
name: 'no-tools-context-agent',
|
|
123
123
|
instructions: 'You are a helpful assistant',
|
|
124
|
-
model: 'openai/gpt-
|
|
124
|
+
model: 'openai/gpt-6.1-sol',
|
|
125
125
|
tools: {
|
|
126
126
|
searchDatabase,
|
|
127
127
|
sendEmail,
|
|
@@ -39,9 +39,9 @@ const toolSearch = new ToolSearchProcessor({
|
|
|
39
39
|
|
|
40
40
|
**options.search.minScore** (`number`): Minimum relevance score for including a tool in search results. Scores are raw BM25 relevance plus name-match boosts (+5 when a query term equals the tool ID, +2 when it appears in the ID). They are not normalized and often exceed 1. Scores depend on the tools in the catalog and their descriptions, so a threshold tuned for one tool set may not carry over to another. Tools scoring less than or equal to this value are excluded. Use small values such as 0 to 0.5 to require some term overlap.
|
|
41
41
|
|
|
42
|
-
**options.search.autoLoad** (`boolean`): When true, tools returned by
|
|
42
|
+
**options.search.autoLoad** (`boolean`): When true, tools returned by search_tools are activated immediately as part of the search. The load_tool meta-tool is not exposed, collapsing the two-step search then load flow into a single search step. Discovered tools become available on the next turn. Keep topK conservative since every match is activated.
|
|
43
43
|
|
|
44
|
-
**options.storage** (`'in-memory' | 'context'`): Where loaded-tool state lives. 'in-memory' (default) tracks loaded tools in an in-memory map per thread with TTL cleanup (see ttl); state is lost on restart and anonymous requests share a 'default' entry. 'context' derives loaded state from the conversation messages — a tool is loaded while a
|
|
44
|
+
**options.storage** (`'in-memory' | 'context'`): Where loaded-tool state lives. 'in-memory' (default) tracks loaded tools in an in-memory map per thread with TTL cleanup (see ttl); state is lost on restart and anonymous requests share a 'default' entry. 'context' derives loaded state from the conversation messages — a tool is loaded while a search_tools/load_tool result naming it remains in the messages; it works without memory (same-process only, and only for requests with a real thread ID), survives a restart whenever the messages are available again (memory with message history, or the caller resending the conversation), and de-loads automatically once that result is no longer present in the messages. The 'context' store is opt-in.
|
|
45
45
|
|
|
46
46
|
**options.ttl** (`number`): Time-to-live for in-memory thread state, in milliseconds. Only applies to the default storage: 'in-memory' store; after this duration of inactivity thread state is cleaned up. Set to 0 to disable cleanup. Ignored by the 'context' store.
|
|
47
47
|
|
|
@@ -145,7 +145,7 @@ const agent = new Agent({
|
|
|
145
145
|
id: 'mcp-agent',
|
|
146
146
|
name: 'mcp-agent',
|
|
147
147
|
instructions: 'Search for a tool when you need a capability you do not have.',
|
|
148
|
-
model: 'openai/gpt-
|
|
148
|
+
model: 'openai/gpt-6.1-sol',
|
|
149
149
|
// Resolved per request, then searchable alongside staticTools
|
|
150
150
|
tools: async ({ requestContext }) => mcpClient.getTools(requestContext.get('userToken')),
|
|
151
151
|
inputProcessors: [toolSearch],
|
|
@@ -184,7 +184,7 @@ const agent = new Agent({
|
|
|
184
184
|
name: 'dynamic-tools-agent',
|
|
185
185
|
instructions:
|
|
186
186
|
'You are a helpful assistant with access to many tools. Use search_tools to find relevant tools, then load_tool to make them available.',
|
|
187
|
-
model: 'openai/gpt-
|
|
187
|
+
model: 'openai/gpt-6.1-sol',
|
|
188
188
|
inputProcessors: [toolSearch],
|
|
189
189
|
})
|
|
190
190
|
```
|
|
@@ -238,7 +238,7 @@ Use `clearState`, `clearAllState`, `getStateStats`, and `cleanupNow` to inspect
|
|
|
238
238
|
|
|
239
239
|
Loaded state is derived from the conversation messages: a tool is loaded while a `search_tools` or `load_tool` result naming it remains in the messages. This mode:
|
|
240
240
|
|
|
241
|
-
- Works without memory configuration. Without memory, loaded tools are kept for the current process only, and only for requests with a real thread ID
|
|
241
|
+
- Works without memory configuration. Without memory, loaded tools are kept for the current process only, and only for requests with a real thread ID. Anonymous requests require the caller to resend the relevant messages to retain loaded tools between calls.
|
|
242
242
|
- Survives a restart whenever the messages are available again: from memory with message history, or because the caller resends the conversation. Without memory, a restart restores only what's in the messages the caller sends.
|
|
243
243
|
- De-loads a tool automatically once that result is no longer present in the messages.
|
|
244
244
|
|
|
@@ -264,7 +264,7 @@ import { ToolSearchProcessor, TokenLimiter } from '@mastra/core/processors'
|
|
|
264
264
|
const agent = new Agent({
|
|
265
265
|
id: 'my-agent',
|
|
266
266
|
name: 'my-agent',
|
|
267
|
-
model: 'openai/gpt-
|
|
267
|
+
model: 'openai/gpt-6.1-sol',
|
|
268
268
|
inputProcessors: [
|
|
269
269
|
new ToolSearchProcessor({
|
|
270
270
|
tools: allTools,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# UnicodeNormalizer
|
|
6
6
|
|
|
7
|
-
The `UnicodeNormalizer` is an **input processor** that normalizes Unicode text to ensure consistent formatting and remove potentially problematic characters before messages are sent to the language model. This processor
|
|
7
|
+
The `UnicodeNormalizer` is an **input processor** that normalizes Unicode text to ensure consistent formatting and remove potentially problematic characters before messages are sent to the language model. This processor always normalizes text to Unicode NFKC form. The normalization form isn't configurable. It also standardizes whitespace formatting. Control character removal is opt-in: set `stripControlChars` to `true` to enable it.
|
|
8
8
|
|
|
9
9
|
## Usage example
|
|
10
10
|
|
|
@@ -47,7 +47,7 @@ export const agent = new Agent({
|
|
|
47
47
|
id: 'normalized-agent',
|
|
48
48
|
name: 'normalized-agent',
|
|
49
49
|
instructions: 'You are a helpful assistant',
|
|
50
|
-
model: 'openai/gpt-
|
|
50
|
+
model: 'openai/gpt-6.1-sol',
|
|
51
51
|
inputProcessors: [
|
|
52
52
|
new UnicodeNormalizer({
|
|
53
53
|
stripControlChars: true,
|
|
@@ -35,7 +35,7 @@ const processor = new WorkingMemory({
|
|
|
35
35
|
|
|
36
36
|
**options.template.format** (`'markdown' | 'json'`): Format of the working memory content
|
|
37
37
|
|
|
38
|
-
**options.template.content** (`string
|
|
38
|
+
**options.template.content** (`string | Record<string, unknown>`): Template content defining the structure of working memory data. The object form is only valid when format is json
|
|
39
39
|
|
|
40
40
|
**options.scope** (`'thread' | 'resource'`): Scope of working memory. 'thread' scopes to current thread, 'resource' shares across all threads for the resource
|
|
41
41
|
|
|
@@ -73,7 +73,7 @@ export const agent = new Agent({
|
|
|
73
73
|
id: 'personalized-agent',
|
|
74
74
|
name: 'personalized-agent',
|
|
75
75
|
instructions: 'You are a helpful assistant that remembers user preferences',
|
|
76
|
-
model: 'openai/gpt-
|
|
76
|
+
model: 'openai/gpt-6.1-sol',
|
|
77
77
|
inputProcessors: [
|
|
78
78
|
new WorkingMemory({
|
|
79
79
|
storage,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# LeaseProvider
|
|
6
6
|
|
|
7
|
-
`LeaseProvider` is the distributed leasing contract, separate from event delivery ([`PubSub`](https://mastra.ai/reference/pubsub/base)). Mastra's [signals layer](https://mastra.ai/docs/
|
|
7
|
+
`LeaseProvider` is the distributed leasing contract, separate from event delivery ([`PubSub`](https://mastra.ai/reference/pubsub/base)). Mastra's [signals layer](https://mastra.ai/docs/signals/overview) uses it to elect a single owner across multiple processes (for example, serverless invocations) for a resource, most commonly a thread key. The owner is the process that wakes and runs the agent stream, so other processes route follow-up work to it instead of starting a competing run.
|
|
8
8
|
|
|
9
9
|
[Durable agents](https://mastra.ai/docs/harness/durable-agents) also claim each run through a lease when the workflows store doesn't support run fencing, so crash recovery can tell whether another process still drives the run.
|
|
10
10
|
|
|
@@ -133,5 +133,5 @@ When the configured pub/sub backend doesn't implement `LeaseProvider`, the runti
|
|
|
133
133
|
|
|
134
134
|
- [PubSub](https://mastra.ai/reference/pubsub/base): The event delivery contract, separate from leasing
|
|
135
135
|
- [RedisStreamsPubSub](https://mastra.ai/reference/pubsub/redis-streams): The built-in backend that implements `LeaseProvider`
|
|
136
|
-
- [Signals](https://mastra.ai/docs/
|
|
136
|
+
- [Signals](https://mastra.ai/docs/signals/overview): The runtime that uses leasing to coordinate thread execution across processes
|
|
137
137
|
- [Channels](https://mastra.ai/docs/channels): Uses leasing to coordinate agent runs in serverless and multi-instance deployments
|
|
@@ -181,9 +181,19 @@ When a subscriber calls `nack`, the event is republished with an incremented `de
|
|
|
181
181
|
|
|
182
182
|
A subscription never reclaims an event its own handler is still processing, so a slow handler isn't invoked twice for the same event. If a handler hangs, a different consumer in the group reclaims the event once it has been idle for `reclaimIdleMs`. In a single-consumer group there's no sibling to do that, so set `inFlightTimeoutMs` to have the subscription nack the event itself after that long.
|
|
183
183
|
|
|
184
|
+
### Evented agent worker takeover
|
|
185
|
+
|
|
186
|
+
With Postgres storage, distributed evented agents publish worker orchestration events through Redis. If a worker exits before acknowledging an event, another worker can reclaim it and finish the run while the original API process stays alive. Configure the API process with `MASTRA_WORKERS=false` and worker processes with `MASTRA_WORKERS=orchestration`. All processes must share the same Postgres database, Redis connection settings, and `keyPrefix`.
|
|
187
|
+
|
|
188
|
+
Keep `reclaimIdleMs` above 30 seconds (the default is 60 seconds). A lower value can reclaim an event while the stopped worker's step lease is still held, causing the event to be acknowledged without running.
|
|
189
|
+
|
|
190
|
+
Runs started on older versions can finish after upgrading, but don't have guaranteed crash recovery. Saved steps without occurrence identifiers keep their existing unguarded behavior. Other storage adapters keep distributed internal orchestration on the worker process.
|
|
191
|
+
|
|
192
|
+
An interrupted step can execute again, so make external side effects idempotent. Completed step occurrences are protected against stale redeliveries, and a completed loop iteration reuses its saved result and loop decision. Guarded execution persists the records needed for recovery even when `shouldPersistSnapshot` returns `false`. Resume, time travel, restart races, and individual `foreach` items aren't covered by these occurrence guards.
|
|
193
|
+
|
|
184
194
|
## Distributed leasing
|
|
185
195
|
|
|
186
|
-
`RedisStreamsPubSub` implements the [`LeaseProvider`](https://mastra.ai/reference/pubsub/lease-provider) contract on top of the same Redis connection. The [signals runtime](https://mastra.ai/docs/
|
|
196
|
+
`RedisStreamsPubSub` implements the [`LeaseProvider`](https://mastra.ai/reference/pubsub/lease-provider) contract on top of the same Redis connection. The [signals runtime](https://mastra.ai/docs/signals/overview) uses it to elect a single owner (usually per thread key) so that across instances only one process wakes and runs the agent, and others route follow-up work to the holder. This is what makes signals work on serverless and multi-instance deployments; without a shared lease, each instance would start its own competing run.
|
|
187
197
|
|
|
188
198
|
Lease keys are namespaced under the same `keyPrefix` as topics, as `<keyPrefix>:lease:<key>`. All operations are atomic: `acquireLease` uses `SET NX PX` and refreshes its own TTL idempotently, while `releaseLease`, `renewLease`, and `transferLease` use Lua scripts that check ownership before mutating, so a concurrent renewal from another owner is never clobbered.
|
|
189
199
|
|
|
@@ -53,7 +53,7 @@ await pubsub.close()
|
|
|
53
53
|
|
|
54
54
|
## Broker election
|
|
55
55
|
|
|
56
|
-
The broker is the first process to link its socket into place at the shared path. It routes events between all connected clients, and other processes connect to it as clients. Each candidate binds a socket at a private name and hard-links it to the shared path. The link fails if a socket is already there,
|
|
56
|
+
The broker is the first process to link its socket into place at the shared path. It routes events between all connected clients, and other processes connect to it as clients. Each candidate binds a socket at a private name and hard-links it to the shared path. The link fails if a socket is already there, preventing a candidate from accidentally replacing a live broker.
|
|
57
57
|
|
|
58
58
|
When the broker exits cleanly, it removes the shared path. Clients then reconnect, and the first to link its socket into place becomes the new broker. The remaining clients resubscribe to it.
|
|
59
59
|
|
|
@@ -63,7 +63,7 @@ For markdown documents where preserving the semantic relationships between secti
|
|
|
63
63
|
const chunks = await doc.chunk({
|
|
64
64
|
strategy: 'semantic-markdown',
|
|
65
65
|
joinThreshold: 500,
|
|
66
|
-
modelName: 'gpt-5',
|
|
66
|
+
modelName: 'gpt-5.6',
|
|
67
67
|
})
|
|
68
68
|
```
|
|
69
69
|
|
|
@@ -118,7 +118,7 @@ const { embeddings } = await embedMany({
|
|
|
118
118
|
})
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
Google (
|
|
121
|
+
Google (gemini-embedding-001):
|
|
122
122
|
|
|
123
123
|
```ts
|
|
124
124
|
const { embeddings } = await embedMany({
|
|
@@ -67,7 +67,7 @@ Configuration options specific to Chroma vector store.
|
|
|
67
67
|
|
|
68
68
|
**where** (`Where`): Metadata filtering conditions. Each field maps to a literal value or an operator expression ($gt, $gte, $lt, $lte, $ne, $eq, $in, $nin). Combine conditions with $and and $or.
|
|
69
69
|
|
|
70
|
-
**whereDocument** (`WhereDocument`): Document content filtering conditions using $contains and $
|
|
70
|
+
**whereDocument** (`WhereDocument`): Document content filtering conditions using $contains and $not_contains. Combine conditions with $and and $or.
|
|
71
71
|
|
|
72
72
|
**Filter Syntax Examples:**
|
|
73
73
|
|
|
@@ -172,26 +172,31 @@ await vectorTool.execute({ queryText: 'search query' }, { mastra, requestContext
|
|
|
172
172
|
### Multi-Database Configuration
|
|
173
173
|
|
|
174
174
|
```typescript
|
|
175
|
+
import { RequestContext } from '@mastra/core/request-context'
|
|
176
|
+
|
|
175
177
|
const vectorTool = createVectorQueryTool({
|
|
176
|
-
vectorStoreName: '
|
|
178
|
+
vectorStoreName: 'pinecone',
|
|
177
179
|
indexName: 'documents',
|
|
178
180
|
model: embedModel,
|
|
179
|
-
databaseConfig: {
|
|
180
|
-
pinecone: {
|
|
181
|
-
namespace: 'default',
|
|
182
|
-
},
|
|
183
|
-
pgvector: {
|
|
184
|
-
minScore: 0.8,
|
|
185
|
-
ef: 150,
|
|
186
|
-
},
|
|
187
|
-
chroma: {
|
|
188
|
-
where: { type: 'documentation' },
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
181
|
})
|
|
182
|
+
|
|
183
|
+
// Select the store per request and pass only its matching config block
|
|
184
|
+
const pineconeContext = new RequestContext()
|
|
185
|
+
pineconeContext.set('vectorStoreName', 'pinecone')
|
|
186
|
+
pineconeContext.set('databaseConfig', {
|
|
187
|
+
pinecone: { namespace: 'default' },
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
const pgVectorContext = new RequestContext()
|
|
191
|
+
pgVectorContext.set('vectorStoreName', 'pgVector')
|
|
192
|
+
pgVectorContext.set('databaseConfig', {
|
|
193
|
+
pgvector: { minScore: 0.8, ef: 150 },
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
await vectorTool.execute({ queryText: 'search query' }, { mastra, requestContext: pgVectorContext })
|
|
192
197
|
```
|
|
193
198
|
|
|
194
|
-
> **Note:** **Multi-Database Support**:
|
|
199
|
+
> **Note:** **Multi-Database Support**: Settings from every database block you configure are merged into the query parameters, regardless of which vector store is queried. Shared keys apply to whichever store runs the query. For example, `pgvector.minScore` is passed as `minScore`, which other stores such as LibSQL also read to filter results. Pass only the block for the vector store you query.
|
|
195
200
|
|
|
196
201
|
**Performance Tuning**:
|
|
197
202
|
|
|
@@ -70,7 +70,7 @@ The `extract` parameter accepts the following fields:
|
|
|
70
70
|
|
|
71
71
|
**promptTemplate** (`string`): Custom prompt template for question generation. Must include both {context} and {numQuestions} placeholders
|
|
72
72
|
|
|
73
|
-
**embeddingOnly** (`boolean`):
|
|
73
|
+
**embeddingOnly** (`boolean`): Accepted but currently has no effect. Questions are still generated and returned in questionsThisExcerptCanAnswer
|
|
74
74
|
|
|
75
75
|
### `KeywordExtractArgs`
|
|
76
76
|
|
|
@@ -84,7 +84,7 @@ The `extract` parameter accepts the following fields:
|
|
|
84
84
|
|
|
85
85
|
**schema** (`ZodType`): Zod schema defining the structure of the data to extract.
|
|
86
86
|
|
|
87
|
-
**llm** (`MastraLanguageModel`): AI SDK language model to use for extraction.
|
|
87
|
+
**llm** (`MastraLanguageModel | MastraLegacyLanguageModel`): AI SDK language model to use for extraction.
|
|
88
88
|
|
|
89
89
|
**instructions** (`string`): Instructions for the LLM on what to extract.
|
|
90
90
|
|
|
@@ -79,7 +79,7 @@ const ragAgent = new Agent({
|
|
|
79
79
|
instructions: `You are a helpful assistant that answers questions based on the provided context.
|
|
80
80
|
When answering questions, use the graph query tool to find relevant information and relationships.
|
|
81
81
|
Base your answers on the context provided by the tool, and clearly state if the context doesn't contain enough information.`,
|
|
82
|
-
model: 'openai/gpt-
|
|
82
|
+
model: 'openai/gpt-6.1-sol',
|
|
83
83
|
tools: {
|
|
84
84
|
graphQueryTool,
|
|
85
85
|
},
|
|
@@ -201,7 +201,7 @@ const agent = new Agent({
|
|
|
201
201
|
name: 'RAG Agent',
|
|
202
202
|
instructions: `Use vector search for simple fact-finding queries.
|
|
203
203
|
Use graph search when you need to understand relationships or find connected information.`,
|
|
204
|
-
model: 'openai/gpt-
|
|
204
|
+
model: 'openai/gpt-6.1-sol',
|
|
205
205
|
tools: {
|
|
206
206
|
vectorQueryTool,
|
|
207
207
|
graphQueryTool,
|
|
@@ -36,7 +36,7 @@ const results = await store.query({
|
|
|
36
36
|
|
|
37
37
|
### Array Operators
|
|
38
38
|
|
|
39
|
-
`$in`Matches any value in array{ category: { $in: \["A", "B"] } }Supported by: All except Couchbase`$nin`Matches none of the values{ status: { $nin: \["deleted", "archived"] } }Supported by: All except Couchbase`$all`Matches arrays containing all elements{ tags: { $all: \["urgent", "high"] } }Supported by: Astra, Pinecone, Upstash, MongoDB, OracleDB`$elemMatch`Matches array elements meeting criteria{ scores: { $elemMatch: { $gt: 80 } } }Supported by: libSQL, PgVector, MongoDB, OracleDB
|
|
39
|
+
`$in`Matches any value in array{ category: { $in: \["A", "B"] } }Supported by: All except Couchbase`$nin`Matches none of the values{ status: { $nin: \["deleted", "archived"] } }Supported by: All except Couchbase`$all`Matches arrays containing all elements{ tags: { $all: \["urgent", "high"] } }Supported by: Astra, Pinecone, Qdrant, Upstash, MongoDB, OracleDB`$elemMatch`Matches array elements meeting criteria{ scores: { $elemMatch: { $gt: 80 } } }Supported by: libSQL, PgVector, MongoDB, OracleDB
|
|
40
40
|
|
|
41
41
|
### Logical Operators
|
|
42
42
|
|
|
@@ -21,7 +21,7 @@ function rerank(
|
|
|
21
21
|
import { ModelRouterLanguageModel } from '@mastra/core/llm'
|
|
22
22
|
import { rerank } from '@mastra/rag'
|
|
23
23
|
|
|
24
|
-
const model = new ModelRouterLanguageModel('openai/gpt-
|
|
24
|
+
const model = new ModelRouterLanguageModel('openai/gpt-6.1-sol')
|
|
25
25
|
|
|
26
26
|
const rerankedResults = await rerank(vectorSearchResults, 'How do I deploy to production?', model, {
|
|
27
27
|
weights: {
|