@mastra/mcp-docs-server 1.3.15-alpha.2 → 1.3.15
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 +9 -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 +5 -5
- 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 +3 -3
- package/.docs/docs/harness/background-tasks.md +1 -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/access-tokens.md +84 -0
- package/.docs/docs/mastra-platform/api.md +2 -2
- package/.docs/docs/mastra-platform/configuration.md +10 -14
- package/.docs/docs/mastra-platform/database.md +30 -23
- package/.docs/docs/mastra-platform/{environments.md → deploy/environments.md} +7 -7
- package/.docs/docs/mastra-platform/{github.md → deploy/github.md} +3 -3
- package/.docs/docs/mastra-platform/{deploy.md → deploy/overview.md} +8 -10
- package/.docs/docs/mastra-platform/{regions.md → deploy/regions.md} +4 -4
- package/.docs/docs/mastra-platform/{server.md → deploy/server.md} +18 -10
- package/.docs/docs/mastra-platform/{studio.md → deploy/studio.md} +2 -2
- package/.docs/docs/mastra-platform/{trace-intelligence.md → observability/trace-intelligence.md} +6 -6
- package/.docs/docs/mastra-platform/overview.md +12 -12
- package/.docs/docs/mastra-platform/system-environment-variables.md +13 -13
- package/.docs/docs/mastra-platform/team-members.md +49 -0
- package/.docs/docs/mastra-platform/workspaces.md +11 -11
- 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 +13 -13
- package/.docs/docs/observability/overview.md +2 -2
- 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/auth.md +1 -1
- package/.docs/docs/studio/deployment.md +3 -3
- package/.docs/docs/studio/editor.md +2 -2
- package/.docs/docs/studio/observability.md +3 -3
- package/.docs/docs/studio/overview.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 +14 -14
- 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/integrations.md +2 -2
- 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 +4 -4
- 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 +9 -9
- 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/advanced-queries.md +1 -1
- 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/create-tool.md +1 -1
- 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/.docs/reference/workspace/platform-filesystem.md +1 -1
- package/.docs/reference/workspace/platform-sandbox.md +1 -1
- package/package.json +4 -4
- /package/.docs/docs/mastra-platform/{observability.md → observability/overview.md} +0 -0
|
@@ -8,7 +8,7 @@ The LanceVectorStore class provides vector search using [LanceDB](https://lanced
|
|
|
8
8
|
|
|
9
9
|
## Factory method
|
|
10
10
|
|
|
11
|
-
The LanceVectorStore uses a factory pattern for creation.
|
|
11
|
+
The LanceVectorStore uses a factory pattern for creation. Use the static `create()` method rather than the constructor directly.
|
|
12
12
|
|
|
13
13
|
**uri** (`string`): Path to LanceDB database or URI for cloud deployments
|
|
14
14
|
|
|
@@ -180,7 +180,7 @@ Returns LanceDB `OptimizeStats` (compaction and pruning counts).
|
|
|
180
180
|
|
|
181
181
|
`optimize()` adds new rows to the existing index without retraining it. If your data distribution has changed a lot, rebuild the index with `deleteIndex()` and `createIndex()` instead.
|
|
182
182
|
|
|
183
|
-
LanceDB suggests optimizing after
|
|
183
|
+
LanceDB suggests optimizing after about 100,000 modified rows or 20 write operations. Use `getIndexCoverage()` to build your own policy:
|
|
184
184
|
|
|
185
185
|
```typescript
|
|
186
186
|
const [coverage] = await store.getIndexCoverage({ indexName: 'docs' })
|
|
@@ -269,7 +269,7 @@ try {
|
|
|
269
269
|
|
|
270
270
|
- For optimal performance with large datasets, consider adjusting `numPartitions` and `numSubVectors` values
|
|
271
271
|
|
|
272
|
-
- Use `close()` method to
|
|
272
|
+
- Use the `close()` method to close connections when done with the database
|
|
273
273
|
|
|
274
274
|
- Store metadata with a consistent schema to simplify filtering operations
|
|
275
275
|
|
|
@@ -44,7 +44,7 @@ const store = new MongoDBVector({
|
|
|
44
44
|
})
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
### Custom
|
|
47
|
+
### Custom embedding field path
|
|
48
48
|
|
|
49
49
|
If you need to store embeddings in a nested field structure (e.g., to integrate with existing MongoDB collections), use the `embeddingFieldPath` option:
|
|
50
50
|
|
|
@@ -230,7 +230,7 @@ const results = await store.textQuery({
|
|
|
230
230
|
|
|
231
231
|
### `hybridQuery()`
|
|
232
232
|
|
|
233
|
-
Runs a hybrid search that fuses vector similarity with full-text results through MongoDB's server-side `$rankFusion`. The feature requires MongoDB 8.0 or later and is
|
|
233
|
+
Runs a hybrid search that fuses vector similarity with full-text results through MongoDB's server-side `$rankFusion`. The feature requires MongoDB 8.0 or later and is available from 8.1. MongoDB Atlas 8.0.x supports it where enabled, although enablement may require a support case. A full-text search index must exist. Managed indexes create one automatically, while bring-your-own collections require an explicit `createSearchIndex()` call.
|
|
234
234
|
|
|
235
235
|
**indexName** (`string`): Name of the Mastra index to search
|
|
236
236
|
|
|
@@ -267,7 +267,7 @@ const results = await store.hybridQuery({
|
|
|
267
267
|
})
|
|
268
268
|
```
|
|
269
269
|
|
|
270
|
-
`hybridQuery()` requires MongoDB 8.0 or later for the `$rankFusion` stage, which is
|
|
270
|
+
`hybridQuery()` requires MongoDB 8.0 or later for the `$rankFusion` stage, which is available from 8.1. On 8.0.x, the stage runs where enabled, including MongoDB Atlas, but enablement may require a support case. If your deployment is older or lacks `$rankFusion`, run `query()` and `textQuery()` separately before merging the results client-side.
|
|
271
271
|
|
|
272
272
|
### `describeIndex()`
|
|
273
273
|
|
|
@@ -382,7 +382,7 @@ try {
|
|
|
382
382
|
}
|
|
383
383
|
```
|
|
384
384
|
|
|
385
|
-
## Automated
|
|
385
|
+
## Automated embedding
|
|
386
386
|
|
|
387
387
|
MongoDB can generate the embeddings for you. Create the index with `autoEmbed` and a Voyage AI model, write plain text through `documents`, and search with `queryText`. No embedding provider runs in your application, and no vectors travel through it.
|
|
388
388
|
|
|
@@ -510,7 +510,7 @@ await store.createSearchIndex({ indexName: 'precedents', fields: ['note'] })
|
|
|
510
510
|
|
|
511
511
|
- Index metadata fields used in filters for optimal query performance.
|
|
512
512
|
- Use consistent field naming in metadata to avoid unexpected query results.
|
|
513
|
-
-
|
|
513
|
+
- Monitor index and collection statistics to ensure efficient search.
|
|
514
514
|
- When indexing existing collections, ensure all documents have the required `embedding` field.
|
|
515
515
|
|
|
516
516
|
## Usage example
|
|
@@ -36,7 +36,7 @@ The PgVector class provides vector search using [PostgreSQL](https://www.postgre
|
|
|
36
36
|
|
|
37
37
|
## Constructor examples
|
|
38
38
|
|
|
39
|
-
### Connection
|
|
39
|
+
### Connection string
|
|
40
40
|
|
|
41
41
|
```ts
|
|
42
42
|
import { PgVector } from '@mastra/pg'
|
|
@@ -47,7 +47,7 @@ const vectorStore = new PgVector({
|
|
|
47
47
|
})
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
### Host
|
|
50
|
+
### Host, port, and database configuration
|
|
51
51
|
|
|
52
52
|
```ts
|
|
53
53
|
const vectorStore = new PgVector({
|
|
@@ -60,7 +60,7 @@ const vectorStore = new PgVector({
|
|
|
60
60
|
})
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
### Advanced
|
|
63
|
+
### Advanced configuration
|
|
64
64
|
|
|
65
65
|
```ts
|
|
66
66
|
const vectorStore = new PgVector({
|
|
@@ -114,7 +114,7 @@ const vectorStore = new PgVector({
|
|
|
114
114
|
|
|
115
115
|
**hnsw\.efConstruction** (`number`): Build-time complexity (default: 32)
|
|
116
116
|
|
|
117
|
-
#### Memory
|
|
117
|
+
#### Memory requirements
|
|
118
118
|
|
|
119
119
|
HNSW indexes require substantial shared memory during construction. For 100K vectors:
|
|
120
120
|
|
|
@@ -326,21 +326,21 @@ try {
|
|
|
326
326
|
|
|
327
327
|
## Index configuration guide
|
|
328
328
|
|
|
329
|
-
### Performance
|
|
329
|
+
### Performance optimization
|
|
330
330
|
|
|
331
|
-
#### IVFFlat
|
|
331
|
+
#### IVFFlat tuning
|
|
332
332
|
|
|
333
333
|
- **lists parameter**: Set to `sqrt(n) * 2` where n is the number of vectors
|
|
334
334
|
- More lists = better accuracy but slower build time
|
|
335
|
-
- Fewer lists = faster build but
|
|
335
|
+
- Fewer lists = faster build but lower accuracy in some cases
|
|
336
336
|
|
|
337
|
-
#### HNSW
|
|
337
|
+
#### HNSW tuning
|
|
338
338
|
|
|
339
339
|
- **m parameter**:
|
|
340
340
|
|
|
341
341
|
- 8-16: Moderate accuracy, lower memory
|
|
342
342
|
- 16-32: High accuracy, moderate memory
|
|
343
|
-
- 32-64:
|
|
343
|
+
- 32-64: High accuracy, high memory
|
|
344
344
|
|
|
345
345
|
- **efConstruction**:
|
|
346
346
|
|
|
@@ -348,7 +348,7 @@ try {
|
|
|
348
348
|
- 64-128: Slower build, better quality
|
|
349
349
|
- 128-256: Slowest build, best quality
|
|
350
350
|
|
|
351
|
-
### Index
|
|
351
|
+
### Index recreation behavior
|
|
352
352
|
|
|
353
353
|
The system automatically detects configuration changes and only rebuilds indexes when necessary:
|
|
354
354
|
|
|
@@ -358,7 +358,7 @@ The system automatically detects configuration changes and only rebuilds indexes
|
|
|
358
358
|
|
|
359
359
|
## Best practices
|
|
360
360
|
|
|
361
|
-
-
|
|
361
|
+
- Evaluate your index configuration to ensure optimal performance.
|
|
362
362
|
- Adjust parameters like `lists` and `m` based on dataset size and query requirements.
|
|
363
363
|
- **Monitor index performance** using `describeIndex()` to track usage
|
|
364
364
|
- Rebuild indexes periodically to maintain efficiency, especially after substantial data changes
|
|
@@ -28,7 +28,7 @@ The QdrantVector class provides vector search using [Qdrant](https://qdrant.tech
|
|
|
28
28
|
|
|
29
29
|
**namedVectors** (`Record<string, { size: number; distance: 'cosine' | 'euclidean' | 'dotproduct' }>`): Configuration for named vector spaces. When provided, creates a collection with multiple named vector fields.
|
|
30
30
|
|
|
31
|
-
#### Creating a `named vectors`
|
|
31
|
+
#### Creating a `named vectors` collection
|
|
32
32
|
|
|
33
33
|
```typescript
|
|
34
34
|
// Create a collection with multiple named vector spaces
|
|
@@ -54,7 +54,7 @@ await store.createIndex({
|
|
|
54
54
|
|
|
55
55
|
**vectorName** (`string`): Name of the vector space to upsert into when using named vectors.
|
|
56
56
|
|
|
57
|
-
#### Upserting into
|
|
57
|
+
#### Upserting into named vector spaces
|
|
58
58
|
|
|
59
59
|
```typescript
|
|
60
60
|
// Upsert into the "text" vector space
|
|
@@ -108,7 +108,7 @@ Attempts to delete an item by its ID from the specified index. Logs an error mes
|
|
|
108
108
|
|
|
109
109
|
Delete multiple vectors by IDs or by metadata filter. Either `ids` or `filter` must be provided, but not both, and neither can be empty.
|
|
110
110
|
|
|
111
|
-
Filter deletion runs one approximate query with `topK: 1000` and deletes the returned IDs. `deleteVectors()` returns `Promise<void>` and
|
|
111
|
+
Filter deletion runs one approximate query with `topK: 1000` and deletes the returned IDs. `deleteVectors()` returns `Promise<void>` and doesn't report how many vectors it deleted, so repeating the call can't guarantee complete deletion. Use [Upstash's filter-delete API](https://upstash.com/docs/vector/api/endpoints/delete) when complete filter deletion is required. Deleting by `ids` isn't subject to this query limit.
|
|
112
112
|
|
|
113
113
|
**indexName** (`string`): Namespace to delete from
|
|
114
114
|
|
|
@@ -120,7 +120,7 @@ Filter deletion runs one approximate query with `topK: 1000` and deletes the ret
|
|
|
120
120
|
|
|
121
121
|
Upstash Vector supports hybrid search that combines semantic search (dense vectors) with keyword-based search (sparse vectors) for improved relevance and accuracy.
|
|
122
122
|
|
|
123
|
-
### Basic
|
|
123
|
+
### Basic hybrid usage
|
|
124
124
|
|
|
125
125
|
```typescript
|
|
126
126
|
import { UpstashVector } from '@mastra/upstash'
|
|
@@ -157,7 +157,7 @@ const results = await vectorStore.query({
|
|
|
157
157
|
})
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
-
### Advanced
|
|
160
|
+
### Advanced hybrid search options
|
|
161
161
|
|
|
162
162
|
```typescript
|
|
163
163
|
import { FusionAlgorithm, QueryMode } from '@upstash/vector'
|
|
@@ -189,7 +189,7 @@ const sparseResults = await vectorStore.query({
|
|
|
189
189
|
})
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
-
### Updating
|
|
192
|
+
### Updating hybrid vectors
|
|
193
193
|
|
|
194
194
|
```typescript
|
|
195
195
|
// Update both dense and sparse components
|
|
@@ -116,7 +116,7 @@ API keys and regions can be provided via constructor options or environment vari
|
|
|
116
116
|
- `AZURE_API_KEY` - Your Azure Speech Services subscription key
|
|
117
117
|
- `AZURE_REGION` - Your Azure region (e.g., 'eastus', 'westeurope')
|
|
118
118
|
|
|
119
|
-
### Voice
|
|
119
|
+
### Voice capabilities
|
|
120
120
|
|
|
121
121
|
- Azure offers 200+ neural voices across 50+ languages
|
|
122
122
|
- Each voice ID follows the format: `{language}-{region}-{name}Neural` (e.g., 'en-US-JennyNeural')
|
|
@@ -76,7 +76,7 @@ Returns an array of available voice options, where each node contains:
|
|
|
76
76
|
- This provider only supports text-to-speech (TTS) functionality, not speech-to-text (STT)
|
|
77
77
|
- The service integrates well with other Cloudflare Workers products
|
|
78
78
|
- For production use, ensure your Cloudflare account has the appropriate Workers AI subscription
|
|
79
|
-
- Voice options are more limited compared to some other providers, but performance at the edge is
|
|
79
|
+
- Voice options are more limited compared to some other providers, but performance at the edge is strong
|
|
80
80
|
|
|
81
81
|
## Related providers
|
|
82
82
|
|
|
@@ -164,7 +164,7 @@ Returns: `string` - The location (default: `'us-central1'`)
|
|
|
164
164
|
|
|
165
165
|
The Google Voice provider supports two authentication methods:
|
|
166
166
|
|
|
167
|
-
#### Standard
|
|
167
|
+
#### Standard mode (API key)
|
|
168
168
|
|
|
169
169
|
Uses a Google Cloud API key for authentication. Suitable for development and basic use cases.
|
|
170
170
|
|
|
@@ -180,7 +180,7 @@ const voice = new GoogleVoice({
|
|
|
180
180
|
})
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
#### Vertex AI
|
|
183
|
+
#### Vertex AI mode (service account)
|
|
184
184
|
|
|
185
185
|
Uses Google Cloud project-based authentication with service accounts. Recommended for production and enterprise deployments.
|
|
186
186
|
|
|
@@ -228,9 +228,9 @@ const voice = new GoogleVoice({
|
|
|
228
228
|
})
|
|
229
229
|
```
|
|
230
230
|
|
|
231
|
-
##### Required
|
|
231
|
+
##### Required permissions
|
|
232
232
|
|
|
233
|
-
##### IAM
|
|
233
|
+
##### IAM roles
|
|
234
234
|
|
|
235
235
|
For Text-to-Speech:
|
|
236
236
|
|
|
@@ -242,7 +242,7 @@ For Speech-to-Text:
|
|
|
242
242
|
|
|
243
243
|
- `roles/speech.client` - Speech-to-Text Client
|
|
244
244
|
|
|
245
|
-
##### OAuth
|
|
245
|
+
##### OAuth scopes
|
|
246
246
|
|
|
247
247
|
For synchronous Text-to-Speech synthesis:
|
|
248
248
|
|
|
@@ -271,7 +271,7 @@ For long-audio Text-to-Speech operations:
|
|
|
271
271
|
|
|
272
272
|
5. The `speak()` method supports advanced audio configuration through the Google Cloud Text-to-Speech API.
|
|
273
273
|
|
|
274
|
-
6. The `listen()` method supports
|
|
274
|
+
6. The `listen()` method supports recognition configurations through the Google Cloud Speech-to-Text API.
|
|
275
275
|
|
|
276
276
|
7. Available voices can be filtered by language code using the `getSpeakers()` method.
|
|
277
277
|
|
|
@@ -511,7 +511,7 @@ Returns: `Promise<Array<{ voiceId: string; description?: string }>>`
|
|
|
511
511
|
|
|
512
512
|
#### `disconnect()`
|
|
513
513
|
|
|
514
|
-
Disconnects from the Gemini Live session and cleans up resources. This is the async method that
|
|
514
|
+
Disconnects from the Gemini Live session and cleans up resources. This is the async method that handles cleanup.
|
|
515
515
|
|
|
516
516
|
Returns: `Promise<void>`
|
|
517
517
|
|
|
@@ -599,7 +599,7 @@ The following voice options are available:
|
|
|
599
599
|
|
|
600
600
|
### Authentication methods
|
|
601
601
|
|
|
602
|
-
#### Gemini API (
|
|
602
|
+
#### Gemini API (development)
|
|
603
603
|
|
|
604
604
|
The simplest method using an API key from [Google AI Studio](https://makersuite.google.com/app/apikey):
|
|
605
605
|
|
|
@@ -610,7 +610,7 @@ const voice = new GeminiLiveVoice({
|
|
|
610
610
|
})
|
|
611
611
|
```
|
|
612
612
|
|
|
613
|
-
#### Vertex AI (
|
|
613
|
+
#### Vertex AI (production)
|
|
614
614
|
|
|
615
615
|
For production use with OAuth authentication and Google Cloud Platform:
|
|
616
616
|
|
|
@@ -641,7 +641,7 @@ const voice = new GeminiLiveVoice({
|
|
|
641
641
|
|
|
642
642
|
### Advanced features
|
|
643
643
|
|
|
644
|
-
#### Session
|
|
644
|
+
#### Session management
|
|
645
645
|
|
|
646
646
|
The Gemini Live API supports session resumption for handling network interruptions:
|
|
647
647
|
|
|
@@ -660,7 +660,7 @@ const voice = new GeminiLiveVoice({
|
|
|
660
660
|
})
|
|
661
661
|
```
|
|
662
662
|
|
|
663
|
-
#### Tool
|
|
663
|
+
#### Tool calling
|
|
664
664
|
|
|
665
665
|
Enable the model to call functions during conversations:
|
|
666
666
|
|
|
@@ -690,7 +690,7 @@ voice.on('toolCall', ({ name, args, id }) => {
|
|
|
690
690
|
- The Gemini Live API uses WebSockets for real-time communication
|
|
691
691
|
- Audio is processed as 16kHz PCM16 for input and 24kHz PCM16 for output
|
|
692
692
|
- The voice instance must be connected with `connect()` before using other methods
|
|
693
|
-
- Always call `close()` when done to
|
|
693
|
+
- Always call `close()` when done to clean up resources
|
|
694
694
|
- Vertex AI authentication requires appropriate IAM permissions (`aiplatform.user` role)
|
|
695
695
|
- Session resumption allows recovery from network interruptions
|
|
696
696
|
- The API supports real-time interactions with text and audio
|
|
@@ -196,7 +196,7 @@ await voice.send(microphoneStream)
|
|
|
196
196
|
voice.close()
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
-
> Inworld API keys are pre-Basic-encoded
|
|
199
|
+
> Inworld API keys are pre-Basic-encoded: paste them verbatim into `INWORLD_API_KEY`, and the package doesn't re-encode them.
|
|
200
200
|
|
|
201
201
|
### Constructor parameters
|
|
202
202
|
|
|
@@ -399,7 +399,7 @@ Returns: `void`
|
|
|
399
399
|
|
|
400
400
|
#### `getSpeakers()`
|
|
401
401
|
|
|
402
|
-
Returns the curated voice list bundled with the package. Inworld's catalog is larger than this list
|
|
402
|
+
Returns the curated voice list bundled with the package. Inworld's catalog is larger than this list. Any voice ID can be passed to `speaker` at runtime.
|
|
403
403
|
|
|
404
404
|
Returns: `Promise<Array<{ voiceId: string }>>`
|
|
405
405
|
|
|
@@ -48,7 +48,7 @@ These steps take you from an empty project to a voice agent you can talk to. A v
|
|
|
48
48
|
LIVEKIT_API_SECRET=your-api-secret
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
3. Add a voice agent to your Mastra instance and expose a connection route. The `liveKitConnectionRoute()` helper adds a `POST /voice/livekit/connection-details` endpoint that
|
|
51
|
+
3. Add a voice agent to your Mastra instance and expose a connection route. The `liveKitConnectionRoute()` helper adds a `POST /voice/livekit/connection-details` endpoint that creates a LiveKit token and dispatches your agent into a room:
|
|
52
52
|
|
|
53
53
|
```typescript
|
|
54
54
|
import { Mastra } from '@mastra/core/mastra'
|
|
@@ -162,7 +162,7 @@ export default createLiveKitWorker({
|
|
|
162
162
|
- `turnDetection: 'multilingual'`: Runs LiveKit's semantic end-of-turn model locally on CPU. It reads the live transcript to avoid cutting users off mid-thought. Use `'vad'` or `'stt'` for silence-based endpointing instead.
|
|
163
163
|
- `endpointing`: Bounds how long the agent waits after the user stops speaking.
|
|
164
164
|
- `interruption`: Controls barge-in. When the user speaks over the agent, LiveKit stops playback and cancels the in-flight Mastra stream, so token generation stops too.
|
|
165
|
-
- `preemptiveGeneration`: Starts the Mastra agent's reply while the user is still finishing, hiding time-to-first-token. The worker disables it by default: each preemptive attempt runs the Mastra agent on an interim transcript, and a run that LiveKit later discards has already persisted a partial user message and a partial, never-spoken reply to the thread. Re-enable it with `preemptiveGeneration: { enabled: true }` if latency matters more than exact thread history, or keep both by running turns read-only
|
|
165
|
+
- `preemptiveGeneration`: Starts the Mastra agent's reply while the user is still finishing, hiding time-to-first-token. The worker disables it by default: each preemptive attempt runs the Mastra agent on an interim transcript, and a run that LiveKit later discards has already persisted a partial user message and a partial, never-spoken reply to the thread. Re-enable it with `preemptiveGeneration: { enabled: true }` if latency matters more than exact thread history, or keep both by running turns read-only. See [preemptive generation with memory](#preemptive-generation-with-memory).
|
|
166
166
|
|
|
167
167
|
See the [LiveKit turn detection docs](https://docs.livekit.io/agents/logic/turns/) for all options.
|
|
168
168
|
|
|
@@ -316,7 +316,7 @@ export default createLiveKitWorker({
|
|
|
316
316
|
})
|
|
317
317
|
```
|
|
318
318
|
|
|
319
|
-
The same `options` field works on `MastraVoiceAgent` and `MastraLLM
|
|
319
|
+
The same `options` field works on `MastraVoiceAgent` and `MastraLLM`. On the remote transport it's forwarded in the request body as `memory.options`.
|
|
320
320
|
|
|
321
321
|
### Speak while tools run
|
|
322
322
|
|
|
@@ -339,7 +339,7 @@ The phrase is spoken as part of the reply and recorded in the transcript.
|
|
|
339
339
|
|
|
340
340
|
By default the worker generates each reply with a Mastra agent. To run multi-step logic per turn (for example classify intent, route, call tools in sequence, then compose a reply), generate replies with a Mastra [workflow](https://mastra.ai/docs/workflows/overview) instead. Set `workflow` in place of `agent`.
|
|
341
341
|
|
|
342
|
-
LiveKit still owns the audio loop and calls into Mastra once per turn
|
|
342
|
+
LiveKit still owns the audio loop and calls into Mastra once per turn. The workflow runs to completion each turn. The workflow can't suspend or resume, and no conversation state carries between turns. Pass the transcript in through `workflowInput` so the workflow stays stateless:
|
|
343
343
|
|
|
344
344
|
```typescript
|
|
345
345
|
import { createLiveKitWorker, chatContextToMessages } from '@mastra/livekit/worker'
|
|
@@ -374,7 +374,7 @@ const generateResponse = createStep({
|
|
|
374
374
|
|
|
375
375
|
- `replyStep`: Restricts spoken output to one step. Omit it to speak every step that writes to its `writer`.
|
|
376
376
|
- `resultText`: A fallback that derives the reply from the final run result when no step streams text. Streaming through `writer` gives lower time-to-first-token, so prefer it.
|
|
377
|
-
- `abortSignal`: Forward the step's `abortSignal` into `agent.stream()` so barge-in stops generation
|
|
377
|
+
- `abortSignal`: Forward the step's `abortSignal` into `agent.stream()` so barge-in stops generation right away. When the user interrupts, the worker cancels the run.
|
|
378
378
|
- `generate`: For full control, pass a `generate` function instead. It can be any reply generator that turns a turn into a text stream.
|
|
379
379
|
|
|
380
380
|
With a workflow, the worker doesn't persist turns automatically the way an agent's `stream()` does. Persist conversation history inside the workflow, or keep the LiveKit transcript as the source of truth and pass it in each turn.
|
|
@@ -434,7 +434,7 @@ Both paths share the same reply pipeline underneath; choose by who should own th
|
|
|
434
434
|
|
|
435
435
|
Tools stay on the Mastra agent and execute on the server. LiveKit-side tools passed to the session are ignored. Tool activity reaches the worker through `toolFeedback` (spoken filler), `onToolCall` (fires as each tool call starts), and `onTurnComplete` (fires after each reply with the text, tool calls, and token usage). Agent-initiated hang-up takes a few lines: pair `onToolCall` with [`runEndCall()`](#runendcall).
|
|
436
436
|
|
|
437
|
-
> **Warning:** Don't combine the `memory` option with LiveKit's `preemptiveGeneration`, which LiveKit enables by default in sessions you build yourself. A speculative turn persists a partial user message and a partial, never-spoken reply to the thread before LiveKit discards it. Set `turnHandling: { preemptiveGeneration: { enabled: false } }`, run without `memory` and pass the full transcript each turn, or set `memory.options.readOnly` and persist committed turns yourself
|
|
437
|
+
> **Warning:** Don't combine the `memory` option with LiveKit's `preemptiveGeneration`, which LiveKit enables by default in sessions you build yourself. A speculative turn persists a partial user message and a partial, never-spoken reply to the thread before LiveKit discards it. Set `turnHandling: { preemptiveGeneration: { enabled: false } }`, run without `memory` and pass the full transcript each turn, or set `memory.options.readOnly` and persist committed turns yourself. See [preemptive generation with memory](#preemptive-generation-with-memory).
|
|
438
438
|
|
|
439
439
|
`MastraLLM` also accepts an in-process Mastra `agent` instance, session ownership without a second deployment, or a custom `generate` function. The remote transport is available standalone as [`createRemoteAgentReplyGenerator()`](#createremoteagentreplygenerator), which also plugs into `createLiveKitWorker`'s `generate` option to run the batteries-included worker against a remote server.
|
|
440
440
|
|
|
@@ -532,7 +532,7 @@ await dispatchVoiceSession({
|
|
|
532
532
|
// Add the phone participant to roomName through your existing LiveKit SIP code.
|
|
533
533
|
```
|
|
534
534
|
|
|
535
|
-
Use a fresh room name for each recorded session and await dispatch before dialing. `dispatchVoiceSession()` throws `LiveKitRecordingRoomConflictError` if the room already exists. Import this error from `@mastra/livekit` to handle the conflict.
|
|
535
|
+
Use a fresh room name for each recorded session and await dispatch before dialing. `dispatchVoiceSession()` throws `LiveKitRecordingRoomConflictError` if the room already exists. Import this error from `@mastra/livekit` to handle the conflict. Because the existence check and room creation are separate requests, your application must prevent another process from creating the same room concurrently, and the option doesn't start recording in an existing room or capture earlier audio.
|
|
536
536
|
|
|
537
537
|
For browser sessions, pass the same settings to the connection route:
|
|
538
538
|
|
|
@@ -552,7 +552,7 @@ With recording enabled, the route creates the room and dispatches the agent when
|
|
|
552
552
|
|
|
553
553
|
The route also accepts a synchronous or asynchronous `recording` callback. It receives `{ body, context, roomName }`, including the resolved room name, so your server can choose settings for each session. Return `undefined` to skip recording for that request. Recording configuration isn't read directly from the request body.
|
|
554
554
|
|
|
555
|
-
An existing recording room returns HTTP 409 before agent dispatch or token issuance. Other room creation and dispatch errors reject the operation
|
|
555
|
+
An existing recording room returns HTTP 409 before agent dispatch or token issuance. Other room creation and dispatch errors reject the operation, and the route doesn't issue a token on failure. If dispatch fails after room creation, the room remains in LiveKit, and successful setup doesn't guarantee that the recording finishes or uploads successfully. Use LiveKit's [egress events](https://docs.livekit.io/intro/basics/rooms-participants-tracks/webhooks-events/#webhook-events) to check completion and retrieve file details before making a recording available to users. To verify the setup, make a test call, end the room, and listen to the completed file under `calls/` in your bucket for audio from both participants.
|
|
556
556
|
|
|
557
557
|
#### Recording lifecycle and consent
|
|
558
558
|
|
|
@@ -560,15 +560,15 @@ Enabling `recording` starts recording during room creation, before a browser con
|
|
|
560
560
|
|
|
561
561
|
`createConsentTool()` and `configuration.consentPolicy` don't control LiveKit egress. They don't delay, pause, or stop an automatic recording. If your application needs consent during the call before capturing audio, obtain it first and use LiveKit's explicit egress APIs to start recording in the existing room. A spoken greeting alone doesn't gate this feature.
|
|
562
562
|
|
|
563
|
-
Recordings follow the LiveKit room lifecycle
|
|
563
|
+
Recordings follow the LiveKit room lifecycle, and disconnecting only the agent doesn't necessarily end the room or finalize the file. Wait for a successful egress completion status and file results before marking a recording ready. Treat failed setup and abandoned rooms as application cleanup responsibilities.
|
|
564
564
|
|
|
565
|
-
The audio file lives in the configured output storage, separately from Mastra memory, transcripts, and traces
|
|
565
|
+
The audio file lives in the configured output storage, separately from Mastra memory, transcripts, and traces, so deleting a Mastra thread doesn't delete the recording. Your application manages storage access, retention, and download links for end users. Keep storage credentials in server configuration, including when choosing recording settings per session.
|
|
566
566
|
|
|
567
567
|
### Review recordings in Studio
|
|
568
568
|
|
|
569
569
|
Register `liveKitRecordingRoute()` to add **Review Audio** to a voice call's trace panel in Studio. The button opens an audio player for that call. Recording and trace storage must both be configured: the route reads the stored `voice call` span and passes its `roomName` to your server-side resolver. The browser supplies only the trace ID.
|
|
570
570
|
|
|
571
|
-
The resolver returns `{ url, expiresAt? }`, or `undefined` when no file is available.
|
|
571
|
+
The resolver returns `{ url, expiresAt? }`, or `undefined` when no file is available. For private storage, use a short-lived signed URL, because the route doesn't persist playback URLs in traces and Studio requests a fresh URL each time the review opens. Missing files and playback errors offer **Refresh recording** so you can retry after the upload finishes or a link expires.
|
|
572
572
|
|
|
573
573
|
For the S3 configuration above, use the same `calls/{room_name}.ogg` object key for recording and playback. Room names must remain unique across calls, including after a room has ended. Install the AWS SDK in your application:
|
|
574
574
|
|
|
@@ -732,7 +732,7 @@ Register [`liveKitRecordingRoute()`](#review-recordings-in-studio) on the server
|
|
|
732
732
|
|
|
733
733
|
`@mastra/client-js@1.51.2` declares support for Zod 3 and 4, but its `@ai-sdk/ui-utils@1.2.11` dependency declares a Zod 3 peer dependency. This mismatch can cause strict npm installs with Zod 4 to fail. Use Zod `^3.25.76` with that SDK to satisfy both peer ranges. Server and worker consumers without the optional client SDK also support Zod 4.
|
|
734
734
|
|
|
735
|
-
The `/client` entry point excludes LiveKit server and worker imports. Other integration entry points don't require `@mastra/client-js`. Installing `@mastra/livekit` still installs its package-level dependencies
|
|
735
|
+
The `/client` entry point excludes LiveKit server and worker imports. Other integration entry points don't require `@mastra/client-js`. Installing `@mastra/livekit` still installs its package-level dependencies. The browser entry point only controls which code enters the browser bundle. Storage credentials and recording authorization remain on the server.
|
|
736
736
|
|
|
737
737
|
### Turn metrics and playback completion
|
|
738
738
|
|
|
@@ -755,7 +755,7 @@ export default createLiveKitWorker({
|
|
|
755
755
|
|
|
756
756
|
Observers run asynchronously and aren't awaited by the audio pipeline. Errors are logged. Keep their work small. Neither observer writes or reconciles memory.
|
|
757
757
|
|
|
758
|
-
`onTurnMetrics` receives versioned records with `phase: 'generation'` or `phase: 'speech'`. Generation records contain a `turnId`, a unique `attemptId`, a terminal `outcome`, `durationMs`, optional `firstTextMs`, and tool timings. Attempts for the same user message share its turn ID. Tool durations run from the bridge receiving a tool call to receiving its result
|
|
758
|
+
`onTurnMetrics` receives versioned records with `phase: 'generation'` or `phase: 'speech'`. Generation records contain a `turnId`, a unique `attemptId`, a terminal `outcome`, `durationMs`, optional `firstTextMs`, and tool timings. Attempts for the same user message share its turn ID. Tool durations run from the bridge receiving a tool call to receiving its result. Remote durations include transport and aren't pure server execution times. A tool without a result has no duration.
|
|
759
759
|
|
|
760
760
|
Speech records also contain LiveKit's `speechId`. The bridge carries turn and attempt IDs in assistant message metadata so they can be joined after playback. Speech without a correlated assistant message, such as cancelled speech that produced no output, uses its speech ID as the turn ID and omits the attempt ID. Don't infer a correlation by matching event arrival order.
|
|
761
761
|
|
|
@@ -768,17 +768,17 @@ Speech records also contain LiveKit's `speechId`. The bridge carries turn and at
|
|
|
768
768
|
|
|
769
769
|
Missing measurements are `undefined`, not zero. Local generation durations use a monotonic clock. LiveKit's speech timing values are converted to milliseconds. When observability is configured, these records appear as events in the existing `voice call` trace. Pipeline metric events retain LiveKit's speech ID when supplied.
|
|
770
770
|
|
|
771
|
-
`onSpeechComplete` runs once when a speech handle finishes, or when the session closes with that speech pending. It supplies the speech metrics plus optional `playedText` and `transcriptSource`. Outcomes are `completed`, `interrupted`, `cancelled`, or `failed`. A completed speech lifecycle alone doesn't prove that audio was produced
|
|
771
|
+
`onSpeechComplete` runs once when a speech handle finishes, or when the session closes with that speech pending. It supplies the speech metrics plus optional `playedText` and `transcriptSource`. Outcomes are `completed`, `interrupted`, `cancelled`, or `failed`. A completed speech lifecycle alone doesn't prove that audio was produced. Check whether the relevant audio measurements are present.
|
|
772
772
|
|
|
773
773
|
The measurement source is `server-playout`. LiveKit's committed transcript can be partial or estimated, depending on the output's synchronization support. It doesn't prove that the remote browser or phone listener heard every word. `transcriptSource: 'unavailable'` means no committed assistant transcript was available.
|
|
774
774
|
|
|
775
|
-
Keep using `onTurnComplete` for its existing generation contract. It can fire before speech playback finishes, with `interrupted: false`, even when the caller interrupts the audio later. Use `onSpeechComplete` for playback outcomes. Existing agent memory may already contain generated text
|
|
775
|
+
Keep using `onTurnComplete` for its existing generation contract. It can fire before speech playback finishes, with `interrupted: false`, even when the caller interrupts the audio later. Use `onSpeechComplete` for playback outcomes. Existing agent memory may already contain generated text, and adding this hook doesn't change that persistence behavior.
|
|
776
776
|
|
|
777
777
|
For a session you own, call `observeVoiceSession(session, { onTurnMetrics, onSpeechComplete })` from `@mastra/livekit/worker` or `@mastra/livekit/plugin` before `session.start()`. Its return value detaches the observer and finalizes pending speech as cancelled. The worker attaches its observer automatically.
|
|
778
778
|
|
|
779
779
|
### Speech segment boundaries
|
|
780
780
|
|
|
781
|
-
The built-in agent, remote, and workflow reply generators preserve text-segment and tool-step boundaries. Tool feedback is flushed after its text is queued, so an acknowledgment can reach text-to-speech while a tool is still running. A flush requests a segment boundary
|
|
781
|
+
The built-in agent, remote, and workflow reply generators preserve text-segment and tool-step boundaries. Tool feedback is flushed after its text is queued, so an acknowledgment can reach text-to-speech while a tool is still running. A flush requests a segment boundary. It doesn't guarantee immediate audio from every speech provider.
|
|
782
782
|
|
|
783
783
|
Custom generators can continue returning string streams. To emit an explicit boundary, return a `ReadableStream<VoiceReplyChunk>` and enqueue `VOICE_TEXT_FLUSH`, both exported from `@mastra/livekit/worker` and `@mastra/livekit/plugin`. Consumers that read a reply generator directly must distinguish strings from boundary objects. Never concatenate a boundary object into a transcript.
|
|
784
784
|
|
|
@@ -817,7 +817,7 @@ LiveKit's guidance on sizing, graceful shutdown, and hosting applies unchanged.
|
|
|
817
817
|
|
|
818
818
|
A LiveKit voice session involves three pieces:
|
|
819
819
|
|
|
820
|
-
1. Your Mastra server
|
|
820
|
+
1. Your Mastra server creates a LiveKit access token and dispatches your agent into a room. The dispatch carries metadata such as the Mastra agent id, memory thread, and resource.
|
|
821
821
|
2. A LiveKit agent worker (a separate long-running process) receives the job and runs the audio pipeline. Audio flows between the browser and the worker over WebRTC and never passes through your Mastra HTTP server.
|
|
822
822
|
3. Each time the user finishes a turn, the worker calls the Mastra agent's `stream()` with the new input and speaks the streamed text. When the user interrupts, LiveKit cancels the stream and Mastra stops generating.
|
|
823
823
|
|
|
@@ -832,13 +832,13 @@ Conversation history lives in Mastra Memory, so voice sessions and text chat can
|
|
|
832
832
|
|
|
833
833
|
## Upgrade to 0.5.0
|
|
834
834
|
|
|
835
|
-
The 0.5.0 prerelease requires LiveKit Agents 1.7.1 or newer within 1.x. The speech helpers use `FlushSentinel` and `SpeechHandle.exception()`, which are absent in Agents 1.4.0. Test the supplied prerelease version or package archive before deploying it.
|
|
835
|
+
The 0.5.0 prerelease requires LiveKit Agents 1.7.1 or newer within 1.x. The speech helpers use `FlushSentinel` and `SpeechHandle.exception()`, which are absent in Agents 1.4.0. Test the supplied prerelease version or package archive before deploying it. Note that updating a dependency range doesn't update an existing lockfile, so check the installed versions after installation.
|
|
836
836
|
|
|
837
837
|
If you used `client.getLiveKitRecording(traceId)` in an earlier snapshot, switch to `getLiveKitRecording(client, traceId)` from `@mastra/livekit/client`. Import `LiveKitRecordingResponse` from the same entry point instead of `GetLiveKitRecordingResponse` from client-js.
|
|
838
838
|
|
|
839
839
|
### Authorize recording access
|
|
840
840
|
|
|
841
|
-
Before upgrading an application that registers `liveKitRecordingRoute()`, add an `authorize({ traceId, context })` callback that checks the authenticated user's access to the requested trace. The callback is required even when `requiresAuth: false
|
|
841
|
+
Before upgrading an application that registers `liveKitRecordingRoute()`, add an `authorize({ traceId, context })` callback that checks the authenticated user's access to the requested trace. The callback is required even when `requiresAuth: false`. Omitting it throws during route registration. Return `true` only to allow access, before trace lookup or playback URL resolution. See [Review recordings in Studio](#review-recordings-in-studio) for the setup example.
|
|
842
842
|
|
|
843
843
|
### Install compatible packages
|
|
844
844
|
|
|
@@ -878,7 +878,7 @@ yarn add ./mastra-livekit-0.5.0-next.0.tgz @livekit/agents@1.7.1 @livekit/agents
|
|
|
878
878
|
bun add ./mastra-livekit-0.5.0-next.0.tgz @livekit/agents@1.7.1 @livekit/agents-plugin-livekit@1.7.1 @livekit/agents-plugin-silero@1.7.1 @livekit/rtc-node@0.13.34 livekit-server-sdk@2.16.0
|
|
879
879
|
```
|
|
880
880
|
|
|
881
|
-
Replace the archive path with the supplied prerelease. Install any other `@livekit/agents-plugin-*` packages at the matching release. Agents 1.7.1 and Silero 1.7.1 require RTC `^0.13.34
|
|
881
|
+
Replace the archive path with the supplied prerelease. Install any other `@livekit/agents-plugin-*` packages at the matching release. Agents 1.7.1 and Silero 1.7.1 require RTC `^0.13.34`. RTC 1.x doesn't satisfy that requirement. Don't override peer dependency errors to install it.
|
|
882
882
|
|
|
883
883
|
Keep Node.js 22.13 or newer. Both `@mastra/livekit` and Agents require Zod `^3.25.76 || ^4.1.8`. Upgrade older Zod versions before installing 0.5.0. Verify the installed dependency tree and initialize the worker's models:
|
|
884
884
|
|
|
@@ -935,7 +935,7 @@ The default still loads the Silero plugin during prewarm. The `'english'` and `'
|
|
|
935
935
|
Mastra tools continue to run through the Mastra agent. If you also implement LiveKit tools or a custom LiveKit plugin, account for the changes since Agents 1.4:
|
|
936
936
|
|
|
937
937
|
- `ToolContext` is a class. Use its accessors and `flatten()` instead of enumerating or mutating it as a plain object.
|
|
938
|
-
- Named tool lists and duplicate-name checks are supported. Object shorthand with anonymous tools remains supported
|
|
938
|
+
- Named tool lists and duplicate-name checks are supported. Object shorthand with anonymous tools remains supported. Converting every tool map isn't required.
|
|
939
939
|
- Provider tools use subclasses of `ProviderTool` instead of the older `ProviderDefinedTool` API.
|
|
940
940
|
|
|
941
941
|
See the [LiveKit tool API](https://github.com/livekit/agents-js/blob/main/agents/src/llm/tool_context.ts) for custom plugin migration details.
|
|
@@ -1058,7 +1058,7 @@ Starts the LiveKit worker CLI (`dev`, `start`, and `connect` subcommands) for a
|
|
|
1058
1058
|
|
|
1059
1059
|
### `pipeAgentReplyToWriter()`
|
|
1060
1060
|
|
|
1061
|
-
Streams a Mastra agent's reply into a workflow step's `writer` on the workflow reply path. It forwards the agent's text deltas, so text-to-speech starts before the full reply is ready, and its tool-call chunks, so `toolFeedback` fires and `onTurnComplete` sees the tool list. Piping only `stream.textStream` silently drops tool calls. Pass the step's `abortSignal` to `agent.stream()` so barge-in stops generation
|
|
1061
|
+
Streams a Mastra agent's reply into a workflow step's `writer` on the workflow reply path. It forwards the agent's text deltas, so text-to-speech starts before the full reply is ready, and its tool-call chunks, so `toolFeedback` fires and `onTurnComplete` sees the tool list. Piping only `stream.textStream` silently drops tool calls. Pass the step's `abortSignal` to `agent.stream()` so barge-in stops generation right away.
|
|
1062
1062
|
|
|
1063
1063
|
```typescript
|
|
1064
1064
|
import { pipeAgentReplyToWriter } from '@mastra/livekit'
|
|
@@ -1194,7 +1194,7 @@ Provide exactly one reply source: `remote`, `agent`, or `generate`.
|
|
|
1194
1194
|
|
|
1195
1195
|
**onTurnComplete** (`(ctx: VoiceTurnCompleteContext) => void | Promise<void>`): Called once per turn after the reply finished streaming, off the audio path and not awaited. The context carries the produced reply: text, toolCalls, interrupted, and usage.
|
|
1196
1196
|
|
|
1197
|
-
> **Warning:** Don't combine `memory` with the session's `preemptiveGeneration` option, which LiveKit enables by default in sessions you build yourself. A speculative turn persists a partial user message and a partial, never-spoken reply to the thread before LiveKit discards it. Set `turnHandling: { preemptiveGeneration: { enabled: false } }` on the session, or set `memory.options.readOnly` and persist committed turns yourself
|
|
1197
|
+
> **Warning:** Don't combine `memory` with the session's `preemptiveGeneration` option, which LiveKit enables by default in sessions you build yourself. A speculative turn persists a partial user message and a partial, never-spoken reply to the thread before LiveKit discards it. Set `turnHandling: { preemptiveGeneration: { enabled: false } }` on the session, or set `memory.options.readOnly` and persist committed turns yourself. See [preemptive generation with memory](#preemptive-generation-with-memory). Stateless mode (no `memory`) works with preemptive generation.
|
|
1198
1198
|
|
|
1199
1199
|
#### Tools run on the Mastra agent
|
|
1200
1200
|
|
|
@@ -1212,7 +1212,7 @@ When the user interrupts a reply:
|
|
|
1212
1212
|
|
|
1213
1213
|
1. The plugin cancels the stream. The server aborts generation and persists nothing from that turn.
|
|
1214
1214
|
2. LiveKit records the part the user actually heard in its chat context, flagged as interrupted.
|
|
1215
|
-
3. On the next turn, the plugin re-sends that heard-only fragment, ordered before the new user message,
|
|
1215
|
+
3. On the next turn, the plugin re-sends that heard-only fragment, ordered before the new user message, which backfills the memory thread to match the call. Messages carry LiveKit's message ids and the server deduplicates by id, so retries and re-sends stay idempotent.
|
|
1216
1216
|
|
|
1217
1217
|
A user who hangs up immediately after interrupting leaves that final fragment unrecorded. When the transcript must capture it, reconcile immediately from the session event; the shared message id means the next turn's re-send upserts instead of duplicating:
|
|
1218
1218
|
|
|
@@ -1401,7 +1401,7 @@ With `createLiveKitWorker()`, set `configuration: { endCall: {} }` and the worke
|
|
|
1401
1401
|
|
|
1402
1402
|
### `liveKitConnectionRoute()`
|
|
1403
1403
|
|
|
1404
|
-
Returns an [API route](https://mastra.ai/docs/server/custom-api-routes) that
|
|
1404
|
+
Returns an [API route](https://mastra.ai/docs/server/custom-api-routes) that creates a LiveKit access token with the voice agent dispatched into the room. Frontends call it to join a session.
|
|
1405
1405
|
|
|
1406
1406
|
```typescript
|
|
1407
1407
|
import { Mastra } from '@mastra/core/mastra'
|
|
@@ -204,7 +204,7 @@ voice.connect()
|
|
|
204
204
|
|
|
205
205
|
**speaker** (`string`): Default voice ID for speech synthesis. (Default: `'alloy'`)
|
|
206
206
|
|
|
207
|
-
#### Voice
|
|
207
|
+
#### Voice activity detection (VAD) configuration
|
|
208
208
|
|
|
209
209
|
**type** (`string`): Type of VAD to use. Server-side VAD provides better accuracy. (Default: `'server_vad'`)
|
|
210
210
|
|
|
@@ -318,7 +318,7 @@ The OpenAIRealtimeVoice class emits the following events:
|
|
|
318
318
|
|
|
319
319
|
**error** (`event`): Emitted when an error occurs. Callback receives the error object.
|
|
320
320
|
|
|
321
|
-
#### OpenAI Realtime
|
|
321
|
+
#### OpenAI Realtime events
|
|
322
322
|
|
|
323
323
|
Every server event received from the OpenAI Realtime API is also emitted with the `openAIRealtime:` prefix, using the [OpenAI server event type](https://platform.openai.com/docs/api-reference/realtime-server-events) as the suffix. The callback receives the complete event payload.
|
|
324
324
|
|
|
@@ -328,7 +328,7 @@ voice.on('openAIRealtime:rate_limits.updated', event => {
|
|
|
328
328
|
})
|
|
329
329
|
```
|
|
330
330
|
|
|
331
|
-
#### Socket
|
|
331
|
+
#### Socket events
|
|
332
332
|
|
|
333
333
|
**open** (`event`): Emitted when the WebSocket connection to OpenAI opens.
|
|
334
334
|
|
|
@@ -354,5 +354,5 @@ The following voice options are available:
|
|
|
354
354
|
- Server-side Voice Activity Detection (VAD) provides better accuracy for speech detection
|
|
355
355
|
- All audio data is processed as Int16Array format
|
|
356
356
|
- The voice instance must be connected with `connect()` before using other methods
|
|
357
|
-
- Always call `close()` when done to
|
|
357
|
+
- Always call `close()` when done to clean up resources
|
|
358
358
|
- Memory management is handled by OpenAI Realtime API
|
|
@@ -90,7 +90,7 @@ This method isn't supported by Speechify and will throw an error. Speechify does
|
|
|
90
90
|
- The default model is 'simba-3.5', Speechify's recommended model: 48 languages on one id, and every catalog voice speaks all of them
|
|
91
91
|
- 'simba-3.2' is English only; a non-English voice returns an error
|
|
92
92
|
- 'simba-3.0' covers English, German, Spanish, French, Italian and Portuguese
|
|
93
|
-
- 'simba-english' and 'simba-multilingual' are legacy ids. New workspaces get a 'model_retired' error, and from 2026-11-21 they
|
|
93
|
+
- 'simba-english' and 'simba-multilingual' are legacy ids. New workspaces get a 'model_retired' error, and from 2026-11-21 they're served by 'simba-3.2' and 'simba-3.5'
|
|
94
94
|
- The default speaker follows the configured model: 'harper_32' for the Simba 3 models, otherwise 'george'
|
|
95
95
|
- Speech-to-text functionality isn't supported
|
|
96
96
|
- Additional audio stream options can be passed through the speak() method's options parameter
|