@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
|
@@ -18,7 +18,7 @@ export const agent = new Agent({
|
|
|
18
18
|
id: 'my-agent',
|
|
19
19
|
name: 'my-agent',
|
|
20
20
|
instructions: 'You are a helpful assistant.',
|
|
21
|
-
model: 'openai/gpt-
|
|
21
|
+
model: 'openai/gpt-6-luna',
|
|
22
22
|
memory: new Memory({
|
|
23
23
|
options: {
|
|
24
24
|
observationalMemory: true,
|
|
@@ -37,15 +37,15 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
|
|
|
37
37
|
|
|
38
38
|
**enabled** (`boolean`): Enable or disable Observational Memory. When omitted from a config object, defaults to true. Only enabled: false explicitly disables it. (Default: `true`)
|
|
39
39
|
|
|
40
|
-
**model** (`'auto' | string | LanguageModel | DynamicModel | ModelByInputTokens | ModelWithRetries[]`): Model for both the Observer and Reflector agents. Cannot be used together with observation.model or reflection.model. When all model fields are omitted, each role defaults to "auto". Automatic selection prefers google/gemini-2.5-flash when
|
|
40
|
+
**model** (`'auto' | string | LanguageModel | DynamicModel | ModelByInputTokens | ModelWithRetries[]`): Model for both the Observer and Reflector agents. Cannot be used together with observation.model or reflection.model. When all model fields are omitted, each role defaults to "auto". Automatic selection prefers google/gemini-2.5-flash when GOOGLE_GENERATIVE_AI_API_KEY is configured, then a low-cost model for the active provider, then the active main model. Use "default" for the legacy fixed default. (Default: `'auto'`)
|
|
41
41
|
|
|
42
|
-
**autoModels** (`Record<string, string>`): Overrides the model automatic selection picks for a provider, keyed by provider ID. For example, { openai: "\_\
|
|
42
|
+
**autoModels** (`Record<string, string>`): Overrides the model automatic selection picks for a provider, keyed by provider ID. For example, { openai: "\_\_GATEWAY_OPENAI_MODEL_LUNA\_\_" }. Providers not listed use the built-in pick.
|
|
43
43
|
|
|
44
44
|
**resolveModel** (`(modelId: string, context: { requestContext?: RequestContext }) => MastraModelConfig | Promise<MastraModelConfig>`): Creates the model automatic selection picked, so it can use your credentials and routing. Receives only concrete model IDs, never "auto". When omitted, the picked ID goes through Mastra model routing.
|
|
45
45
|
|
|
46
46
|
**scope** (`'resource' | 'thread'`): Memory scope for observations. 'thread' keeps observations per-thread. 'resource' is deprecated and will be removed in a future release. It shares observations across all threads for a resource and works much worse than thread scope for prompt caching and agent understanding. For cross-thread continuity, use thread scope with retrieval or resource-scoped working memory. See resource scope (deprecated). (Default: `'thread'`)
|
|
47
47
|
|
|
48
|
-
**activateAfterIdle** (`number | string | false | "auto" | Record<string, number | string | false | "auto">`): Time before buffered observations are forced to activate after inactivity, even before observation.messageTokens is reached. Accepts a numeric millisecond value such as
|
|
48
|
+
**activateAfterIdle** (`number | string | false | "auto" | Record<string, number | string | false | "auto">`): Time before buffered observations are forced to activate after inactivity, even before observation.messageTokens is reached. Accepts a numeric millisecond value such as 300_000, duration strings like "5m" or "1hr", "auto" for a provider-aware prompt cache TTL, false to disable inherited observation idle activation, or an object of per-provider TTLs such as { default: "auto", anthropic: "1h" }. Object keys match the actor model provider before the first ., case-insensitively, so anthropic covers the direct Anthropic provider but not Claude through another provider such as amazon-bedrock; default covers every other provider. Reflections do not inherit this setting. Use reflection.activateAfterIdle to opt reflections into idle activation.
|
|
49
49
|
|
|
50
50
|
**activateOnProviderChange** (`boolean`): Force buffered observations to activate when the actor provider or model changes. Reflections do not inherit this setting. Use reflection.activateOnProviderChange to opt reflections into provider-change activation. (Default: `false`)
|
|
51
51
|
|
|
@@ -59,7 +59,7 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
|
|
|
59
59
|
|
|
60
60
|
**observation** (`ObservationalMemoryObservationConfig`): Configuration for the observation step. Controls when the Observer agent runs and how it behaves.
|
|
61
61
|
|
|
62
|
-
**observation.model** (`'auto' | string | LanguageModel | DynamicModel | ModelByInputTokens | ModelWithRetries[]`): Model for the Observer agent. With 'auto', each observation uses the Gemini default when
|
|
62
|
+
**observation.model** (`'auto' | string | LanguageModel | DynamicModel | ModelByInputTokens | ModelWithRetries[]`): Model for the Observer agent. With 'auto', each observation uses the Gemini default when GOOGLE_GENERATIVE_AI_API_KEY is set, otherwise a low-cost model for the calling agent's effective provider, then the calling model or configured model instance. Cannot be set if a top-level model is also provided. If neither this nor the top-level model is set, falls back to reflection.model.
|
|
63
63
|
|
|
64
64
|
**observation.instruction** (`string`): Custom instruction appended to the Observer's system prompt. Use this to customize what the Observer focuses on, such as domain-specific preferences or priorities.
|
|
65
65
|
|
|
@@ -75,13 +75,13 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
|
|
|
75
75
|
|
|
76
76
|
**observation.maxRetries** (`number`): Retries after the initial Observer model call on transient provider errors. Governs OM's own retry ladder; the Observer model call itself is configured with no provider-level retries.
|
|
77
77
|
|
|
78
|
-
**observation.failurePolicy** (`'abort' | 'continue'`): Terminal policy once Observer retries are exhausted in a synchronous observation. Background buffered observation failures are reported as
|
|
78
|
+
**observation.failurePolicy** (`'abort' | 'continue'`): Terminal policy once Observer retries are exhausted in a synchronous observation. Background buffered observation failures are reported as om_buffering_failed and never stop the turn. 'abort' aborts the agent turn. 'continue' emits the existing failure diagnostic, keeps the failed input pending for a later cycle, and allows the main agent turn to continue. Persistence, indexing, transform, locking, invariant, and explicit abort failures remain fatal. This setting doesn't prevent the underlying provider error or change blockAfter or attachment handling, and it has no backstop for a sustained outage: pending messages keep accruing in the main agent's context until they reach the model's context limit.
|
|
79
79
|
|
|
80
80
|
**observation.messageTokens** (`number`): Token count of unobserved messages that triggers observation. When unobserved message tokens exceed this threshold, the Observer agent is called. Text is estimated locally with tokenx. Image parts are included with model-aware heuristics when possible, with deterministic fallbacks when image metadata is incomplete. Image-like file parts are counted the same way when uploads are normalized as files.
|
|
81
81
|
|
|
82
82
|
**observation.maxTokensPerBatch** (`number`): Maximum tokens per batch when observing multiple threads in resource scope (deprecated). Threads are chunked into batches of this size and processed in parallel. Lower values mean more parallelism but more API calls.
|
|
83
83
|
|
|
84
|
-
**observation.modelSettings** (`ObservationalMemoryModelSettings`): Model settings for the Observer agent. The temperature: 0.3 default is only applied when the resolved model is known to support temperature. The maxOutputTokens:
|
|
84
|
+
**observation.modelSettings** (`ObservationalMemoryModelSettings`): Model settings for the Observer agent. The temperature: 0.3 default is only applied when the resolved model is known to support temperature. The maxOutputTokens: 100_000 default is only applied with default model selection (no model set, "default", or a ModelByInputTokens selector). Custom models get no maxOutputTokens default.
|
|
85
85
|
|
|
86
86
|
**observation.modelSettings.temperature** (`number`): Temperature for generation. Lower values produce more consistent output. The 0.3 default is only applied when the resolved model is known to support temperature.
|
|
87
87
|
|
|
@@ -107,11 +107,11 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
|
|
|
107
107
|
|
|
108
108
|
**reflection** (`ObservationalMemoryReflectionConfig`): Configuration for the reflection step. Controls when the Reflector agent runs and how it behaves.
|
|
109
109
|
|
|
110
|
-
**reflection.model** (`'auto' | string | LanguageModel | DynamicModel | ModelByInputTokens | ModelWithRetries[]`): Model for the Reflector agent. With 'auto', each reflection uses the Gemini default when
|
|
110
|
+
**reflection.model** (`'auto' | string | LanguageModel | DynamicModel | ModelByInputTokens | ModelWithRetries[]`): Model for the Reflector agent. With 'auto', each reflection uses the Gemini default when GOOGLE_GENERATIVE_AI_API_KEY is set, otherwise a low-cost model for the calling agent's effective provider, then the calling model or configured model instance. Cannot be set if a top-level model is also provided. If neither this nor the top-level model is set, falls back to observation.model.
|
|
111
111
|
|
|
112
112
|
**reflection.maxRetries** (`number`): Retries after the initial Reflector model call on transient provider errors. Governs OM's own retry ladder; the Reflector model call itself is configured with no provider-level retries.
|
|
113
113
|
|
|
114
|
-
**reflection.failurePolicy** (`'abort' | 'continue'`): Terminal policy once Reflector retries are exhausted in a synchronous reflection. Background buffered reflection failures are reported as
|
|
114
|
+
**reflection.failurePolicy** (`'abort' | 'continue'`): Terminal policy once Reflector retries are exhausted in a synchronous reflection. Background buffered reflection failures are reported as om_buffering_failed and never stop the turn. 'abort' aborts the agent turn. 'continue' emits the failure diagnostic and allows the turn to continue, leaving already-persisted observations committed and deferring reflection to the next threshold crossing. A provider outage usually takes out both stages, so set the policy on observation too if the turn should survive one.
|
|
115
115
|
|
|
116
116
|
**reflection.instruction** (`string`): Custom instruction appended to the Reflector's system prompt. Use this to customize how the Reflector consolidates observations, such as prioritizing certain types of information.
|
|
117
117
|
|
|
@@ -121,7 +121,7 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
|
|
|
121
121
|
|
|
122
122
|
**reflection.observationTokens** (`number`): Token count of observations that triggers reflection. When observation tokens exceed this threshold, the Reflector agent is called to condense them.
|
|
123
123
|
|
|
124
|
-
**reflection.modelSettings** (`ObservationalMemoryModelSettings`): Model settings for the Reflector agent. The temperature: 0 default is only applied when the resolved model is known to support temperature. The maxOutputTokens:
|
|
124
|
+
**reflection.modelSettings** (`ObservationalMemoryModelSettings`): Model settings for the Reflector agent. The temperature: 0 default is only applied when the resolved model is known to support temperature. The maxOutputTokens: 100_000 default is only applied with default model selection (no model set, "default", or a ModelByInputTokens selector). Custom models get no maxOutputTokens default.
|
|
125
125
|
|
|
126
126
|
**reflection.modelSettings.temperature** (`number`): Temperature for generation. Lower values produce more consistent output. The 0 default is only applied when the resolved model is known to support temperature.
|
|
127
127
|
|
|
@@ -158,7 +158,7 @@ import { z } from 'zod'
|
|
|
158
158
|
const memory = new Memory({
|
|
159
159
|
options: {
|
|
160
160
|
observationalMemory: {
|
|
161
|
-
model: 'openai/gpt-
|
|
161
|
+
model: 'openai/gpt-6-luna',
|
|
162
162
|
observation: {
|
|
163
163
|
extract: [
|
|
164
164
|
new Extractor({
|
|
@@ -240,7 +240,7 @@ export const agent = new Agent({
|
|
|
240
240
|
id: 'my-agent',
|
|
241
241
|
name: 'my-agent',
|
|
242
242
|
instructions: 'You are a helpful assistant.',
|
|
243
|
-
model: 'openai/gpt-
|
|
243
|
+
model: 'openai/gpt-6-luna',
|
|
244
244
|
memory: new Memory({
|
|
245
245
|
options: {
|
|
246
246
|
observationalMemory: {
|
|
@@ -269,7 +269,7 @@ export const agent = new Agent({
|
|
|
269
269
|
id: 'my-agent',
|
|
270
270
|
name: 'my-agent',
|
|
271
271
|
instructions: 'You are a helpful assistant.',
|
|
272
|
-
model: 'openai/gpt-
|
|
272
|
+
model: 'openai/gpt-6-luna',
|
|
273
273
|
memory: new Memory({
|
|
274
274
|
options: {
|
|
275
275
|
observationalMemory: {
|
|
@@ -299,11 +299,11 @@ export const agent = new Agent({
|
|
|
299
299
|
id: 'my-agent',
|
|
300
300
|
name: 'my-agent',
|
|
301
301
|
instructions: 'You are a helpful assistant.',
|
|
302
|
-
model: 'openai/gpt-
|
|
302
|
+
model: 'openai/gpt-6.1-sol',
|
|
303
303
|
memory: new Memory({
|
|
304
304
|
options: {
|
|
305
305
|
observationalMemory: {
|
|
306
|
-
model: 'openai/gpt-
|
|
306
|
+
model: 'openai/gpt-6-luna',
|
|
307
307
|
},
|
|
308
308
|
},
|
|
309
309
|
}),
|
|
@@ -320,7 +320,7 @@ export const agent = new Agent({
|
|
|
320
320
|
id: 'my-agent',
|
|
321
321
|
name: 'my-agent',
|
|
322
322
|
instructions: 'You are a helpful assistant.',
|
|
323
|
-
model: 'openai/gpt-
|
|
323
|
+
model: 'openai/gpt-6.1-sol',
|
|
324
324
|
memory: new Memory({
|
|
325
325
|
options: {
|
|
326
326
|
observationalMemory: {
|
|
@@ -328,7 +328,7 @@ export const agent = new Agent({
|
|
|
328
328
|
model: 'google/gemini-2.5-flash',
|
|
329
329
|
},
|
|
330
330
|
reflection: {
|
|
331
|
-
model: 'openai/gpt-
|
|
331
|
+
model: 'openai/gpt-6-luna',
|
|
332
332
|
},
|
|
333
333
|
},
|
|
334
334
|
},
|
|
@@ -348,7 +348,7 @@ export const agent = new Agent({
|
|
|
348
348
|
id: 'health-assistant',
|
|
349
349
|
name: 'health-assistant',
|
|
350
350
|
instructions: 'You are a health and wellness assistant.',
|
|
351
|
-
model: 'openai/gpt-
|
|
351
|
+
model: 'openai/gpt-6.1-sol',
|
|
352
352
|
memory: new Memory({
|
|
353
353
|
options: {
|
|
354
354
|
observationalMemory: {
|
|
@@ -393,7 +393,7 @@ export const agent = new Agent({
|
|
|
393
393
|
id: 'my-agent',
|
|
394
394
|
name: 'my-agent',
|
|
395
395
|
instructions: 'You are a helpful assistant.',
|
|
396
|
-
model: 'openai/gpt-
|
|
396
|
+
model: 'openai/gpt-6-luna',
|
|
397
397
|
memory: new Memory({
|
|
398
398
|
options: {
|
|
399
399
|
observationalMemory: {
|
|
@@ -748,7 +748,7 @@ const memory = new Memory({ storage })
|
|
|
748
748
|
const om = new ObservationalMemory({
|
|
749
749
|
storage: storage.stores.memory!,
|
|
750
750
|
memory,
|
|
751
|
-
model: 'google/gemini-
|
|
751
|
+
model: 'google/gemini-3.8-flash',
|
|
752
752
|
observation: {
|
|
753
753
|
messageTokens: 20_000,
|
|
754
754
|
},
|
|
@@ -763,7 +763,7 @@ export const agent = new Agent({
|
|
|
763
763
|
id: 'my-agent',
|
|
764
764
|
name: 'my-agent',
|
|
765
765
|
instructions: 'You are a helpful assistant.',
|
|
766
|
-
model: 'openai/gpt-
|
|
766
|
+
model: 'openai/gpt-6-luna',
|
|
767
767
|
inputProcessors: [omProcessor],
|
|
768
768
|
outputProcessors: [omProcessor],
|
|
769
769
|
})
|
|
@@ -920,8 +920,8 @@ import { ModelByInputTokens } from '@mastra/memory'
|
|
|
920
920
|
const selector = new ModelByInputTokens({
|
|
921
921
|
upTo: {
|
|
922
922
|
10_000: 'google/gemini-2.5-flash', // Fast for small inputs
|
|
923
|
-
40_000: 'openai/gpt-
|
|
924
|
-
1_000_000: 'openai/gpt-
|
|
923
|
+
40_000: 'openai/gpt-6-luna', // Stronger for medium inputs
|
|
924
|
+
1_000_000: 'openai/gpt-6.1-sol', // Most capable for large inputs
|
|
925
925
|
},
|
|
926
926
|
})
|
|
927
927
|
```
|
|
@@ -950,7 +950,7 @@ import { skillResultRedactor } from '@mastra/memory/hooks'
|
|
|
950
950
|
const memory = new Memory({
|
|
951
951
|
options: {
|
|
952
952
|
observationalMemory: {
|
|
953
|
-
model: 'google/gemini-
|
|
953
|
+
model: 'google/gemini-3.8-flash',
|
|
954
954
|
hooks: {
|
|
955
955
|
beforeObservation: skillResultRedactor(),
|
|
956
956
|
},
|
|
@@ -961,7 +961,7 @@ const memory = new Memory({
|
|
|
961
961
|
|
|
962
962
|
#### Parameters
|
|
963
963
|
|
|
964
|
-
**toolNames** (`readonly string[]`): Tool names whose results are redacted. Defaults to the built-in skill tools: skill,
|
|
964
|
+
**toolNames** (`readonly string[]`): Tool names whose results are redacted. Defaults to the built-in skill tools: skill, skill_search, and skill_read. Use this to redact a different set of tool results.
|
|
965
965
|
|
|
966
966
|
#### Returns
|
|
967
967
|
|
|
@@ -16,7 +16,7 @@ Use this when you already have the messages in hand and want explicit control ov
|
|
|
16
16
|
import { summarizeConversation } from '@mastra/memory'
|
|
17
17
|
|
|
18
18
|
const result = await summarizeConversation({
|
|
19
|
-
model: 'openai/gpt-
|
|
19
|
+
model: 'openai/gpt-6-luna',
|
|
20
20
|
messages,
|
|
21
21
|
instructions: 'Summarize this voicemail call for the business owner.',
|
|
22
22
|
})
|
|
@@ -24,7 +24,7 @@ const result = await summarizeConversation({
|
|
|
24
24
|
|
|
25
25
|
## Parameters
|
|
26
26
|
|
|
27
|
-
**model** (`string | LanguageModel | DynamicModel | ModelWithRetries[]`): Model that runs the summarization, such as a router string like '\_\
|
|
27
|
+
**model** (`string | LanguageModel | DynamicModel | ModelWithRetries[]`): Model that runs the summarization, such as a router string like '\_\_GATEWAY_OPENAI_MODEL_LUNA\_\_'. Pass an array of { model, maxRetries } entries to fall back to the next model when one fails.
|
|
28
28
|
|
|
29
29
|
**messages** (`MastraDBMessage[]`): The conversation to summarize. When empty, the function returns an empty result without calling the model.
|
|
30
30
|
|
|
@@ -80,7 +80,7 @@ const sessionSummary = new Extractor({
|
|
|
80
80
|
|
|
81
81
|
export async function onSessionEnd(messages: MastraDBMessage[]) {
|
|
82
82
|
const { summary, extracted, extractionFailures } = await summarizeConversation({
|
|
83
|
-
model: 'openai/gpt-
|
|
83
|
+
model: 'openai/gpt-6-luna',
|
|
84
84
|
messages,
|
|
85
85
|
instructions: 'Summarize this support session for the account manager.',
|
|
86
86
|
extract: [sessionSummary],
|
|
@@ -16,7 +16,7 @@ Use this when a session ends and you want a summary or structured extraction of
|
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
18
|
const result = await memory.summarizeThread({
|
|
19
|
-
model: 'openai/gpt-
|
|
19
|
+
model: 'openai/gpt-6-luna',
|
|
20
20
|
threadId: 'thread-123',
|
|
21
21
|
instructions: 'Summarize this voicemail call for the business owner.',
|
|
22
22
|
})
|
|
@@ -26,7 +26,7 @@ const result = await memory.summarizeThread({
|
|
|
26
26
|
|
|
27
27
|
**threadId** (`string`): The unique identifier of the thread to summarize.
|
|
28
28
|
|
|
29
|
-
**model** (`string | LanguageModel | DynamicModel`): Model that runs the summarization, such as a router string like '\_\
|
|
29
|
+
**model** (`string | LanguageModel | DynamicModel`): Model that runs the summarization, such as a router string like '\_\_GATEWAY_OPENAI_MODEL_LUNA\_\_'.
|
|
30
30
|
|
|
31
31
|
**resourceId** (`string`): ID of the resource that owns the thread. If provided, validates thread ownership. Also passed to extractor contexts.
|
|
32
32
|
|
|
@@ -78,7 +78,7 @@ const callSummary = new Extractor({
|
|
|
78
78
|
|
|
79
79
|
export async function onCallEnd(threadId: string, resourceId: string) {
|
|
80
80
|
await memory.summarizeThread({
|
|
81
|
-
model: 'openai/gpt-
|
|
81
|
+
model: 'openai/gpt-6-luna',
|
|
82
82
|
threadId,
|
|
83
83
|
resourceId,
|
|
84
84
|
instructions: 'Summarize this voicemail call for the business owner.',
|
|
@@ -31,7 +31,7 @@ const agent = new AgentNetwork({
|
|
|
31
31
|
name: 'agent-network',
|
|
32
32
|
agents: [agent1, agent2],
|
|
33
33
|
tools: { tool1, tool2 },
|
|
34
|
-
model: 'openai/gpt-
|
|
34
|
+
model: 'openai/gpt-6.1-sol',
|
|
35
35
|
instructions: 'You are a network agent that can help users with a variety of tasks.',
|
|
36
36
|
})
|
|
37
37
|
|
|
@@ -51,7 +51,7 @@ const agent = new Agent({
|
|
|
51
51
|
name: 'agent-network',
|
|
52
52
|
agents: { agent1, agent2 },
|
|
53
53
|
tools: { tool1, tool2 },
|
|
54
|
-
model: 'openai/gpt-
|
|
54
|
+
model: 'openai/gpt-6.1-sol',
|
|
55
55
|
instructions: 'You are a network agent that can help users with a variety of tasks.',
|
|
56
56
|
memory,
|
|
57
57
|
})
|
|
@@ -72,7 +72,7 @@ const agent = new NewAgentNetwork({
|
|
|
72
72
|
agents: { agent1, agent2 },
|
|
73
73
|
workflows: { workflow1 },
|
|
74
74
|
tools: { tool1, tool2 },
|
|
75
|
-
model: 'openai/gpt-
|
|
75
|
+
model: 'openai/gpt-6.1-sol',
|
|
76
76
|
instructions: 'You are a network agent that can help users with a variety of tasks.',
|
|
77
77
|
})
|
|
78
78
|
|
|
@@ -93,7 +93,7 @@ const agent = new Agent({
|
|
|
93
93
|
agents: { agent1, agent2 },
|
|
94
94
|
workflows: { workflow1 },
|
|
95
95
|
tools: { tool1, tool2 },
|
|
96
|
-
model: 'openai/gpt-
|
|
96
|
+
model: 'openai/gpt-6.1-sol',
|
|
97
97
|
instructions: 'You are a network agent that can help users with a variety of tasks.',
|
|
98
98
|
memory,
|
|
99
99
|
})
|
|
@@ -204,7 +204,7 @@ await server.startHTTP({
|
|
|
204
204
|
|
|
205
205
|
### Server `protocolVersion` option
|
|
206
206
|
|
|
207
|
-
Servers accepted `protocolVersion` (`'2025-11-25'`, `'2026-07-28'` or `'auto'`). Only `2026-07-28` is served now, exposed as the `MCP_PROTOCOL_VERSION` constant. Remove the option; a client that doesn't offer `2026-07-28` fails with an explicit negotiation error instead of a downgrade.
|
|
207
|
+
Servers accepted `protocolVersion` (`'2025-11-25'`, `'2026-07-28'` or `'auto'`). Only `2026-07-28` is served now, exposed as the `MCP_PROTOCOL_VERSION` constant. Remove the option; a client that doesn't offer `2026-07-28` fails with an explicit negotiation error instead of a downgrade. To keep serving clients that still open with `initialize` over HTTP, set `legacy: 'stateless'` on the server. Each of their requests is then answered without a session.
|
|
208
208
|
|
|
209
209
|
```diff
|
|
210
210
|
const server = new MCPServer({
|
|
@@ -550,7 +550,7 @@ To migrate, use storage APIs directly for testing instead of specialized evals t
|
|
|
550
550
|
+ // Use storage APIs directly for testing
|
|
551
551
|
```
|
|
552
552
|
|
|
553
|
-
###
|
|
553
|
+
### TABLE_EVALS from MSSQL storage
|
|
554
554
|
|
|
555
555
|
The `TABLE_EVALS` table has been removed from MSSQL storage implementations. This change reflects the removal of legacy evals functionality.
|
|
556
556
|
|
|
@@ -82,7 +82,13 @@ createTool({
|
|
|
82
82
|
});
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
The `suspendPayload`
|
|
85
|
+
The `suspendPayload` is validated against the `suspendSchema` when the tool is executed. What happens when the `suspendPayload` doesn't match the `suspendSchema` depends on how the tool runs:
|
|
86
|
+
|
|
87
|
+
- **Agent**: The validation error is returned as the tool output and a warning is logged, but suspension continues.
|
|
88
|
+
- **Direct `execute()` call**: The validation error is returned as the tool output without logging a warning.
|
|
89
|
+
- **Workflow step**: The step fails with a suspend data validation error, and the workflow run fails.
|
|
90
|
+
|
|
91
|
+
Also, when the tool is resumed, the `resumeData` gets validated against the `resumeSchema`. If the resumeData doesn't match the `resumeSchema`, the tool will return a `ValidationError`, preventing the tool resumption.
|
|
86
92
|
|
|
87
93
|
To skip the `suspendSchema` or `resumeSchema` validation, don't define `suspendSchema` or `resumeSchema` in the tool creation.
|
|
88
94
|
|
|
@@ -146,7 +146,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
146
146
|
|
|
147
147
|
- `structuredOutput` - Enhanced structured output with model override and custom options.
|
|
148
148
|
|
|
149
|
-
- `jsonPromptInjection` - Used to override the default behaviour of passing
|
|
149
|
+
- `jsonPromptInjection` - Used to override the default behaviour of passing response_format to the model. This will inject context into the prompt to coerce the model into returning structured outputs.
|
|
150
150
|
|
|
151
151
|
- `model` - If a model is added this will create a sub agent to structure the response from the main agent. The main agent will call tools and return text, and the sub agent will return an object that conforms to your schema provided. This is a replacement for `experimental_output`.
|
|
152
152
|
|
|
@@ -163,7 +163,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
163
163
|
name: z.string(),
|
|
164
164
|
age: z.number(),
|
|
165
165
|
}),
|
|
166
|
-
model: 'openai/gpt-
|
|
166
|
+
model: 'openai/gpt-6.1-sol', // Optional model override for structuring
|
|
167
167
|
errorStrategy: 'fallback',
|
|
168
168
|
fallbackValue: { name: 'unknown', age: 0 },
|
|
169
169
|
instructions: 'Extract user information', // Override default structuring instructions
|
|
@@ -301,7 +301,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
301
301
|
schema: z.object({
|
|
302
302
|
summary: z.string(),
|
|
303
303
|
}),
|
|
304
|
-
model: 'openai/gpt-
|
|
304
|
+
model: 'openai/gpt-6.1-sol',
|
|
305
305
|
},
|
|
306
306
|
})
|
|
307
307
|
```
|
|
@@ -39,14 +39,16 @@ Token metrics are emitted from `MODEL_GENERATION` and `CLASSIFIER_EVALUATION` sp
|
|
|
39
39
|
|
|
40
40
|
### Input token metrics
|
|
41
41
|
|
|
42
|
-
| Metric name
|
|
43
|
-
|
|
|
44
|
-
| `mastra_model_total_input_tokens`
|
|
45
|
-
| `mastra_model_input_text_tokens`
|
|
46
|
-
| `mastra_model_input_cache_read_tokens`
|
|
47
|
-
| `mastra_model_input_cache_write_tokens`
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
42
|
+
| Metric name | Description |
|
|
43
|
+
| ------------------------------------------ | ------------------------------------------------------------------- |
|
|
44
|
+
| `mastra_model_total_input_tokens` | Total input tokens |
|
|
45
|
+
| `mastra_model_input_text_tokens` | Text tokens in the input prompt |
|
|
46
|
+
| `mastra_model_input_cache_read_tokens` | Tokens read from prompt cache (e.g. Anthropic) |
|
|
47
|
+
| `mastra_model_input_cache_write_tokens` | Tokens written to prompt cache |
|
|
48
|
+
| `mastra_model_input_cache_write_5m_tokens` | Tokens written to prompt cache with a 5-minute TTL (e.g. Anthropic) |
|
|
49
|
+
| `mastra_model_input_cache_write_1h_tokens` | Tokens written to prompt cache with a 1-hour TTL (e.g. Anthropic) |
|
|
50
|
+
| `mastra_model_input_audio_tokens` | Audio tokens in the input (multimodal models) |
|
|
51
|
+
| `mastra_model_input_image_tokens` | Image tokens in the input (vision models) |
|
|
50
52
|
|
|
51
53
|
### Output token metrics
|
|
52
54
|
|
|
@@ -10,8 +10,9 @@ Advanced trace queries select completed traces with a structured time range and
|
|
|
10
10
|
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ------------------------------------------ |
|
|
11
11
|
| Query traces | List matching traces, paginate through them, and poll for new ones. | `queryTraces()` | `POST /api/observability/traces/query` |
|
|
12
12
|
| Aggregate traces | Count matching traces and compute measures, such as error rate, latency percentiles, tokens, and cost, optionally grouped by dimensions and time buckets. | `aggregateTraces()` | `POST /api/observability/traces/aggregate` |
|
|
13
|
+
| Aggregate spans | Compute the same measures over individual spans, such as every agent run including nested ones, grouped by span dimensions. | `aggregateSpans()` | `POST /api/observability/spans/aggregate` |
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
The trace APIs accept the same [trace selection](#select-traces). The filters, operators, and limits on this page apply to each. Use the aggregate API to find the group that needs attention, such as an agent with a high error rate, then send the same predicate plus the group's dimensions to the query API to list the traces behind it. Each query result represents a trace. Use its `traceId` to [retrieve the full trace](https://mastra.ai/reference/client-js/observability).
|
|
15
16
|
|
|
16
17
|
The endpoints use the same authentication as other observability routes and require the `observability:read` permission. Every request requires a time range.
|
|
17
18
|
|
|
@@ -25,6 +26,7 @@ The configured observability store must support each API. Call `getObservability
|
|
|
25
26
|
| -------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
26
27
|
| `traceQuery` | `trace-query` | `queryTraces()` |
|
|
27
28
|
| `traceAggregate` | `trace-aggregate` | `aggregateTraces()` |
|
|
29
|
+
| `spanAggregate` | `span-aggregate` | `aggregateSpans()` |
|
|
28
30
|
| `traceQueryRootDuration` | `trace-query-root-duration` | Trace-scope `durationMs` predicates |
|
|
29
31
|
| `traceQueryTimeToFirstChunk` | `trace-query-time-to-first-chunk` | `timeToFirstChunkMs` predicates and results |
|
|
30
32
|
| `traceQueryTimeToFirstChunkSort` | `trace-query-time-to-first-chunk-sort` | `orderBy` on `timeToFirstChunkMs` |
|
|
@@ -34,7 +36,7 @@ The configured observability store must support each API. Call `getObservability
|
|
|
34
36
|
| `traceQueryDiscovery` | `trace-query-discovery` | [Field and value discovery](#discover-fields-and-values) |
|
|
35
37
|
| `traceQueryTenantScope` | `trace-query-tenant-scope` | [Trusted tenant scope](#trusted-tenant-scope) |
|
|
36
38
|
|
|
37
|
-
A missing `traceAggregate` value means the server doesn't support aggregation. Servers without the aggregate route return `404`, and stores without the feature return `501 TRACE_AGGREGATE_UNSUPPORTED`. Against a store without a sub-feature, a request that uses a gated field returns `501` before storage runs. Root span `name`, `spanType`, and `entityId` are the exception and return `422` with a `field_not_allowed` issue.
|
|
39
|
+
A missing `traceAggregate` value means the server doesn't support aggregation. Servers without the aggregate route return `404`, and stores without the feature return `501 TRACE_AGGREGATE_UNSUPPORTED`. A missing `spanAggregate` value means the same for span aggregation, and stores without the feature return `501 SPAN_AGGREGATE_UNSUPPORTED`. Against a store without a sub-feature, a request that uses a gated field returns `501` before storage runs. Root span `name`, `spanType`, and `entityId` are the exception and return `422` with a `field_not_allowed` issue.
|
|
38
40
|
|
|
39
41
|
## Select traces
|
|
40
42
|
|
|
@@ -212,7 +214,7 @@ const selectedModel = {
|
|
|
212
214
|
{
|
|
213
215
|
op: 'eq',
|
|
214
216
|
left: { path: 'model' },
|
|
215
|
-
right: { literal: 'claude-sonnet-
|
|
217
|
+
right: { literal: 'claude-sonnet-5-5' },
|
|
216
218
|
},
|
|
217
219
|
{ op: 'eq', left: { path: 'provider' }, right: { literal: 'anthropic' } },
|
|
218
220
|
],
|
|
@@ -700,14 +702,14 @@ Token and cost measures read the model usage metrics recorded for each trace, so
|
|
|
700
702
|
|
|
701
703
|
A trace that recorded at least one usage metric is usage-bearing. `tokens.<kind>.sum` adds the tokens of a group's usage-bearing traces, and `tokens.<kind>.avg` divides that sum by the number of usage-bearing traces, not by `count`. Both are `null` when the group has no usage-bearing traces.
|
|
702
704
|
|
|
703
|
-
Cost comes from estimated cost recorded on total input and total output token metrics. `cost.sum` adds the cost of traces with at least one priced metric, and `cost.avg` divides by the number of those traces. A
|
|
705
|
+
Cost comes from estimated cost recorded on total input and total output token metrics. `cost.sum` adds the cost of traces with at least one priced metric, and `cost.avg` divides by the number of those traces. A partly priced call, where Mastra could price some token types but not others, adds the cost of the priced token types. A metric with any other pricing failure adds no cost.
|
|
704
706
|
|
|
705
707
|
When you request any `cost.*` measure, every row also includes a `cost` object:
|
|
706
708
|
|
|
707
|
-
| Field | Description
|
|
708
|
-
| ---------- |
|
|
709
|
-
| `coverage` | Fraction of usage-bearing traces whose usage was fully priced, from 0 to 1. `null` when the group has no usage-bearing traces. |
|
|
710
|
-
| `unit` | Cost unit of the priced metrics, such as `USD`. `'mixed'` when they use more than one unit, and `null` when none are priced.
|
|
709
|
+
| Field | Description |
|
|
710
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
711
|
+
| `coverage` | Fraction of usage-bearing traces whose usage was fully priced, from 0 to 1. A trace with a partly priced call isn't fully priced, so it lowers coverage even though its known cost is in `cost.sum`. `null` when the group has no usage-bearing traces. |
|
|
712
|
+
| `unit` | Cost unit of the priced metrics, such as `USD`. `'mixed'` when they use more than one unit, and `null` when none are priced. |
|
|
711
713
|
|
|
712
714
|
`cost.sum` and `cost.avg` are `null` when the group has no priced traces or `unit` is `'mixed'`. A coverage below 1 means the cost understates the group's spend. The `cost` object isn't a measure, so `having` and `orderBy` can't reference it.
|
|
713
715
|
|
|
@@ -803,11 +805,90 @@ PostgreSQL and ClickHouse stop aggregations after the same `traceQueryTimeoutMs`
|
|
|
803
805
|
| `501` | The installed Core or configured observability store doesn't support aggregation or a requested field. Returns `TRACE_AGGREGATE_UNSUPPORTED`. |
|
|
804
806
|
| `504` | A PostgreSQL or ClickHouse aggregation exceeded its execution timeout. Returns `TRACE_QUERY_EXECUTION_TIMEOUT` without partial results. |
|
|
805
807
|
|
|
808
|
+
## Aggregate spans
|
|
809
|
+
|
|
810
|
+
Use `aggregateSpans()` or `POST /api/observability/spans/aggregate` to compute measures over individual spans instead of traces. Trace aggregation only sees each trace's root span, so an agent run nested inside a workflow isn't counted. Span aggregation counts every span that matches, at any depth.
|
|
811
|
+
|
|
812
|
+
The request has the same shape as [`aggregateTraces()`](#aggregate-request-fields), with the same measures, `having`, `orderBy`, `interval`, limits, and errors. The differences are in which records are selected and which dimensions are available.
|
|
813
|
+
|
|
814
|
+
### Aggregate spans with the client SDK
|
|
815
|
+
|
|
816
|
+
This request counts agent runs by status per day, including nested runs:
|
|
817
|
+
|
|
818
|
+
```typescript
|
|
819
|
+
const { capabilities } = await mastraClient.getObservabilityCapabilities()
|
|
820
|
+
|
|
821
|
+
if (capabilities.spanAggregate) {
|
|
822
|
+
const { rows } = await mastraClient.aggregateSpans({
|
|
823
|
+
timeRange: {
|
|
824
|
+
from: '2026-08-01T00:00:00.000Z',
|
|
825
|
+
to: '2026-08-08T00:00:00.000Z',
|
|
826
|
+
},
|
|
827
|
+
where: { op: 'eq', left: { path: 'spanType' }, right: { literal: 'agent_run' } },
|
|
828
|
+
groupBy: ['status'],
|
|
829
|
+
interval: '1d',
|
|
830
|
+
measures: ['count', 'duration.p95'],
|
|
831
|
+
})
|
|
832
|
+
}
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
Send the same body to `POST /api/observability/spans/aggregate` to use HTTP directly.
|
|
836
|
+
|
|
837
|
+
### Span selection
|
|
838
|
+
|
|
839
|
+
Aggregation selects the spans that [`querySpans()`](https://mastra.ai/reference/client-js/observability) would return for the same `timeRange` and `where`:
|
|
840
|
+
|
|
841
|
+
- `timeRange` bounds each span's `startedAt`, and can span up to 365 days.
|
|
842
|
+
- `where` accepts the `querySpans()` fields and operators, such as `spanType`, `name`, `status`, `durationMs`, entity and parent/root entity fields, and context identifiers.
|
|
843
|
+
- Only completed spans count. When a span was exported more than once, only its latest copy counts.
|
|
844
|
+
|
|
845
|
+
`count` equals the number of spans `querySpans()` pages through for the same request. Buckets use each span's `startedAt`. `duration.*` measures read the span's own duration, and `errorCount` and `errorRate` read whether the span itself recorded an error.
|
|
846
|
+
|
|
847
|
+
On ClickHouse, a request whose `where` limits `spanType` to agent, workflow, processor, or scorer runs, RAG ingestion, or tool calls reads the smaller branch table instead of every span. That path can differ from `querySpans()`:
|
|
848
|
+
|
|
849
|
+
- Spans written before an upgrade from `@mastra/clickhouse` 1.4, 1.5, or 1.6 aren't in the branch table, so older windows can count fewer spans.
|
|
850
|
+
- After ClickHouse merges the copies of a span exported more than once, the branch table keeps the copy written last, not the one that ended last. Counts don't change, but the `status` and duration of a retried span can.
|
|
851
|
+
|
|
852
|
+
### Span dimensions
|
|
853
|
+
|
|
854
|
+
| Dimension | Notes |
|
|
855
|
+
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
856
|
+
| `name`, `spanType`, `status` | The span's own name, type, and status. `status` is `error` when the span recorded an error and `success` otherwise. |
|
|
857
|
+
| `entityType`, `entityId`, `entityName` | The entity that produced the span. |
|
|
858
|
+
| `parentEntityType`, `parentEntityName`, `rootEntityType`, `rootEntityName` | The calling entity and the trace's root entity, such as the agent that made a model call. |
|
|
859
|
+
| `environment`, `serviceName`, `executionSource` | Deployment attributes recorded on the span. |
|
|
860
|
+
| `threadId`, `resourceId`, `userId`, `sessionId`, `organizationId`, `experimentId` | Context identifiers recorded on the span. |
|
|
861
|
+
|
|
862
|
+
`countDistinct.<field>` accepts these dimensions and `traceId`, so `countDistinct.traceId` counts the traces the selected spans belong to. Span aggregation can't group by `metadata.<key>`, identity fields such as `traceId`, `spanId`, or `runId`, or by model and provider.
|
|
863
|
+
|
|
864
|
+
### Span tokens and cost
|
|
865
|
+
|
|
866
|
+
Token and cost measures use the usage metrics recorded by each span, matched by `traceId` and `spanId`. The [trace token rules](#token-and-cost-measures) apply per span: metrics from `timeRange.from` on count, retried exports count once, and averages divide by usage-bearing spans.
|
|
867
|
+
|
|
868
|
+
Usage isn't added up to parent spans. Model calls record usage on `model_generation` spans, so an `agent_run` span has no tokens of its own unless a model call under it wasn't exported. When a `model_generation` span isn't exported, its usage is recorded on the nearest exported ancestor instead. For token totals per agent, select `model_generation` spans and group by the calling agent:
|
|
869
|
+
|
|
870
|
+
```typescript
|
|
871
|
+
const tokensByAgent = await mastraClient.aggregateSpans({
|
|
872
|
+
timeRange: {
|
|
873
|
+
from: '2026-08-01T00:00:00.000Z',
|
|
874
|
+
to: '2026-08-08T00:00:00.000Z',
|
|
875
|
+
},
|
|
876
|
+
where: { op: 'eq', left: { path: 'spanType' }, right: { literal: 'model_generation' } },
|
|
877
|
+
groupBy: ['parentEntityName'],
|
|
878
|
+
measures: ['tokens.total.sum', 'cost.sum'],
|
|
879
|
+
orderBy: { field: 'cost.sum', direction: 'desc' },
|
|
880
|
+
})
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
### List the spans behind a group
|
|
884
|
+
|
|
885
|
+
Aggregation never returns span records. To inspect a group, send the same `timeRange` and `where` to `querySpans()`, and add the group's dimension values as `eq` conditions. For example, add `{ op: 'eq', left: { path: 'status' }, right: { literal: 'error' } }` to list the failed agent runs from the first example.
|
|
886
|
+
|
|
806
887
|
## Trusted tenant scope
|
|
807
888
|
|
|
808
|
-
Hosts that serve more than one tenant supply a trusted scope outside the query document. The server reads the reserved `organizationId` request-context key, which only server-side authentication can set, and passes `{ organizationId }` to the planner. The scope is carried on the trusted plan and ANDed into every scan: current roots, related spans, the usage metrics read by token and cost measures, and both discovery routes. A related record from another tenant that shares a `traceId` never qualifies a trace.
|
|
889
|
+
Hosts that serve more than one tenant supply a trusted scope outside the query document. The server reads the reserved `organizationId` request-context key, which only server-side authentication can set, and passes `{ organizationId }` to the planner. The scope is carried on the trusted plan and ANDed into every scan: current roots, related spans, the usage metrics read by token and cost measures, span aggregation, and both discovery routes. A related record from another tenant that shares a `traceId` never qualifies a trace.
|
|
809
890
|
|
|
810
|
-
Hosts that call storage directly can pass a fuller scope to `planTraceQuery()`, `planTraceAggregate()`, `planTraceQueryObservedFields()`, and `planTraceQueryValues()`:
|
|
891
|
+
Hosts that call storage directly can pass a fuller scope to `planTraceQuery()`, `planTraceAggregate()`, `planSpanAggregate()`, `planTraceQueryObservedFields()`, and `planTraceQueryValues()`:
|
|
811
892
|
|
|
812
893
|
```typescript
|
|
813
894
|
const plan = planTraceQuery(parseTraceQueryRequest(request), {
|
|
@@ -938,7 +1019,7 @@ Both routes require `observability:read` and use the configured observability st
|
|
|
938
1019
|
|
|
939
1020
|
## Limitations
|
|
940
1021
|
|
|
941
|
-
|
|
1022
|
+
The query and aggregate APIs consider completed traces and spans only, not running ones. Trace queries can't return custom projections, embedded evidence, or summaries, and numbered trace pages include a total count. Trace aggregation can't group by span fields other than the root span's `name`, `spanType`, and `entityId`, or by `traceId` or `attributes.*`. Aggregation can't compute numeric measures over metadata, paginate groups, or zero-fill empty buckets. Span aggregation can't group by `model` or `provider`, and it attributes tokens only to the span that recorded them. The CLI's `mastra api trace aggregate` covers trace aggregation, and `mastra api span query` and `mastra api span aggregate` cover span queries and span aggregation.
|
|
942
1023
|
|
|
943
1024
|
## Related
|
|
944
1025
|
|
|
@@ -56,7 +56,7 @@ If no `LoggerProvider` is registered globally, emission is a silent no-op.
|
|
|
56
56
|
async flush(): Promise<void>
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
Force flushes the tracer provider and logger provider if they support `forceFlush`. The global providers are resolved at flush time, so a `LoggerProvider` registered after the bridge was constructed is flushed too. Useful in serverless environments where you need to drain telemetry before the runtime terminates.
|
|
59
|
+
Force flushes the tracer provider and logger provider if they support `forceFlush`. The global providers are resolved at flush time, so a `LoggerProvider` registered after the bridge was constructed is flushed too. Useful in serverless environments where you need to drain telemetry before the runtime terminates. Call `sdk.shutdown()` as well before the process exits to wait for any batch your OTEL SDK has already started exporting. Neither this method nor the provider's own `forceFlush()` waits for that batch.
|
|
60
60
|
|
|
61
61
|
### `shutdown`
|
|
62
62
|
|
|
@@ -43,9 +43,9 @@ Extends `BaseExporterConfig`, which includes:
|
|
|
43
43
|
- `logger?: IMastraLogger` - Logger instance
|
|
44
44
|
- `logLevel?: LogLevel | 'debug' | 'info' | 'warn' | 'error'` - Log level (default: INFO)
|
|
45
45
|
|
|
46
|
-
**apiKey** (`string`): Confident AI API key. Falls back to the
|
|
46
|
+
**apiKey** (`string`): Confident AI API key. Falls back to the CONFIDENT_API_KEY env var. The exporter disables itself when no key is found.
|
|
47
47
|
|
|
48
|
-
**environment** (`string`): Trace environment. Falls back to
|
|
48
|
+
**environment** (`string`): Trace environment. Falls back to CONFIDENT_TRACE_ENVIRONMENT, then 'development'.
|
|
49
49
|
|
|
50
50
|
**name** (`string`): Trace name applied to every trace. Defaults to the Mastra serviceName.
|
|
51
51
|
|
|
@@ -46,7 +46,7 @@ Logs shutdown message.
|
|
|
46
46
|
|
|
47
47
|
The exporter outputs different formats based on event type:
|
|
48
48
|
|
|
49
|
-
###
|
|
49
|
+
### SPAN_STARTED
|
|
50
50
|
|
|
51
51
|
```text
|
|
52
52
|
🚀 SPAN_STARTED
|
|
@@ -59,7 +59,7 @@ The exporter outputs different formats based on event type:
|
|
|
59
59
|
────────────────────────────────────────
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
###
|
|
62
|
+
### SPAN_ENDED
|
|
63
63
|
|
|
64
64
|
```text
|
|
65
65
|
✅ SPAN_ENDED
|
|
@@ -75,7 +75,7 @@ The exporter outputs different formats based on event type:
|
|
|
75
75
|
────────────────────────────────────────
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
###
|
|
78
|
+
### SPAN_UPDATED
|
|
79
79
|
|
|
80
80
|
```text
|
|
81
81
|
📝 SPAN_UPDATED
|