@mastra/mcp-docs-server 1.0.0-beta.13 → 1.0.0-beta.15
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/%40mastra%2Fagent-builder.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +78 -78
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +173 -173
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +248 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +338 -338
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Flance.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +139 -139
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +219 -219
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +219 -219
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +235 -235
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +102 -102
- package/.docs/organized/changelogs/%40mastra%2Frag.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Freact.md +77 -70
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +218 -218
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +195 -195
- package/.docs/organized/changelogs/create-mastra.md +13 -13
- package/.docs/organized/changelogs/mastra.md +56 -56
- package/.docs/organized/code-examples/agent-v6.md +210 -0
- package/.docs/organized/code-examples/ai-elements.md +1 -1
- package/.docs/organized/code-examples/client-side-tools.md +1 -1
- package/.docs/raw/agents/adding-voice.mdx +10 -6
- package/.docs/raw/agents/agent-approval.mdx +5 -6
- package/.docs/raw/agents/agent-memory.mdx +22 -30
- package/.docs/raw/agents/guardrails.mdx +60 -50
- package/.docs/raw/agents/networks.mdx +8 -12
- package/.docs/raw/agents/overview.mdx +39 -23
- package/.docs/raw/agents/processors.mdx +20 -19
- package/.docs/raw/agents/structured-output.mdx +11 -7
- package/.docs/raw/agents/using-tools.mdx +4 -5
- package/.docs/raw/deployment/mastra-server.mdx +3 -3
- package/.docs/raw/deployment/overview.mdx +7 -1
- package/.docs/raw/deployment/web-framework.mdx +4 -6
- package/.docs/raw/deployment/workflow-runners.mdx +14 -0
- package/.docs/raw/evals/custom-scorers.mdx +9 -6
- package/.docs/raw/evals/overview.mdx +3 -6
- package/.docs/raw/evals/running-in-ci.mdx +2 -2
- package/.docs/raw/getting-started/manual-install.mdx +20 -20
- package/.docs/raw/getting-started/mcp-docs-server.mdx +2 -2
- package/.docs/raw/getting-started/studio.mdx +1 -1
- package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +4 -4
- package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +30 -30
- package/.docs/raw/guides/build-your-ui/assistant-ui.mdx +8 -8
- package/.docs/raw/guides/build-your-ui/copilotkit.mdx +11 -11
- package/.docs/raw/guides/deployment/amazon-ec2.mdx +9 -9
- package/.docs/raw/guides/deployment/aws-lambda.mdx +11 -11
- package/.docs/raw/guides/deployment/azure-app-services.mdx +2 -2
- package/.docs/raw/guides/deployment/cloudflare-deployer.mdx +5 -6
- package/.docs/raw/guides/deployment/digital-ocean.mdx +10 -10
- package/.docs/raw/guides/deployment/index.mdx +1 -1
- package/.docs/raw/guides/deployment/inngest.mdx +444 -0
- package/.docs/raw/guides/deployment/netlify-deployer.mdx +4 -4
- package/.docs/raw/guides/deployment/vercel-deployer.mdx +5 -6
- package/.docs/raw/guides/getting-started/astro.mdx +292 -451
- package/.docs/raw/guides/getting-started/express.mdx +7 -7
- package/.docs/raw/guides/getting-started/hono.mdx +18 -18
- package/.docs/raw/guides/getting-started/next-js.mdx +19 -20
- package/.docs/raw/guides/getting-started/quickstart.mdx +4 -4
- package/.docs/raw/guides/getting-started/sveltekit.mdx +238 -409
- package/.docs/raw/guides/getting-started/vite-react.mdx +21 -21
- 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 +13 -13
- package/.docs/raw/guides/guide/stock-agent.mdx +5 -5
- package/.docs/raw/guides/guide/web-search.mdx +8 -8
- package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +7 -7
- package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +2 -2
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +1 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +11 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/processors.mdx +11 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +41 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +0 -2
- 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 +39 -0
- package/.docs/raw/mastra-cloud/observability.mdx +9 -15
- package/.docs/raw/mastra-cloud/overview.mdx +14 -44
- package/.docs/raw/mastra-cloud/setup.mdx +64 -0
- package/.docs/raw/mastra-cloud/studio.mdx +35 -0
- package/.docs/raw/mcp/overview.mdx +31 -13
- package/.docs/raw/mcp/publishing-mcp-server.mdx +2 -2
- package/.docs/raw/memory/memory-processors.mdx +9 -9
- package/.docs/raw/memory/message-history.mdx +69 -0
- package/.docs/raw/memory/overview.mdx +34 -76
- package/.docs/raw/memory/semantic-recall.mdx +58 -49
- package/.docs/raw/memory/storage.mdx +188 -0
- package/.docs/raw/memory/working-memory.mdx +7 -7
- package/.docs/raw/observability/logging.mdx +9 -10
- package/.docs/raw/observability/overview.mdx +0 -1
- package/.docs/raw/observability/tracing/bridges/otel.mdx +2 -2
- package/.docs/raw/observability/tracing/exporters/default.mdx +3 -3
- package/.docs/raw/observability/tracing/exporters/langfuse.mdx +1 -2
- package/.docs/raw/observability/tracing/overview.mdx +23 -25
- package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +3 -3
- package/.docs/raw/rag/chunking-and-embedding.mdx +6 -6
- package/.docs/raw/rag/graph-rag.mdx +7 -7
- package/.docs/raw/rag/overview.mdx +1 -1
- package/.docs/raw/rag/retrieval.mdx +21 -22
- package/.docs/raw/rag/vector-databases.mdx +22 -22
- package/.docs/raw/reference/agents/agent.mdx +3 -3
- package/.docs/raw/reference/agents/generate.mdx +1 -1
- package/.docs/raw/reference/agents/generateLegacy.mdx +2 -2
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +2 -2
- package/.docs/raw/reference/agents/getDefaultOptions.mdx +2 -2
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +2 -2
- package/.docs/raw/reference/agents/getDescription.mdx +1 -1
- package/.docs/raw/reference/agents/getInstructions.mdx +2 -2
- package/.docs/raw/reference/agents/getLLM.mdx +2 -2
- package/.docs/raw/reference/agents/getMemory.mdx +2 -2
- package/.docs/raw/reference/agents/getModel.mdx +2 -2
- package/.docs/raw/reference/agents/getTools.mdx +2 -2
- package/.docs/raw/reference/agents/getVoice.mdx +2 -2
- package/.docs/raw/reference/agents/listAgents.mdx +2 -2
- package/.docs/raw/reference/agents/listScorers.mdx +2 -2
- package/.docs/raw/reference/agents/listTools.mdx +2 -2
- package/.docs/raw/reference/agents/listWorkflows.mdx +2 -2
- package/.docs/raw/reference/agents/network.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/chat-route.mdx +2 -2
- package/.docs/raw/reference/ai-sdk/handle-chat-stream.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/handle-network-stream.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/handle-workflow-stream.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/network-route.mdx +2 -2
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-stream.mdx +6 -6
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v4-messages.mdx +3 -3
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v5-messages.mdx +3 -3
- package/.docs/raw/reference/ai-sdk/with-mastra.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/workflow-route.mdx +2 -2
- package/.docs/raw/reference/auth/auth0.mdx +1 -2
- package/.docs/raw/reference/auth/clerk.mdx +1 -2
- package/.docs/raw/reference/auth/firebase.mdx +2 -4
- package/.docs/raw/reference/auth/jwt.mdx +1 -2
- package/.docs/raw/reference/auth/supabase.mdx +1 -2
- package/.docs/raw/reference/auth/workos.mdx +1 -2
- package/.docs/raw/reference/cli/create-mastra.mdx +10 -10
- package/.docs/raw/reference/cli/mastra.mdx +9 -9
- package/.docs/raw/reference/client-js/agents.mdx +1 -2
- package/.docs/raw/reference/client-js/mastra-client.mdx +1 -1
- package/.docs/raw/reference/core/getAgent.mdx +1 -1
- package/.docs/raw/reference/core/getAgentById.mdx +1 -1
- package/.docs/raw/reference/core/getDeployer.mdx +1 -1
- package/.docs/raw/reference/core/getLogger.mdx +1 -1
- package/.docs/raw/reference/core/getMCPServer.mdx +1 -1
- package/.docs/raw/reference/core/getMCPServerById.mdx +1 -1
- package/.docs/raw/reference/core/getMemory.mdx +2 -2
- package/.docs/raw/reference/core/getServer.mdx +1 -1
- package/.docs/raw/reference/core/getStorage.mdx +2 -2
- package/.docs/raw/reference/core/getStoredAgentById.mdx +3 -3
- package/.docs/raw/reference/core/getTelemetry.mdx +1 -1
- package/.docs/raw/reference/core/getVector.mdx +1 -1
- package/.docs/raw/reference/core/getWorkflow.mdx +1 -1
- package/.docs/raw/reference/core/listAgents.mdx +1 -1
- package/.docs/raw/reference/core/listLogs.mdx +1 -1
- package/.docs/raw/reference/core/listLogsByRunId.mdx +1 -1
- package/.docs/raw/reference/core/listMCPServers.mdx +1 -1
- package/.docs/raw/reference/core/listMemory.mdx +2 -2
- package/.docs/raw/reference/core/listStoredAgents.mdx +4 -4
- package/.docs/raw/reference/core/listVectors.mdx +1 -1
- package/.docs/raw/reference/core/listWorkflows.mdx +1 -1
- package/.docs/raw/reference/core/setLogger.mdx +1 -1
- package/.docs/raw/reference/core/setStorage.mdx +2 -2
- package/.docs/raw/reference/core/setTelemetry.mdx +1 -1
- package/.docs/raw/reference/deployer/cloudflare.mdx +1 -2
- package/.docs/raw/reference/deployer/deployer.mdx +0 -1
- package/.docs/raw/reference/deployer/netlify.mdx +1 -1
- package/.docs/raw/reference/deployer/vercel.mdx +2 -4
- package/.docs/raw/reference/evals/answer-relevancy.mdx +1 -1
- package/.docs/raw/reference/evals/answer-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/bias.mdx +1 -1
- package/.docs/raw/reference/evals/completeness.mdx +1 -1
- package/.docs/raw/reference/evals/content-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/context-precision.mdx +1 -1
- package/.docs/raw/reference/evals/faithfulness.mdx +1 -1
- package/.docs/raw/reference/evals/hallucination.mdx +1 -1
- package/.docs/raw/reference/evals/keyword-coverage.mdx +1 -1
- package/.docs/raw/reference/evals/prompt-alignment.mdx +7 -7
- package/.docs/raw/reference/evals/textual-difference.mdx +1 -1
- package/.docs/raw/reference/evals/tone-consistency.mdx +1 -1
- package/.docs/raw/reference/evals/tool-call-accuracy.mdx +10 -10
- package/.docs/raw/reference/evals/toxicity.mdx +1 -1
- package/.docs/raw/reference/logging/pino-logger.mdx +7 -8
- package/.docs/raw/reference/memory/createThread.mdx +2 -2
- package/.docs/raw/reference/memory/deleteMessages.mdx +2 -2
- package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +2 -2
- package/.docs/raw/reference/memory/memory-class.mdx +3 -3
- package/.docs/raw/reference/memory/query.mdx +2 -2
- package/.docs/raw/reference/memory/recall.mdx +2 -2
- package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +1 -1
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +2 -2
- package/.docs/raw/reference/processors/language-detector.mdx +2 -2
- package/.docs/raw/reference/processors/message-history-processor.mdx +2 -2
- package/.docs/raw/reference/processors/moderation-processor.mdx +3 -3
- package/.docs/raw/reference/processors/pii-detector.mdx +3 -3
- package/.docs/raw/reference/processors/processor-interface.mdx +13 -13
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +2 -2
- package/.docs/raw/reference/processors/semantic-recall-processor.mdx +2 -2
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +2 -2
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +40 -19
- package/.docs/raw/reference/processors/tool-call-filter.mdx +3 -3
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +2 -2
- package/.docs/raw/reference/processors/working-memory-processor.mdx +3 -3
- package/.docs/raw/reference/rag/chunk.mdx +1 -1
- package/.docs/raw/reference/rag/extract-params.mdx +2 -2
- package/.docs/raw/reference/rag/metadata-filters.mdx +7 -7
- package/.docs/raw/reference/server/create-route.mdx +13 -13
- package/.docs/raw/reference/server/express-adapter.mdx +6 -7
- package/.docs/raw/reference/server/hono-adapter.mdx +6 -7
- package/.docs/raw/reference/server/mastra-server.mdx +20 -20
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +7 -5
- package/.docs/raw/reference/storage/cloudflare.mdx +2 -2
- package/.docs/raw/reference/storage/convex.mdx +6 -6
- package/.docs/raw/reference/storage/dynamodb.mdx +4 -4
- package/.docs/raw/reference/storage/lance.mdx +6 -5
- package/.docs/raw/reference/storage/libsql.mdx +72 -54
- package/.docs/raw/reference/storage/mongodb.mdx +84 -9
- package/.docs/raw/reference/storage/mssql.mdx +8 -6
- package/.docs/raw/{memory → reference}/storage/overview.mdx +12 -110
- package/.docs/raw/reference/storage/postgresql.mdx +82 -9
- package/.docs/raw/reference/storage/upstash.mdx +74 -2
- package/.docs/raw/reference/streaming/agents/stream.mdx +5 -5
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +2 -2
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/resumeStream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/stream.mdx +2 -2
- package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +4 -4
- package/.docs/raw/reference/templates/overview.mdx +1 -2
- package/.docs/raw/reference/tools/create-tool.mdx +1 -4
- package/.docs/raw/reference/tools/vector-query-tool.mdx +1 -1
- package/.docs/raw/reference/vectors/astra.mdx +3 -3
- package/.docs/raw/reference/vectors/chroma.mdx +3 -3
- package/.docs/raw/reference/vectors/convex.mdx +12 -12
- package/.docs/raw/reference/vectors/couchbase.mdx +5 -5
- package/.docs/raw/reference/vectors/duckdb.mdx +10 -10
- package/.docs/raw/reference/vectors/elasticsearch.mdx +4 -4
- package/.docs/raw/reference/vectors/lance.mdx +4 -4
- package/.docs/raw/reference/vectors/libsql.mdx +61 -11
- package/.docs/raw/reference/vectors/mongodb.mdx +58 -5
- package/.docs/raw/reference/vectors/pg.mdx +53 -6
- package/.docs/raw/reference/vectors/pinecone.mdx +3 -3
- package/.docs/raw/reference/vectors/qdrant.mdx +3 -3
- package/.docs/raw/reference/vectors/s3vectors.mdx +6 -6
- package/.docs/raw/reference/vectors/turbopuffer.mdx +4 -4
- package/.docs/raw/reference/vectors/upstash.mdx +55 -6
- package/.docs/raw/reference/vectors/vectorize.mdx +3 -3
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/restart.mdx +1 -3
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/start.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/startAsync.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +5 -5
- package/.docs/raw/reference/workflows/run.mdx +1 -1
- package/.docs/raw/reference/workflows/step.mdx +3 -3
- package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +3 -3
- package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +6 -6
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +7 -7
- package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow.mdx +3 -3
- package/.docs/raw/server/auth/auth0.mdx +20 -14
- package/.docs/raw/server/auth/clerk.mdx +16 -9
- package/.docs/raw/server/auth/firebase.mdx +21 -15
- package/.docs/raw/server/auth/jwt.mdx +14 -7
- package/.docs/raw/server/auth/supabase.mdx +16 -9
- package/.docs/raw/server/auth/workos.mdx +19 -13
- package/.docs/raw/server/custom-adapters.mdx +10 -10
- package/.docs/raw/server/custom-api-routes.mdx +2 -4
- package/.docs/raw/server/mastra-client.mdx +24 -13
- package/.docs/raw/server/mastra-server.mdx +3 -3
- package/.docs/raw/server/middleware.mdx +7 -7
- package/.docs/raw/server/request-context.mdx +31 -30
- package/.docs/raw/server/server-adapters.mdx +6 -6
- package/.docs/raw/streaming/events.mdx +14 -7
- package/.docs/raw/streaming/overview.mdx +21 -10
- package/.docs/raw/streaming/tool-streaming.mdx +6 -6
- package/.docs/raw/streaming/workflow-streaming.mdx +6 -8
- package/.docs/raw/tools-mcp/advanced-usage.mdx +2 -2
- package/.docs/raw/tools-mcp/mcp-overview.mdx +31 -12
- package/.docs/raw/tools-mcp/overview.mdx +9 -10
- package/.docs/raw/voice/overview.mdx +2 -2
- package/.docs/raw/workflows/agents-and-tools.mdx +28 -19
- package/.docs/raw/workflows/control-flow.mdx +27 -40
- package/.docs/raw/workflows/error-handling.mdx +15 -22
- package/.docs/raw/workflows/human-in-the-loop.mdx +6 -7
- package/.docs/raw/workflows/input-data-mapping.mdx +7 -7
- package/.docs/raw/workflows/overview.mdx +34 -23
- package/.docs/raw/workflows/snapshots.mdx +16 -45
- package/.docs/raw/workflows/suspend-and-resume.mdx +7 -7
- package/.docs/raw/workflows/time-travel.mdx +16 -16
- package/.docs/raw/workflows/workflow-state.mdx +5 -8
- package/CHANGELOG.md +16 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/stdio.js +53 -0
- package/package.json +3 -3
- package/.docs/raw/mastra-cloud/dashboard.mdx +0 -96
- package/.docs/raw/mastra-cloud/setting-up.mdx +0 -102
- 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/workflows/inngest-workflow.mdx +0 -363
|
@@ -140,7 +140,7 @@ Setup the tool:
|
|
|
140
140
|
|
|
141
141
|
In your `src/mastra/index.ts` file, register the agent:
|
|
142
142
|
|
|
143
|
-
```ts
|
|
143
|
+
```ts title="src/mastra/index.ts" {2, 5}
|
|
144
144
|
import { Mastra } from "@mastra/core";
|
|
145
145
|
import { searchAgent } from "./agents/searchAgent";
|
|
146
146
|
|
|
@@ -155,7 +155,7 @@ export const mastra = new Mastra({
|
|
|
155
155
|
|
|
156
156
|
You can test your agent with [Studio](/docs/v1/getting-started/studio) using the `mastra dev` command:
|
|
157
157
|
|
|
158
|
-
```bash
|
|
158
|
+
```bash
|
|
159
159
|
mastra dev
|
|
160
160
|
```
|
|
161
161
|
|
|
@@ -175,7 +175,7 @@ For more control over search behavior, you can integrate external search APIs as
|
|
|
175
175
|
|
|
176
176
|
Install dependencies
|
|
177
177
|
|
|
178
|
-
```bash
|
|
178
|
+
```bash
|
|
179
179
|
npm install exa-js
|
|
180
180
|
```
|
|
181
181
|
|
|
@@ -185,7 +185,7 @@ npm install exa-js
|
|
|
185
185
|
|
|
186
186
|
Create a new file `src/mastra/agents/searchAgent.ts` and define your agent:
|
|
187
187
|
|
|
188
|
-
```ts
|
|
188
|
+
```ts title="src/mastra/agents/searchAgent.ts"
|
|
189
189
|
import { Agent } from "@mastra/core/agent";
|
|
190
190
|
|
|
191
191
|
export const searchAgent = new Agent({
|
|
@@ -203,7 +203,7 @@ export const searchAgent = new Agent({
|
|
|
203
203
|
|
|
204
204
|
Setup the tool
|
|
205
205
|
|
|
206
|
-
```ts
|
|
206
|
+
```ts title="src/mastra/tools/searchTool.ts"
|
|
207
207
|
import { createTool } from "@mastra/core/tools";
|
|
208
208
|
import z from "zod";
|
|
209
209
|
import Exa from "exa-js";
|
|
@@ -246,7 +246,7 @@ export const webSearch = createTool({
|
|
|
246
246
|
|
|
247
247
|
Add to your Agent
|
|
248
248
|
|
|
249
|
-
```ts
|
|
249
|
+
```ts title="src/mastra/agents/searchAgent.ts"
|
|
250
250
|
import { webSearch } from "./tools/searchTool";
|
|
251
251
|
|
|
252
252
|
export const searchAgent = new Agent({
|
|
@@ -267,7 +267,7 @@ export const searchAgent = new Agent({
|
|
|
267
267
|
|
|
268
268
|
In your `src/mastra/index.ts` file, register the agent:
|
|
269
269
|
|
|
270
|
-
```ts
|
|
270
|
+
```ts title="src/mastra/index.ts" {2, 5}
|
|
271
271
|
import { Mastra } from "@mastra/core";
|
|
272
272
|
import { searchAgent } from "./agents/searchAgent";
|
|
273
273
|
|
|
@@ -282,7 +282,7 @@ export const mastra = new Mastra({
|
|
|
282
282
|
|
|
283
283
|
You can test your agent with [Studio](/docs/v1/getting-started/studio) using the `mastra dev` command:
|
|
284
284
|
|
|
285
|
-
```bash
|
|
285
|
+
```bash
|
|
286
286
|
mastra dev
|
|
287
287
|
```
|
|
288
288
|
|
|
@@ -11,7 +11,7 @@ This guide demonstrates how to create a WhatsApp chat bot using Mastra agents an
|
|
|
11
11
|
|
|
12
12
|
This example requires a WhatsApp Business API setup and uses the `anthropic` model. Add these environment variables to your `.env` file:
|
|
13
13
|
|
|
14
|
-
```bash title=".env"
|
|
14
|
+
```bash title=".env"
|
|
15
15
|
ANTHROPIC_API_KEY=<your-anthropic-api-key>
|
|
16
16
|
WHATSAPP_VERIFY_TOKEN=<your-verify-token>
|
|
17
17
|
WHATSAPP_ACCESS_TOKEN=<your-whatsapp-access-token>
|
|
@@ -23,7 +23,7 @@ WHATSAPP_API_VERSION=v22.0
|
|
|
23
23
|
|
|
24
24
|
This client handles sending messages to users via the WhatsApp Business API.
|
|
25
25
|
|
|
26
|
-
```typescript title="src/whatsapp-client.ts"
|
|
26
|
+
```typescript title="src/whatsapp-client.ts"
|
|
27
27
|
// Simple WhatsApp Business API client for sending messages
|
|
28
28
|
|
|
29
29
|
interface SendMessageParams {
|
|
@@ -87,7 +87,7 @@ export async function sendWhatsAppMessage({ to, message }: SendMessageParams) {
|
|
|
87
87
|
|
|
88
88
|
This agent handles the main conversation logic with a friendly, conversational personality.
|
|
89
89
|
|
|
90
|
-
```typescript title="src/mastra/agents/chat-agent.ts"
|
|
90
|
+
```typescript title="src/mastra/agents/chat-agent.ts"
|
|
91
91
|
import { Agent } from "@mastra/core/agent";
|
|
92
92
|
import { Memory } from "@mastra/memory";
|
|
93
93
|
import { LibSQLStore } from "@mastra/libsql";
|
|
@@ -136,7 +136,7 @@ export const chatAgent = new Agent({
|
|
|
136
136
|
|
|
137
137
|
This agent converts longer responses into natural, bite-sized text messages suitable for WhatsApp.
|
|
138
138
|
|
|
139
|
-
```typescript title="src/mastra/agents/text-message-agent.ts"
|
|
139
|
+
```typescript title="src/mastra/agents/text-message-agent.ts"
|
|
140
140
|
import { Agent } from "@mastra/core/agent";
|
|
141
141
|
import { Memory } from "@mastra/memory";
|
|
142
142
|
import { LibSQLStore } from "@mastra/libsql";
|
|
@@ -174,7 +174,7 @@ export const textMessageAgent = new Agent({
|
|
|
174
174
|
|
|
175
175
|
This workflow orchestrates the entire chat process: generating a response, breaking it into messages, and sending them via WhatsApp.
|
|
176
176
|
|
|
177
|
-
```typescript title="src/mastra/workflows/chat-workflow.ts"
|
|
177
|
+
```typescript title="src/mastra/workflows/chat-workflow.ts"
|
|
178
178
|
import { createStep, createWorkflow } from "@mastra/core/workflows";
|
|
179
179
|
import { z } from "zod";
|
|
180
180
|
import { sendWhatsAppMessage } from "../../whatsapp-client";
|
|
@@ -300,7 +300,7 @@ chatWorkflow.commit();
|
|
|
300
300
|
|
|
301
301
|
Configure your Mastra instance with the agents, workflow, and WhatsApp webhook endpoints.
|
|
302
302
|
|
|
303
|
-
```typescript title="src/mastra/index.ts"
|
|
303
|
+
```typescript title="src/mastra/index.ts"
|
|
304
304
|
import { Mastra } from "@mastra/core";
|
|
305
305
|
import { registerApiRoute } from "@mastra/core/server";
|
|
306
306
|
import { PinoLogger } from "@mastra/loggers";
|
|
@@ -365,7 +365,7 @@ export const mastra = new Mastra({
|
|
|
365
365
|
|
|
366
366
|
You can test the chat bot locally by simulating a WhatsApp webhook payload.
|
|
367
367
|
|
|
368
|
-
```typescript title="src/test-whatsapp-bot.ts"
|
|
368
|
+
```typescript title="src/test-whatsapp-bot.ts"
|
|
369
369
|
import "dotenv/config";
|
|
370
370
|
|
|
371
371
|
import { mastra } from "./mastra";
|
|
@@ -45,7 +45,7 @@ When using tools with TypeScript in AI SDK v5, Mastra provides type inference he
|
|
|
45
45
|
|
|
46
46
|
The `InferUITool` type helper infers the input and output types of a single Mastra tool:
|
|
47
47
|
|
|
48
|
-
```typescript title="app/types.ts"
|
|
48
|
+
```typescript title="app/types.ts"
|
|
49
49
|
import { InferUITool, createTool } from "@mastra/core/tools";
|
|
50
50
|
import { z } from "zod";
|
|
51
51
|
|
|
@@ -80,7 +80,7 @@ type WeatherUITool = InferUITool<typeof weatherTool>;
|
|
|
80
80
|
|
|
81
81
|
The `InferUITools` type helper infers the input and output types of multiple tools:
|
|
82
82
|
|
|
83
|
-
```typescript title="app/mastra/tools.ts"
|
|
83
|
+
```typescript title="app/mastra/tools.ts"
|
|
84
84
|
import { InferUITools, createTool } from "@mastra/core/tools";
|
|
85
85
|
import { z } from "zod";
|
|
86
86
|
|
|
@@ -252,18 +252,26 @@ To migrate, use `MastraDBMessage` for storage or AI SDK v5 message formats direc
|
|
|
252
252
|
|
|
253
253
|
The `processors` config option in the Memory constructor has been deprecated and now throws an error. Processors should be configured at the Agent level instead. This change provides clearer configuration boundaries and better encapsulation.
|
|
254
254
|
|
|
255
|
-
To migrate, move processor configuration from Memory to Agent
|
|
255
|
+
To migrate, move processor configuration from Memory to Agent using `inputProcessors` and/or `outputProcessors`.
|
|
256
256
|
|
|
257
257
|
```diff
|
|
258
|
+
+ import { TokenLimiter } from '@mastra/core/processors';
|
|
259
|
+
+
|
|
258
260
|
const memory = new Memory({
|
|
259
261
|
storage,
|
|
260
262
|
vector,
|
|
261
263
|
embedder,
|
|
262
264
|
- processors: [/* ... */],
|
|
263
265
|
});
|
|
264
|
-
|
|
266
|
+
|
|
265
267
|
const agent = new Agent({
|
|
266
268
|
memory,
|
|
267
|
-
+
|
|
269
|
+
+ inputProcessors: [
|
|
270
|
+
+ new TokenLimiter({ limit: 4000 }), // Limits historical messages to fit context window
|
|
271
|
+
+ ],
|
|
268
272
|
});
|
|
269
273
|
```
|
|
274
|
+
|
|
275
|
+
Additionally, the `@mastra/memory/processors` import path has been removed. Import processors from `@mastra/core/processors` instead. See the [processors migration guide](/guides/v1/migrations/upgrade-to-v1/processors#memory-processor-exports-moved-to-core) for details.
|
|
276
|
+
|
|
277
|
+
For more information on using processors with agents, see the [Processors docs](/docs/v1/agents/processors). For a complete example with memory, see the [TokenLimiter reference](/reference/v1/processors/token-limiter-processor#extended-usage-example).
|
|
@@ -60,3 +60,14 @@ If you have used `InputProcessor`, replace it with `Processor` which implements
|
|
|
60
60
|
- import { InputProcessor, ModerationProcessor } from '@mastra/core/agent/input-processors/processors';
|
|
61
61
|
+ import { Processor, ModerationProcessor } from '@mastra/core/processors';
|
|
62
62
|
```
|
|
63
|
+
|
|
64
|
+
### Memory processor exports moved to core
|
|
65
|
+
|
|
66
|
+
The `@mastra/memory/processors` export has been removed. All processors are now exported from `@mastra/core/processors`. This change consolidates all processor exports in a single location.
|
|
67
|
+
|
|
68
|
+
To migrate, update your import paths from `@mastra/memory/processors` to `@mastra/core/processors`.
|
|
69
|
+
|
|
70
|
+
```diff
|
|
71
|
+
- import { TokenLimiter, ToolCallFilter } from '@mastra/memory/processors';
|
|
72
|
+
+ import { TokenLimiter, ToolCallFilter } from '@mastra/core/processors';
|
|
73
|
+
```
|
|
@@ -80,6 +80,47 @@ npx @mastra/codemod@beta v1/storage-get-messages-paginated .
|
|
|
80
80
|
|
|
81
81
|
:::
|
|
82
82
|
|
|
83
|
+
### Domain-specific storage access via `getStore()`
|
|
84
|
+
|
|
85
|
+
Storage operations are now accessed through domain-specific stores instead of directly on the storage instance.
|
|
86
|
+
|
|
87
|
+
Domains include:
|
|
88
|
+
- **`memory`** - Threads, messages, and resources
|
|
89
|
+
- **`workflows`** - Workflow snapshots
|
|
90
|
+
- **`scores`** - Evaluation scores
|
|
91
|
+
- **`observability`** - Traces and spans
|
|
92
|
+
- **`agents`** - Stored agent data
|
|
93
|
+
|
|
94
|
+
To migrate, call `getStore()` with the domain name, then call methods on the returned store.
|
|
95
|
+
|
|
96
|
+
```diff
|
|
97
|
+
const storage = mastra.getStorage();
|
|
98
|
+
|
|
99
|
+
// Memory operations (threads, messages, resources)
|
|
100
|
+
- const thread = await storage.getThread({ threadId: '123' });
|
|
101
|
+
- await storage.saveThread({ thread });
|
|
102
|
+
+ const memoryStore = await storage.getStore('memory');
|
|
103
|
+
+ const thread = await memoryStore?.getThreadById({ threadId: '123' });
|
|
104
|
+
+ await memoryStore?.saveThread({ thread });
|
|
105
|
+
|
|
106
|
+
// Workflow operations (snapshots)
|
|
107
|
+
- const snapshot = await storage.loadWorkflowSnapshot({ runId, workflowName });
|
|
108
|
+
- await storage.persistWorkflowSnapshot({ runId, workflowName, snapshot });
|
|
109
|
+
+ const workflowStore = await storage.getStore('workflows');
|
|
110
|
+
+ const snapshot = await workflowStore?.loadWorkflowSnapshot({ runId, workflowName });
|
|
111
|
+
+ await workflowStore?.persistWorkflowSnapshot({ runId, workflowName, snapshot });
|
|
112
|
+
|
|
113
|
+
// Observability operations (traces, spans)
|
|
114
|
+
- const traces = await storage.listTraces({ page: 0, perPage: 20 });
|
|
115
|
+
+ const observabilityStore = await storage.getStore('observability');
|
|
116
|
+
+ const traces = await observabilityStore?.listTraces({ page: 0, perPage: 20 });
|
|
117
|
+
|
|
118
|
+
// Score operations (evaluations)
|
|
119
|
+
- const scores = await storage.listScoresByScorerId({ scorerId: 'helpfulness' });
|
|
120
|
+
+ const scoresStore = await storage.getStore('scores');
|
|
121
|
+
+ const scores = await scoresStore?.listScoresByScorerId({ scorerId: 'helpfulness' });
|
|
122
|
+
```
|
|
123
|
+
|
|
83
124
|
### `getThreadsByResourceId` to `listThreadsByResourceId`
|
|
84
125
|
|
|
85
126
|
The `getThreadsByResourceId()` method has been renamed to `listThreadsByResourceId()`. This change aligns with the convention that `list*` methods return collections.
|
|
@@ -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
|
```
|
|
@@ -334,7 +333,6 @@ createStep({
|
|
|
334
333
|
+ if (!context.resumeData) {
|
|
335
334
|
+ return context.suspend({})
|
|
336
335
|
+ }
|
|
337
|
-
+ //..continue execution logic
|
|
338
336
|
+ }
|
|
339
337
|
});
|
|
340
338
|
+
|
|
@@ -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,39 @@
|
|
|
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
|
+
## Using your deployment
|
|
33
|
+
|
|
34
|
+
After deployment, interact with your agents using the [Mastra Client](/docs/v1/server/mastra-client) or call the REST API endpoints directly.
|
|
35
|
+
|
|
36
|
+
## Next steps
|
|
37
|
+
|
|
38
|
+
- [Studio](/docs/v1/mastra-cloud/studio) - Test your agents in the cloud
|
|
39
|
+
- [Observability](/docs/v1/mastra-cloud/observability) - Monitor traces and logs
|
|
@@ -1,46 +1,40 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "Observability | Mastra Cloud"
|
|
3
3
|
description: Monitoring and debugging tools for Mastra Cloud deployments
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Observability
|
|
7
7
|
|
|
8
|
-
|
|
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
9
|
|
|
10
10
|
For details on configuring observability, see the [Cloud Exporter](/docs/v1/observability/tracing/exporters/cloud) docs.
|
|
11
11
|
|
|
12
12
|
## Traces
|
|
13
13
|
|
|
14
|
-
|
|
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
15
|
|
|
16
16
|
### Agents
|
|
17
17
|
|
|
18
|
-
With observability enabled, you can view detailed outputs from your agents in the **Traces** section in Studio.
|
|
18
|
+
With observability enabled, you can view detailed outputs from your agents in the **Traces** section in [Studio](/docs/v1/mastra-cloud/studio).
|
|
19
19
|
|
|
20
20
|

|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Agent traces break a run into clear steps, model calls, tool calls, and intermediate chunks, each with timing, inputs, outputs, and errors. You can drill into any span to inspect prompts, token usage, and results, making it easy to diagnose issues and understand how the agent produced its output.
|
|
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.
|
|
25
23
|
|
|
26
24
|
### Workflows
|
|
27
25
|
|
|
28
|
-
With observability enabled, you can view detailed outputs from your workflows in the **Traces** section in Studio.
|
|
26
|
+
With observability enabled, you can view detailed outputs from your workflows in the **Traces** section in [Studio](/docs/v1/mastra-cloud/studio).
|
|
29
27
|
|
|
30
28
|

|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Workflow traces capture each step in the run, including transitions, branching, timing, and any tool calls inside the workflow. You can inspect inputs, outputs, and errors for every step, making it easy to debug long-running or multi-step processes and understand how data flows through the workflow.
|
|
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.
|
|
35
31
|
|
|
36
32
|
## Logs
|
|
37
33
|
|
|
38
|
-
|
|
34
|
+
The **Logs** page in the [project dashboard](/docs/v1/mastra-cloud/deployment#project-dashboard) displays detailed information for debugging and monitoring your application's behavior.
|
|
39
35
|
|
|
40
36
|

|
|
41
37
|
|
|
42
|
-
Key features:
|
|
43
|
-
|
|
44
38
|
Each log entry includes its severity level and a detailed message showing agent, workflow, or storage activity.
|
|
45
39
|
|
|
46
40
|
## Next steps
|
|
@@ -5,57 +5,27 @@ description: Deployment and monitoring service for Mastra applications
|
|
|
5
5
|
|
|
6
6
|
# Mastra Cloud
|
|
7
7
|
|
|
8
|
-
[Mastra Cloud](https://mastra.ai
|
|
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
9
|
|
|
10
|
-
##
|
|
10
|
+
## Studio
|
|
11
11
|
|
|
12
|
-
|
|
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
13
|
|
|
14
|
-
|
|
14
|
+
## Deploy
|
|
15
15
|
|
|
16
|
-
|
|
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
17
|
|
|
18
|
-
|
|
18
|
+
Once deployed, the project dashboard gives you visibility into:
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
- Deployment status and history
|
|
21
|
+
- Build logs and configuration
|
|
22
|
+
- Environment variables and settings
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
## Observability
|
|
23
25
|
|
|
24
|
-
|
|
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.
|
|
25
27
|
|
|
26
|
-
|
|
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
|
+
:::
|
|
27
31
|
|
|
28
|
-
The Project Dashboard gives you an overview of your application's status and deployments, with access to logs and a Studio for testing agents and workflows.
|
|
29
|
-
|
|
30
|
-
## Project structure
|
|
31
|
-
|
|
32
|
-
Use a standard Mastra project structure for proper detection and deployment.
|
|
33
|
-
|
|
34
|
-
```shell
|
|
35
|
-
src
|
|
36
|
-
└── mastra
|
|
37
|
-
├── agents
|
|
38
|
-
│ └── agent-name.ts
|
|
39
|
-
├── tools
|
|
40
|
-
│ └── tool-name.ts
|
|
41
|
-
├── workflows
|
|
42
|
-
│ └── workflow-name.ts
|
|
43
|
-
└── index.ts
|
|
44
|
-
package.json
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Mastra Cloud scans your repository for:
|
|
48
|
-
|
|
49
|
-
- **Agents**: Defined using: `new Agent({...})`
|
|
50
|
-
- **Tools**: Defined using: `createTool({...})`
|
|
51
|
-
- **Workflows**: Defined using: `createWorkflow({...})`
|
|
52
|
-
- **Steps**: Defined using: `createStep({...})`
|
|
53
|
-
- **Environment Variables**: API keys and configuration variables
|
|
54
|
-
|
|
55
|
-
## Technical implementation
|
|
56
|
-
|
|
57
|
-
Mastra Cloud is purpose-built for Mastra agents, tools, and workflows. It handles long-running requests, records detailed traces for every execution, and includes built-in support for evals.
|
|
58
|
-
|
|
59
|
-
## Next steps
|
|
60
|
-
|
|
61
|
-
- [Setting Up and Deploying](/docs/v1/mastra-cloud/setting-up)
|