@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
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Reference: CLI Commands | CLI"
|
|
3
3
|
description: Documentation for the Mastra CLI to develop, build, and start your project.
|
|
4
|
+
packages:
|
|
5
|
+
- "@mastra/core"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# CLI Commands
|
|
@@ -19,7 +21,7 @@ The command accepts [common flags][common-flags] and the following additional fl
|
|
|
19
21
|
|
|
20
22
|
#### `--https`
|
|
21
23
|
|
|
22
|
-
Enable local HTTPS support. [Learn more](/
|
|
24
|
+
Enable local HTTPS support. [Learn more](/reference/v1/configuration#serverhttps).
|
|
23
25
|
|
|
24
26
|
#### `--inspect`
|
|
25
27
|
|
|
@@ -41,7 +43,7 @@ You can set certain environment variables to modify the behavior of `mastra dev`
|
|
|
41
43
|
|
|
42
44
|
Set `MASTRA_DEV_NO_CACHE=1` to force a full rebuild rather than using the cached assets under `.mastra/`:
|
|
43
45
|
|
|
44
|
-
```bash
|
|
46
|
+
```bash
|
|
45
47
|
MASTRA_DEV_NO_CACHE=1 mastra dev
|
|
46
48
|
```
|
|
47
49
|
|
|
@@ -51,7 +53,7 @@ This helps when you are debugging bundler plugins or suspect stale output.
|
|
|
51
53
|
|
|
52
54
|
`MASTRA_CONCURRENCY` caps how many expensive operations run in parallel (primarily build and evaluation steps). For example:
|
|
53
55
|
|
|
54
|
-
```bash
|
|
56
|
+
```bash
|
|
55
57
|
MASTRA_CONCURRENCY=4 mastra dev
|
|
56
58
|
```
|
|
57
59
|
|
|
@@ -61,7 +63,7 @@ Leave it unset to let the CLI pick a sensible default for the machine.
|
|
|
61
63
|
|
|
62
64
|
When using providers supported by the Vercel AI SDK you can redirect requests through proxies or internal gateways by setting a base URL. For OpenAI:
|
|
63
65
|
|
|
64
|
-
```bash
|
|
66
|
+
```bash
|
|
65
67
|
OPENAI_API_KEY=<your-api-key> \
|
|
66
68
|
OPENAI_BASE_URL=https://openrouter.example/v1 \
|
|
67
69
|
mastra dev
|
|
@@ -69,7 +71,7 @@ mastra dev
|
|
|
69
71
|
|
|
70
72
|
For Anthropic:
|
|
71
73
|
|
|
72
|
-
```bash
|
|
74
|
+
```bash
|
|
73
75
|
ANTHROPIC_API_KEY=<your-api-key> \
|
|
74
76
|
ANTHROPIC_BASE_URL=https://anthropic.internal \
|
|
75
77
|
mastra dev
|
|
@@ -86,10 +88,16 @@ Under the hood Mastra's Rollup server locates your Mastra entry file and bundles
|
|
|
86
88
|
|
|
87
89
|
The output in `.mastra` can be deployed to any cloud server using [`mastra start`](#mastra-start).
|
|
88
90
|
|
|
89
|
-
If you're deploying to a [serverless platform](/
|
|
91
|
+
If you're deploying to a [serverless platform](/guides/v1/deployment) you need to install the correct deployer in order to receive the correct output in `.mastra`.
|
|
90
92
|
|
|
91
93
|
It accepts [common flags][common-flags].
|
|
92
94
|
|
|
95
|
+
### Flags
|
|
96
|
+
|
|
97
|
+
#### `--studio`
|
|
98
|
+
|
|
99
|
+
Bundle the Studio UI with the build.
|
|
100
|
+
|
|
93
101
|
### Configs
|
|
94
102
|
|
|
95
103
|
You can set certain environment variables to modify the behavior of `mastra build`.
|
|
@@ -98,7 +106,7 @@ You can set certain environment variables to modify the behavior of `mastra buil
|
|
|
98
106
|
|
|
99
107
|
For CI or when running in resource constrained environments you can cap how many expensive tasks run at once by setting `MASTRA_CONCURRENCY`.
|
|
100
108
|
|
|
101
|
-
```bash
|
|
109
|
+
```bash
|
|
102
110
|
MASTRA_CONCURRENCY=2 mastra build
|
|
103
111
|
```
|
|
104
112
|
|
|
@@ -124,6 +132,30 @@ The path to your built Mastra output directory. Defaults to `.mastra/output`.
|
|
|
124
132
|
|
|
125
133
|
Disable the [OTEL Tracing](/docs/v1/observability/tracing/overview).
|
|
126
134
|
|
|
135
|
+
## `mastra studio`
|
|
136
|
+
|
|
137
|
+
Starts [Mastra Studio](/docs/v1/getting-started/studio) as a static server. After starting, you can enter your Mastra instance URL (e.g. `http://localhost:4111`) to connect Studio to your Mastra backend.
|
|
138
|
+
|
|
139
|
+
### Flags
|
|
140
|
+
|
|
141
|
+
The command accepts [common flags][common-flags] and the following additional flags:
|
|
142
|
+
|
|
143
|
+
#### `--port`
|
|
144
|
+
|
|
145
|
+
The port to run Studio on. Defaults to `3000`.
|
|
146
|
+
|
|
147
|
+
#### `--server-host`
|
|
148
|
+
|
|
149
|
+
The host of the Mastra API server to connect to. Defaults to `localhost`.
|
|
150
|
+
|
|
151
|
+
#### `--server-port`
|
|
152
|
+
|
|
153
|
+
The port of the Mastra API server to connect to. Defaults to `4111`.
|
|
154
|
+
|
|
155
|
+
#### `--server-protocol`
|
|
156
|
+
|
|
157
|
+
The protocol of the Mastra API server to connect to. Defaults to `http`.
|
|
158
|
+
|
|
127
159
|
## `mastra lint`
|
|
128
160
|
|
|
129
161
|
The `mastra lint` command validates the structure and code of your Mastra project to ensure it follows best practices and is error-free.
|
|
@@ -140,13 +172,13 @@ Read the [Scorers overview](/docs/v1/evals/overview) to learn more.
|
|
|
140
172
|
|
|
141
173
|
Add a new scorer to your project. You can use an interactive prompt:
|
|
142
174
|
|
|
143
|
-
```bash
|
|
175
|
+
```bash
|
|
144
176
|
mastra scorers add
|
|
145
177
|
```
|
|
146
178
|
|
|
147
179
|
Or provide a scorer name directly:
|
|
148
180
|
|
|
149
|
-
```bash
|
|
181
|
+
```bash
|
|
150
182
|
mastra scorers add answer-relevancy
|
|
151
183
|
```
|
|
152
184
|
|
|
@@ -196,29 +228,45 @@ Do not include example code. Useful when using the `--default` flag.
|
|
|
196
228
|
|
|
197
229
|
Configure your code editor with Mastra's MCP server. Choose from: `"cursor" | "cursor-global" | "windsurf" | "vscode"`.
|
|
198
230
|
|
|
231
|
+
## `mastra migrate`
|
|
232
|
+
|
|
233
|
+
Runs database migrations to update your storage schema. This command is useful when upgrading Mastra versions that include storage schema changes.
|
|
234
|
+
|
|
235
|
+
The command bundles your project, connects to your configured storage backend, and executes any pending migrations. Currently supports:
|
|
236
|
+
|
|
237
|
+
- **Duplicate spans migration**: Removes duplicate `(traceId, spanId)` entries and adds a unique constraint to ensure data integrity.
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
mastra migrate
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
See the [Storage migration guide](/guides/v1/migrations/upgrade-to-v1/storage#duplicate-spans-migration) for details on when migrations are needed.
|
|
244
|
+
|
|
245
|
+
It accepts [common flags][common-flags].
|
|
246
|
+
|
|
199
247
|
## Common flags
|
|
200
248
|
|
|
201
249
|
### `--dir`
|
|
202
250
|
|
|
203
|
-
**Available in:** `dev`, `build`, `lint`
|
|
251
|
+
**Available in:** `dev`, `build`, `lint`, `migrate`
|
|
204
252
|
|
|
205
253
|
The path to your Mastra folder. Defaults to `src/mastra`.
|
|
206
254
|
|
|
207
255
|
### `--debug`
|
|
208
256
|
|
|
209
|
-
**Available in:** `dev`, `build`
|
|
257
|
+
**Available in:** `dev`, `build`, `migrate`
|
|
210
258
|
|
|
211
259
|
Enable verbose logging for Mastra's internals. Defaults to `false`.
|
|
212
260
|
|
|
213
261
|
### `--env`
|
|
214
262
|
|
|
215
|
-
**Available in:** `dev`, `start`
|
|
263
|
+
**Available in:** `dev`, `start`, `studio`, `migrate`
|
|
216
264
|
|
|
217
265
|
Custom environment variables file to include. By default, includes `.env.development`, `.env.local`, and `.env`.
|
|
218
266
|
|
|
219
267
|
### `--root`
|
|
220
268
|
|
|
221
|
-
**Available in:** `dev`, `build`, `lint`
|
|
269
|
+
**Available in:** `dev`, `build`, `lint`, `migrate`
|
|
222
270
|
|
|
223
271
|
Path to your root folder. Defaults to `process.cwd()`.
|
|
224
272
|
|
|
@@ -246,13 +294,13 @@ By default, Mastra collects anonymous information about your project like your O
|
|
|
246
294
|
|
|
247
295
|
You can opt out of the CLI analytics by setting an environment variable:
|
|
248
296
|
|
|
249
|
-
```bash
|
|
297
|
+
```bash
|
|
250
298
|
MASTRA_TELEMETRY_DISABLED=1
|
|
251
299
|
```
|
|
252
300
|
|
|
253
301
|
You can also set this while using other `mastra` commands:
|
|
254
302
|
|
|
255
|
-
```bash
|
|
303
|
+
```bash
|
|
256
304
|
MASTRA_TELEMETRY_DISABLED=1 mastra dev
|
|
257
305
|
```
|
|
258
306
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Reference: Agents API | Client SDK"
|
|
3
3
|
description: Learn how to interact with Mastra AI agents, including generating responses, streaming interactions, and managing agent tools using the client-js SDK.
|
|
4
|
+
packages:
|
|
5
|
+
- "@mastra/ai-sdk"
|
|
6
|
+
- "@mastra/client-js"
|
|
7
|
+
- "@mastra/core"
|
|
4
8
|
---
|
|
5
9
|
|
|
6
10
|
# Agents API
|
|
@@ -24,7 +28,6 @@ Get an instance of a specific agent by its ID:
|
|
|
24
28
|
```typescript title="src/mastra/agents/my-agent.ts"
|
|
25
29
|
export const myAgent = new Agent({
|
|
26
30
|
id: "my-agent",
|
|
27
|
-
// ...
|
|
28
31
|
});
|
|
29
32
|
```
|
|
30
33
|
|
|
@@ -47,25 +50,31 @@ const details = await agent.details();
|
|
|
47
50
|
Generate a response from the agent:
|
|
48
51
|
|
|
49
52
|
```typescript
|
|
50
|
-
const response = await agent.generate(
|
|
51
|
-
|
|
53
|
+
const response = await agent.generate(
|
|
54
|
+
[
|
|
52
55
|
{
|
|
53
56
|
role: "user",
|
|
54
57
|
content: "Hello, how are you?",
|
|
55
58
|
},
|
|
56
59
|
],
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
{
|
|
61
|
+
memory: {
|
|
62
|
+
thread: "thread-abc", // Optional: Thread ID for conversation context
|
|
63
|
+
resource: "user-123", // Optional: Resource ID
|
|
64
|
+
},
|
|
65
|
+
structuredOutput: {} // Optional: Structured Output configuration
|
|
66
|
+
}
|
|
67
|
+
);
|
|
61
68
|
```
|
|
62
69
|
|
|
63
|
-
You can also use the simplified string format:
|
|
70
|
+
You can also use the simplified string format with memory options:
|
|
64
71
|
|
|
65
72
|
```typescript
|
|
66
73
|
const response = await agent.generate("Hello, how are you?", {
|
|
67
|
-
|
|
68
|
-
|
|
74
|
+
memory: {
|
|
75
|
+
thread: "thread-1",
|
|
76
|
+
resource: "resource-1",
|
|
77
|
+
},
|
|
69
78
|
});
|
|
70
79
|
```
|
|
71
80
|
|
|
@@ -74,14 +83,7 @@ const response = await agent.generate("Hello, how are you?", {
|
|
|
74
83
|
Stream responses from the agent for real-time interactions:
|
|
75
84
|
|
|
76
85
|
```typescript
|
|
77
|
-
const response = await agent.stream(
|
|
78
|
-
messages: [
|
|
79
|
-
{
|
|
80
|
-
role: "user",
|
|
81
|
-
content: "Tell me a story",
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
});
|
|
86
|
+
const response = await agent.stream("Tell me a story");
|
|
85
87
|
|
|
86
88
|
// Process data stream with the processDataStream util
|
|
87
89
|
response.processDataStream({
|
|
@@ -91,11 +93,14 @@ response.processDataStream({
|
|
|
91
93
|
});
|
|
92
94
|
```
|
|
93
95
|
|
|
94
|
-
You can also use the simplified string format:
|
|
96
|
+
You can also use the simplified string format with memory options:
|
|
95
97
|
|
|
96
98
|
```typescript
|
|
97
99
|
const response = await agent.stream("Tell me a story", {
|
|
98
|
-
|
|
100
|
+
memory: {
|
|
101
|
+
thread: "thread-1",
|
|
102
|
+
resource: "resource-1",
|
|
103
|
+
},
|
|
99
104
|
clientTools: { colorChangeTool },
|
|
100
105
|
});
|
|
101
106
|
|
|
@@ -123,12 +128,12 @@ while (true) {
|
|
|
123
128
|
|
|
124
129
|
To stream AI SDK-formatted parts on the client from an `agent.stream(...)` response, wrap `response.processDataStream` into a `ReadableStream<ChunkType>` and use `toAISdkStream`:
|
|
125
130
|
|
|
126
|
-
```typescript title="client-ai-sdk-transform.ts"
|
|
131
|
+
```typescript title="client-ai-sdk-transform.ts"
|
|
127
132
|
import { createUIMessageStream } from "ai";
|
|
128
133
|
import { toAISdkStream } from "@mastra/ai-sdk";
|
|
129
134
|
import type { ChunkType, MastraModelOutput } from "@mastra/core/stream";
|
|
130
135
|
|
|
131
|
-
const response = await agent.stream(
|
|
136
|
+
const response = await agent.stream("Tell me a story");
|
|
132
137
|
|
|
133
138
|
const chunkStream: ReadableStream<ChunkType> = new ReadableStream<ChunkType>({
|
|
134
139
|
start(controller) {
|
|
@@ -179,14 +184,7 @@ const result = await agent.executeTool("tool-id", {
|
|
|
179
184
|
Stream responses from an agent network for multi-agent interactions:
|
|
180
185
|
|
|
181
186
|
```typescript
|
|
182
|
-
const response = await agent.network(
|
|
183
|
-
messages: [
|
|
184
|
-
{
|
|
185
|
-
role: "user",
|
|
186
|
-
content: "Research this topic and write a summary",
|
|
187
|
-
},
|
|
188
|
-
],
|
|
189
|
-
});
|
|
187
|
+
const response = await agent.network("Research this topic and write a summary");
|
|
190
188
|
|
|
191
189
|
response.processDataStream({
|
|
192
190
|
onChunk: async (chunk) => {
|
|
@@ -229,6 +227,44 @@ response.processDataStream({
|
|
|
229
227
|
});
|
|
230
228
|
```
|
|
231
229
|
|
|
230
|
+
### approveToolCallGenerate()
|
|
231
|
+
|
|
232
|
+
Approve a pending tool call when using `generate()` (non-streaming). Returns the complete response:
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
const output = await agent.generate("Find user John", {
|
|
236
|
+
requireToolApproval: true,
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
if (output.finishReason === "suspended") {
|
|
240
|
+
const result = await agent.approveToolCallGenerate({
|
|
241
|
+
runId: output.runId,
|
|
242
|
+
toolCallId: output.suspendPayload.toolCallId,
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
console.log(result.text);
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### declineToolCallGenerate()
|
|
250
|
+
|
|
251
|
+
Decline a pending tool call when using `generate()` (non-streaming). Returns the complete response:
|
|
252
|
+
|
|
253
|
+
```typescript
|
|
254
|
+
const output = await agent.generate("Find user John", {
|
|
255
|
+
requireToolApproval: true,
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
if (output.finishReason === "suspended") {
|
|
259
|
+
const result = await agent.declineToolCallGenerate({
|
|
260
|
+
runId: output.runId,
|
|
261
|
+
toolCallId: output.suspendPayload.toolCallId,
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
console.log(result.text);
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
232
268
|
## Client Tools
|
|
233
269
|
|
|
234
270
|
Client-side tools allow you to execute custom functions on the client side when the agent requests them.
|
|
@@ -250,14 +286,16 @@ const colorChangeTool = createTool({
|
|
|
250
286
|
});
|
|
251
287
|
|
|
252
288
|
// Use with generate
|
|
253
|
-
const response = await agent.generate({
|
|
254
|
-
messages: "Change the background to blue",
|
|
289
|
+
const response = await agent.generate("Change the background to blue", {
|
|
255
290
|
clientTools: { colorChangeTool },
|
|
256
291
|
});
|
|
257
292
|
|
|
258
293
|
// Use with stream
|
|
259
|
-
const response = await agent.stream({
|
|
260
|
-
|
|
294
|
+
const response = await agent.stream("Tell me a story", {
|
|
295
|
+
memory: {
|
|
296
|
+
thread: "thread-1",
|
|
297
|
+
resource: "resource-1",
|
|
298
|
+
},
|
|
261
299
|
clientTools: { colorChangeTool },
|
|
262
300
|
});
|
|
263
301
|
|
|
@@ -267,7 +305,11 @@ response.processDataStream({
|
|
|
267
305
|
console.log(chunk.payload.text);
|
|
268
306
|
} else if (chunk.type === "tool-call") {
|
|
269
307
|
console.log(
|
|
270
|
-
`calling tool ${chunk.payload.toolName} with args ${JSON.stringify(
|
|
308
|
+
`calling tool ${chunk.payload.toolName} with args ${JSON.stringify(
|
|
309
|
+
chunk.payload.args,
|
|
310
|
+
null,
|
|
311
|
+
2
|
|
312
|
+
)}`
|
|
271
313
|
);
|
|
272
314
|
}
|
|
273
315
|
},
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Reference: Error Handling | Client SDK"
|
|
3
3
|
description: Learn about the built-in retry mechanism and error handling capabilities in the Mastra client-js SDK.
|
|
4
|
+
packages:
|
|
5
|
+
- "@mastra/client-js"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Error Handling
|
|
@@ -14,9 +16,7 @@ All API methods can throw errors that you can catch and handle:
|
|
|
14
16
|
```typescript
|
|
15
17
|
try {
|
|
16
18
|
const agent = mastraClient.getAgent("agent-id");
|
|
17
|
-
const response = await agent.generate(
|
|
18
|
-
messages: [{ role: "user", content: "Hello" }],
|
|
19
|
-
});
|
|
19
|
+
const response = await agent.generate("Hello");
|
|
20
20
|
} catch (error) {
|
|
21
21
|
console.error("An error occurred:", error.message);
|
|
22
22
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Reference: Mastra Client SDK | Client SDK"
|
|
3
3
|
description: Learn how to interact with Mastra using the client-js SDK.
|
|
4
|
+
packages:
|
|
5
|
+
- "@mastra/client-js"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Mastra Client SDK
|
|
7
9
|
|
|
8
|
-
The Mastra Client SDK provides a simple and type-safe interface for interacting with your [Mastra Server](/docs/v1/deployment/
|
|
10
|
+
The Mastra Client SDK provides a simple and type-safe interface for interacting with your [Mastra Server](/docs/v1/deployment/mastra-server) from your client environment.
|
|
9
11
|
|
|
10
12
|
## Usage example
|
|
11
13
|
|
|
12
|
-
```typescript title="lib/mastra/mastra-client.ts"
|
|
14
|
+
```typescript title="lib/mastra/mastra-client.ts"
|
|
13
15
|
import { MastraClient } from "@mastra/client-js";
|
|
14
16
|
|
|
15
17
|
export const mastraClient = new MastraClient({
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Reference: Memory API | Client SDK"
|
|
3
3
|
description: Learn how to manage conversation threads and message history in Mastra using the client-js SDK.
|
|
4
|
+
packages:
|
|
5
|
+
- "@mastra/client-js"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Memory API
|
|
@@ -14,10 +16,12 @@ Retrieve all memory threads for a specific resource:
|
|
|
14
16
|
```typescript
|
|
15
17
|
const threads = await mastraClient.getMemoryThreads({
|
|
16
18
|
resourceId: "resource-1",
|
|
17
|
-
agentId: "agent-1",
|
|
19
|
+
agentId: "agent-1", // Optional - can be omitted if storage is configured
|
|
18
20
|
});
|
|
19
21
|
```
|
|
20
22
|
|
|
23
|
+
When `agentId` is omitted and storage is configured on the server, threads will be retrieved using storage directly. This is useful when multiple agents share the same threads (e.g., in workflows with multiple agent steps).
|
|
24
|
+
|
|
21
25
|
### Create a New Thread
|
|
22
26
|
|
|
23
27
|
Create a new memory thread:
|
|
@@ -69,6 +73,44 @@ Delete a thread and its messages:
|
|
|
69
73
|
await thread.delete();
|
|
70
74
|
```
|
|
71
75
|
|
|
76
|
+
### Clone Thread
|
|
77
|
+
|
|
78
|
+
Create a copy of a thread with all its messages:
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
const { thread: clonedThread, clonedMessages } = await thread.clone();
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Clone with options:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
const { thread: clonedThread, clonedMessages } = await thread.clone({
|
|
88
|
+
newThreadId: "custom-clone-id",
|
|
89
|
+
title: "Cloned Conversation",
|
|
90
|
+
metadata: { branch: "experiment-1" },
|
|
91
|
+
options: {
|
|
92
|
+
messageLimit: 10, // Only clone last 10 messages
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Clone with message filtering:
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
const { thread: clonedThread } = await thread.clone({
|
|
101
|
+
options: {
|
|
102
|
+
messageFilter: {
|
|
103
|
+
startDate: new Date("2024-01-01"),
|
|
104
|
+
endDate: new Date("2024-01-31"),
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The clone response includes:
|
|
111
|
+
- `thread`: The newly created cloned thread with clone metadata
|
|
112
|
+
- `clonedMessages`: Array of the cloned messages with new IDs
|
|
113
|
+
|
|
72
114
|
## Message Operations
|
|
73
115
|
|
|
74
116
|
### Save Messages
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Reference: Workflows API | Client SDK"
|
|
3
3
|
description: Learn how to interact with and execute automated workflows in Mastra using the client-js SDK.
|
|
4
|
+
packages:
|
|
5
|
+
- "@mastra/client-js"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Workflows API
|
|
@@ -48,8 +50,16 @@ const run = await workflow.createRun();
|
|
|
48
50
|
|
|
49
51
|
// Or with an existing runId
|
|
50
52
|
const run = await workflow.createRun({ runId: "existing-run-id" });
|
|
53
|
+
|
|
54
|
+
// Or with a resourceId to associate the run with a specific resource
|
|
55
|
+
const run = await workflow.createRun({
|
|
56
|
+
runId: "my-run-id",
|
|
57
|
+
resourceId: "user-123"
|
|
58
|
+
});
|
|
51
59
|
```
|
|
52
60
|
|
|
61
|
+
The `resourceId` parameter associates the workflow run with a specific resource (e.g., user ID, tenant ID). This value is persisted with the run and can be used for filtering and querying runs later.
|
|
62
|
+
|
|
53
63
|
### startAsync()
|
|
54
64
|
|
|
55
65
|
Start a workflow run and await the full result:
|
|
@@ -80,6 +90,18 @@ const result = await run.startAsync({
|
|
|
80
90
|
|
|
81
91
|
The `initialState` object should match the structure defined in the workflow's `stateSchema`. See [Workflow State](/docs/v1/workflows/workflow-state) for more details.
|
|
82
92
|
|
|
93
|
+
To associate a run with a specific resource, pass `resourceId` to `createRun()`:
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
const run = await workflow.createRun({ resourceId: "user-123" });
|
|
97
|
+
|
|
98
|
+
const result = await run.startAsync({
|
|
99
|
+
inputData: {
|
|
100
|
+
city: "New York",
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
```
|
|
104
|
+
|
|
83
105
|
### start()
|
|
84
106
|
|
|
85
107
|
Start a workflow run without waiting for completion:
|
|
@@ -94,7 +116,7 @@ await run.start({
|
|
|
94
116
|
});
|
|
95
117
|
|
|
96
118
|
// Poll for results later
|
|
97
|
-
const result = await workflow.
|
|
119
|
+
const result = await workflow.runById(run.runId);
|
|
98
120
|
```
|
|
99
121
|
|
|
100
122
|
This is useful for long-running workflows where you want to start execution and check results later.
|
|
@@ -125,6 +147,21 @@ await run.resume({
|
|
|
125
147
|
});
|
|
126
148
|
```
|
|
127
149
|
|
|
150
|
+
### cancel()
|
|
151
|
+
|
|
152
|
+
Cancel a running workflow:
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
const run = await workflow.createRun({ runId: existingRunId });
|
|
156
|
+
|
|
157
|
+
const result = await run.cancel();
|
|
158
|
+
// Returns: { message: 'Workflow run canceled' }
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
This method stops any running steps and prevents subsequent steps from executing. Steps that check the `abortSignal` parameter can respond to cancellation by cleaning up resources (timeouts, network requests, etc.).
|
|
162
|
+
|
|
163
|
+
See the [Run.cancel()](/reference/v1/workflows/run-methods/cancel) reference for detailed information about how cancellation works and how to write steps that respond to cancellation.
|
|
164
|
+
|
|
128
165
|
### stream()
|
|
129
166
|
|
|
130
167
|
Stream workflow execution for real-time updates:
|
|
@@ -143,12 +180,19 @@ for await (const chunk of stream) {
|
|
|
143
180
|
}
|
|
144
181
|
```
|
|
145
182
|
|
|
146
|
-
###
|
|
183
|
+
### runById()
|
|
147
184
|
|
|
148
185
|
Get the execution result for a workflow run:
|
|
149
186
|
|
|
150
187
|
```typescript
|
|
151
|
-
const result = await workflow.
|
|
188
|
+
const result = await workflow.runById(runId);
|
|
189
|
+
|
|
190
|
+
// Or with options for performance optimization:
|
|
191
|
+
const result = await workflow.runById(runId, {
|
|
192
|
+
fields: ['status', 'result'], // Only fetch specific fields
|
|
193
|
+
withNestedWorkflows: false, // Skip expensive nested workflow data
|
|
194
|
+
requestContext: { userId: 'user-123' }, // Optional request context
|
|
195
|
+
});
|
|
152
196
|
```
|
|
153
197
|
|
|
154
198
|
<h3>Run result format</h3>
|