@mastra/mcp-docs-server 1.3.15-alpha.1 → 1.3.15-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/docs/agents/guardrails.md +1 -1
- package/.docs/docs/agents/human-in-the-loop.md +2 -2
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/overview.md +2 -2
- package/.docs/docs/agents/processors.md +2 -2
- package/.docs/docs/agents/tools.md +3 -3
- package/.docs/docs/auth/composite-auth.md +1 -1
- package/.docs/docs/auth/custom-auth-provider.md +5 -5
- package/.docs/docs/auth/fga.md +1 -1
- package/.docs/docs/auth/jwt.md +2 -2
- package/.docs/docs/auth/simple-auth.md +1 -1
- package/.docs/docs/browser.md +1 -1
- package/.docs/docs/channels.md +2 -2
- package/.docs/docs/connections/sdk-agents.md +1 -1
- package/.docs/docs/deployment/overview.md +2 -2
- package/.docs/docs/deployment/web-framework.md +3 -3
- package/.docs/docs/develop.md +1 -1
- package/.docs/docs/evals/built-in-scorers.md +1 -1
- package/.docs/docs/evals/custom-scorers.md +8 -8
- package/.docs/docs/evals/overview.md +1 -1
- package/.docs/docs/evals/quick-checks.md +1 -1
- package/.docs/docs/guides/authentication-identity.md +1 -1
- package/.docs/docs/guides/context-engineering.md +1 -1
- package/.docs/docs/guides/multi-agent-systems.md +2 -2
- package/.docs/docs/harness/agent-controller.md +5 -3
- package/.docs/docs/harness/background-tasks.md +7 -1
- package/.docs/docs/harness/durable-agents.md +1 -1
- package/.docs/docs/index.md +2 -2
- package/.docs/docs/license.md +1 -1
- package/.docs/docs/mastra-platform/server.md +1 -1
- package/.docs/docs/mastra-platform/trace-intelligence.md +3 -3
- package/.docs/docs/mastra-platform/workspaces.md +1 -1
- package/.docs/docs/memory/memory-processors.md +2 -2
- package/.docs/docs/memory/message-history.md +1 -1
- package/.docs/docs/memory/multi-user-threads.md +1 -1
- package/.docs/docs/memory/observational-memory.md +3 -3
- package/.docs/docs/memory/semantic-recall.md +4 -4
- package/.docs/docs/memory/working-memory.md +16 -16
- package/.docs/docs/observability/integrations/exporters/mastra-storage.md +12 -12
- package/.docs/docs/observability/tracing/overview.md +4 -2
- package/.docs/docs/sandbox/filesystem.md +1 -1
- package/.docs/docs/server/custom-api-routes.md +1 -1
- package/.docs/docs/server/middleware.md +1 -1
- package/.docs/docs/server/request-context.md +1 -1
- package/.docs/docs/signals/overview.md +1 -1
- package/.docs/docs/signals/sending-signals.md +1 -1
- package/.docs/docs/studio/deployment.md +2 -2
- package/.docs/docs/studio/editor.md +2 -2
- package/.docs/docs/studio/observability.md +1 -1
- package/.docs/docs/workflows/control-flow.md +4 -4
- package/.docs/docs/workflows/overview.md +3 -3
- package/.docs/docs/workflows/snapshots.md +2 -2
- package/.docs/integrations/agentic-ui/ai-sdk-ui.md +3 -3
- package/.docs/integrations/agentic-ui/assistant-ui.md +5 -5
- package/.docs/integrations/agentic-ui/copilotkit.md +4 -4
- package/.docs/integrations/agentic-ui/openui.md +2 -2
- package/.docs/integrations/auth/auth0.md +3 -3
- package/.docs/integrations/auth/better-auth.md +1 -1
- package/.docs/integrations/auth/clerk.md +1 -1
- package/.docs/integrations/auth/firebase.md +3 -3
- package/.docs/integrations/auth/google.md +2 -2
- package/.docs/integrations/auth/okta.md +3 -3
- package/.docs/integrations/auth/supabase.md +1 -1
- package/.docs/integrations/auth/workos.md +1 -1
- package/.docs/integrations/browsers/stagehand.md +1 -1
- package/.docs/integrations/channels/imessage.md +1 -1
- package/.docs/integrations/channels/ring.md +6 -6
- package/.docs/integrations/channels/slack.md +1 -1
- package/.docs/integrations/channels/whatsapp.md +1 -1
- package/.docs/integrations/databases/aurora-dsql.md +13 -13
- package/.docs/integrations/databases/clickhouse.md +2 -2
- package/.docs/integrations/databases/cloudflare-d1.md +4 -4
- package/.docs/integrations/databases/cloudflare-kv.md +10 -10
- package/.docs/integrations/databases/convex.md +6 -6
- package/.docs/integrations/databases/dynamodb.md +8 -8
- package/.docs/integrations/databases/elasticsearch.md +6 -6
- package/.docs/integrations/databases/lancedb.md +4 -4
- package/.docs/integrations/databases/mongodb.md +2 -2
- package/.docs/integrations/databases/mssql.md +2 -2
- package/.docs/integrations/databases/oracledb.md +2 -2
- package/.docs/integrations/databases/postgresql.md +14 -14
- package/.docs/integrations/databases/redis.md +7 -7
- package/.docs/integrations/databases/spanner.md +2 -2
- package/.docs/integrations/databases/upstash.md +5 -5
- package/.docs/integrations/databases/valkey.md +1 -1
- package/.docs/integrations/deploy/amazon-ec2.md +1 -1
- package/.docs/integrations/deploy/aws-bedrock-agentcore.md +1 -1
- package/.docs/integrations/deploy/aws-lambda.md +12 -12
- package/.docs/integrations/deploy/azure-app-services.md +2 -2
- package/.docs/integrations/deploy/cloudflare.md +2 -2
- package/.docs/integrations/deploy/digital-ocean.md +2 -2
- package/.docs/integrations/deploy/inngest.md +5 -5
- package/.docs/integrations/deploy/kubernetes-helm.md +20 -20
- package/.docs/integrations/deploy/neon.md +1 -1
- package/.docs/integrations/deploy/netlify.md +1 -1
- package/.docs/integrations/deploy/render.md +1 -1
- package/.docs/integrations/deploy/temporal.md +1 -1
- package/.docs/integrations/deploy/vercel.md +4 -4
- package/.docs/integrations/file-storage/google-cloud-storage.md +1 -1
- package/.docs/integrations/frameworks/angular.md +1 -1
- package/.docs/integrations/frameworks/astro.md +3 -3
- package/.docs/integrations/frameworks/electron.md +1 -1
- package/.docs/integrations/frameworks/express.md +1 -1
- package/.docs/integrations/frameworks/hono.md +1 -1
- package/.docs/integrations/frameworks/nestjs.md +2 -2
- package/.docs/integrations/frameworks/next-js.md +3 -3
- package/.docs/integrations/frameworks/nuxt.md +1 -1
- package/.docs/integrations/frameworks/sveltekit.md +1 -1
- package/.docs/integrations/frameworks/tanstack-start.md +3 -3
- package/.docs/integrations/frameworks/vite-react.md +3 -3
- package/.docs/integrations/observability/arize.md +9 -9
- package/.docs/integrations/observability/arthur.md +3 -3
- package/.docs/integrations/observability/braintrust.md +3 -3
- package/.docs/integrations/observability/confident-ai.md +5 -5
- package/.docs/integrations/observability/datadog.md +9 -9
- package/.docs/integrations/observability/laminar.md +2 -2
- package/.docs/integrations/observability/langfuse.md +13 -13
- package/.docs/integrations/observability/langsmith.md +9 -9
- package/.docs/integrations/observability/opentelemetry.md +23 -23
- package/.docs/integrations/observability/sentry.md +4 -4
- package/.docs/integrations/sandboxes/agentcore.md +1 -1
- package/.docs/integrations/sandboxes/apple-container.md +2 -2
- package/.docs/integrations/sandboxes/cloudflare-sandbox.md +6 -6
- package/.docs/integrations/sandboxes/daytona.md +5 -5
- package/.docs/integrations/sandboxes/docker.md +6 -6
- package/.docs/integrations/sandboxes/e2b-desktop.md +1 -1
- package/.docs/integrations/sandboxes/e2b.md +14 -14
- package/.docs/integrations/sandboxes/modal.md +1 -1
- package/.docs/integrations/sandboxes/railway.md +1 -1
- package/.docs/integrations/sandboxes/sprites.md +2 -2
- package/.docs/integrations/sandboxes/vercel.md +4 -4
- package/.docs/integrations/vectors/couchbase.md +1 -1
- package/.docs/integrations/vectors/duckdb.md +5 -5
- package/.docs/integrations/vectors/lance.md +3 -3
- package/.docs/integrations/vectors/mongodb.md +5 -5
- package/.docs/integrations/vectors/pg.md +11 -11
- package/.docs/integrations/vectors/qdrant.md +2 -2
- package/.docs/integrations/vectors/upstash.md +4 -4
- package/.docs/integrations/voice/azure.md +1 -1
- package/.docs/integrations/voice/cloudflare.md +1 -1
- package/.docs/integrations/voice/google.md +12 -12
- package/.docs/integrations/voice/inworld.md +2 -2
- package/.docs/integrations/voice/livekit.md +25 -25
- package/.docs/integrations/voice/openai.md +4 -4
- package/.docs/integrations/voice/sarvam.md +1 -1
- package/.docs/integrations/voice/speechify.md +1 -1
- package/.docs/integrations/voice/xai.md +1 -1
- package/.docs/models/environment-variables.md +92 -3
- package/.docs/models/gateways/merge-gateway.md +4 -1
- package/.docs/models/gateways/neon.md +1 -2
- package/.docs/models/gateways/netlify.md +7 -6
- package/.docs/models/gateways/openrouter.md +16 -11
- package/.docs/models/gateways/requesty.md +7 -17
- package/.docs/models/gateways/vercel.md +12 -16
- package/.docs/models/index.md +93 -30
- package/.docs/models/providers/302ai.md +2 -1
- package/.docs/models/providers/abacus.md +1 -1
- package/.docs/models/providers/abliteratedllm.md +95 -0
- package/.docs/models/providers/abliteration-ai.md +7 -6
- package/.docs/models/providers/adaption.md +87 -0
- package/.docs/models/providers/adzuki.md +92 -0
- package/.docs/models/providers/aigrow.md +89 -0
- package/.docs/models/providers/aimlapi.md +1 -7
- package/.docs/models/providers/aipg.md +82 -0
- package/.docs/models/providers/aistupidlevel.md +90 -0
- package/.docs/models/providers/aki-io.md +15 -13
- package/.docs/models/providers/ambient.md +13 -12
- package/.docs/models/providers/anonrouter.md +83 -0
- package/.docs/models/providers/anthropic.md +18 -20
- package/.docs/models/providers/apiko.md +83 -0
- package/.docs/models/providers/augure.md +86 -0
- package/.docs/models/providers/autarcho.md +81 -0
- package/.docs/models/providers/bailing.md +15 -12
- package/.docs/models/providers/bumo.md +100 -0
- package/.docs/models/providers/byteplus.md +94 -0
- package/.docs/models/providers/cedarllm.md +81 -0
- package/.docs/models/providers/cheapaimodel.md +85 -0
- package/.docs/models/providers/cheapest-token.md +99 -0
- package/.docs/models/providers/cheapllm.md +81 -0
- package/.docs/models/providers/chutes.md +8 -8
- package/.docs/models/providers/cline-pass.md +4 -3
- package/.docs/models/providers/cloudcode.md +86 -0
- package/.docs/models/providers/cloudflare-workers-ai.md +2 -1
- package/.docs/models/providers/commandcode.md +22 -1
- package/.docs/models/providers/confidential-ai.md +81 -0
- package/.docs/models/providers/cortecs.md +14 -14
- package/.docs/models/providers/crossmodel.md +7 -2
- package/.docs/models/providers/deepinfra.md +3 -1
- package/.docs/models/providers/digitalocean.md +5 -4
- package/.docs/models/providers/dothoosh.md +96 -0
- package/.docs/models/providers/doubleword.md +98 -0
- package/.docs/models/providers/edenai.md +52 -44
- package/.docs/models/providers/empiriolabs.md +2 -1
- package/.docs/models/providers/engy.md +2 -1
- package/.docs/models/providers/entrim.md +84 -0
- package/.docs/models/providers/ezkielyna.md +85 -0
- package/.docs/models/providers/fastrouter.md +21 -5
- package/.docs/models/providers/fiftyx.md +81 -0
- package/.docs/models/providers/fireworks-ai.md +1 -1
- package/.docs/models/providers/fortytwo.md +81 -0
- package/.docs/models/providers/frequency.md +81 -0
- package/.docs/models/providers/frogbot.md +30 -5
- package/.docs/models/providers/gisoo.md +96 -0
- package/.docs/models/providers/google.md +5 -4
- package/.docs/models/providers/graphn.md +87 -0
- package/.docs/models/providers/hetzner.md +1 -1
- package/.docs/models/providers/hostinger-router.md +88 -0
- package/.docs/models/providers/huawei-maas.md +88 -0
- package/.docs/models/providers/hubris.md +96 -0
- package/.docs/models/providers/huggingface.md +5 -1
- package/.docs/models/providers/humain.md +82 -0
- package/.docs/models/providers/hyper.md +24 -22
- package/.docs/models/providers/inceptron.md +4 -4
- package/.docs/models/providers/infer.md +17 -9
- package/.docs/models/providers/inferall.md +86 -0
- package/.docs/models/providers/inference-coop.md +88 -0
- package/.docs/models/providers/inferenceapis.md +91 -0
- package/.docs/models/providers/inferris.md +84 -0
- package/.docs/models/providers/infersia.md +86 -0
- package/.docs/models/providers/isoquant.md +82 -0
- package/.docs/models/providers/iteracompute.md +33 -16
- package/.docs/models/providers/jad-ai.md +83 -0
- package/.docs/models/providers/joingonka.md +83 -0
- package/.docs/models/providers/jzstoken.md +102 -0
- package/.docs/models/providers/keln.md +94 -0
- package/.docs/models/providers/kenari.md +47 -12
- package/.docs/models/providers/kilo.md +191 -100
- package/.docs/models/providers/kitani.md +89 -0
- package/.docs/models/providers/klavo.md +90 -0
- package/.docs/models/providers/korouter.md +99 -0
- package/.docs/models/providers/kunavo.md +96 -0
- package/.docs/models/providers/liquid.md +15 -8
- package/.docs/models/providers/lithosai.md +83 -0
- package/.docs/models/providers/llmgateway-providers.md +96 -43
- package/.docs/models/providers/llmgateway.md +33 -21
- package/.docs/models/providers/logits.md +82 -0
- package/.docs/models/providers/lowrouter.md +17 -4
- package/.docs/models/providers/lyceum.md +88 -0
- package/.docs/models/providers/mallard.md +81 -0
- package/.docs/models/providers/meragpt.md +81 -0
- package/.docs/models/providers/mistral.md +1 -1
- package/.docs/models/providers/moneo.md +92 -0
- package/.docs/models/providers/nan.md +11 -8
- package/.docs/models/providers/nano-gpt.md +77 -73
- package/.docs/models/providers/nearai.md +1 -1
- package/.docs/models/providers/nebius.md +3 -6
- package/.docs/models/providers/neuralwatt.md +28 -25
- package/.docs/models/providers/nodecode.md +81 -0
- package/.docs/models/providers/nokeep.md +83 -0
- package/.docs/models/providers/novita-ai.md +4 -1
- package/.docs/models/providers/oathbreaker.md +82 -0
- package/.docs/models/providers/obscurify.md +95 -0
- package/.docs/models/providers/ofox.md +7 -3
- package/.docs/models/providers/ollama-cloud.md +2 -1
- package/.docs/models/providers/openai.md +4 -2
- package/.docs/models/providers/opencode-go.md +3 -1
- package/.docs/models/providers/opencode.md +5 -3
- package/.docs/models/providers/opper.md +2 -1
- package/.docs/models/providers/outerlabs.md +98 -0
- package/.docs/models/providers/paraloncloud.md +81 -0
- package/.docs/models/providers/pareto.md +9 -7
- package/.docs/models/providers/phala.md +99 -0
- package/.docs/models/providers/phase.md +82 -0
- package/.docs/models/providers/powerspring.md +87 -0
- package/.docs/models/providers/prime.md +5 -5
- package/.docs/models/providers/proxystacks.md +84 -0
- package/.docs/models/providers/rayline.md +82 -0
- package/.docs/models/providers/refuseless.md +86 -0
- package/.docs/models/providers/ruapi.md +89 -0
- package/.docs/models/providers/runcrate.md +91 -0
- package/.docs/models/providers/runinfra.md +2 -1
- package/.docs/models/providers/sagg.md +81 -0
- package/.docs/models/providers/sambanova.md +10 -12
- package/.docs/models/providers/sandbase.md +90 -0
- package/.docs/models/providers/scx-ai.md +20 -10
- package/.docs/models/providers/sensenova.md +4 -4
- package/.docs/models/providers/siliconflow-cn.md +2 -1
- package/.docs/models/providers/sokkan.md +85 -0
- package/.docs/models/providers/sparrowcodes.md +99 -0
- package/.docs/models/providers/steadyrouter.md +101 -0
- package/.docs/models/providers/stepping-stone.md +95 -0
- package/.docs/models/providers/superbot-gg.md +82 -0
- package/.docs/models/providers/synthetic.md +14 -14
- package/.docs/models/providers/synthorai.md +92 -0
- package/.docs/models/providers/teamorouter.md +90 -0
- package/.docs/models/providers/teapot-router.md +87 -0
- package/.docs/models/providers/tencent-token-plan.md +23 -11
- package/.docs/models/providers/tenstorrent.md +84 -0
- package/.docs/models/providers/therouter.md +81 -0
- package/.docs/models/providers/tinfoil.md +1 -1
- package/.docs/models/providers/toapis.md +83 -0
- package/.docs/models/providers/tokenify.md +85 -0
- package/.docs/models/providers/tokenlab.md +81 -0
- package/.docs/models/providers/tokenwatt.md +81 -0
- package/.docs/models/providers/trustedtokens.md +90 -0
- package/.docs/models/providers/umans-ai-coding-plan.md +2 -5
- package/.docs/models/providers/umans-ai.md +5 -7
- package/.docs/models/providers/unbiased.md +81 -0
- package/.docs/models/providers/uncensuredai.md +83 -0
- package/.docs/models/providers/unrestricted.md +84 -0
- package/.docs/models/providers/uplinkswitch.md +92 -0
- package/.docs/models/providers/verda.md +81 -0
- package/.docs/models/providers/volcengine-coding-plan.md +16 -9
- package/.docs/models/providers/volcengine.md +2 -2
- package/.docs/models/providers/wafer.ai.md +20 -10
- package/.docs/models/providers/wallaby.md +7 -5
- package/.docs/models/providers/wally.md +9 -8
- package/.docs/models/providers/watt.md +98 -0
- package/.docs/models/providers/xxapi.md +96 -0
- package/.docs/models/providers/zenifra.md +22 -10
- package/.docs/models/providers/zerogpu.md +89 -0
- package/.docs/models/providers/zro.md +85 -0
- package/.docs/models/providers.md +92 -3
- package/.docs/reference/agents/agent.md +1 -1
- package/.docs/reference/agents/durable-agent.md +2 -2
- package/.docs/reference/agents/generateLegacy.md +4 -4
- package/.docs/reference/agents/network.md +2 -2
- package/.docs/reference/ai-sdk/overview.md +2 -2
- package/.docs/reference/build-with-ai.md +3 -3
- package/.docs/reference/channels/slack-provider.md +1 -1
- package/.docs/reference/classifier/classifier.md +1 -1
- package/.docs/reference/cli/mastra.md +2 -2
- package/.docs/reference/client-js/agent-controller.md +1 -1
- package/.docs/reference/client-js/memory.md +10 -10
- package/.docs/reference/client-js/observability.md +1 -1
- package/.docs/reference/client-js/responses.md +1 -1
- package/.docs/reference/client-js/tools.md +2 -2
- package/.docs/reference/client-js/vectors.md +6 -6
- package/.docs/reference/configuration.md +1 -1
- package/.docs/reference/connect/tools.md +1 -1
- package/.docs/reference/deployer.md +4 -4
- package/.docs/reference/evals/answer-relevancy.md +2 -2
- package/.docs/reference/evals/bias.md +2 -2
- package/.docs/reference/evals/checks.md +1 -1
- package/.docs/reference/evals/completeness.md +4 -4
- package/.docs/reference/evals/content-similarity.md +4 -4
- package/.docs/reference/evals/context-precision.md +6 -6
- package/.docs/reference/evals/context-recall.md +1 -1
- package/.docs/reference/evals/context-relevance.md +9 -9
- package/.docs/reference/evals/create-scorer.md +3 -3
- package/.docs/reference/evals/faithfulness.md +1 -1
- package/.docs/reference/evals/hallucination.md +6 -6
- package/.docs/reference/evals/keyword-coverage.md +2 -2
- package/.docs/reference/evals/multi-turn-judge.md +1 -1
- package/.docs/reference/evals/noise-sensitivity.md +16 -16
- package/.docs/reference/evals/prompt-alignment.md +25 -25
- package/.docs/reference/evals/run-evals.md +2 -2
- package/.docs/reference/evals/summarization.md +1 -1
- package/.docs/reference/evals/textual-difference.md +2 -2
- package/.docs/reference/evals/tone-consistency.md +2 -2
- package/.docs/reference/evals/tool-call-accuracy.md +10 -10
- package/.docs/reference/evals/toxicity.md +2 -2
- package/.docs/reference/evals/trajectory-accuracy.md +2 -2
- package/.docs/reference/manual-install.md +2 -2
- package/.docs/reference/memory/listThreads.md +1 -1
- package/.docs/reference/migrations/agentnetwork.md +1 -1
- package/.docs/reference/migrations/mastra-cloud.md +4 -4
- package/.docs/reference/migrations/mcp-v2.md +1 -1
- package/.docs/reference/migrations/upgrade-to-v1/deployment.md +1 -1
- package/.docs/reference/migrations/upgrade-to-v1/overview.md +8 -8
- package/.docs/reference/migrations/upgrade-to-v1/tracing.md +3 -3
- package/.docs/reference/observability/tracing/bridges/datadog.md +4 -4
- package/.docs/reference/observability/tracing/bridges/otel.md +4 -4
- package/.docs/reference/observability/tracing/exporters/arize.md +4 -4
- package/.docs/reference/observability/tracing/exporters/arthur.md +3 -3
- package/.docs/reference/observability/tracing/exporters/braintrust.md +2 -2
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +2 -2
- package/.docs/reference/observability/tracing/exporters/confident-ai.md +2 -2
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/datadog.md +3 -3
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +5 -5
- package/.docs/reference/observability/tracing/exporters/laminar.md +2 -2
- package/.docs/reference/observability/tracing/exporters/langfuse.md +3 -3
- package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/mastra-storage-exporter.md +5 -5
- package/.docs/reference/observability/tracing/exporters/otel.md +4 -4
- package/.docs/reference/observability/tracing/exporters/posthog.md +2 -2
- package/.docs/reference/observability/tracing/exporters/sentry.md +4 -4
- package/.docs/reference/observability/tracing/instances.md +1 -1
- package/.docs/reference/processors/model-selection-processor.md +2 -2
- package/.docs/reference/processors/processor-interface.md +3 -3
- package/.docs/reference/processors/stream-error-retry-processor.md +1 -1
- package/.docs/reference/processors/system-prompt-scrubber.md +1 -1
- package/.docs/reference/processors/token-limiter-processor.md +1 -1
- package/.docs/reference/processors/unicode-normalizer.md +1 -1
- package/.docs/reference/project-structure.md +2 -2
- package/.docs/reference/pubsub/google-cloud-pubsub.md +1 -1
- package/.docs/reference/pubsub/lease-provider.md +1 -1
- package/.docs/reference/pubsub/redis-streams.md +1 -1
- package/.docs/reference/pubsub/unix-socket-pubsub.md +1 -1
- package/.docs/reference/rag/chunk.md +1 -1
- package/.docs/reference/rag/chunking-and-embedding.md +4 -4
- package/.docs/reference/rag/database-config.md +4 -4
- package/.docs/reference/rag/graph-rag-guide.md +3 -3
- package/.docs/reference/rag/metadata-filters.md +4 -4
- package/.docs/reference/rag/overview.md +4 -0
- package/.docs/reference/rag/rerank.md +1 -1
- package/.docs/reference/rag/rerankWithScorer.md +1 -1
- package/.docs/reference/rag/retrieval.md +8 -6
- package/.docs/reference/rag/vector-databases.md +7 -7
- package/.docs/reference/server/nestjs-adapter.md +1 -1
- package/.docs/reference/server/register-api-route.md +5 -5
- package/.docs/reference/storage/composite.md +1 -1
- package/.docs/reference/storage/overview.md +1 -1
- package/.docs/reference/storage/retention.md +2 -2
- package/.docs/reference/storage/turso.md +1 -1
- package/.docs/reference/streaming/agents/MastraModelOutput.md +5 -5
- package/.docs/reference/streaming/agents/stream.md +5 -5
- package/.docs/reference/streaming/agents/streamLegacy.md +4 -4
- package/.docs/reference/templates/overview.md +1 -1
- package/.docs/reference/tools/bedrock-kb-tool.md +8 -8
- package/.docs/reference/tools/mcp-client.md +9 -9
- package/.docs/reference/tools/mcp-server.md +17 -17
- package/.docs/reference/tools/vector-query-tool.md +6 -6
- package/.docs/reference/voice/composite-voice.md +3 -3
- package/.docs/reference/voice/overview.md +5 -5
- package/.docs/reference/voice/speech-to-speech.md +2 -2
- package/.docs/reference/voice/voice.close.md +1 -1
- package/.docs/reference/voice/voice.connect.md +1 -1
- package/.docs/reference/voice/voice.listen.md +1 -1
- package/.docs/reference/voice/voice.speak.md +1 -1
- package/.docs/reference/workspace/local-sandbox.md +1 -1
- package/package.json +2 -2
|
@@ -176,7 +176,7 @@ When using the HTML strategy, all general options are ignored. Use `headers` for
|
|
|
176
176
|
|
|
177
177
|
When using the `headers` option, the markdown strategy ignores all general options and content is split based on the markdown header structure. To use size-based chunking with markdown, omit the `headers` parameter.
|
|
178
178
|
|
|
179
|
-
### Semantic
|
|
179
|
+
### Semantic markdown
|
|
180
180
|
|
|
181
181
|
**joinThreshold** (`number`): Maximum token count for merging related sections. Sections exceeding this limit individually are left intact, but smaller sections are merged with siblings or parents if the combined size stays under this threshold. (Default: `500`)
|
|
182
182
|
|
|
@@ -20,7 +20,7 @@ const docFromJSON = MDocument.fromJSON(`{ "key": "value" }`)
|
|
|
20
20
|
Use `chunk` to split documents into manageable pieces. Mastra supports multiple chunking strategies optimized for different document types:
|
|
21
21
|
|
|
22
22
|
- `recursive`: Smart splitting based on content structure
|
|
23
|
-
- `character`:
|
|
23
|
+
- `character`: Character-based splits
|
|
24
24
|
- `token`: Token-aware splitting
|
|
25
25
|
- `markdown`: Markdown-aware splitting
|
|
26
26
|
- `semantic-markdown`: Markdown splitting based on related header families
|
|
@@ -69,13 +69,13 @@ const chunks = await doc.chunk({
|
|
|
69
69
|
|
|
70
70
|
> **Note:** Metadata extraction may use LLM calls, so ensure your API key is set.
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
The [`chunk()` reference documentation](https://mastra.ai/reference/rag/chunk) covers chunking strategies in depth.
|
|
73
73
|
|
|
74
74
|
## Embedding generation
|
|
75
75
|
|
|
76
76
|
Transform chunks into embeddings using your preferred provider. Mastra supports embedding models through the model router.
|
|
77
77
|
|
|
78
|
-
### Using the
|
|
78
|
+
### Using the model router
|
|
79
79
|
|
|
80
80
|
The simplest way is to use Mastra's model router with `provider/model` strings:
|
|
81
81
|
|
|
@@ -95,7 +95,7 @@ The model router automatically handles API key detection from environment variab
|
|
|
95
95
|
|
|
96
96
|
The embedding functions return vectors, arrays of numbers representing the semantic meaning of your text, ready for similarity searches in your vector database.
|
|
97
97
|
|
|
98
|
-
### Configuring
|
|
98
|
+
### Configuring embedding dimensions
|
|
99
99
|
|
|
100
100
|
Embedding models typically output vectors with a fixed number of dimensions (e.g., 1536 for OpenAI's `text-embedding-3-small`). Some models support reducing this dimensionality, which can help:
|
|
101
101
|
|
|
@@ -120,7 +120,7 @@ Configuration options specific to Turbopuffer vector store.
|
|
|
120
120
|
|
|
121
121
|
**Basic Usage**:
|
|
122
122
|
|
|
123
|
-
### Basic
|
|
123
|
+
### Basic database configuration
|
|
124
124
|
|
|
125
125
|
```typescript
|
|
126
126
|
import { createVectorQueryTool } from '@mastra/rag'
|
|
@@ -139,7 +139,7 @@ const vectorTool = createVectorQueryTool({
|
|
|
139
139
|
|
|
140
140
|
**Runtime Override**:
|
|
141
141
|
|
|
142
|
-
### Runtime
|
|
142
|
+
### Runtime configuration override
|
|
143
143
|
|
|
144
144
|
```typescript
|
|
145
145
|
import { RequestContext } from '@mastra/core/request-context'
|
|
@@ -169,7 +169,7 @@ await vectorTool.execute({ queryText: 'search query' }, { mastra, requestContext
|
|
|
169
169
|
|
|
170
170
|
**Multi-Database**:
|
|
171
171
|
|
|
172
|
-
### Multi-
|
|
172
|
+
### Multi-database configuration
|
|
173
173
|
|
|
174
174
|
```typescript
|
|
175
175
|
import { RequestContext } from '@mastra/core/request-context'
|
|
@@ -200,7 +200,7 @@ await vectorTool.execute({ queryText: 'search query' }, { mastra, requestContext
|
|
|
200
200
|
|
|
201
201
|
**Performance Tuning**:
|
|
202
202
|
|
|
203
|
-
### Performance
|
|
203
|
+
### Performance tuning
|
|
204
204
|
|
|
205
205
|
```typescript
|
|
206
206
|
// High accuracy configuration
|
|
@@ -14,9 +14,9 @@ GraphRAG is particularly effective when:
|
|
|
14
14
|
- Documents reference each other
|
|
15
15
|
- You need to traverse relationships to find complete answers
|
|
16
16
|
- Understanding connections between concepts is important
|
|
17
|
-
-
|
|
17
|
+
- Vector similarity alone misses important contextual relationships
|
|
18
18
|
|
|
19
|
-
For
|
|
19
|
+
For semantic search without relationship traversal, use [standard retrieval methods](https://mastra.ai/reference/rag/retrieval).
|
|
20
20
|
|
|
21
21
|
## How GraphRAG works
|
|
22
22
|
|
|
@@ -148,7 +148,7 @@ The agent uses the graph query tool to:
|
|
|
148
148
|
|
|
149
149
|
The threshold parameter substantially impacts retrieval quality:
|
|
150
150
|
|
|
151
|
-
- **High threshold (0.8-0.9)**: Strict connections and fewer relationships, plus more precise but
|
|
151
|
+
- **High threshold (0.8-0.9)**: Strict connections and fewer relationships, plus more precise but incomplete results
|
|
152
152
|
- **Medium threshold (0.6-0.8)**: Balanced approach, good for most use cases
|
|
153
153
|
- **Low threshold (0.4-0.6)**: More connections and broader context, plus risk of including less relevant information
|
|
154
154
|
|
|
@@ -62,13 +62,13 @@ const results = await store.query({
|
|
|
62
62
|
|
|
63
63
|
- Valid JSON types (string, number, boolean, object, array)
|
|
64
64
|
- Not undefined
|
|
65
|
-
-
|
|
65
|
+
- Typed for the operator (e.g., numbers for numeric comparisons)
|
|
66
66
|
|
|
67
67
|
3. Logical operators:
|
|
68
68
|
|
|
69
69
|
- Must contain valid conditions
|
|
70
70
|
- Can't be empty
|
|
71
|
-
- Must be
|
|
71
|
+
- Must be nested correctly
|
|
72
72
|
- Can only be used at top level or nested within other logical operators
|
|
73
73
|
- Can't be used at field level or nested inside a field
|
|
74
74
|
- Can't be used inside an operator
|
|
@@ -116,7 +116,7 @@ const results = await store.query({
|
|
|
116
116
|
- Field names can't contain dots (.) or start with $
|
|
117
117
|
- Field names limited to 512 characters
|
|
118
118
|
- Vectors must be re-upserted after creating new metadata indexes to be included in filtered results
|
|
119
|
-
- Range queries may have reduced accuracy with
|
|
119
|
+
- Range queries may have reduced accuracy with large datasets (\~10M+ vectors)
|
|
120
120
|
|
|
121
121
|
### libSQL
|
|
122
122
|
|
|
@@ -209,7 +209,7 @@ await store.createIndex({
|
|
|
209
209
|
|
|
210
210
|
- Currently doesn't have support for metadata filters. Filtering must be done client-side after retrieving results or by using the Couchbase SDK's Search capabilities directly for more complex queries.
|
|
211
211
|
|
|
212
|
-
### Amazon S3
|
|
212
|
+
### Amazon S3 vectors
|
|
213
213
|
|
|
214
214
|
- Equality values must be primitives (string/number/boolean). `null`/`undefined`, arrays, objects, and Date aren't allowed for equality. Range operators accept numbers or Date (Dates are normalized to epoch ms).
|
|
215
215
|
- `$in`/`$nin` require **non-empty arrays of primitives**. Date elements are allowed and normalized to epoch ms. **Array equality** isn't supported.
|
|
@@ -13,6 +13,10 @@ Mastra's RAG system provides:
|
|
|
13
13
|
- Chunking and embedding strategies for optimal retrieval
|
|
14
14
|
- Observability for tracking embedding and retrieval performance
|
|
15
15
|
|
|
16
|
+
> **Note:** For agents that answer from your docs, policies or other content, use [Knowledge](https://mastra.ai/docs/knowledge/overview). You [load your content](https://mastra.ai/docs/knowledge/load-your-content) into it, agents [search it](https://mastra.ai/docs/knowledge/search) by keyword and, with a vector store and embedder, by meaning, and [scopes](https://mastra.ai/docs/knowledge/scopes-and-access) decide which customer's or team's content each run can read. Knowledge was added in `@mastra/core@1.82.0` and is in alpha, so its API may change between releases.
|
|
17
|
+
>
|
|
18
|
+
> Use the RAG APIs when you need direct control over chunking, embedding, vector stores and retrieval.
|
|
19
|
+
|
|
16
20
|
## Example
|
|
17
21
|
|
|
18
22
|
To implement RAG, you process your documents into chunks, create embeddings, store them in a vector database, and then retrieve relevant context at query time.
|
|
@@ -57,7 +57,7 @@ const rerankedResults = await rerank(vectorSearchResults, 'How do I deploy to pr
|
|
|
57
57
|
|
|
58
58
|
The rerank function accepts any LanguageModel from the Vercel AI SDK. When using the Cohere model `rerank-v3.5`, it will automatically use Cohere's reranking capabilities.
|
|
59
59
|
|
|
60
|
-
> **Note:** For semantic scoring to work
|
|
60
|
+
> **Note:** For semantic scoring to work during re-ranking, each result must include the text content in its `metadata.text` field.
|
|
61
61
|
|
|
62
62
|
## Returns
|
|
63
63
|
|
|
@@ -61,7 +61,7 @@ const rerankedResults = await rerank({
|
|
|
61
61
|
|
|
62
62
|
The `rerankWithScorer` function accepts any `RelevanceScoreProvider` from @mastra/rag.
|
|
63
63
|
|
|
64
|
-
> **Note:** For semantic scoring to work
|
|
64
|
+
> **Note:** For semantic scoring to work during re-ranking, each result must include the text content in its `metadata.text` field.
|
|
65
65
|
|
|
66
66
|
## Returns
|
|
67
67
|
|
|
@@ -8,6 +8,8 @@ After storing embeddings, you need to retrieve relevant chunks to answer user qu
|
|
|
8
8
|
|
|
9
9
|
Mastra provides flexible retrieval options with support for semantic search, filtering, and re-ranking.
|
|
10
10
|
|
|
11
|
+
For an agent that answers from your docs or policies, with each customer or team limited to its own content, use [Knowledge](https://mastra.ai/docs/knowledge/overview) and its [scopes](https://mastra.ai/docs/knowledge/scopes-and-access) instead. The [RAG overview](https://mastra.ai/reference/rag/overview) explains when to use each.
|
|
12
|
+
|
|
11
13
|
## How retrieval works
|
|
12
14
|
|
|
13
15
|
1. The user's query is converted to an embedding using the same model used for document embeddings
|
|
@@ -71,7 +73,7 @@ Results can also include `vector` when you set `includeVector: true`, and `docum
|
|
|
71
73
|
|
|
72
74
|
## Advanced retrieval options
|
|
73
75
|
|
|
74
|
-
### Metadata
|
|
76
|
+
### Metadata filtering
|
|
75
77
|
|
|
76
78
|
Filter results based on metadata fields to narrow down the search space. This approach - combining vector similarity search with metadata filters - is sometimes called hybrid vector search, as it merges semantic search with structured filtering criteria.
|
|
77
79
|
|
|
@@ -257,7 +259,7 @@ With IVFFlat, or HNSW on older pgvector versions, pgVector compares the query ve
|
|
|
257
259
|
|
|
258
260
|
Indexing the metadata fields you filter on speeds up both cases and gives PostgreSQL the row counts it needs to choose between them.
|
|
259
261
|
|
|
260
|
-
### Vector
|
|
262
|
+
### Vector query tool
|
|
261
263
|
|
|
262
264
|
Sometimes you want to give your agent the ability to query a vector database directly. The Vector Query Tool allows your agent to be in charge of retrieval decisions, combining semantic search with optional filtering and reranking based on the agent's understanding of the user's needs.
|
|
263
265
|
|
|
@@ -272,7 +274,7 @@ const vectorQueryTool = createVectorQueryTool({
|
|
|
272
274
|
})
|
|
273
275
|
```
|
|
274
276
|
|
|
275
|
-
When creating the tool, pay special attention to the tool's name and description - these help the agent understand when and how to use the retrieval capabilities. For example, you might name it "SearchKnowledgeBase" and describe it as "Search
|
|
277
|
+
When creating the tool, pay special attention to the tool's name and description - these help the agent understand when and how to use the retrieval capabilities. For example, you might name it "SearchKnowledgeBase" and describe it as "Search the documentation to find relevant information about X topic."
|
|
276
278
|
|
|
277
279
|
This is particularly useful when:
|
|
278
280
|
|
|
@@ -280,7 +282,7 @@ This is particularly useful when:
|
|
|
280
282
|
- The retrieval process requires complex decision-making
|
|
281
283
|
- You want the agent to combine multiple retrieval strategies based on context
|
|
282
284
|
|
|
283
|
-
#### Database-
|
|
285
|
+
#### Database-specific configurations
|
|
284
286
|
|
|
285
287
|
The Vector Query Tool supports database-specific configurations that enable you to use unique features and optimizations of different vector stores.
|
|
286
288
|
|
|
@@ -378,7 +380,7 @@ await pineconeQueryTool.execute({ queryText: 'search query' }, { mastra, request
|
|
|
378
380
|
|
|
379
381
|
For detailed configuration options and advanced usage, see the [Vector Query Tool Reference](https://mastra.ai/reference/tools/vector-query-tool).
|
|
380
382
|
|
|
381
|
-
### Vector
|
|
383
|
+
### Vector store prompts
|
|
382
384
|
|
|
383
385
|
Vector store prompts define query patterns and filtering capabilities for each vector database implementation. When implementing filtering, these prompts are required in the agent's instructions to specify valid operators and syntax for each vector store implementation.
|
|
384
386
|
|
|
@@ -645,7 +647,7 @@ The weights control how different factors influence the final ranking:
|
|
|
645
647
|
- `vector`: Higher values favor the original vector similarity scores
|
|
646
648
|
- `position`: Higher values help maintain the original ordering of results
|
|
647
649
|
|
|
648
|
-
> **Note:** For semantic scoring to work
|
|
650
|
+
> **Note:** For semantic scoring to work during re-ranking, each result must include the text content in its `metadata.text` field.
|
|
649
651
|
|
|
650
652
|
You can also use other relevance score providers like Voyage AI, Cohere, or ZeroEntropy:
|
|
651
653
|
|
|
@@ -39,7 +39,7 @@ MongoDB works directly with VoyageAI's embedding models, which are optimized for
|
|
|
39
39
|
|
|
40
40
|
### Hybrid Search (Vector + Full-Text)
|
|
41
41
|
|
|
42
|
-
MongoDB supports hybrid search that combines vector similarity with BM25 full-text search through server-side `$rankFusion`. It requires MongoDB 8.0 or later, is
|
|
42
|
+
MongoDB supports hybrid search that combines vector similarity with BM25 full-text search through server-side `$rankFusion`. It requires MongoDB 8.0 or later, is available from 8.1, and is enabled on MongoDB Atlas 8.0.x. Use it to combine semantic retrieval with keyword-based results:
|
|
43
43
|
|
|
44
44
|
```ts
|
|
45
45
|
await store.createSearchIndex({ indexName: 'myCollection', fields: ['text'] })
|
|
@@ -469,7 +469,7 @@ await store.upsert({
|
|
|
469
469
|
|
|
470
470
|
Once initialized, all vector stores share the same interface for creating indexes, upserting embeddings, and querying.
|
|
471
471
|
|
|
472
|
-
### Creating
|
|
472
|
+
### Creating indexes
|
|
473
473
|
|
|
474
474
|
Before storing embeddings, you need to create an index with the appropriate dimension size for your embedding model:
|
|
475
475
|
|
|
@@ -490,7 +490,7 @@ The dimension size must match the output dimension of your chosen embedding mode
|
|
|
490
490
|
|
|
491
491
|
> **Warning:** Index dimensions can't be changed after creation. To use a different model, delete and recreate the index with the new dimension size.
|
|
492
492
|
|
|
493
|
-
### Naming
|
|
493
|
+
### Naming rules for databases
|
|
494
494
|
|
|
495
495
|
Each vector database enforces specific naming conventions for indexes and collections to ensure compatibility and prevent conflicts.
|
|
496
496
|
|
|
@@ -683,7 +683,7 @@ Index names must:
|
|
|
683
683
|
- Example: `MyIndex` isn't valid (contains uppercase letters)
|
|
684
684
|
- Example: `my-index-` isn't valid (ends with a dash)
|
|
685
685
|
|
|
686
|
-
### Upserting
|
|
686
|
+
### Upserting embeddings
|
|
687
687
|
|
|
688
688
|
After creating an index, you can store embeddings along with their basic metadata:
|
|
689
689
|
|
|
@@ -748,7 +748,7 @@ Key metadata considerations:
|
|
|
748
748
|
|
|
749
749
|
Use `deleteVectors` with a metadata filter to remove embeddings associated with a document. This is useful for cleaning up stale vectors after a document is deleted or updated.
|
|
750
750
|
|
|
751
|
-
### Delete by
|
|
751
|
+
### Delete by metadata filter
|
|
752
752
|
|
|
753
753
|
The most common use case is deleting all vectors for a specific document when a user deletes it:
|
|
754
754
|
|
|
@@ -766,7 +766,7 @@ This is particularly useful when:
|
|
|
766
766
|
- You're re-indexing a document and want to remove old vectors first
|
|
767
767
|
- You need to clean up vectors for a specific user or tenant
|
|
768
768
|
|
|
769
|
-
### Delete
|
|
769
|
+
### Delete multiple documents
|
|
770
770
|
|
|
771
771
|
You can also use complex filters to delete vectors matching multiple conditions:
|
|
772
772
|
|
|
@@ -788,7 +788,7 @@ await store.deleteVectors({
|
|
|
788
788
|
})
|
|
789
789
|
```
|
|
790
790
|
|
|
791
|
-
### Delete by
|
|
791
|
+
### Delete by vector IDs
|
|
792
792
|
|
|
793
793
|
If you have specific vector IDs to delete, you can pass them directly:
|
|
794
794
|
|
|
@@ -92,7 +92,7 @@ handler: async c => {
|
|
|
92
92
|
|
|
93
93
|
## Examples
|
|
94
94
|
|
|
95
|
-
### Basic GET
|
|
95
|
+
### Basic GET route
|
|
96
96
|
|
|
97
97
|
```typescript
|
|
98
98
|
import { Mastra } from '@mastra/core'
|
|
@@ -112,7 +112,7 @@ export const mastra = new Mastra({
|
|
|
112
112
|
})
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
### Route with
|
|
115
|
+
### Route with path parameters
|
|
116
116
|
|
|
117
117
|
```typescript
|
|
118
118
|
registerApiRoute('/users/:userId/posts/:postId', {
|
|
@@ -126,7 +126,7 @@ registerApiRoute('/users/:userId/posts/:postId', {
|
|
|
126
126
|
})
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
### POST
|
|
129
|
+
### POST route with body
|
|
130
130
|
|
|
131
131
|
```typescript
|
|
132
132
|
registerApiRoute('/items', {
|
|
@@ -142,7 +142,7 @@ registerApiRoute('/items', {
|
|
|
142
142
|
})
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
### Route with
|
|
145
|
+
### Route with middleware
|
|
146
146
|
|
|
147
147
|
```typescript
|
|
148
148
|
registerApiRoute('/protected', {
|
|
@@ -179,7 +179,7 @@ registerApiRoute('/customer-webhook', {
|
|
|
179
179
|
})
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
-
### Route with OpenAPI
|
|
182
|
+
### Route with OpenAPI documentation
|
|
183
183
|
|
|
184
184
|
```typescript
|
|
185
185
|
import { z } from 'zod'
|
|
@@ -372,7 +372,7 @@ const storage = new MastraCompositeStore({
|
|
|
372
372
|
|
|
373
373
|
### Specialized storage for observability
|
|
374
374
|
|
|
375
|
-
Observability data can
|
|
375
|
+
Observability data can overwhelm general-purpose databases in production. A single agent interaction can generate hundreds of spans, and high-traffic applications can produce thousands of traces per day.
|
|
376
376
|
|
|
377
377
|
**[ClickHouse](https://mastra.ai/integrations/databases/clickhouse)** is recommended for production observability because it's optimized for high-volume, write-heavy analytics workloads. Use composite storage to route observability to ClickHouse while keeping other data in your primary database:
|
|
378
378
|
|
|
@@ -49,7 +49,7 @@ Stores conversation messages and their metadata. Each message belongs to a threa
|
|
|
49
49
|
|
|
50
50
|
idtextPRIMARYKEYNOT NULLUnique identifier for the messagethread_idtextFK → threads.idNOT NULLParent thread referenceresourceIdtextCAN BE NULLID of the resource that owns this messagecontenttextNOT NULLJSON of the message content in V2 format. Example: `{ format: 2, parts: [...] }`roletextNOT NULLEnum of `user | assistant`createdAttimestampNOT NULLUsed for thread message ordering
|
|
51
51
|
|
|
52
|
-
The message `content` column contains a JSON object conforming to the `MastraMessageContentV2` type, which is designed to align
|
|
52
|
+
The message `content` column contains a JSON object conforming to the `MastraMessageContentV2` type, which is designed to align with the AI SDK `UIMessage` message shape.
|
|
53
53
|
|
|
54
54
|
formatintegerNOT NULLMessage format version (currently 2)partsarray (JSON)NOT NULLArray of message parts (text, tool-invocation, file, reasoning, etc.). The structure of items in this array varies by `type`.experimental_attachmentsarray (JSON)CAN BE NULLOptional array of file attachmentscontenttextCAN BE NULLOptional main text content of the messagetoolInvocationsarray (JSON)CAN BE NULLOptional array summarizing tool calls and resultsreasoningobject (JSON)CAN BE NULLOptional information about the reasoning process behind the assistant's responseannotationsobject (JSON)CAN BE NULLOptional additional metadata or annotations
|
|
55
55
|
|
|
@@ -39,7 +39,7 @@ Storage adapters use the shared core retention contract for `prune()`, or a data
|
|
|
39
39
|
|
|
40
40
|
Run `prune()` from a scheduler or maintenance worker, not from application startup or shutdown hooks. For deployments that share a database, prefer a single active scheduler or worker for pruning.
|
|
41
41
|
|
|
42
|
-
Prefer lower-traffic periods when pruning large tables. Use `maxBatches`, `maxRows`, and `pauseMs` to bound each run, and pass an `AbortSignal` when the maintenance process needs to stop
|
|
42
|
+
Prefer lower-traffic periods when pruning large tables. Use `maxBatches`, `maxRows`, and `pauseMs` to bound each run, and pass an `AbortSignal` when the maintenance process needs to stop on request. These recommendations apply to adapters that expose `prune()`. ClickHouse applies its native time to live (TTL) policy within the database.
|
|
43
43
|
|
|
44
44
|
## Usage example
|
|
45
45
|
|
|
@@ -296,7 +296,7 @@ const storage = new MongoDBStore({
|
|
|
296
296
|
|
|
297
297
|
`prune()` deletes rows but doesn't shrink the database file. On SQLite/libSQL the freed pages go on a freelist for reuse by future writes. Reusing these pages prevents unbounded file growth for most users.
|
|
298
298
|
|
|
299
|
-
Handing that free space back to the OS is a separate concern that Mastra doesn't manage. If you specifically need to shrink the file, run the underlying database's compaction (for example `VACUUM` on self-hosted libSQL) yourself in a maintenance window. A full `VACUUM` locks the file and needs
|
|
299
|
+
Handing that free space back to the OS is a separate concern that Mastra doesn't manage. If you specifically need to shrink the file, run the underlying database's compaction (for example `VACUUM` on self-hosted libSQL) yourself in a maintenance window. A full `VACUUM` locks the file and needs about twice the file size in free disk. On PostgreSQL, autovacuum reclaims dead tuples for reuse automatically. A manual `VACUUM FULL` is only needed if you must return disk to the OS.
|
|
300
300
|
|
|
301
301
|
For MongoDB, deleted documents are reused by future insertions. To reclaim disk space, run [`db.runCommand({ compact: "collection_name" })`](https://www.mongodb.com/docs/manual/reference/command/compact/) during a maintenance window.
|
|
302
302
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
4
4
|
|
|
5
|
-
# Turso
|
|
5
|
+
# Turso storage
|
|
6
6
|
|
|
7
7
|
Use `@mastra/turso` to store Mastra agents, workflows, memory, and other storage domains in a local [Turso Database](https://github.com/tursodatabase/turso) file.
|
|
8
8
|
|
|
@@ -131,7 +131,7 @@ These properties resolve to final values after the stream completes:
|
|
|
131
131
|
|
|
132
132
|
## Usage examples
|
|
133
133
|
|
|
134
|
-
### Basic
|
|
134
|
+
### Basic text streaming
|
|
135
135
|
|
|
136
136
|
```typescript
|
|
137
137
|
const stream = await agent.stream('Write a haiku')
|
|
@@ -146,7 +146,7 @@ const fullText = await stream.text
|
|
|
146
146
|
console.log(fullText)
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
### Structured
|
|
149
|
+
### Structured output streaming
|
|
150
150
|
|
|
151
151
|
```typescript
|
|
152
152
|
const stream = await agent.stream('Generate user data', {
|
|
@@ -169,7 +169,7 @@ const user = await stream.object
|
|
|
169
169
|
console.log('Final:', user) // { name: "John", age: 30, email: "john@example.com" }
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
### Tool
|
|
172
|
+
### Tool calls and results
|
|
173
173
|
|
|
174
174
|
```typescript
|
|
175
175
|
const stream = await agent.stream("What's the weather in NYC?", {
|
|
@@ -184,7 +184,7 @@ console.log('Tools called:', toolCalls)
|
|
|
184
184
|
console.log('Results:', toolResults)
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
-
### Complete
|
|
187
|
+
### Complete output access
|
|
188
188
|
|
|
189
189
|
```typescript
|
|
190
190
|
const stream = await agent.stream('Analyze this data')
|
|
@@ -198,7 +198,7 @@ console.log({
|
|
|
198
198
|
})
|
|
199
199
|
```
|
|
200
200
|
|
|
201
|
-
### Full
|
|
201
|
+
### Full stream processing
|
|
202
202
|
|
|
203
203
|
```typescript
|
|
204
204
|
const stream = await agent.stream('Complex task')
|
|
@@ -305,7 +305,7 @@ To abort a run you no longer hold a handle to, use the `runId` with [`durableAge
|
|
|
305
305
|
|
|
306
306
|
## Extended usage example
|
|
307
307
|
|
|
308
|
-
### Mastra
|
|
308
|
+
### Mastra format (default)
|
|
309
309
|
|
|
310
310
|
```ts
|
|
311
311
|
import { stepCountIs } from 'ai-v5'
|
|
@@ -355,9 +355,9 @@ Exceeding a budget fails with a `MastraTimeoutError`, which carries a `timeoutTy
|
|
|
355
355
|
|
|
356
356
|
Nested `timeout` settings are merged per key across call-time and per-model `modelSettings`, so a per-model `stepMs` override keeps a call-time `firstChunkMs`.
|
|
357
357
|
|
|
358
|
-
### AI SDK v5+
|
|
358
|
+
### AI SDK v5+ format
|
|
359
359
|
|
|
360
|
-
To use the stream with AI SDK v5 (and later), you can convert it using
|
|
360
|
+
To use the stream with AI SDK v5 (and later), you can convert it using the `toAISdkStream` utility.
|
|
361
361
|
|
|
362
362
|
```ts
|
|
363
363
|
import { stepCountIs, createUIMessageStreamResponse } from 'ai'
|
|
@@ -376,7 +376,7 @@ return createUIMessageStreamResponse({
|
|
|
376
376
|
})
|
|
377
377
|
```
|
|
378
378
|
|
|
379
|
-
### Using
|
|
379
|
+
### Using callbacks
|
|
380
380
|
|
|
381
381
|
All callback functions are now available as top-level properties for a cleaner API experience.
|
|
382
382
|
|
|
@@ -406,7 +406,7 @@ for await (const chunk of stream.textStream) {
|
|
|
406
406
|
}
|
|
407
407
|
```
|
|
408
408
|
|
|
409
|
-
### Advanced example with
|
|
409
|
+
### Advanced example with options
|
|
410
410
|
|
|
411
411
|
```ts
|
|
412
412
|
import { z } from 'zod'
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
4
4
|
|
|
5
|
-
# Agent.streamLegacy() (
|
|
5
|
+
# Agent.streamLegacy() (legacy)
|
|
6
6
|
|
|
7
7
|
> **Warning:** **Deprecated**: This method is deprecated and only works with V1 models. For V2 models, use the new [`.stream()`](https://mastra.ai/reference/streaming/agents/stream) method instead. See the [migration guide](https://mastra.ai/reference/migrations/vnext-to-standard-apis) for details on upgrading.
|
|
8
8
|
|
|
@@ -146,9 +146,9 @@ await agent.streamLegacy('message for agent', {
|
|
|
146
146
|
|
|
147
147
|
> **Note:** The new `.stream()` method offers enhanced capabilities including AI SDK v5+ compatibility, better structured-output handling, and improved callback system. See the [migration guide](https://mastra.ai/reference/migrations/vnext-to-standard-apis) for detailed migration instructions.
|
|
148
148
|
|
|
149
|
-
### Quick
|
|
149
|
+
### Quick migration example
|
|
150
150
|
|
|
151
|
-
#### Before (
|
|
151
|
+
#### Before (legacy)
|
|
152
152
|
|
|
153
153
|
```typescript
|
|
154
154
|
const result = await agent.streamLegacy('message', {
|
|
@@ -158,7 +158,7 @@ const result = await agent.streamLegacy('message', {
|
|
|
158
158
|
})
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
-
#### After (
|
|
161
|
+
#### After (new API)
|
|
162
162
|
|
|
163
163
|
```typescript
|
|
164
164
|
const result = await agent.stream('message', {
|
|
@@ -55,7 +55,7 @@ bun x create-mastra@latest my-project --template template-name
|
|
|
55
55
|
|
|
56
56
|
This creates a complete project and installs its dependencies. The template author controls the models, provider dependencies, environment variables, and source code.
|
|
57
57
|
|
|
58
|
-
### Setup
|
|
58
|
+
### Setup process
|
|
59
59
|
|
|
60
60
|
After installation:
|
|
61
61
|
|
|
@@ -19,7 +19,7 @@ const kbTool = createBedrockKBTool({
|
|
|
19
19
|
})
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
### With an
|
|
22
|
+
### With an agent
|
|
23
23
|
|
|
24
24
|
```typescript
|
|
25
25
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -49,13 +49,13 @@ const agent = new Agent({
|
|
|
49
49
|
|
|
50
50
|
**userId** (`string`): Default AWS user ID for document-level access control. A userId in the Mastra request context takes precedence.
|
|
51
51
|
|
|
52
|
-
## Input
|
|
52
|
+
## Input schema
|
|
53
53
|
|
|
54
54
|
The tool accepts the following input when called by an agent:
|
|
55
55
|
|
|
56
56
|
**queryText** (`string`): The search query to find relevant documents in the knowledge base.
|
|
57
57
|
|
|
58
|
-
## Output
|
|
58
|
+
## Output schema
|
|
59
59
|
|
|
60
60
|
The tool returns an object with:
|
|
61
61
|
|
|
@@ -70,9 +70,9 @@ The tool returns an object with:
|
|
|
70
70
|
| `score` | `number \| undefined` | The relevance score returned by standard retrieval, which the agentic API omits from result items. |
|
|
71
71
|
| `metadata` | `Record<string, unknown>` | Additional metadata from the retrieval result. |
|
|
72
72
|
|
|
73
|
-
## Retrieval
|
|
73
|
+
## Retrieval modes
|
|
74
74
|
|
|
75
|
-
### Agentic
|
|
75
|
+
### Agentic retrieval (default)
|
|
76
76
|
|
|
77
77
|
When `useAgenticRetrieval` is `true` (default), the tool uses `AgenticRetrieveStreamCommand` which:
|
|
78
78
|
|
|
@@ -82,7 +82,7 @@ When `useAgenticRetrieval` is `true` (default), the tool uses `AgenticRetrieveSt
|
|
|
82
82
|
|
|
83
83
|
If agentic retrieval fails (e.g., older SDK, permissions), it automatically falls back to standard managed retrieval.
|
|
84
84
|
|
|
85
|
-
### Standard
|
|
85
|
+
### Standard managed retrieval
|
|
86
86
|
|
|
87
87
|
When `useAgenticRetrieval` is `false`, the tool uses `RetrieveCommand` with `managedSearchConfiguration` for direct single-pass retrieval.
|
|
88
88
|
|
|
@@ -99,7 +99,7 @@ requestContext.set('userId', 'user-123')
|
|
|
99
99
|
await agent.generate('Find my private documents', { requestContext })
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
## Required IAM
|
|
102
|
+
## Required IAM permissions
|
|
103
103
|
|
|
104
104
|
```json
|
|
105
105
|
{
|
|
@@ -114,6 +114,6 @@ await agent.generate('Find my private documents', { requestContext })
|
|
|
114
114
|
}
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
## SDK
|
|
117
|
+
## SDK requirements
|
|
118
118
|
|
|
119
119
|
- `@aws-sdk/client-bedrock-agent-runtime` >= 3.1000 (AgenticRetrieveStreamCommand requires \~3.1000+)
|