@mastra/mcp-docs-server 0.13.39 → 1.0.0-beta.0
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%2Fai-sdk-v4.md +1 -0
- package/.docs/organized/changelogs/%40internal%2Fchangeset-cli.md +0 -10
- package/.docs/organized/changelogs/%40internal%2Fexternal-types.md +0 -10
- package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +36 -36
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +0 -10
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +70 -70
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +40 -40
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fauth.md +4 -14
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +18 -18
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +199 -199
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +223 -223
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +190 -190
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +199 -199
- package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +7 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +214 -214
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +74 -74
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +67 -67
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +70 -70
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +67 -67
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +209 -209
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +191 -191
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +5 -13
- package/.docs/organized/changelogs/%40mastra%2Flance.md +182 -182
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +199 -199
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +58 -58
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +65 -65
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +228 -228
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +199 -199
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +206 -206
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +197 -197
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +217 -217
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Frag.md +61 -61
- package/.docs/organized/changelogs/%40mastra%2Freact.md +70 -70
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +9 -17
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +6 -30
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +206 -206
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +190 -190
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +18 -18
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +56 -56
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +56 -56
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +20 -20
- package/.docs/organized/changelogs/create-mastra.md +33 -33
- package/.docs/organized/changelogs/mastra.md +86 -86
- package/.docs/organized/code-examples/a2a.md +4 -2
- package/.docs/organized/code-examples/agui.md +12 -9
- package/.docs/organized/code-examples/ai-sdk-useChat.md +12 -18
- package/.docs/organized/code-examples/ai-sdk-v5.md +4 -2
- package/.docs/organized/code-examples/bird-checker-with-express.md +5 -4
- package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +4 -3
- package/.docs/organized/code-examples/bird-checker-with-nextjs.md +4 -3
- package/.docs/organized/code-examples/client-side-tools.md +1 -0
- package/.docs/organized/code-examples/crypto-chatbot.md +1 -1
- package/.docs/organized/code-examples/experimental-auth-weather-agent.md +8 -177
- package/.docs/organized/code-examples/fireworks-r1.md +2 -2
- package/.docs/organized/code-examples/heads-up-game.md +10 -7
- package/.docs/organized/code-examples/mcp-configuration.md +5 -3
- package/.docs/organized/code-examples/mcp-registry-registry.md +3 -2
- package/.docs/organized/code-examples/memory-per-resource-example.md +4 -2
- package/.docs/organized/code-examples/memory-todo-agent.md +1 -0
- package/.docs/organized/code-examples/memory-with-context.md +2 -1
- 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 +13 -8
- package/.docs/organized/code-examples/memory-with-upstash.md +5 -3
- package/.docs/organized/code-examples/openapi-spec-writer.md +32 -41
- package/.docs/organized/code-examples/quick-start.md +5 -32
- package/.docs/organized/code-examples/stock-price-tool.md +6 -5
- package/.docs/organized/code-examples/weather-agent.md +21 -16
- package/.docs/organized/code-examples/workflow-ai-recruiter.md +3 -2
- package/.docs/organized/code-examples/workflow-with-inline-steps.md +9 -12
- package/.docs/organized/code-examples/workflow-with-memory.md +16 -15
- package/.docs/organized/code-examples/workflow-with-separate-steps.md +2 -2
- package/.docs/organized/code-examples/workflow-with-suspend-resume.md +3 -2
- package/.docs/raw/agents/adding-voice.mdx +27 -22
- package/.docs/raw/agents/agent-memory.mdx +23 -15
- package/.docs/raw/agents/guardrails.mdx +33 -12
- package/.docs/raw/agents/networks.mdx +8 -4
- package/.docs/raw/agents/overview.mdx +21 -15
- package/.docs/raw/agents/using-tools.mdx +11 -8
- package/.docs/raw/auth/auth0.mdx +8 -8
- package/.docs/raw/auth/clerk.mdx +6 -6
- package/.docs/raw/auth/firebase.mdx +8 -8
- package/.docs/raw/auth/index.mdx +6 -6
- package/.docs/raw/auth/jwt.mdx +6 -6
- package/.docs/raw/auth/supabase.mdx +7 -7
- package/.docs/raw/auth/workos.mdx +8 -8
- package/.docs/raw/community/contributing-templates.mdx +3 -3
- package/.docs/raw/community/discord.mdx +1 -1
- package/.docs/raw/course/01-first-agent/08-exporting-your-agent.md +2 -1
- package/.docs/raw/course/01-first-agent/16-adding-memory-to-agent.md +2 -1
- package/.docs/raw/course/02-agent-tools-mcp/31-enhancing-memory-configuration.md +2 -0
- package/.docs/raw/course/03-agent-memory/04-creating-basic-memory-agent.md +1 -0
- 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 +2 -0
- package/.docs/raw/course/03-agent-memory/16-configuring-semantic-recall.md +2 -0
- package/.docs/raw/course/03-agent-memory/18-advanced-configuration-semantic-recall.md +1 -0
- package/.docs/raw/course/03-agent-memory/21-configuring-working-memory.md +2 -0
- package/.docs/raw/course/03-agent-memory/22-custom-working-memory-templates.md +1 -0
- package/.docs/raw/course/03-agent-memory/25-combining-memory-features.md +1 -0
- package/.docs/raw/course/03-agent-memory/27-creating-learning-assistant.md +1 -0
- package/.docs/raw/course/04-workflows/08-running-workflows-programmatically.md +2 -2
- package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +5 -5
- package/.docs/raw/deployment/cloud-providers/aws-lambda.mdx +7 -5
- package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +3 -3
- package/.docs/raw/deployment/cloud-providers/digital-ocean.mdx +4 -4
- package/.docs/raw/deployment/cloud-providers/index.mdx +11 -8
- package/.docs/raw/deployment/monorepo.mdx +2 -2
- package/.docs/raw/deployment/overview.mdx +2 -2
- package/.docs/raw/deployment/server-deployment.mdx +2 -10
- package/.docs/raw/deployment/serverless-platforms/cloudflare-deployer.mdx +4 -4
- package/.docs/raw/deployment/serverless-platforms/index.mdx +10 -7
- package/.docs/raw/deployment/serverless-platforms/netlify-deployer.mdx +4 -4
- package/.docs/raw/deployment/serverless-platforms/vercel-deployer.mdx +4 -4
- package/.docs/raw/deployment/web-framework.mdx +8 -8
- package/.docs/raw/{scorers → evals}/custom-scorers.mdx +6 -6
- package/.docs/raw/evals/off-the-shelf-scorers.mdx +50 -0
- package/.docs/raw/{scorers → evals}/overview.mdx +8 -8
- package/.docs/raw/evals/running-in-ci.mdx +113 -0
- package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +22 -21
- package/.docs/raw/frameworks/agentic-uis/copilotkit.mdx +8 -8
- package/.docs/raw/frameworks/agentic-uis/openrouter.mdx +3 -0
- package/.docs/raw/frameworks/servers/express.mdx +10 -9
- package/.docs/raw/frameworks/web-frameworks/astro.mdx +6 -6
- package/.docs/raw/frameworks/web-frameworks/next-js.mdx +3 -3
- package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +4 -4
- package/.docs/raw/frameworks/web-frameworks/vite-react.mdx +2 -2
- package/.docs/raw/getting-started/installation.mdx +13 -12
- package/.docs/raw/getting-started/mcp-docs-server.mdx +1 -1
- package/.docs/raw/getting-started/project-structure.mdx +4 -4
- package/.docs/raw/getting-started/studio.mdx +8 -8
- package/.docs/raw/getting-started/templates.mdx +1 -1
- package/.docs/raw/guides/guide/ai-recruiter.mdx +264 -0
- package/.docs/raw/guides/guide/chef-michel.mdx +271 -0
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +450 -0
- package/.docs/raw/guides/guide/research-assistant.mdx +389 -0
- package/.docs/raw/guides/guide/stock-agent.mdx +185 -0
- package/.docs/raw/guides/guide/web-search.mdx +291 -0
- package/.docs/raw/guides/index.mdx +43 -0
- package/.docs/raw/guides/migrations/agentnetwork.mdx +114 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/_template.mdx +50 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +265 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/cli.mdx +48 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/client.mdx +153 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/evals.mdx +230 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/mastra.mdx +171 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/mcp.mdx +114 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +241 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/overview.mdx +83 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/processors.mdx +62 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +270 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +115 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tracing.mdx +280 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/vectors.mdx +23 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/voice.mdx +39 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +178 -0
- package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +367 -0
- package/.docs/raw/index.mdx +9 -9
- package/.docs/raw/{observability/logging.mdx → logging.mdx} +4 -4
- package/.docs/raw/mastra-cloud/dashboard.mdx +2 -2
- package/.docs/raw/mastra-cloud/observability.mdx +6 -6
- package/.docs/raw/mastra-cloud/overview.mdx +2 -2
- package/.docs/raw/mastra-cloud/setting-up.mdx +4 -4
- package/.docs/raw/memory/conversation-history.mdx +1 -0
- package/.docs/raw/memory/memory-processors.mdx +4 -3
- package/.docs/raw/memory/overview.mdx +9 -5
- package/.docs/raw/memory/semantic-recall.mdx +12 -7
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +10 -5
- package/.docs/raw/memory/storage/memory-with-pg.mdx +9 -4
- package/.docs/raw/memory/storage/memory-with-upstash.mdx +9 -4
- package/.docs/raw/memory/threads-and-resources.mdx +11 -13
- package/.docs/raw/memory/working-memory.mdx +30 -14
- package/.docs/raw/observability/overview.mdx +13 -30
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/arize.mdx +10 -18
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/braintrust.mdx +7 -16
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/cloud.mdx +11 -17
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/default.mdx +16 -20
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/langfuse.mdx +7 -16
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/langsmith.mdx +7 -16
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/otel.mdx +9 -18
- package/.docs/raw/observability/{ai-tracing → tracing}/overview.mdx +107 -142
- package/.docs/raw/observability/{ai-tracing → tracing}/processors/sensitive-data-filter.mdx +14 -13
- package/.docs/raw/rag/chunking-and-embedding.mdx +5 -5
- package/.docs/raw/rag/overview.mdx +3 -13
- package/.docs/raw/rag/retrieval.mdx +24 -12
- package/.docs/raw/rag/vector-databases.mdx +7 -1
- package/.docs/raw/reference/agents/agent.mdx +33 -28
- package/.docs/raw/reference/agents/generate.mdx +10 -10
- package/.docs/raw/reference/agents/generateLegacy.mdx +8 -8
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +21 -15
- package/.docs/raw/reference/agents/getDefaultOptions.mdx +69 -0
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +22 -16
- package/.docs/raw/reference/agents/getDescription.mdx +1 -1
- package/.docs/raw/reference/agents/getInstructions.mdx +8 -8
- package/.docs/raw/reference/agents/getLLM.mdx +9 -9
- package/.docs/raw/reference/agents/getMemory.mdx +9 -9
- package/.docs/raw/reference/agents/getModel.mdx +10 -10
- package/.docs/raw/reference/agents/getVoice.mdx +8 -8
- package/.docs/raw/reference/agents/listAgents.mdx +9 -9
- package/.docs/raw/reference/agents/listScorers.mdx +7 -7
- package/.docs/raw/reference/agents/listTools.mdx +7 -7
- package/.docs/raw/reference/agents/listWorkflows.mdx +7 -7
- package/.docs/raw/reference/agents/network.mdx +11 -10
- package/.docs/raw/reference/auth/auth0.mdx +4 -4
- package/.docs/raw/reference/auth/clerk.mdx +4 -4
- package/.docs/raw/reference/auth/firebase.mdx +6 -6
- package/.docs/raw/reference/auth/jwt.mdx +4 -4
- package/.docs/raw/reference/auth/supabase.mdx +4 -4
- package/.docs/raw/reference/auth/workos.mdx +4 -4
- package/.docs/raw/reference/cli/mastra.mdx +7 -7
- package/.docs/raw/reference/client-js/agents.mdx +6 -2
- package/.docs/raw/reference/client-js/mastra-client.mdx +7 -7
- package/.docs/raw/reference/client-js/memory.mdx +24 -16
- package/.docs/raw/reference/client-js/observability.mdx +11 -11
- package/.docs/raw/reference/client-js/workflows.mdx +6 -34
- package/.docs/raw/reference/core/getAgent.mdx +1 -1
- package/.docs/raw/reference/core/getAgentById.mdx +1 -1
- package/.docs/raw/reference/core/getDeployer.mdx +2 -2
- package/.docs/raw/reference/core/getLogger.mdx +2 -2
- package/.docs/raw/reference/core/getMCPServer.mdx +31 -15
- package/.docs/raw/reference/core/getMCPServerById.mdx +81 -0
- package/.docs/raw/reference/core/getScorer.mdx +3 -3
- package/.docs/raw/reference/core/getScorerById.mdx +79 -0
- package/.docs/raw/reference/core/getServer.mdx +2 -2
- package/.docs/raw/reference/core/getStorage.mdx +2 -2
- package/.docs/raw/reference/core/getTelemetry.mdx +2 -2
- package/.docs/raw/reference/core/getVector.mdx +2 -2
- package/.docs/raw/reference/core/getWorkflow.mdx +1 -1
- package/.docs/raw/reference/core/listAgents.mdx +1 -1
- package/.docs/raw/reference/core/listLogs.mdx +2 -2
- package/.docs/raw/reference/core/listLogsByRunId.mdx +2 -2
- package/.docs/raw/reference/core/listMCPServers.mdx +65 -0
- package/.docs/raw/reference/core/listScorers.mdx +3 -3
- package/.docs/raw/reference/core/listVectors.mdx +36 -0
- package/.docs/raw/reference/core/listWorkflows.mdx +6 -6
- package/.docs/raw/reference/core/mastra-class.mdx +3 -2
- package/.docs/raw/reference/core/setLogger.mdx +2 -2
- package/.docs/raw/reference/core/setStorage.mdx +3 -2
- package/.docs/raw/reference/core/setTelemetry.mdx +2 -2
- package/.docs/raw/reference/deployer/cloudflare.mdx +2 -2
- package/.docs/raw/reference/deployer/deployer.mdx +0 -6
- package/.docs/raw/reference/deployer/netlify.mdx +2 -2
- package/.docs/raw/reference/deployer/vercel.mdx +3 -3
- package/.docs/raw/reference/evals/answer-relevancy.mdx +164 -126
- package/.docs/raw/reference/{scorers → evals}/answer-similarity.mdx +27 -27
- package/.docs/raw/reference/evals/bias.mdx +149 -115
- package/.docs/raw/reference/evals/completeness.mdx +148 -117
- package/.docs/raw/reference/evals/content-similarity.mdx +126 -113
- package/.docs/raw/reference/evals/context-precision.mdx +290 -133
- package/.docs/raw/reference/{scorers → evals}/context-relevance.mdx +6 -6
- package/.docs/raw/reference/{scorers → evals}/create-scorer.mdx +11 -11
- package/.docs/raw/reference/evals/faithfulness.mdx +163 -121
- package/.docs/raw/reference/evals/hallucination.mdx +159 -132
- package/.docs/raw/reference/evals/keyword-coverage.mdx +169 -125
- package/.docs/raw/reference/{scorers → evals}/mastra-scorer.mdx +5 -5
- package/.docs/raw/reference/{scorers → evals}/noise-sensitivity.mdx +9 -9
- package/.docs/raw/reference/evals/prompt-alignment.mdx +604 -182
- package/.docs/raw/reference/{scorers/run-experiment.mdx → evals/run-evals.mdx} +17 -18
- package/.docs/raw/reference/evals/textual-difference.mdx +149 -117
- package/.docs/raw/reference/evals/tone-consistency.mdx +149 -125
- package/.docs/raw/reference/{scorers → evals}/tool-call-accuracy.mdx +8 -6
- package/.docs/raw/reference/evals/toxicity.mdx +152 -96
- package/.docs/raw/reference/{observability/logging → logging}/pino-logger.mdx +2 -2
- package/.docs/raw/reference/memory/createThread.mdx +5 -5
- package/.docs/raw/reference/memory/deleteMessages.mdx +7 -7
- package/.docs/raw/reference/memory/getThreadById.mdx +4 -4
- package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +110 -0
- package/.docs/raw/reference/memory/memory-class.mdx +13 -9
- package/.docs/raw/reference/memory/query.mdx +58 -57
- package/.docs/raw/reference/memory/recall.mdx +185 -0
- package/.docs/raw/reference/observability/tracing/configuration.mdx +245 -0
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/arize.mdx +13 -13
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/braintrust.mdx +11 -8
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/cloud-exporter.mdx +21 -19
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/console-exporter.mdx +49 -17
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/default-exporter.mdx +42 -41
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/langfuse.mdx +10 -7
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/langsmith.mdx +10 -7
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/otel.mdx +5 -5
- package/.docs/raw/reference/observability/tracing/instances.mdx +168 -0
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/interfaces.mdx +115 -89
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/processors/sensitive-data-filter.mdx +3 -3
- package/.docs/raw/reference/observability/{ai-tracing/span.mdx → tracing/spans.mdx} +59 -41
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +1 -1
- package/.docs/raw/reference/processors/language-detector.mdx +1 -1
- package/.docs/raw/reference/processors/moderation-processor.mdx +1 -1
- package/.docs/raw/reference/processors/pii-detector.mdx +1 -1
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +1 -1
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +1 -1
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +1 -1
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +1 -1
- package/.docs/raw/reference/rag/chunk.mdx +1 -8
- package/.docs/raw/reference/rag/database-config.mdx +7 -7
- package/.docs/raw/reference/rag/metadata-filters.mdx +14 -11
- package/.docs/raw/reference/storage/libsql.mdx +2 -0
- package/.docs/raw/reference/storage/mssql.mdx +5 -0
- package/.docs/raw/reference/storage/postgresql.mdx +6 -0
- package/.docs/raw/reference/storage/upstash.mdx +1 -0
- package/.docs/raw/reference/streaming/agents/stream.mdx +12 -12
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +8 -8
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +3 -3
- package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +3 -3
- package/.docs/raw/reference/streaming/workflows/resumeStreamVNext.mdx +6 -6
- package/.docs/raw/reference/streaming/workflows/stream.mdx +10 -10
- package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +11 -11
- package/.docs/raw/reference/templates/overview.mdx +2 -2
- package/.docs/raw/reference/tools/create-tool.mdx +52 -35
- package/.docs/raw/reference/tools/graph-rag-tool.mdx +15 -15
- package/.docs/raw/reference/tools/mcp-client.mdx +1 -1
- package/.docs/raw/reference/tools/mcp-server.mdx +119 -35
- package/.docs/raw/reference/tools/vector-query-tool.mdx +27 -26
- package/.docs/raw/reference/vectors/libsql.mdx +1 -0
- package/.docs/raw/reference/vectors/pg.mdx +3 -0
- package/.docs/raw/reference/vectors/upstash.mdx +1 -0
- package/.docs/raw/reference/voice/google-gemini-live.mdx +1 -1
- package/.docs/raw/reference/voice/voice.addTools.mdx +3 -3
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +4 -4
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +14 -14
- package/.docs/raw/reference/workflows/run-methods/start.mdx +17 -17
- package/.docs/raw/reference/workflows/run.mdx +1 -8
- package/.docs/raw/reference/workflows/step.mdx +5 -5
- package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +7 -13
- package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +5 -0
- package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow.mdx +1 -1
- package/.docs/raw/server-db/custom-api-routes.mdx +2 -2
- package/.docs/raw/server-db/mastra-client.mdx +19 -18
- package/.docs/raw/server-db/middleware.mdx +7 -7
- package/.docs/raw/server-db/production-server.mdx +4 -4
- package/.docs/raw/server-db/{runtime-context.mdx → request-context.mdx} +46 -45
- package/.docs/raw/server-db/storage.mdx +29 -21
- package/.docs/raw/streaming/events.mdx +3 -3
- package/.docs/raw/streaming/overview.mdx +5 -5
- package/.docs/raw/streaming/tool-streaming.mdx +18 -17
- package/.docs/raw/streaming/workflow-streaming.mdx +1 -1
- package/.docs/raw/tools-mcp/advanced-usage.mdx +5 -4
- package/.docs/raw/tools-mcp/mcp-overview.mdx +32 -19
- package/.docs/raw/tools-mcp/overview.mdx +11 -11
- package/.docs/raw/voice/overview.mdx +63 -43
- package/.docs/raw/voice/speech-to-speech.mdx +5 -3
- package/.docs/raw/voice/speech-to-text.mdx +9 -8
- package/.docs/raw/voice/text-to-speech.mdx +12 -11
- package/.docs/raw/workflows/agents-and-tools.mdx +9 -5
- package/.docs/raw/workflows/control-flow.mdx +3 -3
- package/.docs/raw/workflows/error-handling.mdx +2 -21
- package/.docs/raw/workflows/human-in-the-loop.mdx +7 -4
- package/.docs/raw/workflows/inngest-workflow.mdx +2 -2
- package/.docs/raw/workflows/input-data-mapping.mdx +107 -0
- package/.docs/raw/workflows/overview.mdx +17 -16
- package/.docs/raw/workflows/snapshots.mdx +13 -11
- package/.docs/raw/workflows/suspend-and-resume.mdx +23 -15
- package/CHANGELOG.md +52 -57
- package/README.md +11 -2
- package/dist/{chunk-TUAHUTTB.js → chunk-5NJC7NRO.js} +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/prepare-docs/copy-raw.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 +402 -30
- package/dist/tools/migration.d.ts +40 -0
- package/dist/tools/migration.d.ts.map +1 -0
- package/package.json +8 -12
- package/.docs/organized/changelogs/%40mastra%2Fcloud.md +0 -302
- 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/getTools.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/getAgents.mdx +0 -35
- package/.docs/raw/reference/core/getLogs.mdx +0 -96
- package/.docs/raw/reference/core/getLogsByRunId.mdx +0 -87
- package/.docs/raw/reference/core/getMCPServers.mdx +0 -36
- package/.docs/raw/reference/core/getMemory.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/getVectors.mdx +0 -36
- package/.docs/raw/reference/core/getWorkflows.mdx +0 -45
- 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 -185
- package/.docs/raw/reference/observability/ai-tracing/configuration.mdx +0 -238
- 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/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/workflows/run-methods/watch.mdx +0 -73
- 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/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,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Mastra Class | v1 Migration Guide"
|
|
3
|
+
description: "Learn how to migrate Mastra class changes when upgrading to v1."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra Class
|
|
7
|
+
|
|
8
|
+
The Mastra class has been restructured to restrict top-level imports and replace direct property access with getter methods.
|
|
9
|
+
|
|
10
|
+
## Changed
|
|
11
|
+
|
|
12
|
+
### Top-level imports to subpath imports
|
|
13
|
+
|
|
14
|
+
The main `@mastra/core` index file now only exports `Mastra` and `Config`. All other exports have been moved to subpath imports. This change improves tree-shaking and reduces bundle size by allowing bundlers to eliminate unused code.
|
|
15
|
+
|
|
16
|
+
To migrate, update all imports from `@mastra/core` to use the appropriate subpath.
|
|
17
|
+
|
|
18
|
+
```diff
|
|
19
|
+
- import { Mastra, Agent, Workflow, createTool } from '@mastra/core';
|
|
20
|
+
+ import { Mastra, type Config } from '@mastra/core';
|
|
21
|
+
+ import { Agent } from '@mastra/core/agent';
|
|
22
|
+
+ import { Workflow } from '@mastra/core/workflows';
|
|
23
|
+
+ import { createTool } from '@mastra/core/tools';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
:::tip[Codemod]
|
|
27
|
+
|
|
28
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
29
|
+
|
|
30
|
+
```shell
|
|
31
|
+
npx @mastra/codemod v1/mastra-core-imports .
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
:::
|
|
35
|
+
|
|
36
|
+
### `experimental_auth` to `auth`
|
|
37
|
+
|
|
38
|
+
The experimental auth configuration has been promoted to stable. This change reflects that the auth API is now stable and production-ready.
|
|
39
|
+
|
|
40
|
+
To migrate, rename the `experimental_auth` key to `auth` in your Mastra configuration.
|
|
41
|
+
|
|
42
|
+
```diff
|
|
43
|
+
const mastra = new Mastra({
|
|
44
|
+
- experimental_auth: {
|
|
45
|
+
+ auth: {
|
|
46
|
+
provider: workos,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
:::tip[Codemod]
|
|
52
|
+
|
|
53
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
54
|
+
|
|
55
|
+
```shell
|
|
56
|
+
npx @mastra/codemod v1/experimental-auth .
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
:::
|
|
60
|
+
|
|
61
|
+
### Required `id` parameter for all mastra primitives
|
|
62
|
+
|
|
63
|
+
All storage, vector stores, agents, workflows, mcpServers, processors, scorers, tools now require an `id` parameter during initialization. This enables the standardized Mastra API and prevents ID conflicts.
|
|
64
|
+
|
|
65
|
+
All these primitives also now have a `get`, `list`, and `add` functions.
|
|
66
|
+
|
|
67
|
+
To migrate, add an `id` parameter to all storage and vector store instantiations. When using the same storage/vector class multiple times, ensure each instance has a unique ID.
|
|
68
|
+
|
|
69
|
+
```diff
|
|
70
|
+
- const storage = new LibSQLStore({
|
|
71
|
+
- url: ':memory:',
|
|
72
|
+
- });
|
|
73
|
+
+ const storage = new LibSQLStore({
|
|
74
|
+
+ id: 'my-app-storage',
|
|
75
|
+
+ url: ':memory:',
|
|
76
|
+
+ });
|
|
77
|
+
|
|
78
|
+
- const vector = new PgVector({
|
|
79
|
+
- connectionString: process.env.DATABASE_URL,
|
|
80
|
+
- });
|
|
81
|
+
+ const vector = new PgVector({
|
|
82
|
+
+ id: 'my-app-vector',
|
|
83
|
+
+ connectionString: process.env.DATABASE_URL,
|
|
84
|
+
+ });
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
When using separate instances for different purposes, use descriptive unique IDs:
|
|
88
|
+
|
|
89
|
+
```diff
|
|
90
|
+
const agentMemory = new Memory({
|
|
91
|
+
storage: new LibSQLStore({
|
|
92
|
+
- url: 'file:./agent.db',
|
|
93
|
+
+ id: 'weather-agent-memory-storage',
|
|
94
|
+
+ url: 'file:./agent.db',
|
|
95
|
+
}),
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const mastra = new Mastra({
|
|
99
|
+
storage: new LibSQLStore({
|
|
100
|
+
+ id: 'mastra-storage',
|
|
101
|
+
url: ':memory:',
|
|
102
|
+
}),
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Primitive plural APIs changes from `get<primitives>` to `list<primitive>`
|
|
107
|
+
|
|
108
|
+
```diff
|
|
109
|
+
- const mcpServers = mastra.getMCPServers();
|
|
110
|
+
+ const mcpServers = mastra.listMCPServers();
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Each primtive has a `getById` and a `get` function
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
mastra.getMCPServer('myServer'); // Works (registry key)
|
|
117
|
+
mastra.getMCPServerById('my-mcp-server'); // Works (intrinsic ID)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Tool registration now uses intrinsic IDs
|
|
121
|
+
|
|
122
|
+
When tools are auto-registered from agents or MCP servers to the Mastra instance, they now use the tool's intrinsic `id` instead of the configuration object key. This prevents collisions when multiple agents/MCP servers have tools with the same configuration key.
|
|
123
|
+
|
|
124
|
+
To migrate, update any code that references tools by their configuration keys to use the tool's intrinsic ID instead.
|
|
125
|
+
|
|
126
|
+
```diff
|
|
127
|
+
const agent = new Agent({
|
|
128
|
+
id: 'agent1',
|
|
129
|
+
tools: {
|
|
130
|
+
searchTool: weatherSearchTool,
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
- mastra.getTool('searchTool');
|
|
135
|
+
+ mastra.getTool(weatherSearchTool.id);
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Removed
|
|
139
|
+
|
|
140
|
+
### `memory` property from Mastra class
|
|
141
|
+
|
|
142
|
+
The `memory` property has been removed from the Mastra class. Memory is now configured at the Agent level rather than globally.
|
|
143
|
+
|
|
144
|
+
To migrate, move memory configuration from the Mastra constructor to individual Agent constructors.
|
|
145
|
+
|
|
146
|
+
```diff
|
|
147
|
+
- const mastra = new Mastra({
|
|
148
|
+
- memory: new Memory({
|
|
149
|
+
- storage: libsqlStore,
|
|
150
|
+
- vector: libsqlVector,
|
|
151
|
+
- embedder: fastembed,
|
|
152
|
+
- }),
|
|
153
|
+
- });
|
|
154
|
+
-
|
|
155
|
+
- const agent = new Agent({
|
|
156
|
+
- name: 'my-agent',
|
|
157
|
+
- });
|
|
158
|
+
|
|
159
|
+
+ const mastra = new Mastra({
|
|
160
|
+
+ // memory removed from here
|
|
161
|
+
+ });
|
|
162
|
+
+
|
|
163
|
+
+ const agent = new Agent({
|
|
164
|
+
+ name: 'my-agent',
|
|
165
|
+
+ memory: new Memory({
|
|
166
|
+
+ storage: libsqlStore,
|
|
167
|
+
+ vector: libsqlVector,
|
|
168
|
+
+ embedder: fastembed,
|
|
169
|
+
+ }),
|
|
170
|
+
+ });
|
|
171
|
+
```
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MCP | v1 Migration Guide"
|
|
3
|
+
description: "Learn how to migrate MCP-related changes when upgrading to v1."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MCP
|
|
7
|
+
|
|
8
|
+
MCP (Model Context Protocol) tool execution context has been reorganized, and deprecated client classes have been removed.
|
|
9
|
+
|
|
10
|
+
## Changed
|
|
11
|
+
|
|
12
|
+
### `getMCPServers` to `listMCPServers`
|
|
13
|
+
|
|
14
|
+
The `mastra.getMCPServers()` method has been renamed to `mastra.listMCPServers()`. 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.getMCPServers()` with `mastra.listMCPServers()`.
|
|
17
|
+
|
|
18
|
+
```diff
|
|
19
|
+
- const servers = await mastra.getMCPServers();
|
|
20
|
+
+ const servers = await mastra.listMCPServers();
|
|
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 v1/mcp-get-mcp-servers .
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
:::
|
|
32
|
+
|
|
33
|
+
### `getTools` to `listTools`
|
|
34
|
+
|
|
35
|
+
The `mcp.getTools()` method has been renamed to `mcp.listTools()`. This change aligns with the naming convention used across the API where plural getter methods use the `list` prefix.
|
|
36
|
+
|
|
37
|
+
To migrate, replace all calls to `mcp.getTools()` with `mcp.listTools()`.
|
|
38
|
+
|
|
39
|
+
```diff
|
|
40
|
+
- const tools = await mcp.getTools();
|
|
41
|
+
+ const tools = await mcp.listTools();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
:::tip[Codemod]
|
|
45
|
+
|
|
46
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
47
|
+
|
|
48
|
+
```shell
|
|
49
|
+
npx @mastra/codemod v1/mcp-get-tools .
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
:::
|
|
53
|
+
|
|
54
|
+
### `getToolsets` to `listToolsets`
|
|
55
|
+
|
|
56
|
+
The `mcp.getToolsets()` method has been renamed to `mcp.listToolsets()`. This change aligns with the naming convention used across the API where plural getter methods use the `list` prefix.
|
|
57
|
+
|
|
58
|
+
To migrate, replace all calls to `mcp.getToolsets()` with `mcp.listToolsets()`.
|
|
59
|
+
|
|
60
|
+
```diff
|
|
61
|
+
- const toolsets = await mcp.getToolsets();
|
|
62
|
+
+ const toolsets = await mcp.listToolsets();
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
:::tip[Codemod]
|
|
66
|
+
|
|
67
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
68
|
+
|
|
69
|
+
```shell
|
|
70
|
+
npx @mastra/codemod v1/mcp-get-toolsets .
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
:::
|
|
74
|
+
|
|
75
|
+
### MCP tool context properties organization
|
|
76
|
+
|
|
77
|
+
Context properties in MCP tools are now organized under the `context.mcp` namespace. This change provides better organization and clearer API surface for MCP-specific functionality.
|
|
78
|
+
|
|
79
|
+
To migrate, access MCP-specific properties like `elicitation` and `extra` through `context.mcp` instead of directly from the context parameter.
|
|
80
|
+
|
|
81
|
+
```diff
|
|
82
|
+
createTool({
|
|
83
|
+
id: 'account-balance',
|
|
84
|
+
- execute: async ({ context, elicitation, extra }) => {
|
|
85
|
+
- await checkAuth(extra.authInfo);
|
|
86
|
+
- const result = await elicitation.sendRequest({
|
|
87
|
+
- message: `Is it ok to fetch account ${context.accountId}?`,
|
|
88
|
+
- });
|
|
89
|
+
- },
|
|
90
|
+
+ execute: async (inputData, context) => {
|
|
91
|
+
+ await checkAuth(context?.mcp?.extra.authInfo);
|
|
92
|
+
+ const result = await context?.mcp?.elicitation.sendRequest({
|
|
93
|
+
+ message: `Is it ok to fetch account ${inputData.accountId}?`,
|
|
94
|
+
+ });
|
|
95
|
+
+ },
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Removed
|
|
100
|
+
|
|
101
|
+
### Deprecated MCP client classes
|
|
102
|
+
|
|
103
|
+
The `MastraMCPClient` and related deprecated APIs have been removed from `@mastra/mcp`. This change consolidates on the new MCP client API.
|
|
104
|
+
|
|
105
|
+
To migrate, use the new `MCPClient` class instead of deprecated classes.
|
|
106
|
+
|
|
107
|
+
```diff
|
|
108
|
+
- import { MastraMCPClient, MCPConfiguration } from '@mastra/mcp/client';
|
|
109
|
+
+ import { MCPClient } from '@mastra/mcp/client';
|
|
110
|
+
|
|
111
|
+
- const client = new MastraMCPClient({ ... });
|
|
112
|
+
- const config = new MCPConfiguration({ ... });
|
|
113
|
+
+ const client = new MCPClient({ ... });
|
|
114
|
+
```
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Memory | v1 Migration Guide"
|
|
3
|
+
description: "Learn how to migrate memory-related changes when upgrading to v1."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory
|
|
7
|
+
|
|
8
|
+
Memory configuration now requires explicit parameters, and default settings have been updated for better performance and predictability.
|
|
9
|
+
|
|
10
|
+
## Changed
|
|
11
|
+
|
|
12
|
+
### Default settings for semantic recall and last messages
|
|
13
|
+
|
|
14
|
+
Default settings have changed to more reasonable values based on usage patterns. The `lastMessages` default decreased from 40 to 10, `semanticRecall` is now disabled by default, and thread title generation is disabled by default. These changes improve performance and reduce unexpected LLM API calls.
|
|
15
|
+
|
|
16
|
+
To migrate, if you were relying on the old defaults, explicitly configure these settings.
|
|
17
|
+
|
|
18
|
+
```diff
|
|
19
|
+
const memory = new Memory({
|
|
20
|
+
storage,
|
|
21
|
+
vector,
|
|
22
|
+
embedder,
|
|
23
|
+
+ options: {
|
|
24
|
+
+ lastMessages: 40, // Was default before
|
|
25
|
+
+ semanticRecall: {
|
|
26
|
+
+ topK: 2,
|
|
27
|
+
+ messageRange: 2,
|
|
28
|
+
+ scope: 'thread',
|
|
29
|
+
+ }, // Was enabled by default before
|
|
30
|
+
+ generateTitle: true, // Was enabled by default before
|
|
31
|
+
+ },
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Default memory scope from `thread` to `resource`
|
|
36
|
+
|
|
37
|
+
The default scope for both working memory and semantic recall has changed from `'thread'` to `'resource'`. This change aligns with common use cases where applications want to remember user information across conversations. When semantic recall is enabled, it now defaults to searching across all user conversations rather than just the current thread.
|
|
38
|
+
|
|
39
|
+
To migrate, if you want to maintain the old behavior where memory is isolated per conversation thread, explicitly set `scope: 'thread'`.
|
|
40
|
+
|
|
41
|
+
```diff
|
|
42
|
+
const memory = new Memory({
|
|
43
|
+
storage,
|
|
44
|
+
vector,
|
|
45
|
+
embedder,
|
|
46
|
+
options: {
|
|
47
|
+
workingMemory: {
|
|
48
|
+
enabled: true,
|
|
49
|
+
+ scope: 'thread', // Explicitly set to thread-scoped
|
|
50
|
+
template: `# User Profile...`,
|
|
51
|
+
},
|
|
52
|
+
semanticRecall: {
|
|
53
|
+
topK: 3,
|
|
54
|
+
+ scope: 'thread', // Explicitly set to thread-scoped
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Thread title generation location
|
|
61
|
+
|
|
62
|
+
The `generateTitle` option has been moved from `threads.generateTitle` to the top-level of memory options. This change simplifies the API by moving the option to where it logically belongs.
|
|
63
|
+
|
|
64
|
+
To migrate, move `generateTitle` from the `threads` config to the top level of options.
|
|
65
|
+
|
|
66
|
+
```diff
|
|
67
|
+
const memory = new Memory({
|
|
68
|
+
storage,
|
|
69
|
+
vector,
|
|
70
|
+
embedder,
|
|
71
|
+
options: {
|
|
72
|
+
- threads: {
|
|
73
|
+
- generateTitle: true,
|
|
74
|
+
- },
|
|
75
|
+
+ generateTitle: true,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Semantic recall default settings optimization
|
|
81
|
+
|
|
82
|
+
The default settings for semantic recall have been optimized based on RAG research. The `topK` increased from 2 to 4, and `messageRange` changed from `{ before: 2, after: 2 }` to `{ before: 1, after: 1 }`. These changes provide better accuracy while only slightly increasing message count.
|
|
83
|
+
|
|
84
|
+
To migrate, if you were relying on the previous defaults, explicitly set these values.
|
|
85
|
+
|
|
86
|
+
```diff
|
|
87
|
+
const memory = new Memory({
|
|
88
|
+
storage,
|
|
89
|
+
vector,
|
|
90
|
+
embedder,
|
|
91
|
+
options: {
|
|
92
|
+
semanticRecall: {
|
|
93
|
+
+ topK: 2, // Was default before
|
|
94
|
+
+ messageRange: { before: 2, after: 2 }, // Was default before
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### `Memory.query()` renamed to `Memory.recall()`
|
|
101
|
+
|
|
102
|
+
The `Memory.query()` method has been renamed to `Memory.recall()`. The new method returns a simpler format with just `{ messages: MastraDBMessage[] }` instead of multiple format variations. This change better describes the action of retrieving messages from memory and simplifies the API.
|
|
103
|
+
|
|
104
|
+
To migrate, rename `query()` to `recall()` and update code that expects the old return format.
|
|
105
|
+
|
|
106
|
+
```diff
|
|
107
|
+
- const result = await memory.query({ threadId: 'thread-123' });
|
|
108
|
+
+ const result = await memory.recall({ threadId: 'thread-123' });
|
|
109
|
+
- // result: { messages: CoreMessage[], uiMessages: UIMessageWithMetadata[], messagesV2: MastraMessageV2[] }
|
|
110
|
+
+ // result: { messages: MastraDBMessage[] }
|
|
111
|
+
+ const messages = result.messages;
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### `Memory.recall()` parameter changes
|
|
115
|
+
|
|
116
|
+
The `Memory.recall()` method now uses `StorageListMessagesInput` format with pagination, and the `vectorMessageSearch` parameter has been renamed to `vectorSearchString`. These changes align the memory API with the storage pagination API and provide more consistent naming.
|
|
117
|
+
|
|
118
|
+
To migrate, update method name, query parameters, and the vector search parameter.
|
|
119
|
+
|
|
120
|
+
```diff
|
|
121
|
+
- memory.query({
|
|
122
|
+
+ memory.recall({
|
|
123
|
+
threadId: 'thread-123',
|
|
124
|
+
- vectorMessageSearch: 'What did we discuss?',
|
|
125
|
+
- selectBy: { ... },
|
|
126
|
+
+ vectorSearchString: 'What did we discuss?',
|
|
127
|
+
+ page: 0,
|
|
128
|
+
+ perPage: 20,
|
|
129
|
+
+ orderBy: 'createdAt',
|
|
130
|
+
+ filter: { ... },
|
|
131
|
+
+ threadConfig: { semanticRecall: true },
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### `MastraMessageV2` type renamed to `MastraDBMessage`
|
|
136
|
+
|
|
137
|
+
The `MastraMessageV2` type has been renamed to `MastraDBMessage` for clarity. This change better describes the purpose of this type as the database message format.
|
|
138
|
+
|
|
139
|
+
To migrate, replace all instances of `MastraMessageV2` with `MastraDBMessage`.
|
|
140
|
+
|
|
141
|
+
```diff
|
|
142
|
+
- import { MastraMessageV2 } from '@mastra/core';
|
|
143
|
+
- function yourCustomFunction(input: MastraMessageV2) {}
|
|
144
|
+
+ import { MastraDBMessage } from '@mastra/core';
|
|
145
|
+
+ function yourCustomFunction(input: MastraDBMessage) {}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
## Removed
|
|
151
|
+
|
|
152
|
+
### Working memory `text-stream` mode
|
|
153
|
+
|
|
154
|
+
Working memory `use: "text-stream"` option has been removed. Only `tool-call` mode is supported. This change simplifies the working memory API by removing the less reliable streaming mode.
|
|
155
|
+
|
|
156
|
+
To migrate, remove the `use: "text-stream"` option. Working memory will default to tool-call mode.
|
|
157
|
+
|
|
158
|
+
```diff
|
|
159
|
+
const memory = new Memory({
|
|
160
|
+
storage,
|
|
161
|
+
vector,
|
|
162
|
+
embedder,
|
|
163
|
+
options: {
|
|
164
|
+
workingMemory: {
|
|
165
|
+
enabled: true,
|
|
166
|
+
- use: 'text-stream',
|
|
167
|
+
template: '...',
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
});
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### `Memory.rememberMessages()` method
|
|
174
|
+
|
|
175
|
+
The `Memory.rememberMessages()` method has been removed. This method performed the same function as `query()` (now `recall()`), and consolidating to one method simplifies the API.
|
|
176
|
+
|
|
177
|
+
To migrate, replace `rememberMessages()` calls with `recall()`.
|
|
178
|
+
|
|
179
|
+
```diff
|
|
180
|
+
- const { messages } = await memory.rememberMessages({
|
|
181
|
+
+ const { messages } = await memory.recall({
|
|
182
|
+
threadId,
|
|
183
|
+
resourceId,
|
|
184
|
+
});
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### `format` parameter from memory methods
|
|
188
|
+
|
|
189
|
+
The `format` parameter has been removed from all memory get methods. `MastraDBMessage` is now the default return format everywhere. AI SDK format conversion has moved to dedicated utility functions in `@mastra/ai-sdk/ui`. This change improves tree-shaking by moving UI-specific conversion code to a separate package.
|
|
190
|
+
|
|
191
|
+
To migrate, remove the `format` parameter and use conversion functions for AI SDK formats.
|
|
192
|
+
|
|
193
|
+
```diff
|
|
194
|
+
- const messages = await memory.getMessages({ threadId, format: 'v2' });
|
|
195
|
+
- const uiMessages = await memory.getMessages({ threadId, format: 'ui' });
|
|
196
|
+
|
|
197
|
+
+ const result = await memory.recall({ threadId });
|
|
198
|
+
+ const messages = result.messages; // Always MastraDBMessage[]
|
|
199
|
+
+
|
|
200
|
+
+ // Use conversion functions for AI SDK formats
|
|
201
|
+
+ import { toAISdkV5Messages } from '@mastra/ai-sdk/ui';
|
|
202
|
+
+ const uiMessages = toAISdkV5Messages(messages);
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### `MastraMessageV3` type
|
|
206
|
+
|
|
207
|
+
The `MastraMessageV3` type and related conversion methods have been removed. Messages now convert directly between `MastraMessageV2` (now `MastraDBMessage`) and AI SDK v5 formats. This change simplifies the architecture by removing an intermediary format.
|
|
208
|
+
|
|
209
|
+
To migrate, use `MastraDBMessage` for storage or AI SDK v5 message formats directly.
|
|
210
|
+
|
|
211
|
+
```diff
|
|
212
|
+
- import type { MastraMessageV3 } from '@mastra/core/agent';
|
|
213
|
+
- const v3Messages = messageList.get.all.v3();
|
|
214
|
+
|
|
215
|
+
+ // For storage
|
|
216
|
+
+ const v2Messages = messageList.get.all.v2();
|
|
217
|
+
+
|
|
218
|
+
+ // For AI SDK v5
|
|
219
|
+
+ const uiMessages = messageList.get.all.aiV5.ui();
|
|
220
|
+
+ const modelMessages = messageList.get.all.aiV5.model();
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### `processors` config from Memory constructor
|
|
224
|
+
|
|
225
|
+
The `processors` config option in the Memory constructor has been deprecated and now throws an error. Processors should be configured at the Agent level instead. This change provides clearer configuration boundaries and better encapsulation.
|
|
226
|
+
|
|
227
|
+
To migrate, move processor configuration from Memory to Agent.
|
|
228
|
+
|
|
229
|
+
```diff
|
|
230
|
+
const memory = new Memory({
|
|
231
|
+
storage,
|
|
232
|
+
vector,
|
|
233
|
+
embedder,
|
|
234
|
+
- processors: [/* ... */],
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
const agent = new Agent({
|
|
238
|
+
memory,
|
|
239
|
+
+ processors: [/* ... */],
|
|
240
|
+
});
|
|
241
|
+
```
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Overview | v1 Migration Guide"
|
|
3
|
+
description: "Overview of breaking changes when upgrading to Mastra v1."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Upgrade to Mastra v1
|
|
7
|
+
|
|
8
|
+
This guide provides a comprehensive overview of breaking changes when upgrading from Mastra 0.x to v1.0. The migration is organized by package and feature area to help you systematically update your codebase.
|
|
9
|
+
|
|
10
|
+
:::tip[Need help?]
|
|
11
|
+
Need help with the migration? Join our [Discord community](https://discord.gg/BTYqqHKUrf) to ask questions.
|
|
12
|
+
:::
|
|
13
|
+
|
|
14
|
+
## Migration Strategy
|
|
15
|
+
|
|
16
|
+
### Update all Mastra packages
|
|
17
|
+
|
|
18
|
+
Use your package manager to update your project's versions. Be sure to update **all** Mastra packages at the same time to ensure compatibility.
|
|
19
|
+
|
|
20
|
+
### Update Node.js version
|
|
21
|
+
|
|
22
|
+
Mastra v1 requires Node.js 22.13.0 or higher. Update your development and production environments accordingly.
|
|
23
|
+
|
|
24
|
+
## Breaking Changes by Area
|
|
25
|
+
|
|
26
|
+
- **[Mastra Class]/guides/v1/migrations/upgrade-to-v1/mastra)** - Import restructuring and property access changes.
|
|
27
|
+
- **[Agent Class]/guides/v1/migrations/upgrade-to-v1/agent)** - Voice methods moved to namespace and streaming API updates.
|
|
28
|
+
- **[Tools]/guides/v1/migrations/upgrade-to-v1/tools)** - CreateTool execute signature changed to separate input and context.
|
|
29
|
+
- **[Workflows]/guides/v1/migrations/upgrade-to-v1/workflows)** - Function name changes and legacy features removed.
|
|
30
|
+
- **[Memory]/guides/v1/migrations/upgrade-to-v1/memory)** - Configuration now requires explicit parameters and defaults changed.
|
|
31
|
+
- **[Storage]/guides/v1/migrations/upgrade-to-v1/storage)** - Pagination standardized and methods renamed to list pattern.
|
|
32
|
+
- **[Vectors]/guides/v1/migrations/upgrade-to-v1/vectors)** - Vector store methods renamed to list pattern.
|
|
33
|
+
- **[MCP]/guides/v1/migrations/upgrade-to-v1/mcp)** - Tool context reorganized and deprecated client classes removed.
|
|
34
|
+
- **[Tracing]/guides/v1/migrations/upgrade-to-v1/tracing)** - OTEL telemetry replaced with dedicated observability package and exporters.
|
|
35
|
+
- **[Evals & Scorers]/guides/v1/migrations/upgrade-to-v1/evals)** - Scorers API consolidated with new naming conventions.
|
|
36
|
+
- **[CLI]/guides/v1/migrations/upgrade-to-v1/cli)** - Commands and flags removed for simpler interface.
|
|
37
|
+
- **[Client SDKs]/guides/v1/migrations/upgrade-to-v1/client)** - Types and utilities renamed for consistency.
|
|
38
|
+
- **[Voice Packages]/guides/v1/migrations/upgrade-to-v1/voice)** - Packages renamed from speech to voice.
|
|
39
|
+
|
|
40
|
+
## Migration Checklist
|
|
41
|
+
|
|
42
|
+
Work through this checklist in order, starting with high-impact changes that affect most applications.
|
|
43
|
+
|
|
44
|
+
:::info[Codemod]
|
|
45
|
+
|
|
46
|
+
We prepared automated [codemods](https://github.com/mastra-ai/mastra/tree/main/packages/codemod) for you. Throughout the migration guide you'll find instructions on how to use them for specific changes.
|
|
47
|
+
|
|
48
|
+
If you want, you can run all v1 codemods at once:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
npx @mastra/codemod v1
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
:::
|
|
55
|
+
|
|
56
|
+
### High Impact Changes
|
|
57
|
+
|
|
58
|
+
- Update `createTool` tool signatures to `(inputData, context)` format - [Tools]/guides/v1/migrations/upgrade-to-v1/tools)
|
|
59
|
+
- Restructure `@mastra/core` imports to use subpath imports - [Mastra Class]/guides/v1/migrations/upgrade-to-v1/mastra)
|
|
60
|
+
- Update pagination from `offset/limit` to `page/perPage` - [Storage]/guides/v1/migrations/upgrade-to-v1/storage)
|
|
61
|
+
- Install `@mastra/observability` and wrap configuration with `new Observability()` - [Tracing]/guides/v1/migrations/upgrade-to-v1/tracing)
|
|
62
|
+
- Migrate from `telemetry:` to `observability:` configuration (if upgrading from 0.x OTEL) - [Tracing]/guides/v1/migrations/upgrade-to-v1/tracing)
|
|
63
|
+
|
|
64
|
+
### Medium Impact Changes
|
|
65
|
+
|
|
66
|
+
- Rename `RuntimeContext` to `RequestContext` throughout codebase - [Agent Class]/guides/v1/migrations/upgrade-to-v1/agent), [Tools]/guides/v1/migrations/upgrade-to-v1/tools), [Workflows]/guides/v1/migrations/upgrade-to-v1/workflows)
|
|
67
|
+
- Update storage methods from `get*` to `list*` pattern - [Storage]/guides/v1/migrations/upgrade-to-v1/storage)
|
|
68
|
+
- Replace direct property access with getter methods - [Mastra Class]/guides/v1/migrations/upgrade-to-v1/mastra), [Agent Class]/guides/v1/migrations/upgrade-to-v1/agent)
|
|
69
|
+
- Update memory scope if relying on default `thread` scope - [Memory]/guides/v1/migrations/upgrade-to-v1/memory)
|
|
70
|
+
- Update vector store calls to use named arguments - [Storage]/guides/v1/migrations/upgrade-to-v1/storage)
|
|
71
|
+
- Remove `format` parameter from agent methods - [Agent Class]/guides/v1/migrations/upgrade-to-v1/agent)
|
|
72
|
+
- Update voice methods to use `agent.voice` namespace - [Agent Class]/guides/v1/migrations/upgrade-to-v1/agent)
|
|
73
|
+
- Rename configuration property `processors` to `spanOutputProcessors` (if using custom processors) - [Tracing]/guides/v1/migrations/upgrade-to-v1/tracing)
|
|
74
|
+
|
|
75
|
+
### Low Impact Changes
|
|
76
|
+
|
|
77
|
+
- Rename `createRunAsync` to `createRun` - [Workflows]/guides/v1/migrations/upgrade-to-v1/workflows)
|
|
78
|
+
- Update voice package names from `@mastra/speech-*` to `@mastra/voice-*` - [Voice Packages]/guides/v1/migrations/upgrade-to-v1/voice)
|
|
79
|
+
- Update scorer methods: `runExperiment` → `runEvals`, `getScorerByName` → `getScorerById` - [Evals & Scorers]/guides/v1/migrations/upgrade-to-v1/evals)
|
|
80
|
+
- Remove deprecated CLI flags - [CLI]/guides/v1/migrations/upgrade-to-v1/cli)
|
|
81
|
+
- Update client SDK types from `Get*` to `List*` - [Client SDKs]/guides/v1/migrations/upgrade-to-v1/client)
|
|
82
|
+
- Replace `runCount` with `retryCount` - [Workflows]/guides/v1/migrations/upgrade-to-v1/workflows)
|
|
83
|
+
- Update custom exporter method `exportEvent` to `exportTracingEvent` (if using custom exporters) - [Tracing]/guides/v1/migrations/upgrade-to-v1/tracing)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Processors | v1 Migration Guide"
|
|
3
|
+
description: "Learn how to migrate processor changes when upgrading to v1."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Processors
|
|
7
|
+
|
|
8
|
+
Processor interfaces have been updated to use consistent naming patterns and database message types.
|
|
9
|
+
|
|
10
|
+
## Changed
|
|
11
|
+
|
|
12
|
+
### Processor configuration from `name` to `id`
|
|
13
|
+
|
|
14
|
+
Processors now require an `id` field instead of `name`. The `name` field is now optional. This change provides consistency with other Mastra entities like scorers and agents.
|
|
15
|
+
|
|
16
|
+
To migrate, update processor definitions to use `id` as the required field.
|
|
17
|
+
|
|
18
|
+
```diff
|
|
19
|
+
import type { InputProcessor } from '@mastra/core/processors';
|
|
20
|
+
|
|
21
|
+
const processor: InputProcessor = {
|
|
22
|
+
- name: 'my-processor',
|
|
23
|
+
+ id: 'my-processor',
|
|
24
|
+
+ name: 'My Processor', // optional
|
|
25
|
+
processInput: async ({ messages }) => {
|
|
26
|
+
// ...
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Processor message types from `MastraMessageV2` to `MastraDBMessage`
|
|
32
|
+
|
|
33
|
+
Processor message types have changed from `MastraMessageV2` to `MastraDBMessage`. This change provides consistency with scorer configuration and better type safety by aligning with the database message format.
|
|
34
|
+
|
|
35
|
+
To migrate, update processor message type imports and usage.
|
|
36
|
+
|
|
37
|
+
```diff
|
|
38
|
+
import type { InputProcessor } from '@mastra/core/processors';
|
|
39
|
+
- import type { MastraMessageV2 } from '@mastra/core/agent';
|
|
40
|
+
+ import type { MastraDBMessage } from '@mastra/core/agent';
|
|
41
|
+
|
|
42
|
+
const processor: InputProcessor = {
|
|
43
|
+
id: 'my-processor',
|
|
44
|
+
- processInput: async ({ messages }: { messages: MastraMessageV2[] }) => {
|
|
45
|
+
+ processInput: async ({ messages }: { messages: MastraDBMessage[] }) => {
|
|
46
|
+
// ...
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Removed
|
|
52
|
+
|
|
53
|
+
### Deprecated input processor exports
|
|
54
|
+
|
|
55
|
+
Deprecated input-processor exports which include the built-in processors have been removed from `@mastra/core/agent/input-processors/processors`. Use `@mastra/core/processors` instead. This change consolidates processor types under the unified `Processor` interface.
|
|
56
|
+
|
|
57
|
+
If you have used `InputProcessor`, replace it with `Processor` which implements a `processInput` function.
|
|
58
|
+
|
|
59
|
+
```diff
|
|
60
|
+
- import { InputProcessor, ModerationProcessor } from '@mastra/core/agent/input-processors/processors';
|
|
61
|
+
+ import { Processor, ModerationProcessor } from '@mastra/core/processors';
|
|
62
|
+
```
|