@mastra/mcp-docs-server 1.0.0-beta.9 → 1.0.1
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 +3 -1
- package/.docs/organized/changelogs/%40internal%2Fexternal-types.md +3 -1
- package/.docs/organized/changelogs/%40internal%2Fplayground.md +60 -0
- package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +15 -15
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +3 -1
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +287 -287
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +302 -302
- 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 +239 -239
- 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 +202 -0
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +448 -22
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +348 -348
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +60 -60
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +287 -287
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +106 -106
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +90 -90
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +86 -86
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +221 -221
- 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 +625 -229
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +71 -71
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +245 -245
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +28 -28
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +281 -281
- 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 +781 -235
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +198 -198
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +282 -282
- 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 -237
- 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 +230 -230
- 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 +219 -219
- package/.docs/organized/changelogs/mastra.md +276 -276
- 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 +2 -2
- 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/quick-start.md +1 -5
- package/.docs/organized/code-examples/server-app-access.md +2 -2
- 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 +2 -2
- 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 +6 -35
- package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +23 -33
- 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/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 +77 -35
- 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 +4 -2
- package/.docs/raw/reference/client-js/memory.mdx +43 -1
- 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 +7 -3
- 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 +6 -4
- 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 +8 -4
- package/.docs/raw/reference/core/listScorers.mdx +2 -0
- package/.docs/raw/reference/core/listStoredAgents.mdx +7 -5
- 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 +27 -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 +27 -51
- package/.docs/raw/reference/server/fastify-adapter.mdx +130 -0
- package/.docs/raw/reference/server/hono-adapter.mdx +27 -51
- 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-db → server}/server-adapters.mdx +154 -33
- package/.docs/raw/streaming/events.mdx +16 -7
- package/.docs/raw/streaming/overview.mdx +30 -17
- package/.docs/raw/streaming/tool-streaming.mdx +8 -6
- 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 +260 -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/workflows/inngest-workflow.mdx +0 -363
|
@@ -153,7 +153,6 @@ Step `suspendPayload` is now validated for steps that have a `suspendSchema` def
|
|
|
153
153
|
- return suspend({ reason: "Suspension reason" }); // Missing otherReason
|
|
154
154
|
+ return suspend({ reason: "Suspension reason", otherReason: "Other reason" });
|
|
155
155
|
}
|
|
156
|
-
//... continue execution logic
|
|
157
156
|
},
|
|
158
157
|
});
|
|
159
158
|
```
|
|
@@ -177,13 +176,54 @@ To migrate, update any code that consumes branch outputs to handle optional valu
|
|
|
177
176
|
|
|
178
177
|
If your code depends on non-optional types, add runtime checks or provide default values when accessing branch outputs.
|
|
179
178
|
|
|
180
|
-
### `
|
|
179
|
+
### `writableStream` to `outputWriter` in `Run.start()` & `Run.timeTravel()`
|
|
181
180
|
|
|
182
|
-
The `
|
|
183
|
-
The state data validation also uses the `validateInputs` flag to determine whether to validate the state data or not.
|
|
184
|
-
Also, when calling `setState`, you can now pass only the state data being updated, instead of adding the previous state spread (`...state`).
|
|
181
|
+
The `writableStream` parameter in `Run.start()` and `Run.timeTravel()` has been replaced with `outputWriter`. Instead of passing a `WritableStream`, you now pass an async callback function that receives each workflow event chunk directly.
|
|
185
182
|
|
|
186
|
-
|
|
183
|
+
This change simplifies the API - rather than creating a `WritableStream` wrapper, you handle chunks directly in the callback.
|
|
184
|
+
|
|
185
|
+
**Example:** Streaming workflow events to an HTTP response (SSE):
|
|
186
|
+
|
|
187
|
+
```diff
|
|
188
|
+
const run = await workflow.createRun();
|
|
189
|
+
|
|
190
|
+
- const stream = new WritableStream({
|
|
191
|
+
- write(chunk) {
|
|
192
|
+
- response.write(`data: ${JSON.stringify(chunk)}\n\n`);
|
|
193
|
+
- }
|
|
194
|
+
- });
|
|
195
|
+
- await run.start({ inputData, writableStream: stream });
|
|
196
|
+
|
|
197
|
+
+ await run.start({
|
|
198
|
+
+ inputData,
|
|
199
|
+
+ outputWriter: async (chunk) => {
|
|
200
|
+
+ response.write(`data: ${JSON.stringify(chunk)}\n\n`);
|
|
201
|
+
+ },
|
|
202
|
+
+ });
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
:::note
|
|
206
|
+
|
|
207
|
+
The `writer` parameter passed to step `execute` functions is not affected by this change. It remains a `ToolStream` that extends `WritableStream<unknown>` and provides `.write()` and `.custom()` methods:
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
createStep({
|
|
211
|
+
id: 'my-step',
|
|
212
|
+
execute: async ({ writer }) => {
|
|
213
|
+
// This API is unchanged
|
|
214
|
+
await writer.write({ data: 'some output' });
|
|
215
|
+
await writer.custom({ type: 'custom-event', payload: {} });
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
:::
|
|
221
|
+
|
|
222
|
+
### `setState()` is now async and the data passed is validated
|
|
223
|
+
|
|
224
|
+
The `setState()` function is now async. The data passed is now validated against the `stateSchema` defined in the step. The state data validation also uses the `validateInputs` flag to determine whether to validate the state data or not. Also, when calling `setState()`, you can now pass only the state data being updated, instead of adding the previous state spread `(...state)`.
|
|
225
|
+
|
|
226
|
+
To migrate, update the `setState()` function to be async.
|
|
187
227
|
|
|
188
228
|
```diff
|
|
189
229
|
- setState({ ...state, sharedCounter: state.sharedCounter + 1 });
|
|
@@ -293,7 +333,6 @@ createStep({
|
|
|
293
333
|
+ if (!context.resumeData) {
|
|
294
334
|
+ return context.suspend({})
|
|
295
335
|
+ }
|
|
296
|
-
+ //..continue execution logic
|
|
297
336
|
+ }
|
|
298
337
|
});
|
|
299
338
|
+
|
|
@@ -308,3 +347,7 @@ createStep({
|
|
|
308
347
|
+ });
|
|
309
348
|
+ }
|
|
310
349
|
```
|
|
350
|
+
|
|
351
|
+
### `sendEvent` API
|
|
352
|
+
|
|
353
|
+
The `sendEvent` API has been removed from workflows. Use the suspend/resume API instead.
|
|
@@ -106,7 +106,7 @@ See the following API references for more information:
|
|
|
106
106
|
|
|
107
107
|
No `format` option: Always return AI SDK v4 types
|
|
108
108
|
|
|
109
|
-
```typescript
|
|
109
|
+
```typescript
|
|
110
110
|
// Mastra native format (default)
|
|
111
111
|
const result = await agent.stream(messages);
|
|
112
112
|
```
|
|
@@ -118,7 +118,7 @@ Use `format` option to choose output:
|
|
|
118
118
|
- `'mastra'` (default)
|
|
119
119
|
- `'aisdk'` (AI SDK v5 compatible)
|
|
120
120
|
|
|
121
|
-
```typescript
|
|
121
|
+
```typescript
|
|
122
122
|
// AI SDK v5 compatibility
|
|
123
123
|
const result = await agent.stream(messages, {
|
|
124
124
|
format: "aisdk",
|
|
@@ -131,7 +131,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
131
131
|
|
|
132
132
|
- `format` - Choose between 'mastra' or 'aisdk' output format:
|
|
133
133
|
|
|
134
|
-
```typescript
|
|
134
|
+
```typescript copy
|
|
135
135
|
const result = await agent.stream(messages, {
|
|
136
136
|
format: "aisdk", // or 'mastra' (default)
|
|
137
137
|
});
|
|
@@ -139,7 +139,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
139
139
|
|
|
140
140
|
- `system` - Custom system message (separate from instructions).
|
|
141
141
|
|
|
142
|
-
```typescript
|
|
142
|
+
```typescript copy
|
|
143
143
|
const result = await agent.stream(messages, {
|
|
144
144
|
system: "You are a helpful assistant",
|
|
145
145
|
});
|
|
@@ -153,7 +153,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
153
153
|
- 'error' - throw an error
|
|
154
154
|
- 'fallback' - return a fallback value you provide
|
|
155
155
|
|
|
156
|
-
```typescript
|
|
156
|
+
```typescript copy
|
|
157
157
|
const result = await agent.generate(messages, {
|
|
158
158
|
structuredOutput: {
|
|
159
159
|
schema: z.object({
|
|
@@ -170,7 +170,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
170
170
|
|
|
171
171
|
- `stopWhen` - Flexible stop conditions (step count, token limit, etc).
|
|
172
172
|
|
|
173
|
-
```typescript
|
|
173
|
+
```typescript copy
|
|
174
174
|
const result = await agent.stream(messages, {
|
|
175
175
|
stopWhen: ({ steps, totalTokens }) => steps >= 5 || totalTokens >= 10000,
|
|
176
176
|
});
|
|
@@ -178,7 +178,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
178
178
|
|
|
179
179
|
- `providerOptions` - Provider-specific options (e.g., OpenAI-specific settings)
|
|
180
180
|
|
|
181
|
-
```typescript
|
|
181
|
+
```typescript copy
|
|
182
182
|
const result = await agent.stream(messages, {
|
|
183
183
|
providerOptions: {
|
|
184
184
|
openai: {
|
|
@@ -191,7 +191,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
191
191
|
|
|
192
192
|
- `onChunk` - Callback for each streaming chunk.
|
|
193
193
|
|
|
194
|
-
```typescript
|
|
194
|
+
```typescript copy
|
|
195
195
|
const result = await agent.stream(messages, {
|
|
196
196
|
onChunk: (chunk) => {
|
|
197
197
|
console.log("Received chunk:", chunk);
|
|
@@ -201,7 +201,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
201
201
|
|
|
202
202
|
- `onError` - Error callback.
|
|
203
203
|
|
|
204
|
-
```typescript
|
|
204
|
+
```typescript copy
|
|
205
205
|
const result = await agent.stream(messages, {
|
|
206
206
|
onError: (error) => {
|
|
207
207
|
console.error("Stream error:", error);
|
|
@@ -211,7 +211,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
211
211
|
|
|
212
212
|
- `onAbort` - Abort callback.
|
|
213
213
|
|
|
214
|
-
```typescript
|
|
214
|
+
```typescript copy
|
|
215
215
|
const result = await agent.stream(messages, {
|
|
216
216
|
onAbort: () => {
|
|
217
217
|
console.log("Stream aborted");
|
|
@@ -221,7 +221,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
221
221
|
|
|
222
222
|
- `activeTools` - Specify which tools are active for this execution.
|
|
223
223
|
|
|
224
|
-
```typescript
|
|
224
|
+
```typescript copy
|
|
225
225
|
const result = await agent.stream(messages, {
|
|
226
226
|
activeTools: ["search", "calculator"], // Only these tools will be available
|
|
227
227
|
});
|
|
@@ -229,7 +229,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
229
229
|
|
|
230
230
|
- `abortSignal` - AbortSignal for cancellation.
|
|
231
231
|
|
|
232
|
-
```typescript
|
|
232
|
+
```typescript copy
|
|
233
233
|
const controller = new AbortController();
|
|
234
234
|
const result = await agent.stream(messages, {
|
|
235
235
|
abortSignal: controller.signal,
|
|
@@ -240,7 +240,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
240
240
|
|
|
241
241
|
- `prepareStep` - Callback before each step in multi-step execution.
|
|
242
242
|
|
|
243
|
-
```typescript
|
|
243
|
+
```typescript copy
|
|
244
244
|
const result = await agent.stream(messages, {
|
|
245
245
|
prepareStep: ({ step, state }) => {
|
|
246
246
|
console.log("About to execute step:", step);
|
|
@@ -253,7 +253,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
253
253
|
|
|
254
254
|
- `requireToolApproval` - Require approval for all tool calls.
|
|
255
255
|
|
|
256
|
-
```typescript
|
|
256
|
+
```typescript copy
|
|
257
257
|
const result = await agent.stream(messages, {
|
|
258
258
|
requireToolApproval: true,
|
|
259
259
|
});
|
|
@@ -265,7 +265,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
265
265
|
|
|
266
266
|
Unified in `modelSettings`
|
|
267
267
|
|
|
268
|
-
```typescript
|
|
268
|
+
```typescript copy
|
|
269
269
|
const result = await agent.stream(messages, {
|
|
270
270
|
modelSettings: {
|
|
271
271
|
temperature: 0.7,
|
|
@@ -279,7 +279,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
279
279
|
|
|
280
280
|
Moved to memory object.
|
|
281
281
|
|
|
282
|
-
```typescript
|
|
282
|
+
```typescript copy
|
|
283
283
|
const result = await agent.stream(messages, {
|
|
284
284
|
memory: {
|
|
285
285
|
resource: "user-123",
|
|
@@ -294,7 +294,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
294
294
|
|
|
295
295
|
Use `structuredOutput` instead to allow for tool calls and an object return.
|
|
296
296
|
|
|
297
|
-
```typescript
|
|
297
|
+
```typescript copy
|
|
298
298
|
const result = await agent.generate(messages, {
|
|
299
299
|
structuredOutput: {
|
|
300
300
|
schema: z.object({
|
|
@@ -309,7 +309,7 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
309
309
|
|
|
310
310
|
The `output` property is deprecated in favor of `structuredOutput`, to achieve the same results, omit the model and only pass `structuredOutput.schema`, optionally add `jsonPromptInjection: true` if your model does not natively support `response_format`.
|
|
311
311
|
|
|
312
|
-
```typescript
|
|
312
|
+
```typescript copy
|
|
313
313
|
const result = await agent.generate(messages, {
|
|
314
314
|
structuredOutput: {
|
|
315
315
|
schema: {
|
|
@@ -325,11 +325,9 @@ The following options are available in the standard `.stream()` and `generate()`
|
|
|
325
325
|
|
|
326
326
|
Use `memory` instead.
|
|
327
327
|
|
|
328
|
-
```typescript
|
|
328
|
+
```typescript copy
|
|
329
329
|
const result = await agent.generate(messages, {
|
|
330
|
-
memory: {
|
|
331
|
-
// ...
|
|
332
|
-
},
|
|
330
|
+
memory: {},
|
|
333
331
|
});
|
|
334
332
|
```
|
|
335
333
|
|
|
@@ -350,7 +348,7 @@ See the following API references for more information:
|
|
|
350
348
|
|
|
351
349
|
`toolChoice` uses the AI SDK v5 `ToolChoice` type.
|
|
352
350
|
|
|
353
|
-
```typescript
|
|
351
|
+
```typescript copy
|
|
354
352
|
type ToolChoice<TOOLS extends Record<string, unknown>> =
|
|
355
353
|
| "auto"
|
|
356
354
|
| "none"
|
package/.docs/raw/index.mdx
CHANGED
|
@@ -27,9 +27,9 @@ Some highlights include:
|
|
|
27
27
|
|
|
28
28
|
- [**Workflows**](/docs/v1/workflows/overview) - When you need explicit control over execution, use Mastra's graph-based workflow engine to orchestrate complex multi-step processes. Mastra workflows use an intuitive syntax for control flow (`.then()`, `.branch()`, `.parallel()`).
|
|
29
29
|
|
|
30
|
-
- [**Human-in-the-loop**](/docs/v1/workflows/suspend-and-resume) - Suspend an agent or workflow and await user input or approval before resuming. Mastra uses
|
|
30
|
+
- [**Human-in-the-loop**](/docs/v1/workflows/suspend-and-resume) - Suspend an agent or workflow and await user input or approval before resuming. Mastra uses storage to remember execution state, so you can pause indefinitely and resume where you left off.
|
|
31
31
|
|
|
32
|
-
- **Context management** - Give your agents the right context at the right time. Provide [
|
|
32
|
+
- **Context management** - Give your agents the right context at the right time. Provide [message history](/docs/v1/memory/message-history), [retrieve](/docs/v1/rag/overview) data from your sources (APIs, databases, files), and add human-like [working](/docs/v1/memory/working-memory) and [semantic](/docs/v1/memory/semantic-recall) memory so your agents behave coherently.
|
|
33
33
|
|
|
34
34
|
- **Integrations** - Bundle agents and workflows into existing React, Next.js, or Node.js apps, or ship them as standalone endpoints. When building UIs, integrate with agentic libraries like Vercel's AI SDK UI and CopilotKit to bring your AI assistant to life on the web.
|
|
35
35
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Deployment | Mastra Cloud"
|
|
3
|
+
description: Deploy your Mastra application to production
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Deployment
|
|
7
|
+
|
|
8
|
+
Deploy your Mastra application to production and expose your agents, tools, and workflows as REST API endpoints.
|
|
9
|
+
|
|
10
|
+
:::info
|
|
11
|
+
Mastra Cloud is currently in beta, but many teams are already using it to deploy their agents. It's the easiest way to run Mastra agents in a managed environment.
|
|
12
|
+
:::
|
|
13
|
+
|
|
14
|
+
## Enable deployments
|
|
15
|
+
|
|
16
|
+
After [setting up your project](/docs/v1/mastra-cloud/setup), click **Deployment** in the sidebar and select **Enable Deployments**.
|
|
17
|
+
|
|
18
|
+
Once enabled, your project automatically builds and deploys. Future pushes to your main branch trigger automatic redeployments.
|
|
19
|
+
|
|
20
|
+
## Dashboard
|
|
21
|
+
|
|
22
|
+
The **Overview** page shows your project's domain URL, status, latest deployment, and connected agents and workflows.
|
|
23
|
+
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
Click the **Deployments** menu item to view build logs. Open **Settings** to configure environment variables, branch, storage, and endpoint URLs.
|
|
27
|
+
|
|
28
|
+
:::note
|
|
29
|
+
Changes to settings require a new deployment to take effect
|
|
30
|
+
:::
|
|
31
|
+
|
|
32
|
+
## Storage configuration
|
|
33
|
+
|
|
34
|
+
Mastra Cloud offers two storage options:
|
|
35
|
+
|
|
36
|
+
1. **Mastra Cloud Store**: Managed storage provided by Mastra Cloud
|
|
37
|
+
1. **Bring your own database**: Connect to your own external database
|
|
38
|
+
|
|
39
|
+
### Using Mastra Cloud Store
|
|
40
|
+
|
|
41
|
+
When using the managed Mastra Cloud Store (enabled in your project settings), storage must be configured on the `Mastra` instance, not on individual agent `Memory` instances.
|
|
42
|
+
|
|
43
|
+
Configure storage on your Mastra instance:
|
|
44
|
+
|
|
45
|
+
```typescript title="src/mastra/index.ts"
|
|
46
|
+
import { Mastra } from "@mastra/core";
|
|
47
|
+
import { LibSQLStore } from "@mastra/libsql";
|
|
48
|
+
|
|
49
|
+
export const mastra = new Mastra({
|
|
50
|
+
storage: new LibSQLStore({
|
|
51
|
+
id: "mastra-store",
|
|
52
|
+
url: "file:./mastra.db",
|
|
53
|
+
}),
|
|
54
|
+
agents: { myAgent },
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Agents can use Memory without specifying storage as they inherit from the Mastra instance:
|
|
59
|
+
|
|
60
|
+
```typescript title="src/mastra/agents/my-agent.ts"
|
|
61
|
+
import { Agent } from "@mastra/core/agent";
|
|
62
|
+
import { Memory } from "@mastra/memory";
|
|
63
|
+
|
|
64
|
+
export const myAgent = new Agent({
|
|
65
|
+
id: "my-agent",
|
|
66
|
+
memory: new Memory({
|
|
67
|
+
// No storage here - uses instance-level storage from Mastra Cloud Store
|
|
68
|
+
options: {
|
|
69
|
+
lastMessages: 20,
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Bring your own database
|
|
76
|
+
|
|
77
|
+
If you don't use Mastra Cloud Store, you can use any [storage provider](/docs/v1/memory/storage#supported-providers) with any configuration. Set your database connection strings as environment variables in your project's **Settings** page.
|
|
78
|
+
|
|
79
|
+
## Using your deployment
|
|
80
|
+
|
|
81
|
+
After deployment, interact with your agents using the [Mastra Client](/docs/v1/server/mastra-client) or call the REST API endpoints directly.
|
|
82
|
+
|
|
83
|
+
## Next steps
|
|
84
|
+
|
|
85
|
+
- [Studio](/docs/v1/mastra-cloud/studio) - Test your agents in the cloud
|
|
86
|
+
- [Observability](/docs/v1/mastra-cloud/observability) - Monitor traces and logs
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Observability | Mastra Cloud"
|
|
3
|
+
description: Monitoring and debugging tools for Mastra Cloud deployments
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Observability
|
|
7
|
+
|
|
8
|
+
Cloud provides observability for production applications, giving you insight into how your agents and workflows behave. Observability works whether your application is deployed to Mastra Cloud, running locally, or hosted on your own infrastructure. Any Mastra project can send traces and logs to the platform regardless of where it's running.
|
|
9
|
+
|
|
10
|
+
For details on configuring observability, see the [Cloud Exporter](/docs/v1/observability/tracing/exporters/cloud) docs.
|
|
11
|
+
|
|
12
|
+
## Traces
|
|
13
|
+
|
|
14
|
+
Traces are available for both agents and workflows by enabling [observability](/docs/v1/observability/tracing/overview) using one of the [supported providers](/docs/v1/observability/tracing/overview#exporters).
|
|
15
|
+
|
|
16
|
+
### Agents
|
|
17
|
+
|
|
18
|
+
With observability enabled, you can view detailed outputs from your agents in the **Traces** section in [Studio](/docs/v1/mastra-cloud/studio).
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
Agent traces break a run into clear steps: model calls, tool calls, and intermediate chunks. Each includes timing, inputs, outputs, and errors. Drill into any span to inspect prompts, token usage, and results.
|
|
23
|
+
|
|
24
|
+
### Workflows
|
|
25
|
+
|
|
26
|
+
With observability enabled, you can view detailed outputs from your workflows in the **Traces** section in [Studio](/docs/v1/mastra-cloud/studio).
|
|
27
|
+
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
Workflow traces capture each step in the run, including transitions, branching, timing, and any tool calls. Inspect inputs, outputs, and errors for every step to debug long-running or multi-step processes.
|
|
31
|
+
|
|
32
|
+
## Logs
|
|
33
|
+
|
|
34
|
+
The **Logs** page in the [project dashboard](/docs/v1/mastra-cloud/deployment#dashboard) displays detailed information for debugging and monitoring your application's behavior.
|
|
35
|
+
|
|
36
|
+

|
|
37
|
+
|
|
38
|
+
Each log entry includes its severity level and a detailed message showing agent, workflow, or storage activity.
|
|
39
|
+
|
|
40
|
+
## Next steps
|
|
41
|
+
|
|
42
|
+
- [Logging](/docs/v1/observability/logging)
|
|
43
|
+
- [Tracing](/docs/v1/observability/tracing/overview)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Mastra Cloud | Mastra Cloud"
|
|
3
|
+
description: Deployment and monitoring service for Mastra applications
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra Cloud
|
|
7
|
+
|
|
8
|
+
[Mastra Cloud](https://cloud.mastra.ai) is a platform for deploying, managing, and monitoring Mastra applications. [Import your project](/docs/v1/mastra-cloud/setup) to get started.
|
|
9
|
+
|
|
10
|
+
## Studio
|
|
11
|
+
|
|
12
|
+
Run [Studio](/docs/v1/mastra-cloud/studio) in the cloud and share access with your team via a link. Team members can test agents and workflows, tweak system prompts, and give feedback without running the project locally.
|
|
13
|
+
|
|
14
|
+
## Deploy
|
|
15
|
+
|
|
16
|
+
Enable [deployments](/docs/v1/mastra-cloud/deployment) and Mastra Cloud hosts your server for you. Connect your GitHub repository for automatic deployments whenever you push to your configured branch. Mastra Cloud exposes your agents, tools, and workflows as REST API endpoints.
|
|
17
|
+
|
|
18
|
+
Once deployed, the project dashboard gives you visibility into:
|
|
19
|
+
|
|
20
|
+
- Deployment status and history
|
|
21
|
+
- Build logs and configuration
|
|
22
|
+
- Environment variables and settings
|
|
23
|
+
|
|
24
|
+
## Observability
|
|
25
|
+
|
|
26
|
+
[Observability](/docs/v1/mastra-cloud/observability) provides insight into how your agents and workflows behave in production. View detailed traces of agent runs, workflow executions, and logs to debug issues and understand performance.
|
|
27
|
+
|
|
28
|
+
:::info
|
|
29
|
+
You don’t need to deploy to Mastra Cloud to use Observability. You can send traces to Mastra from any environment
|
|
30
|
+
:::
|
|
31
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Setup | Mastra Cloud"
|
|
3
|
+
description: Import your Mastra project to Mastra Cloud
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import Steps from "@site/src/components/Steps";
|
|
7
|
+
import StepItem from "@site/src/components/StepItem";
|
|
8
|
+
|
|
9
|
+
# Setup
|
|
10
|
+
|
|
11
|
+
Import your Mastra project to [Mastra Cloud](https://cloud.mastra.ai) to use [Studio](/docs/v1/mastra-cloud/studio) and optionally [deploy](/docs/v1/mastra-cloud/deployment) your agent.
|
|
12
|
+
|
|
13
|
+
## Before you begin
|
|
14
|
+
|
|
15
|
+
- [Sign in](https://cloud.mastra.ai) to Cloud
|
|
16
|
+
- Push your [Mastra project](/docs/v1/getting-started/start) to GitHub
|
|
17
|
+
|
|
18
|
+
## Options
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
When you create a new project, you can choose from three options:
|
|
24
|
+
|
|
25
|
+
1. **Create from GitHub** - Import a Mastra project from GitHub
|
|
26
|
+
2. **Create from your server** - Connect a self-hosted Mastra instance to [Studio](/docs/v1/mastra-cloud/studio)
|
|
27
|
+
3. **Create from template** - Start from a [pre-built template](https://mastra.ai/templates)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
To create a project from GitHub, follow these steps:
|
|
31
|
+
|
|
32
|
+
## Create from GitHub
|
|
33
|
+
|
|
34
|
+
<Steps>
|
|
35
|
+
|
|
36
|
+
<StepItem>
|
|
37
|
+
Connect to GitHub when prompted
|
|
38
|
+
|
|
39
|
+

|
|
40
|
+
</StepItem>
|
|
41
|
+
|
|
42
|
+
<StepItem>
|
|
43
|
+
Search for your repository and click **Import**
|
|
44
|
+
|
|
45
|
+

|
|
46
|
+
</StepItem>
|
|
47
|
+
|
|
48
|
+
<StepItem>
|
|
49
|
+
Configure your project settings. Mastra Cloud auto-detects most settings, but you'll still need to enter the environment variables for your configured [model provider](/models/v1):
|
|
50
|
+
|
|
51
|
+

|
|
52
|
+
</StepItem>
|
|
53
|
+
|
|
54
|
+
<StepItem>
|
|
55
|
+
|
|
56
|
+
Click **Create Project**
|
|
57
|
+
</StepItem>
|
|
58
|
+
</Steps>
|
|
59
|
+
|
|
60
|
+
## Next steps
|
|
61
|
+
|
|
62
|
+
Once your project is imported, [Studio](/docs/v1/mastra-cloud/studio) automatically creates a sandbox where you can interact with your agents and share access with your team.
|
|
63
|
+
|
|
64
|
+
When you're ready for production, enable [Deployment](/docs/v1/mastra-cloud/deployment) settings and hit deploy!
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Studio | Mastra Cloud"
|
|
3
|
+
description: Run Studio in the cloud for team collaboration
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import YouTube from "@site/src/components/YouTube-player";
|
|
7
|
+
|
|
8
|
+
# Studio
|
|
9
|
+
|
|
10
|
+
<YouTube id="ojGu6Bi4wYk" />
|
|
11
|
+
|
|
12
|
+
Mastra Cloud provides a hosted version of [Studio](/docs/v1/getting-started/studio) that gives your team a shared environment for interacting with and testing your agents. Team members can chat with agents, review traces, give feedback, and tweak system prompts - without needing to run the project locally.
|
|
13
|
+
|
|
14
|
+
[Set up your project](/docs/v1/mastra-cloud/setup) to access Studio in the cloud.
|
|
15
|
+
|
|
16
|
+
See the [Studio documentation](/docs/v1/getting-started/studio) for details on features like the Agents playground, Workflows runner, Tools testing, and MCP Servers.
|
|
17
|
+
|
|
18
|
+
:::note
|
|
19
|
+
You don't need to deploy your agent to use Studio. Studio runs in a sandbox environment separate from your production deployment
|
|
20
|
+
:::
|
|
21
|
+
|
|
22
|
+
## Sharing access
|
|
23
|
+
|
|
24
|
+
To invite team members, go to [Mastra Cloud](https://cloud.mastra.ai), click **Team Settings**, then **Members** to add them. Once invited, they can sign in and access your project's Studio.
|
|
25
|
+
|
|
26
|
+

|
|
27
|
+
|
|
28
|
+
:::warning
|
|
29
|
+
Team members can view environment variables and delete projects. Only invite people you trust.
|
|
30
|
+
:::
|
|
31
|
+
|
|
32
|
+
## Next steps
|
|
33
|
+
|
|
34
|
+
- [Deployment](/docs/v1/mastra-cloud/deployment) - Manage deployments and settings
|
|
35
|
+
- [Observability](/docs/v1/mastra-cloud/observability) - Monitor traces and logs
|