@mastra/mcp-docs-server 0.0.0-bundle-recursion-20251030002519 → 0.0.0-bundle-version-20260121091645
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/organized/changelogs/%40internal%2Fchangeset-cli.md +1 -15
- package/.docs/organized/changelogs/%40internal%2Fexternal-types.md +1 -7
- package/.docs/organized/changelogs/%40internal%2Fplayground.md +60 -0
- package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +201 -1
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +1 -55
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +368 -168
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +362 -162
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fauth.md +52 -0
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +701 -191
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +400 -200
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +596 -191
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +629 -190
- package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +235 -0
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +502 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +376 -176
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +360 -160
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +377 -177
- package/.docs/organized/changelogs/%40mastra%2Fduckdb.md +112 -0
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +575 -197
- package/.docs/organized/changelogs/%40mastra%2Felasticsearch.md +133 -0
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +211 -11
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +64 -0
- package/.docs/organized/changelogs/%40mastra%2Flance.md +621 -191
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +788 -192
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +336 -136
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +384 -184
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +576 -178
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +729 -196
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +670 -191
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +231 -31
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +913 -167
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +248 -48
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +376 -176
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +204 -4
- package/.docs/organized/changelogs/%40mastra%2Frag.md +414 -214
- package/.docs/organized/changelogs/%40mastra%2Freact.md +358 -158
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +101 -0
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +220 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +363 -163
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +640 -193
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +107 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +183 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +201 -1
- package/.docs/organized/changelogs/create-mastra.md +291 -91
- package/.docs/organized/changelogs/mastra.md +365 -165
- package/.docs/organized/code-examples/a2a.md +6 -4
- package/.docs/organized/code-examples/agent-v6.md +221 -0
- package/.docs/organized/code-examples/agui.md +16 -12
- package/.docs/organized/code-examples/ai-elements.md +4 -4
- package/.docs/organized/code-examples/ai-sdk-useChat.md +16 -22
- package/.docs/organized/code-examples/ai-sdk-v5.md +9 -6
- package/.docs/organized/code-examples/assistant-ui.md +7 -7
- package/.docs/organized/code-examples/bird-checker-with-express.md +7 -6
- package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +8 -7
- package/.docs/organized/code-examples/bird-checker-with-nextjs.md +8 -7
- package/.docs/organized/code-examples/client-side-tools.md +6 -5
- package/.docs/organized/code-examples/crypto-chatbot.md +7 -7
- package/.docs/organized/code-examples/experimental-auth-weather-agent.md +9 -178
- package/.docs/organized/code-examples/fireworks-r1.md +5 -5
- package/.docs/organized/code-examples/heads-up-game.md +8 -5
- package/.docs/organized/code-examples/inngest.md +1075 -0
- package/.docs/organized/code-examples/mcp-configuration.md +6 -7
- package/.docs/organized/code-examples/mcp-registry-registry.md +3 -2
- package/.docs/organized/code-examples/mcp-server-adapters.md +720 -0
- package/.docs/organized/code-examples/memory-per-resource-example.md +7 -5
- package/.docs/organized/code-examples/memory-todo-agent.md +2 -1
- package/.docs/organized/code-examples/memory-with-context.md +3 -2
- package/.docs/organized/code-examples/memory-with-libsql.md +4 -2
- package/.docs/organized/code-examples/memory-with-mongodb.md +4 -2
- package/.docs/organized/code-examples/memory-with-pg.md +4 -2
- package/.docs/organized/code-examples/memory-with-processors.md +15 -10
- package/.docs/organized/code-examples/memory-with-upstash.md +5 -3
- package/.docs/organized/code-examples/openapi-spec-writer.md +36 -35
- package/.docs/organized/code-examples/processors-with-ai-sdk.md +14 -0
- package/.docs/organized/code-examples/quick-start.md +8 -39
- package/.docs/organized/code-examples/server-app-access.md +342 -0
- package/.docs/organized/code-examples/server-express-adapter.md +87 -0
- package/.docs/organized/code-examples/server-fastify-adapter.md +83 -0
- package/.docs/organized/code-examples/server-hono-adapter.md +85 -0
- package/.docs/organized/code-examples/server-koa-adapter.md +94 -0
- package/.docs/organized/code-examples/stock-price-tool.md +27 -27
- package/.docs/organized/code-examples/weather-agent.md +21 -16
- package/.docs/organized/code-examples/workflow-ai-recruiter.md +5 -4
- package/.docs/organized/code-examples/workflow-with-inline-steps.md +11 -14
- package/.docs/organized/code-examples/workflow-with-memory.md +18 -17
- package/.docs/organized/code-examples/workflow-with-separate-steps.md +4 -4
- package/.docs/organized/code-examples/workflow-with-suspend-resume.md +5 -4
- package/.docs/raw/agents/adding-voice.mdx +92 -23
- package/.docs/raw/agents/agent-approval.mdx +386 -0
- package/.docs/raw/agents/agent-memory.mdx +53 -41
- package/.docs/raw/agents/guardrails.mdx +141 -68
- package/.docs/raw/agents/network-approval.mdx +281 -0
- package/.docs/raw/agents/networks.mdx +79 -19
- package/.docs/raw/agents/overview.mdx +69 -194
- package/.docs/raw/agents/processors.mdx +496 -0
- package/.docs/raw/agents/structured-output.mdx +294 -0
- package/.docs/raw/agents/using-tools.mdx +86 -22
- package/.docs/raw/community/contributing-templates.mdx +1 -1
- package/.docs/raw/community/discord.mdx +2 -2
- package/.docs/raw/community/licensing.mdx +1 -1
- package/.docs/raw/course/01-first-agent/04-project-structure.md +2 -0
- package/.docs/raw/course/01-first-agent/05-running-playground.md +5 -5
- package/.docs/raw/course/01-first-agent/07-creating-your-agent.md +1 -2
- package/.docs/raw/course/01-first-agent/08-exporting-your-agent.md +2 -1
- package/.docs/raw/course/01-first-agent/09-testing-your-agent.md +3 -3
- package/.docs/raw/course/01-first-agent/12-connecting-tool-to-agent.md +1 -1
- package/.docs/raw/course/01-first-agent/13-testing-your-tool.md +3 -3
- package/.docs/raw/course/01-first-agent/15-installing-memory.md +1 -1
- package/.docs/raw/course/01-first-agent/16-adding-memory-to-agent.md +3 -3
- package/.docs/raw/course/01-first-agent/17-testing-memory.md +2 -2
- package/.docs/raw/course/02-agent-tools-mcp/04-initializing-mcp-tools.md +2 -2
- package/.docs/raw/course/02-agent-tools-mcp/05-updating-your-agent.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/10-updating-agent-instructions-zapier.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/16-updating-agent-instructions-github.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/21-updating-agent-instructions-hackernews.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/27-updating-agent-instructions-filesystem.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/31-enhancing-memory-configuration.md +5 -3
- package/.docs/raw/course/02-agent-tools-mcp/32-conclusion.md +1 -1
- package/.docs/raw/course/03-agent-memory/03-installing-memory.md +1 -1
- package/.docs/raw/course/03-agent-memory/04-creating-basic-memory-agent.md +2 -2
- package/.docs/raw/course/03-agent-memory/07-understanding-memory-threads.md +35 -0
- package/.docs/raw/course/03-agent-memory/08-configuring-conversation-history.md +1 -2
- package/.docs/raw/course/03-agent-memory/10-storage-configuration.md +2 -3
- package/.docs/raw/course/03-agent-memory/13-vector-store-configuration.md +3 -1
- package/.docs/raw/course/03-agent-memory/16-configuring-semantic-recall.md +6 -5
- package/.docs/raw/course/03-agent-memory/18-advanced-configuration-semantic-recall.md +2 -1
- package/.docs/raw/course/03-agent-memory/21-configuring-working-memory.md +5 -4
- package/.docs/raw/course/03-agent-memory/22-custom-working-memory-templates.md +4 -4
- package/.docs/raw/course/03-agent-memory/25-combining-memory-features.md +4 -4
- package/.docs/raw/course/03-agent-memory/27-creating-learning-assistant.md +4 -4
- package/.docs/raw/course/04-workflows/07-using-playground.md +1 -1
- package/.docs/raw/course/04-workflows/08-running-workflows-programmatically.md +2 -2
- package/.docs/raw/course/04-workflows/11-creating-an-ai-agent.md +2 -3
- package/.docs/raw/deployment/cloud-providers.mdx +22 -0
- package/.docs/raw/deployment/mastra-server.mdx +140 -0
- package/.docs/raw/deployment/monorepo.mdx +106 -42
- package/.docs/raw/deployment/overview.mdx +37 -50
- package/.docs/raw/deployment/web-framework.mdx +18 -20
- package/.docs/raw/deployment/workflow-runners.mdx +16 -0
- package/.docs/raw/evals/built-in-scorers.mdx +54 -0
- package/.docs/raw/{scorers → evals}/custom-scorers.mdx +68 -22
- package/.docs/raw/{scorers → evals}/overview.mdx +19 -20
- package/.docs/raw/evals/running-in-ci.mdx +113 -0
- package/.docs/raw/getting-started/{installation.mdx → manual-install.mdx} +30 -103
- package/.docs/raw/getting-started/mcp-docs-server.mdx +57 -32
- package/.docs/raw/getting-started/project-structure.mdx +4 -4
- package/.docs/raw/getting-started/start.mdx +88 -0
- package/.docs/raw/getting-started/studio.mdx +39 -56
- package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +151 -0
- package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +1581 -0
- package/.docs/raw/{frameworks/agentic-uis → guides/build-your-ui}/assistant-ui.mdx +75 -23
- package/.docs/raw/guides/build-your-ui/copilotkit.mdx +227 -0
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/amazon-ec2.mdx +13 -13
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/aws-lambda.mdx +18 -19
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/azure-app-services.mdx +7 -9
- package/.docs/raw/{deployment/serverless-platforms → guides/deployment}/cloudflare-deployer.mdx +10 -7
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/digital-ocean.mdx +22 -27
- package/.docs/raw/guides/deployment/index.mdx +32 -0
- package/.docs/raw/guides/deployment/inngest.mdx +673 -0
- package/.docs/raw/{deployment/serverless-platforms → guides/deployment}/netlify-deployer.mdx +52 -17
- package/.docs/raw/{deployment/serverless-platforms → guides/deployment}/vercel-deployer.mdx +10 -7
- package/.docs/raw/guides/getting-started/astro.mdx +441 -0
- package/.docs/raw/guides/getting-started/express.mdx +128 -0
- package/.docs/raw/guides/getting-started/hono.mdx +227 -0
- package/.docs/raw/guides/getting-started/next-js.mdx +388 -0
- package/.docs/raw/guides/getting-started/nuxt.mdx +505 -0
- package/.docs/raw/guides/getting-started/quickstart.mdx +97 -0
- package/.docs/raw/guides/getting-started/sveltekit.mdx +329 -0
- package/.docs/raw/guides/getting-started/vite-react.mdx +425 -0
- package/.docs/raw/guides/guide/ai-recruiter.mdx +263 -0
- package/.docs/raw/guides/guide/chef-michel.mdx +268 -0
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +450 -0
- package/.docs/raw/guides/guide/research-assistant.mdx +379 -0
- package/.docs/raw/guides/guide/stock-agent.mdx +183 -0
- package/.docs/raw/guides/guide/web-search.mdx +293 -0
- package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +421 -0
- package/.docs/raw/guides/index.mdx +10 -0
- package/.docs/raw/guides/migrations/agentnetwork.mdx +114 -0
- package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +119 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/_template.mdx +50 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +416 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/cli.mdx +62 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/client.mdx +363 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/deployment.mdx +42 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/evals.mdx +260 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/mastra.mdx +160 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/mcp.mdx +114 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +306 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/overview.mdx +120 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/processors.mdx +73 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/rag.mdx +47 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +596 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +180 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tracing.mdx +335 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/vectors.mdx +92 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/voice.mdx +39 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +353 -0
- package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +365 -0
- package/.docs/raw/index.mdx +9 -9
- package/.docs/raw/mastra-cloud/deployment.mdx +86 -0
- package/.docs/raw/mastra-cloud/observability.mdx +17 -25
- package/.docs/raw/mastra-cloud/overview.mdx +15 -49
- package/.docs/raw/mastra-cloud/setup.mdx +64 -0
- package/.docs/raw/mastra-cloud/studio.mdx +35 -0
- package/.docs/raw/mcp/overview.mdx +393 -0
- package/.docs/raw/mcp/publishing-mcp-server.mdx +142 -0
- package/.docs/raw/memory/memory-processors.mdx +273 -82
- package/.docs/raw/memory/message-history.mdx +72 -0
- package/.docs/raw/memory/overview.mdx +42 -76
- package/.docs/raw/memory/semantic-recall.mdx +77 -59
- package/.docs/raw/memory/storage.mdx +248 -0
- package/.docs/raw/memory/working-memory.mdx +41 -21
- package/.docs/raw/observability/logging.mdx +21 -20
- package/.docs/raw/observability/overview.mdx +37 -35
- package/.docs/raw/observability/tracing/bridges/otel.mdx +203 -0
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/arize.mdx +89 -24
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/braintrust.mdx +40 -20
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/cloud.mdx +34 -21
- package/.docs/raw/observability/tracing/exporters/datadog.mdx +175 -0
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/default.mdx +45 -28
- package/.docs/raw/observability/tracing/exporters/laminar.mdx +89 -0
- package/.docs/raw/observability/tracing/exporters/langfuse.mdx +205 -0
- package/.docs/raw/observability/tracing/exporters/langsmith.mdx +121 -0
- package/.docs/raw/observability/tracing/exporters/otel.mdx +457 -0
- package/.docs/raw/observability/tracing/exporters/posthog.mdx +137 -0
- package/.docs/raw/observability/tracing/exporters/sentry.mdx +198 -0
- package/.docs/raw/observability/tracing/overview.mdx +1128 -0
- package/.docs/raw/observability/{ai-tracing → tracing}/processors/sensitive-data-filter.mdx +40 -20
- package/.docs/raw/rag/chunking-and-embedding.mdx +37 -49
- package/.docs/raw/rag/graph-rag.mdx +223 -0
- package/.docs/raw/rag/overview.mdx +11 -17
- package/.docs/raw/rag/retrieval.mdx +110 -97
- package/.docs/raw/rag/vector-databases.mdx +150 -29
- package/.docs/raw/reference/agents/agent.mdx +54 -50
- package/.docs/raw/reference/agents/generate.mdx +410 -146
- package/.docs/raw/reference/agents/generateLegacy.mdx +13 -11
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +24 -16
- package/.docs/raw/reference/agents/getDefaultOptions.mdx +71 -0
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +25 -17
- package/.docs/raw/reference/agents/getDescription.mdx +4 -2
- package/.docs/raw/reference/agents/getInstructions.mdx +12 -10
- package/.docs/raw/reference/agents/getLLM.mdx +14 -12
- package/.docs/raw/reference/agents/getMemory.mdx +13 -11
- package/.docs/raw/reference/agents/getModel.mdx +14 -12
- package/.docs/raw/reference/agents/getTools.mdx +11 -9
- package/.docs/raw/reference/agents/getVoice.mdx +12 -10
- package/.docs/raw/reference/agents/listAgents.mdx +13 -11
- package/.docs/raw/reference/agents/listScorers.mdx +71 -0
- package/.docs/raw/reference/agents/listTools.mdx +71 -0
- package/.docs/raw/reference/agents/listWorkflows.mdx +71 -0
- package/.docs/raw/reference/agents/network.mdx +134 -60
- package/.docs/raw/reference/ai-sdk/chat-route.mdx +130 -0
- package/.docs/raw/reference/ai-sdk/handle-chat-stream.mdx +119 -0
- package/.docs/raw/reference/ai-sdk/handle-network-stream.mdx +66 -0
- package/.docs/raw/reference/ai-sdk/handle-workflow-stream.mdx +118 -0
- package/.docs/raw/reference/ai-sdk/network-route.mdx +102 -0
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-stream.mdx +293 -0
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v4-messages.mdx +130 -0
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v5-messages.mdx +110 -0
- package/.docs/raw/reference/ai-sdk/with-mastra.mdx +122 -0
- package/.docs/raw/reference/ai-sdk/workflow-route.mdx +113 -0
- package/.docs/raw/reference/auth/auth0.mdx +9 -7
- package/.docs/raw/reference/auth/clerk.mdx +9 -7
- package/.docs/raw/reference/auth/firebase.mdx +12 -11
- package/.docs/raw/reference/auth/jwt.mdx +9 -7
- package/.docs/raw/reference/auth/supabase.mdx +9 -7
- package/.docs/raw/reference/auth/workos.mdx +9 -7
- package/.docs/raw/reference/cli/create-mastra.mdx +13 -11
- package/.docs/raw/reference/cli/mastra.mdx +72 -23
- package/.docs/raw/reference/client-js/agents.mdx +316 -86
- package/.docs/raw/reference/client-js/error-handling.mdx +4 -4
- package/.docs/raw/reference/client-js/logs.mdx +4 -2
- package/.docs/raw/reference/client-js/mastra-client.mdx +20 -18
- package/.docs/raw/reference/client-js/memory.mdx +116 -20
- package/.docs/raw/reference/client-js/observability.mdx +14 -12
- package/.docs/raw/reference/client-js/telemetry.mdx +3 -1
- package/.docs/raw/reference/client-js/tools.mdx +4 -2
- package/.docs/raw/reference/client-js/vectors.mdx +3 -1
- package/.docs/raw/reference/client-js/workflows.mdx +132 -87
- package/.docs/raw/reference/configuration.mdx +761 -0
- package/.docs/raw/reference/core/addGateway.mdx +61 -0
- package/.docs/raw/reference/core/getAgent.mdx +4 -2
- package/.docs/raw/reference/core/getAgentById.mdx +4 -2
- package/.docs/raw/reference/core/getDeployer.mdx +4 -2
- package/.docs/raw/reference/core/getGateway.mdx +61 -0
- package/.docs/raw/reference/core/getGatewayById.mdx +64 -0
- package/.docs/raw/reference/core/getLogger.mdx +5 -3
- package/.docs/raw/reference/core/getMCPServer.mdx +34 -16
- package/.docs/raw/reference/core/getMCPServerById.mdx +83 -0
- package/.docs/raw/reference/core/getMemory.mdx +50 -9
- package/.docs/raw/reference/core/getScorer.mdx +6 -4
- package/.docs/raw/reference/core/getScorerById.mdx +81 -0
- package/.docs/raw/reference/core/getServer.mdx +7 -5
- package/.docs/raw/reference/core/getStorage.mdx +6 -4
- package/.docs/raw/reference/core/getStoredAgentById.mdx +185 -0
- package/.docs/raw/reference/core/getTelemetry.mdx +6 -4
- package/.docs/raw/reference/core/getVector.mdx +4 -2
- package/.docs/raw/reference/core/getWorkflow.mdx +4 -2
- package/.docs/raw/reference/core/{getAgents.mdx → listAgents.mdx} +8 -6
- package/.docs/raw/reference/core/listGateways.mdx +55 -0
- package/.docs/raw/reference/core/{getLogs.mdx → listLogs.mdx} +9 -7
- package/.docs/raw/reference/core/{getLogsByRunId.mdx → listLogsByRunId.mdx} +9 -7
- package/.docs/raw/reference/core/listMCPServers.mdx +67 -0
- package/.docs/raw/reference/core/listMemory.mdx +74 -0
- package/.docs/raw/reference/core/listScorers.mdx +45 -0
- package/.docs/raw/reference/core/listStoredAgents.mdx +153 -0
- package/.docs/raw/reference/core/{getVectors.mdx → listVectors.mdx} +8 -6
- package/.docs/raw/reference/core/{getWorkflows.mdx → listWorkflows.mdx} +8 -6
- package/.docs/raw/reference/core/mastra-class.mdx +47 -23
- package/.docs/raw/reference/core/mastra-model-gateway.mdx +229 -0
- package/.docs/raw/reference/core/setLogger.mdx +5 -3
- package/.docs/raw/reference/core/setStorage.mdx +8 -5
- package/.docs/raw/reference/deployer/cloudflare.mdx +24 -55
- package/.docs/raw/reference/deployer/deployer.mdx +3 -8
- package/.docs/raw/reference/deployer/netlify.mdx +6 -4
- package/.docs/raw/reference/deployer/vercel.mdx +8 -7
- package/.docs/raw/reference/evals/answer-relevancy.mdx +99 -128
- package/.docs/raw/reference/evals/answer-similarity.mdx +196 -0
- package/.docs/raw/reference/evals/bias.mdx +91 -112
- package/.docs/raw/reference/evals/completeness.mdx +93 -118
- package/.docs/raw/reference/evals/content-similarity.mdx +73 -117
- package/.docs/raw/reference/evals/context-precision.mdx +195 -137
- package/.docs/raw/reference/{scorers → evals}/context-relevance.mdx +19 -17
- package/.docs/raw/reference/{scorers → evals}/create-scorer.mdx +80 -63
- package/.docs/raw/reference/evals/faithfulness.mdx +94 -122
- package/.docs/raw/reference/evals/hallucination.mdx +89 -134
- package/.docs/raw/reference/evals/keyword-coverage.mdx +94 -126
- package/.docs/raw/reference/{scorers → evals}/mastra-scorer.mdx +9 -5
- package/.docs/raw/reference/{scorers → evals}/noise-sensitivity.mdx +22 -20
- package/.docs/raw/reference/evals/prompt-alignment.mdx +606 -182
- package/.docs/raw/reference/{scorers/run-experiment.mdx → evals/run-evals.mdx} +21 -20
- package/.docs/raw/reference/evals/scorer-utils.mdx +365 -0
- package/.docs/raw/reference/evals/textual-difference.mdx +80 -118
- package/.docs/raw/reference/evals/tone-consistency.mdx +80 -126
- package/.docs/raw/reference/{scorers → evals}/tool-call-accuracy.mdx +37 -33
- package/.docs/raw/reference/evals/toxicity.mdx +93 -97
- package/.docs/raw/reference/index.mdx +2 -0
- package/.docs/raw/reference/{observability/logging → logging}/pino-logger.mdx +12 -10
- package/.docs/raw/reference/memory/clone-utilities.mdx +345 -0
- package/.docs/raw/reference/memory/cloneThread.mdx +237 -0
- package/.docs/raw/reference/memory/createThread.mdx +7 -5
- package/.docs/raw/reference/memory/deleteMessages.mdx +10 -8
- package/.docs/raw/reference/memory/getThreadById.mdx +4 -2
- package/.docs/raw/reference/memory/listThreads.mdx +187 -0
- package/.docs/raw/reference/memory/memory-class.mdx +38 -29
- package/.docs/raw/reference/memory/{query.mdx → recall.mdx} +60 -61
- package/.docs/raw/reference/observability/tracing/bridges/otel.mdx +181 -0
- package/.docs/raw/reference/observability/tracing/configuration.mdx +292 -0
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/arize.mdx +66 -18
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/braintrust.mdx +35 -11
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/cloud-exporter.mdx +32 -20
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/console-exporter.mdx +53 -18
- package/.docs/raw/reference/observability/tracing/exporters/datadog.mdx +172 -0
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/default-exporter.mdx +53 -42
- package/.docs/raw/reference/observability/tracing/exporters/laminar.mdx +139 -0
- package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +184 -0
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/langsmith.mdx +38 -9
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/otel.mdx +87 -80
- package/.docs/raw/reference/observability/tracing/exporters/posthog.mdx +153 -0
- package/.docs/raw/reference/observability/tracing/exporters/sentry.mdx +224 -0
- package/.docs/raw/reference/observability/tracing/instances.mdx +166 -0
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/interfaces.mdx +165 -94
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/processors/sensitive-data-filter.mdx +6 -4
- package/.docs/raw/reference/observability/{ai-tracing/span.mdx → tracing/spans.mdx} +60 -44
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +22 -18
- package/.docs/raw/reference/processors/language-detector.mdx +41 -37
- package/.docs/raw/reference/processors/message-history-processor.mdx +134 -0
- package/.docs/raw/reference/processors/moderation-processor.mdx +66 -35
- package/.docs/raw/reference/processors/pii-detector.mdx +67 -37
- package/.docs/raw/reference/processors/processor-interface.mdx +805 -0
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +40 -35
- package/.docs/raw/reference/processors/semantic-recall-processor.mdx +202 -0
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +38 -36
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +80 -40
- package/.docs/raw/reference/processors/tool-call-filter.mdx +127 -0
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +26 -19
- package/.docs/raw/reference/processors/working-memory-processor.mdx +224 -0
- package/.docs/raw/reference/rag/chunk.mdx +7 -13
- package/.docs/raw/reference/rag/database-config.mdx +12 -10
- package/.docs/raw/reference/rag/document.mdx +3 -1
- package/.docs/raw/reference/rag/embeddings.mdx +8 -6
- package/.docs/raw/reference/rag/extract-params.mdx +58 -4
- package/.docs/raw/reference/rag/graph-rag.mdx +3 -1
- package/.docs/raw/reference/rag/metadata-filters.mdx +32 -9
- package/.docs/raw/reference/rag/rerank.mdx +4 -3
- package/.docs/raw/reference/rag/rerankWithScorer.mdx +3 -2
- package/.docs/raw/reference/server/create-route.mdx +330 -0
- package/.docs/raw/reference/server/express-adapter.mdx +221 -0
- package/.docs/raw/reference/server/fastify-adapter.mdx +130 -0
- package/.docs/raw/reference/server/hono-adapter.mdx +204 -0
- package/.docs/raw/reference/server/koa-adapter.mdx +129 -0
- package/.docs/raw/reference/server/mastra-server.mdx +334 -0
- package/.docs/raw/reference/server/routes.mdx +313 -0
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +44 -2
- package/.docs/raw/reference/storage/cloudflare.mdx +13 -3
- package/.docs/raw/reference/storage/composite.mdx +245 -0
- package/.docs/raw/reference/storage/convex.mdx +166 -0
- package/.docs/raw/reference/storage/dynamodb.mdx +135 -13
- package/.docs/raw/reference/storage/lance.mdx +40 -3
- package/.docs/raw/reference/storage/libsql.mdx +92 -31
- package/.docs/raw/reference/storage/mongodb.mdx +149 -11
- package/.docs/raw/reference/storage/mssql.mdx +53 -6
- package/.docs/raw/{server-db/storage.mdx → reference/storage/overview.mdx} +15 -90
- package/.docs/raw/reference/storage/postgresql.mdx +268 -80
- package/.docs/raw/reference/storage/upstash.mdx +80 -3
- package/.docs/raw/reference/streaming/ChunkType.mdx +33 -5
- package/.docs/raw/reference/streaming/agents/MastraModelOutput.mdx +68 -7
- package/.docs/raw/reference/streaming/agents/stream.mdx +126 -156
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +11 -9
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +13 -13
- package/.docs/raw/reference/streaming/workflows/{resumeStreamVNext.mdx → resumeStream.mdx} +60 -18
- package/.docs/raw/reference/streaming/workflows/stream.mdx +112 -38
- package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +172 -0
- package/.docs/raw/reference/templates/overview.mdx +6 -8
- package/.docs/raw/reference/tools/client.mdx +5 -3
- package/.docs/raw/reference/tools/create-tool.mdx +306 -36
- package/.docs/raw/reference/tools/document-chunker-tool.mdx +3 -1
- package/.docs/raw/reference/tools/graph-rag-tool.mdx +59 -22
- package/.docs/raw/reference/tools/mcp-client.mdx +248 -31
- package/.docs/raw/reference/tools/mcp-server.mdx +442 -56
- package/.docs/raw/reference/tools/vector-query-tool.mdx +106 -42
- package/.docs/raw/reference/vectors/astra.mdx +6 -4
- package/.docs/raw/reference/vectors/chroma.mdx +87 -5
- package/.docs/raw/reference/vectors/convex.mdx +431 -0
- package/.docs/raw/reference/vectors/couchbase.mdx +39 -24
- package/.docs/raw/reference/vectors/duckdb.mdx +464 -0
- package/.docs/raw/reference/vectors/elasticsearch.mdx +318 -0
- package/.docs/raw/reference/vectors/lance.mdx +45 -27
- package/.docs/raw/reference/vectors/libsql.mdx +102 -15
- package/.docs/raw/reference/vectors/mongodb.mdx +133 -14
- package/.docs/raw/reference/vectors/opensearch.mdx +68 -20
- package/.docs/raw/reference/vectors/pg.mdx +105 -43
- package/.docs/raw/reference/vectors/pinecone.mdx +90 -8
- package/.docs/raw/reference/vectors/qdrant.mdx +185 -6
- package/.docs/raw/reference/vectors/s3vectors.mdx +10 -8
- package/.docs/raw/reference/vectors/turbopuffer.mdx +81 -5
- package/.docs/raw/reference/vectors/upstash.mdx +62 -7
- package/.docs/raw/reference/vectors/vectorize.mdx +6 -4
- package/.docs/raw/reference/voice/azure.mdx +98 -81
- package/.docs/raw/reference/voice/cloudflare.mdx +3 -1
- package/.docs/raw/reference/voice/composite-voice.mdx +76 -29
- package/.docs/raw/reference/voice/deepgram.mdx +3 -1
- package/.docs/raw/reference/voice/elevenlabs.mdx +3 -1
- package/.docs/raw/reference/voice/google-gemini-live.mdx +6 -3
- package/.docs/raw/reference/voice/google.mdx +162 -21
- package/.docs/raw/reference/voice/mastra-voice.mdx +3 -1
- package/.docs/raw/reference/voice/murf.mdx +3 -1
- package/.docs/raw/reference/voice/openai-realtime.mdx +6 -3
- package/.docs/raw/reference/voice/openai.mdx +3 -1
- package/.docs/raw/reference/voice/playai.mdx +3 -1
- package/.docs/raw/reference/voice/sarvam.mdx +3 -1
- package/.docs/raw/reference/voice/speechify.mdx +3 -1
- package/.docs/raw/reference/voice/voice.addInstructions.mdx +6 -4
- package/.docs/raw/reference/voice/voice.addTools.mdx +8 -5
- package/.docs/raw/reference/voice/voice.answer.mdx +6 -2
- package/.docs/raw/reference/voice/voice.close.mdx +5 -2
- package/.docs/raw/reference/voice/voice.connect.mdx +7 -3
- package/.docs/raw/reference/voice/voice.events.mdx +3 -1
- package/.docs/raw/reference/voice/voice.getSpeakers.mdx +4 -1
- package/.docs/raw/reference/voice/voice.listen.mdx +93 -53
- package/.docs/raw/reference/voice/voice.off.mdx +4 -2
- package/.docs/raw/reference/voice/voice.on.mdx +7 -3
- package/.docs/raw/reference/voice/voice.send.mdx +6 -2
- package/.docs/raw/reference/voice/voice.speak.mdx +82 -41
- package/.docs/raw/reference/voice/voice.updateConfig.mdx +4 -2
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +59 -9
- package/.docs/raw/reference/workflows/run-methods/restart.mdx +142 -0
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +63 -17
- package/.docs/raw/reference/workflows/run-methods/start.mdx +68 -22
- package/.docs/raw/reference/workflows/run-methods/startAsync.mdx +145 -0
- package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +312 -0
- package/.docs/raw/reference/workflows/run.mdx +38 -15
- package/.docs/raw/reference/workflows/step.mdx +73 -7
- package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +5 -3
- package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +4 -2
- package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +45 -14
- package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +4 -2
- package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +4 -2
- package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +72 -5
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +80 -3
- package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +4 -2
- package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +5 -7
- package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +5 -7
- package/.docs/raw/reference/workflows/workflow-methods/then.mdx +4 -2
- package/.docs/raw/reference/workflows/workflow.mdx +207 -11
- package/.docs/raw/{auth → server/auth}/auth0.mdx +47 -28
- package/.docs/raw/{auth → server/auth}/clerk.mdx +42 -21
- package/.docs/raw/{auth → server/auth}/firebase.mdx +54 -32
- package/.docs/raw/{auth → server/auth}/index.mdx +9 -7
- package/.docs/raw/{auth → server/auth}/jwt.mdx +29 -17
- package/.docs/raw/{auth → server/auth}/supabase.mdx +52 -32
- package/.docs/raw/{auth → server/auth}/workos.mdx +48 -29
- package/.docs/raw/server/custom-adapters.mdx +396 -0
- package/.docs/raw/{server-db → server}/custom-api-routes.mdx +11 -11
- package/.docs/raw/{server-db → server}/mastra-client.mdx +41 -44
- package/.docs/raw/server/mastra-server.mdx +86 -0
- package/.docs/raw/{server-db → server}/middleware.mdx +43 -41
- package/.docs/raw/server/request-context.mdx +235 -0
- package/.docs/raw/server/server-adapters.mdx +410 -0
- package/.docs/raw/streaming/events.mdx +18 -9
- package/.docs/raw/streaming/overview.mdx +52 -28
- package/.docs/raw/streaming/tool-streaming.mdx +75 -33
- package/.docs/raw/streaming/workflow-streaming.mdx +15 -21
- package/.docs/raw/tools-mcp/advanced-usage.mdx +11 -9
- package/.docs/raw/tools-mcp/mcp-overview.mdx +72 -27
- package/.docs/raw/tools-mcp/overview.mdx +21 -20
- package/.docs/raw/voice/overview.mdx +124 -42
- package/.docs/raw/voice/speech-to-speech.mdx +14 -7
- package/.docs/raw/voice/speech-to-text.mdx +8 -4
- package/.docs/raw/voice/text-to-speech.mdx +7 -4
- package/.docs/raw/workflows/agents-and-tools.mdx +73 -26
- package/.docs/raw/workflows/control-flow.mdx +697 -134
- package/.docs/raw/workflows/error-handling.mdx +198 -42
- package/.docs/raw/workflows/human-in-the-loop.mdx +161 -210
- package/.docs/raw/workflows/input-data-mapping.mdx +11 -9
- package/.docs/raw/workflows/overview.mdx +202 -83
- package/.docs/raw/workflows/snapshots.mdx +28 -50
- package/.docs/raw/workflows/suspend-and-resume.mdx +125 -208
- package/.docs/raw/workflows/time-travel.mdx +317 -0
- package/.docs/raw/workflows/workflow-state.mdx +189 -0
- package/CHANGELOG.md +419 -4
- package/README.md +47 -2
- package/dist/{chunk-TUAHUTTB.js → chunk-4CM2BQNP.js} +27 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
- package/dist/prepare-docs/package-changes.d.ts.map +1 -1
- package/dist/prepare-docs/prepare.js +1 -1
- package/dist/prompts/migration.d.ts +6 -0
- package/dist/prompts/migration.d.ts.map +1 -0
- package/dist/stdio.js +1107 -40
- package/dist/tools/course.d.ts.map +1 -1
- package/dist/tools/embedded-docs.d.ts +276 -0
- package/dist/tools/embedded-docs.d.ts.map +1 -0
- package/dist/tools/migration.d.ts +40 -0
- package/dist/tools/migration.d.ts.map +1 -0
- package/package.json +17 -17
- package/.docs/raw/deployment/cloud-providers/index.mdx +0 -55
- package/.docs/raw/deployment/server-deployment.mdx +0 -81
- package/.docs/raw/deployment/serverless-platforms/index.mdx +0 -55
- package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +0 -671
- package/.docs/raw/frameworks/agentic-uis/cedar-os.mdx +0 -123
- package/.docs/raw/frameworks/agentic-uis/copilotkit.mdx +0 -382
- package/.docs/raw/frameworks/agentic-uis/openrouter.mdx +0 -176
- package/.docs/raw/frameworks/servers/express.mdx +0 -209
- package/.docs/raw/frameworks/web-frameworks/astro.mdx +0 -602
- package/.docs/raw/frameworks/web-frameworks/next-js.mdx +0 -379
- package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +0 -486
- package/.docs/raw/frameworks/web-frameworks/vite-react.mdx +0 -255
- package/.docs/raw/getting-started/templates.mdx +0 -65
- package/.docs/raw/mastra-cloud/dashboard.mdx +0 -100
- package/.docs/raw/mastra-cloud/setting-up.mdx +0 -105
- package/.docs/raw/memory/conversation-history.mdx +0 -23
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +0 -140
- package/.docs/raw/memory/storage/memory-with-pg.mdx +0 -138
- package/.docs/raw/memory/storage/memory-with-upstash.mdx +0 -146
- package/.docs/raw/memory/threads-and-resources.mdx +0 -95
- package/.docs/raw/observability/ai-tracing/exporters/langfuse.mdx +0 -122
- package/.docs/raw/observability/ai-tracing/exporters/langsmith.mdx +0 -88
- package/.docs/raw/observability/ai-tracing/exporters/otel.mdx +0 -263
- package/.docs/raw/observability/ai-tracing/overview.mdx +0 -812
- package/.docs/raw/observability/nextjs-tracing.mdx +0 -109
- package/.docs/raw/observability/otel-tracing.mdx +0 -189
- package/.docs/raw/reference/agents/getScorers.mdx +0 -69
- package/.docs/raw/reference/agents/getWorkflows.mdx +0 -69
- package/.docs/raw/reference/client-js/workflows-legacy.mdx +0 -143
- package/.docs/raw/reference/core/getMCPServers.mdx +0 -36
- package/.docs/raw/reference/core/getScorerByName.mdx +0 -78
- package/.docs/raw/reference/core/getScorers.mdx +0 -43
- package/.docs/raw/reference/core/setTelemetry.mdx +0 -36
- package/.docs/raw/reference/evals/context-position.mdx +0 -197
- package/.docs/raw/reference/evals/context-relevancy.mdx +0 -196
- package/.docs/raw/reference/evals/contextual-recall.mdx +0 -196
- package/.docs/raw/reference/evals/summarization.mdx +0 -212
- package/.docs/raw/reference/legacyWorkflows/after.mdx +0 -89
- package/.docs/raw/reference/legacyWorkflows/afterEvent.mdx +0 -79
- package/.docs/raw/reference/legacyWorkflows/commit.mdx +0 -33
- package/.docs/raw/reference/legacyWorkflows/createRun.mdx +0 -76
- package/.docs/raw/reference/legacyWorkflows/else.mdx +0 -68
- package/.docs/raw/reference/legacyWorkflows/events.mdx +0 -305
- package/.docs/raw/reference/legacyWorkflows/execute.mdx +0 -110
- package/.docs/raw/reference/legacyWorkflows/if.mdx +0 -108
- package/.docs/raw/reference/legacyWorkflows/resume.mdx +0 -158
- package/.docs/raw/reference/legacyWorkflows/resumeWithEvent.mdx +0 -133
- package/.docs/raw/reference/legacyWorkflows/snapshots.mdx +0 -207
- package/.docs/raw/reference/legacyWorkflows/start.mdx +0 -87
- package/.docs/raw/reference/legacyWorkflows/step-class.mdx +0 -100
- package/.docs/raw/reference/legacyWorkflows/step-condition.mdx +0 -137
- package/.docs/raw/reference/legacyWorkflows/step-function.mdx +0 -93
- package/.docs/raw/reference/legacyWorkflows/step-options.mdx +0 -69
- package/.docs/raw/reference/legacyWorkflows/step-retries.mdx +0 -196
- package/.docs/raw/reference/legacyWorkflows/suspend.mdx +0 -70
- package/.docs/raw/reference/legacyWorkflows/then.mdx +0 -72
- package/.docs/raw/reference/legacyWorkflows/until.mdx +0 -168
- package/.docs/raw/reference/legacyWorkflows/watch.mdx +0 -124
- package/.docs/raw/reference/legacyWorkflows/while.mdx +0 -168
- package/.docs/raw/reference/legacyWorkflows/workflow.mdx +0 -234
- package/.docs/raw/reference/memory/getThreadsByResourceId.mdx +0 -79
- package/.docs/raw/reference/memory/getThreadsByResourceIdPaginated.mdx +0 -110
- package/.docs/raw/reference/observability/ai-tracing/ai-tracing.mdx +0 -186
- package/.docs/raw/reference/observability/ai-tracing/configuration.mdx +0 -238
- package/.docs/raw/reference/observability/ai-tracing/exporters/langfuse.mdx +0 -116
- package/.docs/raw/reference/observability/otel-tracing/otel-config.mdx +0 -117
- package/.docs/raw/reference/observability/otel-tracing/providers/arize-ax.mdx +0 -81
- package/.docs/raw/reference/observability/otel-tracing/providers/arize-phoenix.mdx +0 -121
- package/.docs/raw/reference/observability/otel-tracing/providers/braintrust.mdx +0 -40
- package/.docs/raw/reference/observability/otel-tracing/providers/dash0.mdx +0 -40
- package/.docs/raw/reference/observability/otel-tracing/providers/index.mdx +0 -20
- package/.docs/raw/reference/observability/otel-tracing/providers/keywordsai.mdx +0 -73
- package/.docs/raw/reference/observability/otel-tracing/providers/laminar.mdx +0 -41
- package/.docs/raw/reference/observability/otel-tracing/providers/langfuse.mdx +0 -84
- package/.docs/raw/reference/observability/otel-tracing/providers/langsmith.mdx +0 -48
- package/.docs/raw/reference/observability/otel-tracing/providers/langwatch.mdx +0 -43
- package/.docs/raw/reference/observability/otel-tracing/providers/new-relic.mdx +0 -40
- package/.docs/raw/reference/observability/otel-tracing/providers/signoz.mdx +0 -40
- package/.docs/raw/reference/observability/otel-tracing/providers/traceloop.mdx +0 -40
- package/.docs/raw/reference/scorers/answer-relevancy.mdx +0 -227
- package/.docs/raw/reference/scorers/answer-similarity.mdx +0 -439
- package/.docs/raw/reference/scorers/bias.mdx +0 -228
- package/.docs/raw/reference/scorers/completeness.mdx +0 -214
- package/.docs/raw/reference/scorers/content-similarity.mdx +0 -197
- package/.docs/raw/reference/scorers/context-precision.mdx +0 -352
- package/.docs/raw/reference/scorers/faithfulness.mdx +0 -241
- package/.docs/raw/reference/scorers/hallucination.mdx +0 -252
- package/.docs/raw/reference/scorers/keyword-coverage.mdx +0 -229
- package/.docs/raw/reference/scorers/prompt-alignment.mdx +0 -668
- package/.docs/raw/reference/scorers/textual-difference.mdx +0 -203
- package/.docs/raw/reference/scorers/tone-consistency.mdx +0 -211
- package/.docs/raw/reference/scorers/toxicity.mdx +0 -228
- package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +0 -47
- package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +0 -153
- package/.docs/raw/reference/workflows/run-methods/watch.mdx +0 -73
- package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +0 -70
- package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +0 -66
- package/.docs/raw/scorers/evals-old-api/custom-eval.mdx +0 -24
- package/.docs/raw/scorers/evals-old-api/overview.mdx +0 -106
- package/.docs/raw/scorers/evals-old-api/running-in-ci.mdx +0 -85
- package/.docs/raw/scorers/evals-old-api/textual-evals.mdx +0 -58
- package/.docs/raw/scorers/off-the-shelf-scorers.mdx +0 -50
- package/.docs/raw/server-db/production-server.mdx +0 -89
- package/.docs/raw/server-db/runtime-context.mdx +0 -193
- package/.docs/raw/workflows/inngest-workflow.mdx +0 -363
- package/.docs/raw/workflows-legacy/control-flow.mdx +0 -774
- package/.docs/raw/workflows-legacy/dynamic-workflows.mdx +0 -239
- package/.docs/raw/workflows-legacy/error-handling.mdx +0 -187
- package/.docs/raw/workflows-legacy/nested-workflows.mdx +0 -360
- package/.docs/raw/workflows-legacy/overview.mdx +0 -182
- package/.docs/raw/workflows-legacy/runtime-variables.mdx +0 -156
- package/.docs/raw/workflows-legacy/steps.mdx +0 -115
- package/.docs/raw/workflows-legacy/suspend-and-resume.mdx +0 -406
- package/.docs/raw/workflows-legacy/variables.mdx +0 -318
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Overview"
|
|
3
|
+
description: "Guides on building with Mastra"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { CardGrid, CardGridItem } from "@site/src/components/CardGrid";
|
|
7
|
+
|
|
8
|
+
# Mastra Guides
|
|
9
|
+
|
|
10
|
+
Mastra offers a variety of guides to help you build and work with Mastra, from building agents and workflows to using the Mastra SDK and API, and implementing different UI frameworks. To find what you need, use the left-hand side navigation to browse by topic or use the search bar to look up specific implementation details, frameworks, or features.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Migration: AgentNetwork to .network() | Migration Guide"
|
|
3
|
+
description: "Learn how to migrate from AgentNetwork primitives to .network() in Mastra."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Migrate from AgentNetwork to `.network()`
|
|
7
|
+
|
|
8
|
+
As of `v0.20.0` for `@mastra/core`, the following changes apply.
|
|
9
|
+
|
|
10
|
+
### Upgrade from AI SDK v4 to v5
|
|
11
|
+
|
|
12
|
+
- Bump all your model provider packages by a major version.
|
|
13
|
+
|
|
14
|
+
:::note
|
|
15
|
+
|
|
16
|
+
This will ensure that they are all v5 models now.
|
|
17
|
+
|
|
18
|
+
:::
|
|
19
|
+
|
|
20
|
+
### Memory is required
|
|
21
|
+
|
|
22
|
+
- Memory is now required for the agent network to function properly.
|
|
23
|
+
|
|
24
|
+
:::note
|
|
25
|
+
|
|
26
|
+
You must configure memory for the agent.
|
|
27
|
+
|
|
28
|
+
:::
|
|
29
|
+
|
|
30
|
+
## Migration paths
|
|
31
|
+
|
|
32
|
+
If you were using the `AgentNetwork` primitive, you can replace the `AgentNetwork` with `Agent`.
|
|
33
|
+
|
|
34
|
+
Before:
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { AgentNetwork } from "@mastra/core/network";
|
|
38
|
+
|
|
39
|
+
const agent = new AgentNetwork({
|
|
40
|
+
name: "agent-network",
|
|
41
|
+
agents: [agent1, agent2],
|
|
42
|
+
tools: { tool1, tool2 },
|
|
43
|
+
model: "openai/gpt-5.1",
|
|
44
|
+
instructions:
|
|
45
|
+
"You are a network agent that can help users with a variety of tasks.",
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
await agent.stream("Find me the weather in Tokyo.");
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
After:
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import { Agent } from "@mastra/core/agent";
|
|
55
|
+
import { Memory } from "@mastra/memory";
|
|
56
|
+
|
|
57
|
+
const memory = new Memory();
|
|
58
|
+
|
|
59
|
+
const agent = new Agent({
|
|
60
|
+
id: "agent-network",
|
|
61
|
+
name: "agent-network",
|
|
62
|
+
agents: { agent1, agent2 },
|
|
63
|
+
tools: { tool1, tool2 },
|
|
64
|
+
model: "openai/gpt-5.1",
|
|
65
|
+
instructions:
|
|
66
|
+
"You are a network agent that can help users with a variety of tasks.",
|
|
67
|
+
memory,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
await agent.network("Find me the weather in Tokyo.");
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
If you were using the `NewAgentNetwork` primitive, you can replace the `NewAgentNetwork` with `Agent`.
|
|
74
|
+
|
|
75
|
+
Before:
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
import { NewAgentNetwork } from "@mastra/core/network/vnext";
|
|
79
|
+
|
|
80
|
+
const agent = new NewAgentNetwork({
|
|
81
|
+
id: "agent-network",
|
|
82
|
+
name: "agent-network",
|
|
83
|
+
agents: { agent1, agent2 },
|
|
84
|
+
workflows: { workflow1 },
|
|
85
|
+
tools: { tool1, tool2 },
|
|
86
|
+
model: "openai/gpt-5.1",
|
|
87
|
+
instructions:
|
|
88
|
+
"You are a network agent that can help users with a variety of tasks.",
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
await agent.loop("Find me the weather in Tokyo.");
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
After:
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
import { Agent } from "@mastra/core/agent";
|
|
98
|
+
import { Memory } from "@mastra/memory";
|
|
99
|
+
|
|
100
|
+
const memory = new Memory();
|
|
101
|
+
|
|
102
|
+
const agent = new Agent({
|
|
103
|
+
name: "agent-network",
|
|
104
|
+
agents: { agent1, agent2 },
|
|
105
|
+
workflows: { workflow1 },
|
|
106
|
+
tools: { tool1, tool2 },
|
|
107
|
+
model: "openai/gpt-5.1",
|
|
108
|
+
instructions:
|
|
109
|
+
"You are a network agent that can help users with a variety of tasks.",
|
|
110
|
+
memory,
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
await agent.network("Find me the weather in Tokyo.");
|
|
114
|
+
```
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Migration: AI SDK v4 to v5 | Migration Guide"
|
|
3
|
+
description: "Mastra-specific guidance for upgrading from AI SDK v4 to v5."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Migrate from AI SDK v4 to v5
|
|
7
|
+
|
|
8
|
+
Looking for integration docs? See [Using AI SDK](/guides/build-your-ui/ai-sdk-ui).
|
|
9
|
+
|
|
10
|
+
Follow the official [AI SDK v5 Migration Guide](https://v5.ai-sdk.dev/docs/migration-guides/migration-guide-5-0) for all AI SDK core breaking changes, package updates, and API changes.
|
|
11
|
+
|
|
12
|
+
This guide covers only the Mastra-specific aspects of the migration.
|
|
13
|
+
|
|
14
|
+
- **Data compatibility**: New data stored in v5 format will no longer work if you downgrade from v5 to v4
|
|
15
|
+
- **Backup recommendation**: Keep DB backups from before you upgrade to v5
|
|
16
|
+
|
|
17
|
+
### Memory and Storage
|
|
18
|
+
|
|
19
|
+
Mastra automatically handles AI SDK v4 data using its internal `MessageList` class, which manages format conversion—including v4 to v5. No database migrations are required; your existing messages are translated on the fly and continue working after you upgrade.
|
|
20
|
+
|
|
21
|
+
### Message Format Conversion
|
|
22
|
+
|
|
23
|
+
For cases where you need to manually convert messages between AI SDK and Mastra formats, use the `convertMessages()` utility:
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { convertMessages } from "@mastra/core/agent";
|
|
27
|
+
|
|
28
|
+
// Convert AI SDK v4 messages to v5
|
|
29
|
+
const aiv5Messages = convertMessages(aiv4Messages).to("AIV5.UI");
|
|
30
|
+
|
|
31
|
+
// Convert Mastra messages to AI SDK v5
|
|
32
|
+
const aiv5Messages = convertMessages(mastraMessages).to("AIV5.Core");
|
|
33
|
+
|
|
34
|
+
// Supported output formats:
|
|
35
|
+
// 'Mastra.V2', 'AIV4.UI', 'AIV5.UI', 'AIV5.Core', 'AIV5.Model'
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
This utility is helpful when you want to fetch messages directly from your storage DB and convert them for use in AI SDK.
|
|
39
|
+
|
|
40
|
+
### Type Inference for Tools
|
|
41
|
+
|
|
42
|
+
When using tools with TypeScript in AI SDK v5, Mastra provides type inference helpers to ensure type safety for your tool inputs and outputs.
|
|
43
|
+
|
|
44
|
+
#### `InferUITool`
|
|
45
|
+
|
|
46
|
+
The `InferUITool` type helper infers the input and output types of a single Mastra tool:
|
|
47
|
+
|
|
48
|
+
```typescript title="app/types.ts"
|
|
49
|
+
import { InferUITool, createTool } from "@mastra/core/tools";
|
|
50
|
+
import { z } from "zod";
|
|
51
|
+
|
|
52
|
+
const weatherTool = createTool({
|
|
53
|
+
id: "get-weather",
|
|
54
|
+
description: "Get the current weather",
|
|
55
|
+
inputSchema: z.object({
|
|
56
|
+
location: z.string().describe("The city and state"),
|
|
57
|
+
}),
|
|
58
|
+
outputSchema: z.object({
|
|
59
|
+
temperature: z.number(),
|
|
60
|
+
conditions: z.string(),
|
|
61
|
+
}),
|
|
62
|
+
execute: async (inputData) => {
|
|
63
|
+
return {
|
|
64
|
+
temperature: 72,
|
|
65
|
+
conditions: "sunny",
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Infer the types from the tool
|
|
71
|
+
type WeatherUITool = InferUITool<typeof weatherTool>;
|
|
72
|
+
// This creates:
|
|
73
|
+
// {
|
|
74
|
+
// input: { location: string };
|
|
75
|
+
// output: { temperature: number; conditions: string };
|
|
76
|
+
// }
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### `InferUITools`
|
|
80
|
+
|
|
81
|
+
The `InferUITools` type helper infers the input and output types of multiple tools:
|
|
82
|
+
|
|
83
|
+
```typescript title="app/mastra/tools.ts"
|
|
84
|
+
import { InferUITools, createTool } from "@mastra/core/tools";
|
|
85
|
+
import { z } from "zod";
|
|
86
|
+
|
|
87
|
+
// Using weatherTool from the previous example
|
|
88
|
+
const tools = {
|
|
89
|
+
weather: weatherTool,
|
|
90
|
+
calculator: createTool({
|
|
91
|
+
id: "calculator",
|
|
92
|
+
description: "Perform basic arithmetic",
|
|
93
|
+
inputSchema: z.object({
|
|
94
|
+
operation: z.enum(["add", "subtract", "multiply", "divide"]),
|
|
95
|
+
a: z.number(),
|
|
96
|
+
b: z.number(),
|
|
97
|
+
}),
|
|
98
|
+
outputSchema: z.object({
|
|
99
|
+
result: z.number(),
|
|
100
|
+
}),
|
|
101
|
+
execute: async (inputData) => {
|
|
102
|
+
// implementation...
|
|
103
|
+
return { result: 0 };
|
|
104
|
+
},
|
|
105
|
+
}),
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// Infer types from the tool set
|
|
109
|
+
export type MyUITools = InferUITools<typeof tools>;
|
|
110
|
+
// This creates:
|
|
111
|
+
// {
|
|
112
|
+
// weather: { input: { location: string }; output: { temperature: number; conditions: string } };
|
|
113
|
+
// calculator: { input: { operation: "add" | "subtract" | "multiply" | "divide"; a: number; b: number }; output: { result: number } };
|
|
114
|
+
// }
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
These type helpers provide full TypeScript support when using Mastra tools with AI SDK v5 UI components, ensuring type safety across your application.
|
|
118
|
+
|
|
119
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
This template is a styleguide on how to populate individual migration guides. Use this as guidance on how to structure files in this directory. You're not allowed to deviate from this structure.
|
|
2
|
+
|
|
3
|
+
Follow the `.cursor/rules/writing-documentation.mdc` instructions on how to write the prose content.
|
|
4
|
+
|
|
5
|
+
After you found all the changes that need to be documented, you should group them in two big groups: "Changed" and "Removed".
|
|
6
|
+
|
|
7
|
+
Example:
|
|
8
|
+
|
|
9
|
+
```md
|
|
10
|
+
## Changed
|
|
11
|
+
|
|
12
|
+
## Removed
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
All changes MUST go under these two sections.
|
|
16
|
+
|
|
17
|
+
Each change (be it "changed" or "removed") should be a h3 heading. You must follow that format exactly.
|
|
18
|
+
|
|
19
|
+
Example:
|
|
20
|
+
|
|
21
|
+
```md
|
|
22
|
+
## Changed
|
|
23
|
+
|
|
24
|
+
### `oldFunction` to `newFunction`
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Now that the headings are in place, you need to follow an EXACT structure for each change. You're not allowed to deviate from this structure.
|
|
28
|
+
|
|
29
|
+
Provide a brief description of the change in one or two sentences. Next, explain in one sentence why it was changed.
|
|
30
|
+
|
|
31
|
+
The third element of each change has to be the explanation how to migrate existing code to the new version. Keep it concise but clear, try not to cut too much information. Afterwards a code block MUST be provided using the "diff" syntax. Inside the code block you need to show a "before" and "after" example of the code that needs to be changed with that diff syntax.
|
|
32
|
+
|
|
33
|
+
Example:
|
|
34
|
+
|
|
35
|
+
````md
|
|
36
|
+
## Changed
|
|
37
|
+
|
|
38
|
+
### `oldFunction` to `newFunction`
|
|
39
|
+
|
|
40
|
+
The `oldFunction` has been renamed to `newFunction`. This change improves clarity and consistency across the API.
|
|
41
|
+
|
|
42
|
+
To migrate, replace all instances of `oldFunction` with `newFunction` in your codebase.
|
|
43
|
+
|
|
44
|
+
```diff
|
|
45
|
+
- const result = oldFunction(args);
|
|
46
|
+
+ const result = newFunction(args);
|
|
47
|
+
```
|
|
48
|
+
````
|
|
49
|
+
|
|
50
|
+
If the migration requires more steps than just a simple find-and-replace, you can add additional explanation before the code block. If it requires multiple steps, use a numbered list to explain each step clearly.
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Agent Class | v1 Migration Guide"
|
|
3
|
+
description: "Learn how to migrate Agent class changes when upgrading to v1."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent Class
|
|
7
|
+
|
|
8
|
+
The Agent class has been updated with reorganized voice methods, updated property access patterns, and streamlined streaming APIs.
|
|
9
|
+
|
|
10
|
+
## Changed
|
|
11
|
+
|
|
12
|
+
### `getAgents` to `listAgents`
|
|
13
|
+
|
|
14
|
+
The `mastra.getAgents()` method has been renamed to `mastra.listAgents()`. This change aligns with the naming convention used across the API where plural getter methods use the `list` prefix.
|
|
15
|
+
|
|
16
|
+
To migrate, replace all calls to `mastra.getAgents()` with `mastra.listAgents()`.
|
|
17
|
+
|
|
18
|
+
```diff
|
|
19
|
+
- const agents = mastra.getAgents();
|
|
20
|
+
+ const agents = mastra.listAgents();
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
:::tip[Codemod]
|
|
24
|
+
|
|
25
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
26
|
+
|
|
27
|
+
```shell
|
|
28
|
+
npx @mastra/codemod@latest v1/mastra-plural-apis .
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
:::
|
|
32
|
+
|
|
33
|
+
### `RuntimeContext` to `RequestContext`
|
|
34
|
+
|
|
35
|
+
The `RuntimeContext` class has been renamed to `RequestContext` throughout the codebase. This change provides clearer naming that better describes its purpose as request-specific data and aligns with web framework conventions.
|
|
36
|
+
|
|
37
|
+
To migrate, update all imports and parameter names from `RuntimeContext`/`runtimeContext` to `RequestContext`/`requestContext`.
|
|
38
|
+
|
|
39
|
+
```diff
|
|
40
|
+
- import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
41
|
+
+ import { RequestContext } from '@mastra/core/request-context';
|
|
42
|
+
|
|
43
|
+
- const runtimeContext = new RuntimeContext();
|
|
44
|
+
- runtimeContext.set('userTier', 'enterprise');
|
|
45
|
+
+ const requestContext = new RequestContext();
|
|
46
|
+
+ requestContext.set('userTier', 'enterprise');
|
|
47
|
+
|
|
48
|
+
- await agent.generate(messages, { runtimeContext });
|
|
49
|
+
+ await agent.generate(messages, { requestContext });
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
:::tip[Codemod]
|
|
53
|
+
|
|
54
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
55
|
+
|
|
56
|
+
```shell
|
|
57
|
+
npx @mastra/codemod@latest v1/runtime-context .
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
:::
|
|
61
|
+
|
|
62
|
+
### Direct property access to getter methods
|
|
63
|
+
|
|
64
|
+
Direct property access to `agent.llm`, `agent.tools`, and `agent.instructions` is deprecated. This change provides better encapsulation and consistency with the broader API design.
|
|
65
|
+
|
|
66
|
+
To migrate, replace property access with the corresponding getter methods.
|
|
67
|
+
|
|
68
|
+
```diff
|
|
69
|
+
- const llm = agent.llm;
|
|
70
|
+
- const tools = agent.tools;
|
|
71
|
+
- const instructions = agent.instructions;
|
|
72
|
+
+ const llm = agent.getLLM();
|
|
73
|
+
+ const tools = agent.getTools();
|
|
74
|
+
+ const instructions = agent.getInstructions();
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
:::tip[Codemod]
|
|
78
|
+
|
|
79
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
80
|
+
|
|
81
|
+
```shell
|
|
82
|
+
npx @mastra/codemod@latest v1/agent-property-access .
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
:::
|
|
86
|
+
|
|
87
|
+
### Voice methods moved to `agent.voice` namespace
|
|
88
|
+
|
|
89
|
+
Voice-related methods have been moved from the Agent class to the `agent.voice` namespace. This change provides better organization and clearer separation of concerns.
|
|
90
|
+
|
|
91
|
+
To migrate, update voice method calls to use the `agent.voice` namespace.
|
|
92
|
+
|
|
93
|
+
```diff
|
|
94
|
+
- await agent.speak('Hello');
|
|
95
|
+
- await agent.listen();
|
|
96
|
+
- const speakers = agent.getSpeakers();
|
|
97
|
+
+ await agent.voice.speak('Hello');
|
|
98
|
+
+ await agent.voice.listen();
|
|
99
|
+
+ const speakers = agent.voice.getSpeakers();
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
:::tip[Codemod]
|
|
103
|
+
|
|
104
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
105
|
+
|
|
106
|
+
```shell
|
|
107
|
+
npx @mastra/codemod@latest v1/agent-voice .
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
:::
|
|
111
|
+
|
|
112
|
+
### `agent.fetchMemory()` to `(await agent.getMemory()).recall()`
|
|
113
|
+
|
|
114
|
+
The `fetchMemory()` method has been replaced with a more explicit API. This change provides better clarity about the asynchronous nature of memory access.
|
|
115
|
+
|
|
116
|
+
To migrate, replace `fetchMemory()` calls with the new API.
|
|
117
|
+
|
|
118
|
+
```diff
|
|
119
|
+
- const messages = await agent.fetchMemory({ threadId: 'thread-123' });
|
|
120
|
+
+ const memory = await agent.getMemory();
|
|
121
|
+
+ const result = await memory.recall({ threadId: 'thread-123' });
|
|
122
|
+
+ const messages = result.messages;
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Processor method names from `get*` to `list*`
|
|
126
|
+
|
|
127
|
+
Agent processor methods have been renamed from `get*` to `list*` pattern for consistency with the broader API. This change aligns with the convention that `list*` methods return collections.
|
|
128
|
+
|
|
129
|
+
To migrate, update processor method names.
|
|
130
|
+
|
|
131
|
+
```diff
|
|
132
|
+
- const inputProcessors = await agent.getInputProcessors(runtimeContext);
|
|
133
|
+
- const outputProcessors = await agent.getOutputProcessors(runtimeContext);
|
|
134
|
+
+ const inputProcessors = await agent.listInputProcessors(requestContext);
|
|
135
|
+
+ const outputProcessors = await agent.listOutputProcessors(requestContext);
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
:::tip[Codemod]
|
|
139
|
+
|
|
140
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
141
|
+
|
|
142
|
+
```shell
|
|
143
|
+
npx @mastra/codemod@latest v1/agent-processor-methods .
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
:::
|
|
147
|
+
|
|
148
|
+
### Default options method renames for AI SDK versions
|
|
149
|
+
|
|
150
|
+
Default options methods have been renamed to clarify legacy (AI SDK v4) vs new (AI SDK v5+) APIs. This change helps developers understand which AI SDK version they're targeting.
|
|
151
|
+
|
|
152
|
+
To migrate, update method names based on which AI SDK version you're using.
|
|
153
|
+
|
|
154
|
+
```diff
|
|
155
|
+
// For legacy AI SDK v4
|
|
156
|
+
- const options = await agent.getDefaultGenerateOptions();
|
|
157
|
+
- const streamOptions = await agent.getDefaultStreamOptions();
|
|
158
|
+
+ const options = await agent.getDefaultGenerateOptionsLegacy();
|
|
159
|
+
+ const streamOptions = await agent.getDefaultStreamOptionsLegacy();
|
|
160
|
+
|
|
161
|
+
// For new AI SDK v5+ (default)
|
|
162
|
+
const streamOptions = await agent.getDefaultStreamOptions();
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### `modelSettings.abortSignal` to top-level `abortSignal`
|
|
166
|
+
|
|
167
|
+
The `abortSignal` option has been moved from `modelSettings` to the top level of stream/generate options. This change provides a clearer separation between model-specific settings and execution control.
|
|
168
|
+
|
|
169
|
+
To migrate, move `abortSignal` from `modelSettings` to the top level.
|
|
170
|
+
|
|
171
|
+
```diff
|
|
172
|
+
agent.stream('Hello', {
|
|
173
|
+
- modelSettings: {
|
|
174
|
+
- abortSignal: abortController.signal,
|
|
175
|
+
- },
|
|
176
|
+
+ abortSignal: abortController.signal,
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
:::tip[Codemod]
|
|
181
|
+
|
|
182
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
183
|
+
|
|
184
|
+
```shell
|
|
185
|
+
npx @mastra/codemod@latest v1/agent-abort-signal .
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
:::
|
|
189
|
+
|
|
190
|
+
### `output` to `structuredOutput.schema`
|
|
191
|
+
|
|
192
|
+
The deprecated `output` and `experimental_output` options have been removed. This change consolidates on a single, stable API for structured output.
|
|
193
|
+
|
|
194
|
+
To migrate, update from `output` or `experimental_output` to `structuredOutput.schema`.
|
|
195
|
+
|
|
196
|
+
```diff
|
|
197
|
+
agent.stream('Hello', {
|
|
198
|
+
- output: z.object({ result: z.string() }),
|
|
199
|
+
+ structuredOutput: {
|
|
200
|
+
+ schema: z.object({ result: z.string() }),
|
|
201
|
+
+ },
|
|
202
|
+
});
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Agent `id` field is now required
|
|
206
|
+
|
|
207
|
+
The `id` field is now required when creating an Agent. Previously, agents could be created without an explicit ID, but this is no longer supported.
|
|
208
|
+
|
|
209
|
+
To migrate, add an `id` field to all Agent configurations.
|
|
210
|
+
|
|
211
|
+
```diff
|
|
212
|
+
const agent = new Agent({
|
|
213
|
+
+ id: 'my-agent',
|
|
214
|
+
name: 'My Agent',
|
|
215
|
+
instructions: 'You are a helpful assistant',
|
|
216
|
+
model: 'openai/gpt-4',
|
|
217
|
+
});
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
The `id` can be the same as the `name`, or you can use a different identifier. The ID will be used when calling `mastra.getAgentById()` and must be unique within your Mastra instance.
|
|
221
|
+
|
|
222
|
+
```typescript
|
|
223
|
+
// Register agent with Mastra
|
|
224
|
+
const mastra = new Mastra({
|
|
225
|
+
agents: {
|
|
226
|
+
myAgent: agent, // key can differ from id
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
// Retrieve by ID
|
|
231
|
+
const agent = mastra.getAgentById('my-agent');
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Stream API responses now redact sensitive data
|
|
235
|
+
|
|
236
|
+
The Mastra server now automatically redacts sensitive information from agent stream responses. This prevents accidental exposure of system prompts, tool definitions, and API keys in `step-start`, `step-finish`, and `finish` stream chunks.
|
|
237
|
+
|
|
238
|
+
**What's redacted:**
|
|
239
|
+
- `request.body` containing LLM request payloads (system prompts, tool schemas)
|
|
240
|
+
- `metadata.request` in step results
|
|
241
|
+
- `output.steps[].request` in nested step data
|
|
242
|
+
|
|
243
|
+
This behavior is enabled by default. If you need access to the full request data (e.g., for debugging or internal services), you can disable redaction when using server adapters directly (e.g., `@mastra/hono` or `@mastra/express`).
|
|
244
|
+
|
|
245
|
+
## Removed
|
|
246
|
+
|
|
247
|
+
### `generateVNext` and `streamVNext` methods
|
|
248
|
+
|
|
249
|
+
The deprecated `generateVNext()` and `streamVNext()` methods have been removed. These methods were previously used for AI SDK v5+ compatibility but are now the standard implementation.
|
|
250
|
+
|
|
251
|
+
To migrate, use the standard `generate()` and `stream()` methods.
|
|
252
|
+
|
|
253
|
+
```diff
|
|
254
|
+
- const result = await agent.generateVNext('Hello');
|
|
255
|
+
- const stream = await agent.streamVNext('Hello');
|
|
256
|
+
+ const result = await agent.generate('Hello');
|
|
257
|
+
+ const stream = await agent.stream('Hello');
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
:::tip[Codemod]
|
|
261
|
+
|
|
262
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
263
|
+
|
|
264
|
+
```shell
|
|
265
|
+
npx @mastra/codemod@latest v1/agent-generate-stream-v-next .
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
:::
|
|
269
|
+
|
|
270
|
+
### `format` parameter from `stream()` and `generate()`
|
|
271
|
+
|
|
272
|
+
The `format` parameter has been removed from `agent.stream()` and `agent.generate()` methods. AI SDK stream transformations are now handled by the `@mastra/ai-sdk` package. This change improves tree-shaking by moving AI SDK-specific code to a dedicated package.
|
|
273
|
+
|
|
274
|
+
To migrate, use the `toAISdkStream()` function from `@mastra/ai-sdk` for AI SDK format conversion.
|
|
275
|
+
|
|
276
|
+
```diff
|
|
277
|
+
- const stream = await agent.stream(messages, {
|
|
278
|
+
- format: 'aisdk',
|
|
279
|
+
- });
|
|
280
|
+
|
|
281
|
+
+ import { toAISdkStream } from '@mastra/ai-sdk';
|
|
282
|
+
+
|
|
283
|
+
+ const stream = await agent.stream(messages);
|
|
284
|
+
+ const aiSdkStream = toAISdkStream(stream, { from: 'agent' });
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### `agent.toStep()` method
|
|
288
|
+
|
|
289
|
+
The `toStep()` method has been removed from the Agent class. Agents can now be added directly to workflow steps without explicit conversion.
|
|
290
|
+
|
|
291
|
+
To migrate, add agents directly to workflow steps. Workflows handle the transformation automatically.
|
|
292
|
+
|
|
293
|
+
```diff
|
|
294
|
+
- const step = agent.toStep();
|
|
295
|
+
- const workflow = new Workflow({
|
|
296
|
+
- steps: [step],
|
|
297
|
+
- });
|
|
298
|
+
|
|
299
|
+
+ const workflow = new Workflow({
|
|
300
|
+
+ steps: [agent],
|
|
301
|
+
+ });
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### `TMetrics` generic parameter from Agent
|
|
305
|
+
|
|
306
|
+
The `TMetrics` generic parameter has been removed from `AgentConfig` and the `Agent` constructor. Metrics/scorers are now configured using the scorers API instead of being part of the Agent type system.
|
|
307
|
+
|
|
308
|
+
To migrate, remove the `TMetrics` generic parameter and configure scorers using the new API.
|
|
309
|
+
|
|
310
|
+
```diff
|
|
311
|
+
- const agent = new Agent<AgentId, Tools, Metrics>({
|
|
312
|
+
+ const agent = new Agent<AgentId, Tools>({
|
|
313
|
+
// ...
|
|
314
|
+
});
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Tripwire response format changed
|
|
318
|
+
|
|
319
|
+
The tripwire response format has changed from separate `tripwire` and `tripwireReason` fields to a single `tripwire` object containing all related data.
|
|
320
|
+
|
|
321
|
+
To migrate, update your code to access tripwire data from the new object structure.
|
|
322
|
+
|
|
323
|
+
```diff
|
|
324
|
+
const result = await agent.generate('Hello');
|
|
325
|
+
|
|
326
|
+
- if (result.tripwire) {
|
|
327
|
+
- console.log(result.tripwireReason);
|
|
328
|
+
- }
|
|
329
|
+
+ if (result.tripwire) {
|
|
330
|
+
+ console.log(result.tripwire.reason);
|
|
331
|
+
+ // New fields available:
|
|
332
|
+
+ // result.tripwire.retry - whether this step should be retried
|
|
333
|
+
+ // result.tripwire.metadata - additional metadata from the processor
|
|
334
|
+
+ // result.tripwire.processorId - which processor triggered the tripwire
|
|
335
|
+
+ }
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
For streaming responses:
|
|
339
|
+
|
|
340
|
+
```diff
|
|
341
|
+
for await (const chunk of stream.fullStream) {
|
|
342
|
+
if (chunk.type === 'tripwire') {
|
|
343
|
+
- console.log(chunk.payload.tripwireReason);
|
|
344
|
+
+ console.log(chunk.payload.reason);
|
|
345
|
+
+ // New fields available:
|
|
346
|
+
+ // chunk.payload.retry
|
|
347
|
+
+ // chunk.payload.metadata
|
|
348
|
+
+ // chunk.payload.processorId
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
The step results now also include tripwire information:
|
|
354
|
+
|
|
355
|
+
```diff
|
|
356
|
+
const result = await agent.generate('Hello');
|
|
357
|
+
|
|
358
|
+
for (const step of result.steps) {
|
|
359
|
+
- // No tripwire info on steps
|
|
360
|
+
+ if (step.tripwire) {
|
|
361
|
+
+ console.log('Step was blocked:', step.tripwire.reason);
|
|
362
|
+
+ }
|
|
363
|
+
}
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### `prepareStep` messages format
|
|
367
|
+
|
|
368
|
+
The `prepareStep` callback now receives messages in `MastraDBMessage` format instead of AI SDK v5+ model message format. This change unifies `prepareStep` with the new `processInputStep` processor method, which runs at each step of the agentic loop.
|
|
369
|
+
|
|
370
|
+
If you need the old AI SDK v5+ format, use `messageList.get.all.aiV5.model()`:
|
|
371
|
+
|
|
372
|
+
```diff
|
|
373
|
+
agent.generate('Hello', {
|
|
374
|
+
prepareStep: async ({ messages, messageList }) => {
|
|
375
|
+
- // messages was AI SDK v5+ ModelMessage format
|
|
376
|
+
- console.log(messages[0].content);
|
|
377
|
+
+ // messages is now MastraDBMessage format
|
|
378
|
+
+ // Use messageList to get AI SDK v5+ format if needed:
|
|
379
|
+
+ const aiSdkMessages = messageList.get.all.aiV5.model();
|
|
380
|
+
|
|
381
|
+
return { toolChoice: 'auto' };
|
|
382
|
+
},
|
|
383
|
+
});
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
### `threadId` and `resourceId` to `memory` option
|
|
387
|
+
|
|
388
|
+
The `threadId` and `resourceId` options have been removed from `agent.stream()` and `agent.generate()`. Use the `memory` option instead, which provides a cleaner API for memory configuration.
|
|
389
|
+
|
|
390
|
+
To migrate, move `threadId` and `resourceId` into the `memory` option:
|
|
391
|
+
|
|
392
|
+
```diff
|
|
393
|
+
await agent.stream('Hello', {
|
|
394
|
+
- threadId: 'thread-123',
|
|
395
|
+
- resourceId: 'user-456',
|
|
396
|
+
+ memory: {
|
|
397
|
+
+ thread: 'thread-123',
|
|
398
|
+
+ resource: 'user-456',
|
|
399
|
+
+ },
|
|
400
|
+
});
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
The `memory` option also supports passing thread metadata when creating new threads:
|
|
404
|
+
|
|
405
|
+
```typescript
|
|
406
|
+
await agent.stream('Hello', {
|
|
407
|
+
memory: {
|
|
408
|
+
thread: {
|
|
409
|
+
id: 'thread-123',
|
|
410
|
+
title: 'Support conversation',
|
|
411
|
+
metadata: { category: 'billing' },
|
|
412
|
+
},
|
|
413
|
+
resource: 'user-456',
|
|
414
|
+
},
|
|
415
|
+
});
|
|
416
|
+
```
|