@mastra/mcp-docs-server 1.0.0-beta.8 → 1.0.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%2Fchangeset-cli.md +1 -13
- package/.docs/organized/changelogs/%40internal%2Fexternal-types.md +1 -5
- package/.docs/organized/changelogs/%40internal%2Fplayground.md +40 -0
- package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +8 -8
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +1 -53
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +287 -287
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +315 -315
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +53 -53
- package/.docs/organized/changelogs/%40mastra%2Fauth.md +38 -0
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +66 -66
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +522 -212
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +658 -196
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +439 -234
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +450 -211
- package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +208 -0
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +448 -22
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +3341 -271
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +60 -60
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +289 -289
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +90 -90
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +74 -74
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +70 -70
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +247 -220
- package/.docs/organized/changelogs/%40mastra%2Fduckdb.md +70 -0
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +403 -225
- package/.docs/organized/changelogs/%40mastra%2Felasticsearch.md +72 -0
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +145 -145
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +54 -0
- package/.docs/organized/changelogs/%40mastra%2Flance.md +456 -226
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +604 -208
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +71 -71
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +247 -247
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +28 -28
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +285 -285
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +354 -156
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +545 -212
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +481 -202
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +194 -194
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +759 -213
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +198 -198
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +636 -229
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +163 -163
- package/.docs/organized/changelogs/%40mastra%2Frag.md +310 -310
- package/.docs/organized/changelogs/%40mastra%2Freact.md +328 -230
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +64 -0
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +160 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +829 -218
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +57 -57
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +479 -232
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +53 -53
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +45 -45
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +45 -45
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +47 -47
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +110 -110
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +15 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +98 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +54 -54
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +46 -46
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +93 -93
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +47 -47
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +45 -45
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +45 -45
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +45 -45
- package/.docs/organized/changelogs/create-mastra.md +227 -227
- package/.docs/organized/changelogs/mastra.md +277 -277
- package/.docs/organized/code-examples/a2a.md +2 -2
- package/.docs/organized/code-examples/agent-v6.md +221 -0
- package/.docs/organized/code-examples/agui.md +4 -4
- package/.docs/organized/code-examples/ai-elements.md +3 -3
- package/.docs/organized/code-examples/ai-sdk-useChat.md +2 -2
- package/.docs/organized/code-examples/ai-sdk-v5.md +3 -3
- package/.docs/organized/code-examples/assistant-ui.md +5 -5
- package/.docs/organized/code-examples/bird-checker-with-express.md +1 -1
- package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +2 -2
- package/.docs/organized/code-examples/bird-checker-with-nextjs.md +3 -3
- package/.docs/organized/code-examples/client-side-tools.md +4 -4
- package/.docs/organized/code-examples/crypto-chatbot.md +5 -5
- package/.docs/organized/code-examples/experimental-auth-weather-agent.md +1 -1
- package/.docs/organized/code-examples/fireworks-r1.md +2 -2
- package/.docs/organized/code-examples/heads-up-game.md +7 -7
- package/.docs/organized/code-examples/inngest.md +1075 -0
- package/.docs/organized/code-examples/mcp-configuration.md +1 -1
- package/.docs/organized/code-examples/mcp-server-adapters.md +3 -4
- package/.docs/organized/code-examples/memory-per-resource-example.md +3 -3
- package/.docs/organized/code-examples/memory-todo-agent.md +1 -1
- package/.docs/organized/code-examples/memory-with-context.md +1 -1
- package/.docs/organized/code-examples/memory-with-processors.md +1 -1
- package/.docs/organized/code-examples/openapi-spec-writer.md +3 -3
- package/.docs/organized/code-examples/processors-with-ai-sdk.md +14 -0
- package/.docs/organized/code-examples/quick-start.md +1 -5
- package/.docs/organized/code-examples/server-app-access.md +3 -3
- package/.docs/organized/code-examples/server-express-adapter.md +1 -1
- package/.docs/organized/code-examples/server-fastify-adapter.md +83 -0
- package/.docs/organized/code-examples/server-hono-adapter.md +3 -3
- package/.docs/organized/code-examples/server-koa-adapter.md +94 -0
- package/.docs/organized/code-examples/stock-price-tool.md +21 -2
- package/.docs/organized/code-examples/workflow-ai-recruiter.md +1 -1
- package/.docs/organized/code-examples/workflow-with-inline-steps.md +1 -1
- package/.docs/organized/code-examples/workflow-with-memory.md +1 -1
- package/.docs/organized/code-examples/workflow-with-separate-steps.md +1 -1
- package/.docs/organized/code-examples/workflow-with-suspend-resume.md +1 -1
- package/.docs/raw/agents/adding-voice.mdx +24 -6
- package/.docs/raw/agents/agent-approval.mdx +209 -12
- package/.docs/raw/agents/agent-memory.mdx +36 -32
- package/.docs/raw/agents/guardrails.mdx +105 -56
- package/.docs/raw/agents/network-approval.mdx +281 -0
- package/.docs/raw/agents/networks.mdx +69 -13
- package/.docs/raw/agents/overview.mdx +43 -25
- package/.docs/raw/agents/processors.mdx +234 -17
- package/.docs/raw/agents/structured-output.mdx +78 -8
- package/.docs/raw/agents/using-tools.mdx +67 -6
- package/.docs/raw/course/01-first-agent/07-creating-your-agent.md +1 -2
- package/.docs/raw/course/01-first-agent/12-connecting-tool-to-agent.md +1 -1
- package/.docs/raw/course/01-first-agent/16-adding-memory-to-agent.md +1 -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 +3 -3
- package/.docs/raw/course/03-agent-memory/04-creating-basic-memory-agent.md +1 -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/13-vector-store-configuration.md +1 -1
- package/.docs/raw/course/03-agent-memory/16-configuring-semantic-recall.md +4 -5
- package/.docs/raw/course/03-agent-memory/18-advanced-configuration-semantic-recall.md +1 -1
- package/.docs/raw/course/03-agent-memory/21-configuring-working-memory.md +3 -4
- package/.docs/raw/course/03-agent-memory/22-custom-working-memory-templates.md +3 -4
- package/.docs/raw/course/03-agent-memory/25-combining-memory-features.md +3 -4
- package/.docs/raw/course/03-agent-memory/27-creating-learning-assistant.md +3 -4
- 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 +35 -48
- package/.docs/raw/deployment/web-framework.mdx +17 -19
- package/.docs/raw/deployment/workflow-runners.mdx +16 -0
- package/.docs/raw/evals/built-in-scorers.mdx +2 -0
- package/.docs/raw/evals/custom-scorers.mdx +60 -12
- package/.docs/raw/evals/overview.mdx +6 -6
- package/.docs/raw/evals/running-in-ci.mdx +4 -2
- package/.docs/raw/getting-started/manual-install.mdx +20 -20
- package/.docs/raw/getting-started/mcp-docs-server.mdx +59 -2
- package/.docs/raw/getting-started/project-structure.mdx +2 -2
- package/.docs/raw/getting-started/start.mdx +17 -1
- package/.docs/raw/getting-started/studio.mdx +10 -37
- package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +151 -0
- package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +1034 -80
- package/.docs/raw/guides/build-your-ui/assistant-ui.mdx +8 -8
- package/.docs/raw/guides/build-your-ui/copilotkit.mdx +32 -11
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/amazon-ec2.mdx +9 -9
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/aws-lambda.mdx +13 -16
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/azure-app-services.mdx +5 -7
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/cloudflare-deployer.mdx +8 -5
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/digital-ocean.mdx +18 -23
- package/.docs/raw/guides/deployment/index.mdx +32 -0
- package/.docs/raw/guides/deployment/inngest.mdx +673 -0
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/netlify-deployer.mdx +7 -3
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/vercel-deployer.mdx +8 -5
- package/.docs/raw/guides/getting-started/astro.mdx +292 -451
- package/.docs/raw/guides/getting-started/express.mdx +72 -153
- package/.docs/raw/guides/getting-started/hono.mdx +227 -0
- package/.docs/raw/guides/getting-started/next-js.mdx +173 -61
- package/.docs/raw/guides/getting-started/nuxt.mdx +505 -0
- package/.docs/raw/guides/getting-started/quickstart.mdx +5 -5
- package/.docs/raw/guides/getting-started/sveltekit.mdx +238 -409
- package/.docs/raw/guides/getting-started/vite-react.mdx +317 -147
- package/.docs/raw/guides/guide/ai-recruiter.mdx +10 -10
- package/.docs/raw/guides/guide/chef-michel.mdx +9 -11
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +15 -15
- package/.docs/raw/guides/guide/research-assistant.mdx +20 -20
- package/.docs/raw/guides/guide/stock-agent.mdx +5 -5
- package/.docs/raw/guides/guide/web-search.mdx +38 -38
- package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +7 -7
- package/.docs/raw/guides/index.mdx +0 -1
- package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +2 -2
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +105 -4
- package/.docs/raw/guides/migrations/upgrade-to-v1/cli.mdx +15 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/client.mdx +170 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/deployment.mdx +42 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/mastra.mdx +0 -35
- package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +40 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/overview.mdx +17 -2
- package/.docs/raw/guides/migrations/upgrade-to-v1/processors.mdx +11 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/rag.mdx +47 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +271 -25
- package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +3 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/tracing.mdx +72 -17
- package/.docs/raw/guides/migrations/upgrade-to-v1/vectors.mdx +46 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +50 -7
- package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +21 -23
- package/.docs/raw/index.mdx +2 -2
- package/.docs/raw/mastra-cloud/deployment.mdx +86 -0
- package/.docs/raw/mastra-cloud/observability.mdx +43 -0
- package/.docs/raw/mastra-cloud/overview.mdx +31 -0
- package/.docs/raw/mastra-cloud/setup.mdx +64 -0
- package/.docs/raw/mastra-cloud/studio.mdx +35 -0
- package/.docs/raw/mcp/overview.mdx +60 -25
- package/.docs/raw/mcp/publishing-mcp-server.mdx +7 -4
- package/.docs/raw/memory/memory-processors.mdx +17 -12
- package/.docs/raw/memory/message-history.mdx +72 -0
- package/.docs/raw/memory/overview.mdx +38 -76
- package/.docs/raw/memory/semantic-recall.mdx +65 -52
- package/.docs/raw/memory/storage.mdx +248 -0
- package/.docs/raw/memory/working-memory.mdx +24 -13
- package/.docs/raw/observability/logging.mdx +16 -15
- package/.docs/raw/observability/overview.mdx +27 -7
- package/.docs/raw/observability/tracing/bridges/otel.mdx +7 -4
- package/.docs/raw/observability/tracing/exporters/arize.mdx +61 -24
- package/.docs/raw/observability/tracing/exporters/braintrust.mdx +32 -22
- package/.docs/raw/observability/tracing/exporters/cloud.mdx +24 -5
- package/.docs/raw/observability/tracing/exporters/datadog.mdx +175 -0
- package/.docs/raw/observability/tracing/exporters/default.mdx +28 -7
- package/.docs/raw/observability/tracing/exporters/laminar.mdx +89 -0
- package/.docs/raw/observability/tracing/exporters/langfuse.mdx +31 -22
- package/.docs/raw/observability/tracing/exporters/langsmith.mdx +33 -3
- package/.docs/raw/observability/tracing/exporters/otel.mdx +194 -22
- package/.docs/raw/observability/tracing/exporters/posthog.mdx +32 -22
- package/.docs/raw/observability/tracing/exporters/sentry.mdx +198 -0
- package/.docs/raw/observability/tracing/overview.mdx +388 -108
- package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +27 -7
- package/.docs/raw/rag/chunking-and-embedding.mdx +22 -33
- package/.docs/raw/rag/graph-rag.mdx +223 -0
- package/.docs/raw/rag/overview.mdx +6 -3
- package/.docs/raw/rag/retrieval.mdx +53 -57
- package/.docs/raw/rag/vector-databases.mdx +55 -31
- package/.docs/raw/reference/agents/agent.mdx +17 -14
- package/.docs/raw/reference/agents/generate.mdx +172 -44
- package/.docs/raw/reference/agents/generateLegacy.mdx +5 -3
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +5 -3
- package/.docs/raw/reference/agents/getDefaultOptions.mdx +5 -3
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +5 -3
- package/.docs/raw/reference/agents/getDescription.mdx +3 -1
- package/.docs/raw/reference/agents/getInstructions.mdx +5 -3
- package/.docs/raw/reference/agents/getLLM.mdx +5 -3
- package/.docs/raw/reference/agents/getMemory.mdx +5 -3
- package/.docs/raw/reference/agents/getModel.mdx +5 -3
- package/.docs/raw/reference/agents/getTools.mdx +4 -2
- package/.docs/raw/reference/agents/getVoice.mdx +4 -2
- package/.docs/raw/reference/agents/listAgents.mdx +4 -2
- package/.docs/raw/reference/agents/listScorers.mdx +5 -3
- package/.docs/raw/reference/agents/listTools.mdx +4 -2
- package/.docs/raw/reference/agents/listWorkflows.mdx +4 -2
- package/.docs/raw/reference/agents/network.mdx +113 -1
- package/.docs/raw/reference/ai-sdk/chat-route.mdx +6 -3
- package/.docs/raw/reference/ai-sdk/handle-chat-stream.mdx +4 -2
- package/.docs/raw/reference/ai-sdk/handle-network-stream.mdx +4 -2
- package/.docs/raw/reference/ai-sdk/handle-workflow-stream.mdx +5 -3
- package/.docs/raw/reference/ai-sdk/network-route.mdx +6 -3
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-stream.mdx +10 -6
- 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 +7 -4
- package/.docs/raw/reference/auth/auth0.mdx +5 -3
- package/.docs/raw/reference/auth/clerk.mdx +5 -3
- package/.docs/raw/reference/auth/firebase.mdx +6 -5
- package/.docs/raw/reference/auth/jwt.mdx +5 -3
- package/.docs/raw/reference/auth/supabase.mdx +5 -3
- package/.docs/raw/reference/auth/workos.mdx +5 -3
- package/.docs/raw/reference/cli/create-mastra.mdx +12 -10
- package/.docs/raw/reference/cli/mastra.mdx +63 -15
- package/.docs/raw/reference/client-js/agents.mdx +311 -85
- package/.docs/raw/reference/client-js/error-handling.mdx +3 -3
- package/.docs/raw/reference/client-js/logs.mdx +2 -0
- package/.docs/raw/reference/client-js/mastra-client.mdx +6 -4
- package/.docs/raw/reference/client-js/memory.mdx +47 -2
- package/.docs/raw/reference/client-js/observability.mdx +2 -0
- package/.docs/raw/reference/client-js/telemetry.mdx +2 -0
- package/.docs/raw/reference/client-js/tools.mdx +2 -0
- package/.docs/raw/reference/client-js/vectors.mdx +2 -0
- package/.docs/raw/reference/client-js/workflows.mdx +47 -3
- package/.docs/raw/reference/configuration.mdx +761 -0
- package/.docs/raw/reference/core/addGateway.mdx +2 -0
- package/.docs/raw/reference/core/getAgent.mdx +3 -1
- package/.docs/raw/reference/core/getAgentById.mdx +3 -1
- package/.docs/raw/reference/core/getDeployer.mdx +3 -1
- package/.docs/raw/reference/core/getGateway.mdx +2 -0
- package/.docs/raw/reference/core/getGatewayById.mdx +2 -0
- package/.docs/raw/reference/core/getLogger.mdx +3 -1
- package/.docs/raw/reference/core/getMCPServer.mdx +3 -1
- package/.docs/raw/reference/core/getMCPServerById.mdx +3 -1
- package/.docs/raw/reference/core/getMemory.mdx +77 -0
- package/.docs/raw/reference/core/getScorer.mdx +2 -0
- package/.docs/raw/reference/core/getScorerById.mdx +2 -0
- package/.docs/raw/reference/core/getServer.mdx +6 -4
- package/.docs/raw/reference/core/getStorage.mdx +5 -3
- package/.docs/raw/reference/core/getStoredAgentById.mdx +185 -0
- package/.docs/raw/reference/core/getTelemetry.mdx +3 -1
- package/.docs/raw/reference/core/getVector.mdx +3 -1
- package/.docs/raw/reference/core/getWorkflow.mdx +3 -1
- package/.docs/raw/reference/core/listAgents.mdx +3 -1
- package/.docs/raw/reference/core/listGateways.mdx +2 -0
- package/.docs/raw/reference/core/listLogs.mdx +3 -1
- package/.docs/raw/reference/core/listLogsByRunId.mdx +3 -1
- package/.docs/raw/reference/core/listMCPServers.mdx +3 -1
- package/.docs/raw/reference/core/listMemory.mdx +74 -0
- package/.docs/raw/reference/core/listScorers.mdx +2 -0
- package/.docs/raw/reference/core/listStoredAgents.mdx +153 -0
- package/.docs/raw/reference/core/listVectors.mdx +3 -1
- package/.docs/raw/reference/core/listWorkflows.mdx +3 -1
- package/.docs/raw/reference/core/mastra-class.mdx +35 -20
- package/.docs/raw/reference/core/mastra-model-gateway.mdx +2 -0
- package/.docs/raw/reference/core/setLogger.mdx +3 -1
- package/.docs/raw/reference/core/setStorage.mdx +6 -4
- package/.docs/raw/reference/deployer/cloudflare.mdx +22 -53
- package/.docs/raw/reference/deployer/deployer.mdx +2 -1
- package/.docs/raw/reference/deployer/netlify.mdx +4 -1
- package/.docs/raw/reference/deployer/vercel.mdx +5 -4
- package/.docs/raw/reference/evals/answer-relevancy.mdx +4 -1
- package/.docs/raw/reference/evals/answer-similarity.mdx +4 -1
- package/.docs/raw/reference/evals/bias.mdx +4 -1
- package/.docs/raw/reference/evals/completeness.mdx +4 -1
- package/.docs/raw/reference/evals/content-similarity.mdx +4 -1
- package/.docs/raw/reference/evals/context-precision.mdx +4 -1
- package/.docs/raw/reference/evals/context-relevance.mdx +2 -0
- package/.docs/raw/reference/evals/create-scorer.mdx +11 -3
- package/.docs/raw/reference/evals/faithfulness.mdx +4 -1
- package/.docs/raw/reference/evals/hallucination.mdx +4 -1
- package/.docs/raw/reference/evals/keyword-coverage.mdx +4 -1
- package/.docs/raw/reference/evals/mastra-scorer.mdx +2 -0
- package/.docs/raw/reference/evals/noise-sensitivity.mdx +2 -0
- package/.docs/raw/reference/evals/prompt-alignment.mdx +9 -7
- package/.docs/raw/reference/evals/run-evals.mdx +3 -1
- package/.docs/raw/reference/evals/scorer-utils.mdx +3 -0
- package/.docs/raw/reference/evals/textual-difference.mdx +4 -1
- package/.docs/raw/reference/evals/tone-consistency.mdx +4 -1
- package/.docs/raw/reference/evals/tool-call-accuracy.mdx +25 -23
- package/.docs/raw/reference/evals/toxicity.mdx +4 -1
- package/.docs/raw/reference/index.mdx +2 -1
- package/.docs/raw/reference/logging/pino-logger.mdx +10 -8
- 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 +6 -4
- package/.docs/raw/reference/memory/deleteMessages.mdx +4 -2
- package/.docs/raw/reference/memory/getThreadById.mdx +3 -1
- package/.docs/raw/reference/memory/listThreads.mdx +187 -0
- package/.docs/raw/reference/memory/memory-class.mdx +27 -20
- package/.docs/raw/reference/memory/recall.mdx +6 -4
- package/.docs/raw/reference/observability/tracing/bridges/otel.mdx +6 -2
- package/.docs/raw/reference/observability/tracing/configuration.mdx +51 -0
- package/.docs/raw/reference/observability/tracing/exporters/arize.mdx +25 -6
- package/.docs/raw/reference/observability/tracing/exporters/braintrust.mdx +23 -2
- package/.docs/raw/reference/observability/tracing/exporters/cloud-exporter.mdx +10 -0
- package/.docs/raw/reference/observability/tracing/exporters/console-exporter.mdx +3 -0
- package/.docs/raw/reference/observability/tracing/exporters/datadog.mdx +172 -0
- package/.docs/raw/reference/observability/tracing/exporters/default-exporter.mdx +10 -0
- package/.docs/raw/reference/observability/tracing/exporters/laminar.mdx +139 -0
- package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +26 -4
- package/.docs/raw/reference/observability/tracing/exporters/langsmith.mdx +10 -0
- package/.docs/raw/reference/observability/tracing/exporters/otel.mdx +51 -34
- package/.docs/raw/reference/observability/tracing/exporters/posthog.mdx +25 -4
- package/.docs/raw/reference/observability/tracing/exporters/sentry.mdx +224 -0
- package/.docs/raw/reference/observability/tracing/instances.mdx +2 -0
- package/.docs/raw/reference/observability/tracing/interfaces.mdx +20 -0
- package/.docs/raw/reference/observability/tracing/processors/sensitive-data-filter.mdx +2 -0
- package/.docs/raw/reference/observability/tracing/spans.mdx +2 -0
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +4 -2
- package/.docs/raw/reference/processors/language-detector.mdx +6 -3
- package/.docs/raw/reference/processors/message-history-processor.mdx +5 -2
- package/.docs/raw/reference/processors/moderation-processor.mdx +6 -4
- package/.docs/raw/reference/processors/pii-detector.mdx +6 -4
- package/.docs/raw/reference/processors/processor-interface.mdx +326 -23
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +5 -3
- package/.docs/raw/reference/processors/semantic-recall-processor.mdx +7 -2
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +5 -3
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +62 -19
- package/.docs/raw/reference/processors/tool-call-filter.mdx +5 -3
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +6 -3
- package/.docs/raw/reference/processors/working-memory-processor.mdx +6 -3
- package/.docs/raw/reference/rag/chunk.mdx +7 -6
- package/.docs/raw/reference/rag/database-config.mdx +8 -6
- package/.docs/raw/reference/rag/document.mdx +2 -0
- package/.docs/raw/reference/rag/embeddings.mdx +2 -0
- package/.docs/raw/reference/rag/extract-params.mdx +57 -3
- package/.docs/raw/reference/rag/graph-rag.mdx +2 -0
- package/.docs/raw/reference/rag/metadata-filters.mdx +27 -7
- package/.docs/raw/reference/rag/rerank.mdx +2 -0
- package/.docs/raw/reference/rag/rerankWithScorer.mdx +2 -0
- package/.docs/raw/reference/server/create-route.mdx +34 -18
- package/.docs/raw/reference/server/express-adapter.mdx +78 -50
- package/.docs/raw/reference/server/fastify-adapter.mdx +130 -0
- package/.docs/raw/reference/server/hono-adapter.mdx +78 -48
- package/.docs/raw/reference/server/koa-adapter.mdx +129 -0
- package/.docs/raw/reference/server/mastra-server.mdx +52 -34
- package/.docs/raw/reference/server/routes.mdx +73 -10
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +10 -5
- package/.docs/raw/reference/storage/cloudflare.mdx +12 -2
- package/.docs/raw/reference/storage/composite.mdx +245 -0
- package/.docs/raw/reference/storage/convex.mdx +8 -6
- package/.docs/raw/reference/storage/dynamodb.mdx +134 -8
- package/.docs/raw/reference/storage/lance.mdx +9 -5
- package/.docs/raw/reference/storage/libsql.mdx +76 -54
- package/.docs/raw/reference/storage/mongodb.mdx +115 -16
- package/.docs/raw/reference/storage/mssql.mdx +11 -6
- package/.docs/raw/{server-db/storage.mdx → reference/storage/overview.mdx} +15 -111
- package/.docs/raw/reference/storage/postgresql.mdx +228 -83
- package/.docs/raw/reference/storage/upstash.mdx +78 -2
- package/.docs/raw/reference/streaming/ChunkType.mdx +31 -3
- package/.docs/raw/reference/streaming/agents/MastraModelOutput.mdx +67 -6
- package/.docs/raw/reference/streaming/agents/stream.mdx +48 -51
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +5 -3
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +3 -1
- package/.docs/raw/reference/streaming/workflows/resumeStream.mdx +3 -1
- package/.docs/raw/reference/streaming/workflows/stream.mdx +37 -22
- package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +6 -4
- package/.docs/raw/reference/templates/overview.mdx +3 -2
- package/.docs/raw/reference/tools/client.mdx +3 -0
- package/.docs/raw/reference/tools/create-tool.mdx +127 -5
- package/.docs/raw/reference/tools/document-chunker-tool.mdx +2 -0
- package/.docs/raw/reference/tools/graph-rag-tool.mdx +40 -3
- package/.docs/raw/reference/tools/mcp-client.mdx +110 -1
- package/.docs/raw/reference/tools/mcp-server.mdx +278 -24
- package/.docs/raw/reference/tools/vector-query-tool.mdx +68 -4
- package/.docs/raw/reference/vectors/astra.mdx +5 -3
- package/.docs/raw/reference/vectors/chroma.mdx +5 -3
- package/.docs/raw/reference/vectors/convex.mdx +14 -12
- package/.docs/raw/reference/vectors/couchbase.mdx +7 -5
- package/.docs/raw/reference/vectors/duckdb.mdx +12 -10
- package/.docs/raw/reference/vectors/elasticsearch.mdx +12 -4
- package/.docs/raw/reference/vectors/lance.mdx +6 -4
- package/.docs/raw/reference/vectors/libsql.mdx +66 -13
- package/.docs/raw/reference/vectors/mongodb.mdx +90 -10
- package/.docs/raw/reference/vectors/opensearch.mdx +30 -3
- package/.docs/raw/reference/vectors/pg.mdx +58 -6
- package/.docs/raw/reference/vectors/pinecone.mdx +23 -8
- package/.docs/raw/reference/vectors/qdrant.mdx +148 -4
- package/.docs/raw/reference/vectors/s3vectors.mdx +8 -6
- package/.docs/raw/reference/vectors/turbopuffer.mdx +6 -4
- package/.docs/raw/reference/vectors/upstash.mdx +60 -6
- package/.docs/raw/reference/vectors/vectorize.mdx +5 -3
- package/.docs/raw/reference/voice/azure.mdx +2 -0
- package/.docs/raw/reference/voice/cloudflare.mdx +2 -0
- package/.docs/raw/reference/voice/composite-voice.mdx +4 -0
- package/.docs/raw/reference/voice/deepgram.mdx +2 -0
- package/.docs/raw/reference/voice/elevenlabs.mdx +2 -0
- package/.docs/raw/reference/voice/google-gemini-live.mdx +3 -0
- package/.docs/raw/reference/voice/google.mdx +2 -0
- package/.docs/raw/reference/voice/mastra-voice.mdx +2 -0
- package/.docs/raw/reference/voice/murf.mdx +2 -0
- package/.docs/raw/reference/voice/openai-realtime.mdx +3 -0
- package/.docs/raw/reference/voice/openai.mdx +2 -0
- package/.docs/raw/reference/voice/playai.mdx +2 -0
- package/.docs/raw/reference/voice/sarvam.mdx +2 -0
- package/.docs/raw/reference/voice/speechify.mdx +2 -0
- package/.docs/raw/reference/voice/voice.addInstructions.mdx +3 -0
- package/.docs/raw/reference/voice/voice.addTools.mdx +3 -0
- package/.docs/raw/reference/voice/voice.answer.mdx +4 -0
- package/.docs/raw/reference/voice/voice.close.mdx +3 -0
- package/.docs/raw/reference/voice/voice.connect.mdx +5 -1
- package/.docs/raw/reference/voice/voice.events.mdx +2 -0
- package/.docs/raw/reference/voice/voice.getSpeakers.mdx +3 -0
- package/.docs/raw/reference/voice/voice.listen.mdx +6 -0
- package/.docs/raw/reference/voice/voice.off.mdx +2 -0
- package/.docs/raw/reference/voice/voice.on.mdx +5 -1
- package/.docs/raw/reference/voice/voice.send.mdx +4 -0
- package/.docs/raw/reference/voice/voice.speak.mdx +6 -0
- package/.docs/raw/reference/voice/voice.updateConfig.mdx +2 -0
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +55 -5
- package/.docs/raw/reference/workflows/run-methods/restart.mdx +3 -3
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +6 -4
- package/.docs/raw/reference/workflows/run-methods/start.mdx +7 -5
- package/.docs/raw/reference/workflows/run-methods/startAsync.mdx +145 -0
- package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +10 -8
- package/.docs/raw/reference/workflows/run.mdx +11 -3
- package/.docs/raw/reference/workflows/step.mdx +56 -3
- package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +3 -1
- package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +3 -1
- package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +39 -2
- package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +3 -1
- package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +3 -1
- package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +71 -4
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +9 -7
- package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +3 -1
- package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +4 -6
- package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +4 -6
- package/.docs/raw/reference/workflows/workflow-methods/then.mdx +3 -1
- package/.docs/raw/reference/workflows/workflow.mdx +193 -2
- package/.docs/raw/{auth → server/auth}/auth0.mdx +40 -21
- package/.docs/raw/{auth → server/auth}/clerk.mdx +37 -16
- package/.docs/raw/{auth → server/auth}/firebase.mdx +47 -25
- package/.docs/raw/{auth → server/auth}/index.mdx +8 -6
- package/.docs/raw/{auth → server/auth}/jwt.mdx +22 -10
- package/.docs/raw/{auth → server/auth}/supabase.mdx +45 -25
- package/.docs/raw/{auth → server/auth}/workos.mdx +39 -20
- package/.docs/raw/{server-db → server}/custom-adapters.mdx +40 -24
- package/.docs/raw/{server-db → server}/custom-api-routes.mdx +6 -6
- package/.docs/raw/{server-db → server}/mastra-client.mdx +35 -38
- package/.docs/raw/server/mastra-server.mdx +86 -0
- package/.docs/raw/{server-db → server}/middleware.mdx +11 -9
- package/.docs/raw/{server-db → server}/request-context.mdx +85 -43
- package/.docs/raw/server/server-adapters.mdx +410 -0
- package/.docs/raw/streaming/events.mdx +16 -7
- package/.docs/raw/streaming/overview.mdx +30 -17
- package/.docs/raw/streaming/tool-streaming.mdx +15 -17
- package/.docs/raw/streaming/workflow-streaming.mdx +8 -8
- package/.docs/raw/tools-mcp/advanced-usage.mdx +4 -2
- package/.docs/raw/tools-mcp/mcp-overview.mdx +46 -12
- package/.docs/raw/tools-mcp/overview.mdx +14 -13
- package/.docs/raw/voice/overview.mdx +17 -2
- package/.docs/raw/voice/speech-to-speech.mdx +5 -0
- package/.docs/raw/voice/speech-to-text.mdx +4 -0
- package/.docs/raw/voice/text-to-speech.mdx +3 -0
- package/.docs/raw/workflows/agents-and-tools.mdx +70 -21
- package/.docs/raw/workflows/control-flow.mdx +369 -34
- package/.docs/raw/workflows/error-handling.mdx +192 -18
- package/.docs/raw/workflows/human-in-the-loop.mdx +8 -7
- package/.docs/raw/workflows/input-data-mapping.mdx +9 -7
- package/.docs/raw/workflows/overview.mdx +80 -34
- package/.docs/raw/workflows/snapshots.mdx +19 -45
- package/.docs/raw/workflows/suspend-and-resume.mdx +14 -14
- package/.docs/raw/workflows/time-travel.mdx +25 -21
- package/.docs/raw/workflows/workflow-state.mdx +7 -8
- package/CHANGELOG.md +254 -0
- package/README.md +36 -0
- 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/stdio.js +746 -49
- 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/package.json +9 -8
- package/.docs/organized/changelogs/%40internal%2Fai-sdk-v4.md +0 -1
- package/.docs/raw/deployment/building-mastra.mdx +0 -73
- package/.docs/raw/deployment/cloud-providers/index.mdx +0 -55
- package/.docs/raw/deployment/mastra-cloud/dashboard.mdx +0 -100
- package/.docs/raw/deployment/mastra-cloud/observability.mdx +0 -53
- package/.docs/raw/deployment/mastra-cloud/overview.mdx +0 -65
- package/.docs/raw/deployment/mastra-cloud/setting-up.mdx +0 -105
- package/.docs/raw/memory/conversation-history.mdx +0 -24
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +0 -140
- package/.docs/raw/memory/storage/memory-with-mongodb.mdx +0 -150
- 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/reference/core/setTelemetry.mdx +0 -36
- package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +0 -110
- package/.docs/raw/reference/memory/query.mdx +0 -189
- 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/server-db/mastra-server.mdx +0 -97
- package/.docs/raw/server-db/server-adapters.mdx +0 -286
- package/.docs/raw/workflows/inngest-workflow.mdx +0 -363
|
@@ -1,15 +1,34 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Monorepo
|
|
2
|
+
title: "Deploy in a Monorepo | Deployment"
|
|
3
3
|
description: Learn how to deploy Mastra applications that are part of a monorepo setup
|
|
4
|
+
packages:
|
|
5
|
+
- "@mastra/deployer"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
import Tabs from "@theme/Tabs";
|
|
9
|
+
import TabItem from "@theme/TabItem";
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
# Deploy in a Monorepo
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
Deploying Mastra in a monorepo follows the same process as a standalone application. This guide covers monorepo-specific considerations. For the core build and deployment steps, see [Deploy a Mastra Server](/docs/v1/deployment/mastra-server).
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
## Supported monorepos
|
|
16
|
+
|
|
17
|
+
Mastra works with:
|
|
18
|
+
|
|
19
|
+
- npm workspaces
|
|
20
|
+
- pnpm workspaces
|
|
21
|
+
- Yarn workspaces
|
|
22
|
+
- Turborepo
|
|
23
|
+
|
|
24
|
+
Known limitations:
|
|
25
|
+
|
|
26
|
+
- Bun workspaces - partial support; known issues
|
|
27
|
+
- Nx - You can use Nx's [supported dependency strategies](https://nx.dev/concepts/decisions/dependency-management) but you need to have `package.json` files inside your workspace packages
|
|
28
|
+
|
|
29
|
+
## Example structure
|
|
30
|
+
|
|
31
|
+
In this example, the Mastra application is located at `apps/api`:
|
|
13
32
|
|
|
14
33
|
```
|
|
15
34
|
apps/
|
|
@@ -29,69 +48,114 @@ packages/
|
|
|
29
48
|
package.json
|
|
30
49
|
```
|
|
31
50
|
|
|
32
|
-
##
|
|
51
|
+
## Building from a monorepo
|
|
52
|
+
|
|
53
|
+
Use your monorepo tool to run the build command from the correct package. There's no need for special flags.
|
|
54
|
+
|
|
55
|
+
Examples:
|
|
33
56
|
|
|
34
|
-
|
|
57
|
+
<Tabs>
|
|
58
|
+
<TabItem value="npm" label="npm">
|
|
35
59
|
|
|
60
|
+
```bash
|
|
61
|
+
npm run build --workspace=apps/api
|
|
36
62
|
```
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
63
|
+
|
|
64
|
+
</TabItem>
|
|
65
|
+
|
|
66
|
+
<TabItem value="pnpm" label="pnpm">
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pnpm --filter api run build
|
|
43
70
|
```
|
|
44
71
|
|
|
45
|
-
|
|
72
|
+
</TabItem>
|
|
46
73
|
|
|
47
|
-
|
|
74
|
+
<TabItem value="yarn" label="yarn">
|
|
48
75
|
|
|
49
|
-
|
|
76
|
+
```bash
|
|
77
|
+
yarn workspace api build
|
|
78
|
+
```
|
|
50
79
|
|
|
51
|
-
|
|
80
|
+
</TabItem>
|
|
52
81
|
|
|
53
|
-
|
|
82
|
+
<TabItem value="turborepo" label="Turborepo">
|
|
54
83
|
|
|
55
|
-
|
|
56
|
-
|
|
84
|
+
```bash
|
|
85
|
+
turbo run build --filter=api
|
|
86
|
+
```
|
|
57
87
|
|
|
58
|
-
|
|
88
|
+
</TabItem>
|
|
59
89
|
|
|
60
|
-
|
|
90
|
+
</Tabs>
|
|
61
91
|
|
|
62
|
-
|
|
92
|
+
Your package's `build` script should run `mastra build`:
|
|
63
93
|
|
|
64
|
-
|
|
94
|
+
```json title="apps/api/package.json"
|
|
95
|
+
{
|
|
96
|
+
"scripts": {
|
|
97
|
+
"build": "mastra build"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
65
101
|
|
|
66
|
-
|
|
102
|
+
## Workspace packages
|
|
67
103
|
|
|
68
|
-
|
|
69
|
-
import { Mastra } from "@mastra/core";
|
|
104
|
+
When your Mastra application imports from other workspace packages, Mastra handles this automatically:
|
|
70
105
|
|
|
106
|
+
- If the package is pre-compiled (e.g., built with `tsc` or `tsdown`), Mastra imports the compiled JavaScript
|
|
107
|
+
- If the package contains uncompiled TypeScript, Mastra transpiles it during the build
|
|
108
|
+
|
|
109
|
+
For most setups, this works without configuration. If you encounter issues with workspace package imports, add the package to [`transpilePackages`](/reference/v1/configuration#bundlertranspilepackages):
|
|
110
|
+
|
|
111
|
+
```typescript title="src/mastra/index.ts"
|
|
71
112
|
export const mastra = new Mastra({
|
|
72
|
-
// ...
|
|
73
113
|
bundler: {
|
|
74
|
-
transpilePackages: ["utils"],
|
|
75
|
-
externals: ["ui"],
|
|
76
|
-
sourcemap: true,
|
|
114
|
+
transpilePackages: ["@my-org/utils"],
|
|
77
115
|
},
|
|
78
116
|
});
|
|
79
117
|
```
|
|
80
118
|
|
|
81
|
-
|
|
119
|
+
## Environment variables
|
|
82
120
|
|
|
83
|
-
|
|
121
|
+
Store `.env` files in the Mastra application directory (e.g., `apps/api/.env`), not the monorepo root.
|
|
84
122
|
|
|
85
|
-
|
|
123
|
+
## Deployment configuration
|
|
86
124
|
|
|
87
|
-
|
|
88
|
-
- pnpm workspaces
|
|
89
|
-
- Yarn workspaces
|
|
90
|
-
- Turborepo
|
|
125
|
+
When deploying to cloud providers, ensure the correct package is selected as the deploy target. Selecting the monorepo root instead of the application directory (e.g., `apps/api`) is a common mistake.
|
|
91
126
|
|
|
92
|
-
|
|
127
|
+
Most providers let you specify the root directory in their dashboard or configuration file.
|
|
128
|
+
|
|
129
|
+
### Mastra Cloud
|
|
130
|
+
|
|
131
|
+
The image below shows how to select `apps/api` as the project root when deploying to [Mastra Cloud](/docs/v1/mastra-cloud/overview). While the interface may differ between providers, the configuration remains the same.
|
|
132
|
+
|
|
133
|
+

|
|
134
|
+
|
|
135
|
+
## Dependency management
|
|
136
|
+
|
|
137
|
+
Keep dependencies consistent to avoid version conflicts and build errors:
|
|
138
|
+
|
|
139
|
+
- Use a **single lockfile** at the monorepo root so all packages resolve the same versions
|
|
140
|
+
- Align versions of **shared libraries** (like Mastra or frameworks) to prevent duplicates
|
|
141
|
+
|
|
142
|
+
## Troubleshooting
|
|
143
|
+
|
|
144
|
+
### Workspace package not found
|
|
145
|
+
|
|
146
|
+
If Mastra can't resolve a workspace package, ensure:
|
|
147
|
+
- The package is listed in your `package.json` dependencies
|
|
148
|
+
- Your lockfile is up to date (`pnpm install`, `npm install`, etc.)
|
|
149
|
+
- The package has a valid `main` or `exports` field in its `package.json`
|
|
150
|
+
|
|
151
|
+
### TypeScript errors from workspace packages
|
|
152
|
+
|
|
153
|
+
If you see type errors from uncompiled workspace packages, either:
|
|
154
|
+
- Build the package first (recommended for faster Mastra builds)
|
|
155
|
+
- Add the package to [`transpilePackages`](/reference/v1/configuration#bundlertranspilepackages) in your Mastra config
|
|
93
156
|
|
|
94
|
-
|
|
95
|
-
- Nx — You can use Nx's [supported dependency strategies](https://nx.dev/concepts/decisions/dependency-management) but you need to have `package.json` files inside your workspace packages
|
|
157
|
+
## Related
|
|
96
158
|
|
|
97
|
-
|
|
159
|
+
- [Deploy a Mastra Server](/docs/v1/deployment/mastra-server) - Core build and deployment guide
|
|
160
|
+
- [Configuration Reference](/reference/v1/configuration) - `bundler.transpilePackages` and other options
|
|
161
|
+
- [CLI Reference](/reference/v1/cli/mastra) - Build command flags
|
|
@@ -1,82 +1,69 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Deployment Overview | Deployment"
|
|
3
3
|
description: Learn about different deployment options for your Mastra applications
|
|
4
|
+
packages:
|
|
5
|
+
- "@mastra/deployer"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Deployment Overview
|
|
7
9
|
|
|
8
|
-
Mastra
|
|
10
|
+
Mastra applications can be deployed to any Node.js-compatible environment. You can deploy a Mastra server, integrate with an existing web framework, deploy to cloud providers, or use Mastra Cloud for managed hosting.
|
|
9
11
|
|
|
10
|
-
##
|
|
12
|
+
## Runtime support
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
| ------------------------ | ------------------------------------------------------------- | -------------------------------------------------------------------- |
|
|
14
|
-
| **Mastra Cloud** | Teams wanting to ship quickly without infrastructure concerns | Fully-managed, automatic scaling, built-in observability |
|
|
15
|
-
| **Framework Deployment** | Teams already using Next.js, Astro etc | Simplify deployment with a unified codebase for frontend and backend |
|
|
16
|
-
| **Server Deployment** | Teams needing maximum control and customization | Full control, custom middleware, integrate with existing apps |
|
|
17
|
-
| **Serverless Platforms** | Teams already using Vercel, Netlify, or Cloudflare | Platform integration, simplified deployment, automatic scaling |
|
|
18
|
-
|
|
19
|
-
## Deployment Options
|
|
20
|
-
|
|
21
|
-
### Runtime support
|
|
14
|
+
Mastra can run against any of these runtime environments:
|
|
22
15
|
|
|
23
16
|
- Node.js `v22.13.0` or later
|
|
24
17
|
- Bun
|
|
25
18
|
- Deno
|
|
26
|
-
-
|
|
19
|
+
- Cloudflare
|
|
27
20
|
|
|
28
|
-
|
|
21
|
+
## Deployment Options
|
|
29
22
|
|
|
30
|
-
Mastra
|
|
23
|
+
### Mastra Server
|
|
31
24
|
|
|
32
|
-
-
|
|
33
|
-
- Deployment on git push
|
|
34
|
-
- Agent testing interface
|
|
35
|
-
- Comprehensive logs and traces
|
|
36
|
-
- Custom domains for each project
|
|
25
|
+
Mastra provides a [server](/docs/v1/server/mastra-server) powered by Hono that can be deployed independently. Use the `mastra build` command to build your application and deploy the output to your preferred VM, container, or PaaS platform.
|
|
37
26
|
|
|
38
|
-
[
|
|
27
|
+
Use this option when you need full control over your infrastructure, long-running processes, or WebSocket connections. The [Mastra server deployment guide](/docs/v1/deployment/mastra-server) provides more details.
|
|
39
28
|
|
|
40
|
-
###
|
|
29
|
+
### Monorepo
|
|
41
30
|
|
|
42
|
-
|
|
31
|
+
Deploy a Mastra server as part of a monorepo setup, following the same approach as standalone deployment.
|
|
43
32
|
|
|
44
|
-
|
|
45
|
-
- [With Astro](/guides/v1/getting-started/astro)
|
|
33
|
+
Read about [monorepo deployment](/docs/v1/deployment/monorepo).
|
|
46
34
|
|
|
47
|
-
|
|
35
|
+
### Cloud Providers
|
|
48
36
|
|
|
49
|
-
|
|
37
|
+
Mastra applications can be deployed to cloud providers and serverless platforms. Mastra includes optional built-in deployers for Vercel, Netlify, and Cloudflare to automate the build and deployment process.
|
|
50
38
|
|
|
51
|
-
|
|
39
|
+
Use this option for auto-scaling, minimal infrastructure management, or when you're already using one of these platforms.
|
|
52
40
|
|
|
53
|
-
|
|
41
|
+
- [Amazon EC2](/guides/v1/deployment/amazon-ec2)
|
|
42
|
+
- [AWS Lambda](/guides/v1/deployment/aws-lambda)
|
|
43
|
+
- [Azure App Services](/guides/v1/deployment/azure-app-services)
|
|
44
|
+
- [Cloudflare](/guides/v1/deployment/cloudflare-deployer)
|
|
45
|
+
- [Digital Ocean](/guides/v1/deployment/digital-ocean)
|
|
46
|
+
- [Netlify](/guides/v1/deployment/netlify-deployer)
|
|
47
|
+
- [Vercel](/guides/v1/deployment/vercel-deployer)
|
|
54
48
|
|
|
55
|
-
|
|
56
|
-
- Configurable CORS and authentication
|
|
57
|
-
- Deploy to VMs, containers, or PaaS platforms
|
|
58
|
-
- Ideal for integrating with existing Node.js applications
|
|
49
|
+
### Web Framework
|
|
59
50
|
|
|
60
|
-
|
|
51
|
+
When Mastra is integrated with a web framework, it deploys alongside your application using the framework's standard deployment process. The guides below cover framework-specific configuration requirements for deployment.
|
|
61
52
|
|
|
62
|
-
|
|
53
|
+
Use these guides when adding Mastra to an existing Next.js or Astro application.
|
|
63
54
|
|
|
64
|
-
|
|
55
|
+
- [With Next.js on Vercel](/docs/v1/deployment/web-framework#with-nextjs-on-vercel)
|
|
56
|
+
- [With Astro on Vercel](/docs/v1/deployment/web-framework#with-astro-on-vercel)
|
|
57
|
+
- [With Astro on Netlify](/docs/v1/deployment/web-framework#with-astro-on-netlify)
|
|
65
58
|
|
|
66
|
-
|
|
67
|
-
- Platform-specific optimizations
|
|
68
|
-
- Simplified deployment process
|
|
69
|
-
- Automatic scaling through the platform
|
|
59
|
+
### Mastra Cloud
|
|
70
60
|
|
|
71
|
-
|
|
61
|
+
We're building Mastra Cloud to be the easiest place to deploy and observe your Mastra agents. It's currently in beta.
|
|
72
62
|
|
|
73
|
-
|
|
63
|
+
Learn more in the [Mastra Cloud docs](/docs/v1/mastra-cloud/overview).
|
|
74
64
|
|
|
75
|
-
|
|
65
|
+
## Workflow Runners
|
|
76
66
|
|
|
77
|
-
-
|
|
78
|
-
- Authentication and request handling
|
|
79
|
-
- Retries and error handling
|
|
80
|
-
- Support for streaming responses
|
|
67
|
+
Mastra workflows run using the built-in execution engine by default. For production workloads requiring managed infrastructure, workflows can also be deployed to specialized platforms like [Inngest](https://www.inngest.com) that provide step memoization, automatic retries, and real-time monitoring.
|
|
81
68
|
|
|
82
|
-
[
|
|
69
|
+
Visit the [Workflow Runners guide](/docs/v1/deployment/workflow-runners) for execution options and the [Inngest deployment guide](/guides/v1/deployment/inngest) for setup instructions.
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Web Framework
|
|
2
|
+
title: "Deploy with a Web Framework | Deployment"
|
|
3
3
|
description: "Learn how Mastra can be deployed when integrated with a Web Framework"
|
|
4
|
+
packages:
|
|
5
|
+
- "@mastra/deployer"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
|
-
# Web Framework
|
|
8
|
+
# Deploy with a Web Framework
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
When Mastra is integrated with a web framework, it deploys alongside your application using the framework's standard deployment process. Follow the instructions below to ensure your Mastra integration deploys correctly.
|
|
11
|
+
|
|
12
|
+
:::warning
|
|
13
|
+
If you're deploying to a cloud provider, remove any usage of [LibSQLStore](/reference/v1/storage/libsql) from your Mastra configuration. LibSQLStore requires filesystem access and is not compatible with serverless platforms.
|
|
14
|
+
:::
|
|
15
|
+
|
|
16
|
+
Integration guides:
|
|
9
17
|
|
|
10
18
|
- [With Next.js](/guides/v1/getting-started/next-js)
|
|
11
19
|
- [With Astro](/guides/v1/getting-started/astro)
|
|
12
20
|
|
|
13
|
-
When integrated with a framework, Mastra typically requires no additional configuration for deployment.
|
|
14
|
-
|
|
15
21
|
## With Next.js on Vercel
|
|
16
22
|
|
|
17
|
-
If you've integrated Mastra with Next.js [by following our guide](/guides/v1/getting-started/next-js) and plan to deploy to Vercel,
|
|
23
|
+
If you've integrated Mastra with Next.js [by following our guide](/guides/v1/getting-started/next-js) and plan to deploy to Vercel, add `serverExternalPackages: ["@mastra/*"]` to your `next.config.ts`:
|
|
18
24
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
```typescript {4} title="next.config.ts" showLineNumbers copy
|
|
25
|
+
```typescript {4} title="next.config.ts"
|
|
22
26
|
import type { NextConfig } from "next";
|
|
23
27
|
|
|
24
28
|
const nextConfig: NextConfig = {
|
|
@@ -30,16 +34,13 @@ export default nextConfig;
|
|
|
30
34
|
|
|
31
35
|
## With Astro on Vercel
|
|
32
36
|
|
|
33
|
-
If you've integrated Mastra with Astro [by following our guide](/guides/v1/getting-started/astro) and plan to deploy to Vercel,
|
|
34
|
-
|
|
35
|
-
The only thing to verify is that you've added the following to your `astro.config.mjs` and removed any usage of [LibSQLStore](/docs/v1/deployment/overview), which is not supported in serverless environments:
|
|
37
|
+
If you've integrated Mastra with Astro [by following our guide](/guides/v1/getting-started/astro) and plan to deploy to Vercel, add the Vercel adapter and server output to your `astro.config.mjs`:
|
|
36
38
|
|
|
37
|
-
```javascript {2,6
|
|
39
|
+
```javascript {2,5-6} title="astro.config.mjs"
|
|
38
40
|
import { defineConfig } from "astro/config";
|
|
39
41
|
import vercel from "@astrojs/vercel";
|
|
40
42
|
|
|
41
43
|
export default defineConfig({
|
|
42
|
-
// ...
|
|
43
44
|
adapter: vercel(),
|
|
44
45
|
output: "server",
|
|
45
46
|
});
|
|
@@ -47,16 +48,13 @@ export default defineConfig({
|
|
|
47
48
|
|
|
48
49
|
## With Astro on Netlify
|
|
49
50
|
|
|
50
|
-
If you've integrated Mastra with Astro [by following our guide](/guides/v1/getting-started/astro) and plan to deploy to Netlify,
|
|
51
|
-
|
|
52
|
-
The only thing to verify is that you've added the following to your `astro.config.mjs` and removed any usage of [LibSQLStore](/docs/v1/deployment/overview), which is not supported in serverless environments:
|
|
51
|
+
If you've integrated Mastra with Astro [by following our guide](/guides/v1/getting-started/astro) and plan to deploy to Netlify, add the Netlify adapter and server output to your `astro.config.mjs`:
|
|
53
52
|
|
|
54
|
-
```javascript {2,6
|
|
53
|
+
```javascript {2,5-6} title="astro.config.mjs"
|
|
55
54
|
import { defineConfig } from "astro/config";
|
|
56
55
|
import netlify from "@astrojs/netlify";
|
|
57
56
|
|
|
58
57
|
export default defineConfig({
|
|
59
|
-
// ...
|
|
60
58
|
adapter: netlify(),
|
|
61
59
|
output: "server",
|
|
62
60
|
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Workflow Runners | Deployment"
|
|
3
|
+
description: "Deploy Mastra workflows to specialized workflow execution platforms"
|
|
4
|
+
packages:
|
|
5
|
+
- "@mastra/deployer"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Workflow Runners
|
|
9
|
+
|
|
10
|
+
Mastra [workflows](../workflows/overview.mdx) can be executed using the built-in workflow runner or deployed to specialized workflow execution platforms that handle orchestration, monitoring, and reliability.
|
|
11
|
+
|
|
12
|
+
## Inngest
|
|
13
|
+
|
|
14
|
+
Inngest is a developer platform for running background workflows without managing infrastructure. Mastra workflows can be deployed to Inngest, which provides step memoization, automatic retries, real-time monitoring, and suspend/resume capabilities.
|
|
15
|
+
|
|
16
|
+
Visit the [Inngest deployment guide](/guides/v1/deployment/inngest) for setup instructions and the [Inngest workflow example](https://github.com/mastra-ai/mastra/tree/main/examples/inngest) for a complete implementation.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Custom Scorers | Evals"
|
|
3
|
+
packages:
|
|
4
|
+
- "@mastra/core"
|
|
3
5
|
---
|
|
4
6
|
|
|
5
7
|
# Custom scorers
|
|
@@ -33,17 +35,19 @@ Each step can use either **functions** or **prompt objects** (LLM-based evaluati
|
|
|
33
35
|
- Natural language understanding tasks
|
|
34
36
|
- Nuanced context evaluation
|
|
35
37
|
|
|
38
|
+
**What “prompt object” means:** Instead of a function, the step is an object with `description` + `createPrompt` (and `outputSchema` for `preprocess`/`analyze`). That object tells Mastra to run the judge LLM for the step and store the structured output in `results.<step>StepResult`.
|
|
39
|
+
|
|
36
40
|
You can mix and match approaches within a single scorer - for example, use a function for preprocessing data and an LLM for analyzing quality.
|
|
37
41
|
|
|
38
42
|
### Initializing a Scorer
|
|
39
43
|
|
|
40
|
-
Every scorer starts with the `createScorer` factory function, which requires
|
|
44
|
+
Every scorer starts with the `createScorer` factory function, which requires an id and description, and optionally accepts a type specification and judge configuration.
|
|
41
45
|
|
|
42
46
|
```typescript
|
|
43
47
|
import { createScorer } from '@mastra/core/evals';
|
|
44
48
|
|
|
45
49
|
const glutenCheckerScorer = createScorer({
|
|
46
|
-
|
|
50
|
+
id: 'gluten-checker',
|
|
47
51
|
description: 'Check if recipes contain gluten ingredients',
|
|
48
52
|
judge: { // Optional: for prompt object steps
|
|
49
53
|
model: 'openai/gpt-5.1',
|
|
@@ -59,13 +63,55 @@ const glutenCheckerScorer = createScorer({
|
|
|
59
63
|
|
|
60
64
|
The judge configuration is only needed if you plan to use prompt objects in any step. Individual steps can override this default configuration with their own judge settings.
|
|
61
65
|
|
|
66
|
+
If all steps are function-based, the judge is never called and there is no judge output. To see LLM output, define at least one step as a prompt object and read the corresponding step result (for example, `results.analyzeStepResult`).
|
|
67
|
+
|
|
68
|
+
#### Minimal judge example (prompt object)
|
|
69
|
+
|
|
70
|
+
This example uses a prompt object in `analyze`, so the judge runs and its structured output is available as `results.analyzeStepResult`.
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import { createScorer } from "@mastra/core/evals";
|
|
74
|
+
import { z } from "zod";
|
|
75
|
+
|
|
76
|
+
const quoteSourcesScorer = createScorer({
|
|
77
|
+
id: "quote-sources",
|
|
78
|
+
description: "Check if the response includes sources",
|
|
79
|
+
judge: {
|
|
80
|
+
model: "openai/gpt-4.1-nano",
|
|
81
|
+
instructions: "You are a strict evaluator.",
|
|
82
|
+
},
|
|
83
|
+
})
|
|
84
|
+
.analyze({
|
|
85
|
+
description: "Detect whether sources are present",
|
|
86
|
+
outputSchema: z.object({
|
|
87
|
+
hasSources: z.boolean(),
|
|
88
|
+
sources: z.array(z.string()),
|
|
89
|
+
}),
|
|
90
|
+
createPrompt: ({ run }) => `
|
|
91
|
+
Does the response contain sources? Extract them as a list.
|
|
92
|
+
|
|
93
|
+
Response:
|
|
94
|
+
${run.output}
|
|
95
|
+
`,
|
|
96
|
+
})
|
|
97
|
+
.generateScore(({ results }) => (results.analyzeStepResult.hasSources ? 1 : 0));
|
|
98
|
+
|
|
99
|
+
// Run the scorer and inspect judge output
|
|
100
|
+
const result = await quoteSourcesScorer.run({
|
|
101
|
+
input: "What is the capital of France?",
|
|
102
|
+
output: "Paris is the capital of France [1]. Source: [1] Wikipedia",
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
console.log(result.score); // 1
|
|
106
|
+
console.log(result.analyzeStepResult); // { hasSources: true, sources: ["Wikipedia"] }
|
|
107
|
+
```
|
|
108
|
+
|
|
62
109
|
#### Agent Type for Agent Evaluation
|
|
63
110
|
|
|
64
111
|
For type safety and compatibility with both live agent scoring and trace scoring, use `type: 'agent'` when creating scorers for agent evaluation. This allows you to use the same scorer for an agent and also use it to score traces:
|
|
65
112
|
|
|
66
113
|
```typescript
|
|
67
114
|
const myScorer = createScorer({
|
|
68
|
-
// ...
|
|
69
115
|
type: "agent", // Automatically handles agent input/output types
|
|
70
116
|
}).generateScore(({ run, results }) => {
|
|
71
117
|
// run.output is automatically typed as ScorerRunOutputForAgent
|
|
@@ -241,9 +287,13 @@ A custom scorer in Mastra uses `createScorer` with four core components:
|
|
|
241
287
|
|
|
242
288
|
Together, these components allow you to define custom evaluation logic using LLMs as judges.
|
|
243
289
|
|
|
244
|
-
|
|
290
|
+
:::info
|
|
291
|
+
|
|
292
|
+
Visit [createScorer](/reference/v1/evals/create-scorer) for the full API and configuration options.
|
|
245
293
|
|
|
246
|
-
|
|
294
|
+
:::
|
|
295
|
+
|
|
296
|
+
```typescript title="src/mastra/scorers/gluten-checker.ts"
|
|
247
297
|
import { createScorer } from "@mastra/core/evals";
|
|
248
298
|
import { z } from "zod";
|
|
249
299
|
|
|
@@ -298,7 +348,7 @@ Return your response in this format:
|
|
|
298
348
|
"This recipe is [gluten-free/contains gluten] because [explanation]"`;
|
|
299
349
|
|
|
300
350
|
export const glutenCheckerScorer = createScorer({
|
|
301
|
-
|
|
351
|
+
id: "gluten-checker",
|
|
302
352
|
description: "Check if the output contains any gluten",
|
|
303
353
|
judge: {
|
|
304
354
|
model: "openai/gpt-4.1-nano",
|
|
@@ -395,11 +445,9 @@ Provides human-readable explanations for the score using another LLM call.
|
|
|
395
445
|
|
|
396
446
|
The reason generation step creates explanations that help users understand why a particular score was assigned, using both the boolean result and the specific gluten sources identified by the analysis step.
|
|
397
447
|
|
|
398
|
-
````
|
|
399
|
-
|
|
400
448
|
## High gluten-free example
|
|
401
449
|
|
|
402
|
-
```typescript title="src/example-high-gluten-free.ts"
|
|
450
|
+
```typescript title="src/example-high-gluten-free.ts"
|
|
403
451
|
const result = await glutenCheckerScorer.run({
|
|
404
452
|
input: [{ role: 'user', content: 'Mix rice, beans, and vegetables' }],
|
|
405
453
|
output: { text: 'Mix rice, beans, and vegetables' },
|
|
@@ -408,7 +456,7 @@ const result = await glutenCheckerScorer.run({
|
|
|
408
456
|
console.log('Score:', result.score);
|
|
409
457
|
console.log('Gluten sources:', result.analyzeStepResult.glutenSources);
|
|
410
458
|
console.log('Reason:', result.reason);
|
|
411
|
-
|
|
459
|
+
```
|
|
412
460
|
|
|
413
461
|
### High gluten-free output
|
|
414
462
|
|
|
@@ -425,7 +473,7 @@ console.log('Reason:', result.reason);
|
|
|
425
473
|
|
|
426
474
|
## Partial gluten example
|
|
427
475
|
|
|
428
|
-
```typescript title="src/example-partial-gluten.ts"
|
|
476
|
+
```typescript title="src/example-partial-gluten.ts"
|
|
429
477
|
const result = await glutenCheckerScorer.run({
|
|
430
478
|
input: [{ role: "user", content: "Mix flour and water to make dough" }],
|
|
431
479
|
output: { text: "Mix flour and water to make dough" },
|
|
@@ -451,7 +499,7 @@ console.log("Reason:", result.reason);
|
|
|
451
499
|
|
|
452
500
|
## Low gluten-free example
|
|
453
501
|
|
|
454
|
-
```typescript title="src/example-low-gluten-free.ts"
|
|
502
|
+
```typescript title="src/example-low-gluten-free.ts"
|
|
455
503
|
const result = await glutenCheckerScorer.run({
|
|
456
504
|
input: [{ role: "user", content: "Add soy sauce and noodles" }],
|
|
457
505
|
output: { text: "Add soy sauce and noodles" },
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Scorers overview | Evals"
|
|
3
3
|
description: Overview of scorers in Mastra, detailing their capabilities for evaluating AI outputs and measuring performance.
|
|
4
|
+
packages:
|
|
5
|
+
- "@mastra/core"
|
|
6
|
+
- "@mastra/evals"
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# Scorers overview
|
|
@@ -23,7 +26,7 @@ There are different kinds of scorers, each serving a specific purpose. Here are
|
|
|
23
26
|
|
|
24
27
|
To access Mastra's scorers feature install the `@mastra/evals` package.
|
|
25
28
|
|
|
26
|
-
```bash
|
|
29
|
+
```bash
|
|
27
30
|
npm install @mastra/evals@beta
|
|
28
31
|
```
|
|
29
32
|
|
|
@@ -35,7 +38,7 @@ npm install @mastra/evals@beta
|
|
|
35
38
|
|
|
36
39
|
You can add built-in scorers to your agents to automatically evaluate their outputs. See the [full list of built-in scorers](/docs/v1/evals/built-in-scorers) for all available options.
|
|
37
40
|
|
|
38
|
-
```typescript title="src/mastra/agents/evaluated-agent.ts"
|
|
41
|
+
```typescript title="src/mastra/agents/evaluated-agent.ts"
|
|
39
42
|
import { Agent } from "@mastra/core/agent";
|
|
40
43
|
import {
|
|
41
44
|
createAnswerRelevancyScorer,
|
|
@@ -43,7 +46,6 @@ import {
|
|
|
43
46
|
} from "@mastra/evals/scorers/prebuilt";
|
|
44
47
|
|
|
45
48
|
export const evaluatedAgent = new Agent({
|
|
46
|
-
// ...
|
|
47
49
|
scorers: {
|
|
48
50
|
relevancy: {
|
|
49
51
|
scorer: createAnswerRelevancyScorer({ model: "openai/gpt-4.1-nano" }),
|
|
@@ -61,13 +63,12 @@ export const evaluatedAgent = new Agent({
|
|
|
61
63
|
|
|
62
64
|
You can also add scorers to individual workflow steps to evaluate outputs at specific points in your process:
|
|
63
65
|
|
|
64
|
-
```typescript title="src/mastra/workflows/content-generation.ts"
|
|
66
|
+
```typescript title="src/mastra/workflows/content-generation.ts"
|
|
65
67
|
import { createWorkflow, createStep } from "@mastra/core/workflows";
|
|
66
68
|
import { z } from "zod";
|
|
67
69
|
import { customStepScorer } from "../scorers/custom-step-scorer";
|
|
68
70
|
|
|
69
71
|
const contentStep = createStep({
|
|
70
|
-
// ...
|
|
71
72
|
scorers: {
|
|
72
73
|
customStepScorer: {
|
|
73
74
|
scorer: customStepScorer(),
|
|
@@ -115,7 +116,6 @@ To score traces, you first need to register your scorers with your Mastra instan
|
|
|
115
116
|
|
|
116
117
|
```typescript
|
|
117
118
|
const mastra = new Mastra({
|
|
118
|
-
// ...
|
|
119
119
|
scorers: {
|
|
120
120
|
answerRelevancy: myAnswerRelevancyScorer,
|
|
121
121
|
responseQuality: myResponseQualityScorer,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Running Scorers in CI | Evals"
|
|
3
3
|
description: "Learn how to run scorer experiments in your CI/CD pipeline using the runEvals function."
|
|
4
|
+
packages:
|
|
5
|
+
- "@mastra/core"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Running Scorers in CI
|
|
@@ -15,7 +17,7 @@ You can use any testing framework that supports ESM modules, such as [Vitest](ht
|
|
|
15
17
|
|
|
16
18
|
Use `runEvals` to evaluate your agent against multiple test cases. The function accepts an array of data items, each containing an `input` and optional `groundTruth` for scorer validation.
|
|
17
19
|
|
|
18
|
-
```typescript
|
|
20
|
+
```typescript title="src/mastra/agents/weather-agent.test.ts"
|
|
19
21
|
import { describe, it, expect } from 'vitest';
|
|
20
22
|
import { createScorer, runEvals } from "@mastra/core/evals";
|
|
21
23
|
import { weatherAgent } from "./weather-agent";
|
|
@@ -72,7 +74,7 @@ The `runEvals` function returns an object with:
|
|
|
72
74
|
|
|
73
75
|
Create separate test cases for different evaluation scenarios:
|
|
74
76
|
|
|
75
|
-
```typescript
|
|
77
|
+
```typescript title="src/mastra/agents/weather-agent.test.ts"
|
|
76
78
|
describe('Weather Agent Tests', () => {
|
|
77
79
|
const locationScorer = createScorer({ /* ... */ });
|
|
78
80
|
|