@mastra/mcp-docs-server 1.2.11 → 1.2.12-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/docs/agents/using-tools.md +25 -0
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +5 -5
- package/.docs/guides/build-your-ui/copilotkit/generative-ui.md +8 -8
- package/.docs/guides/build-your-ui/copilotkit/overview.md +2 -2
- package/.docs/guides/build-your-ui/openui.md +1 -1
- package/.docs/guides/concepts/multi-agent-systems.md +5 -5
- package/.docs/guides/concepts/streaming.md +9 -9
- package/.docs/guides/deployment/amazon-ec2.md +1 -1
- package/.docs/guides/deployment/aws-lambda.md +1 -1
- package/.docs/guides/deployment/azure-app-services.md +1 -1
- package/.docs/guides/deployment/cloudflare.md +1 -1
- package/.docs/guides/deployment/inngest.md +6 -6
- package/.docs/guides/deployment/temporal.md +1 -1
- package/.docs/guides/deployment/vercel.md +1 -1
- package/.docs/guides/getting-started/astro.md +1 -1
- package/.docs/guides/getting-started/electron.md +1 -1
- package/.docs/guides/getting-started/nestjs.md +5 -5
- package/.docs/guides/getting-started/vite-react.md +1 -1
- package/.docs/guides/guide/chef-michel.md +1 -1
- package/.docs/guides/guide/code-review-bot.md +1 -1
- package/.docs/guides/guide/coding-agent.md +4 -4
- package/.docs/guides/guide/dev-assistant.md +1 -1
- package/.docs/guides/guide/docs-manager.md +3 -3
- package/.docs/guides/guide/github-actions-pr-description.md +4 -4
- package/.docs/guides/guide/research-assistant.md +3 -3
- package/.docs/guides/guide/research-coordinator.md +3 -3
- package/.docs/guides/guide/slack-assistant.md +1 -1
- package/.docs/guides/guide/stock-agent.md +1 -1
- package/.docs/guides/index.md +1 -1
- package/.docs/guides/migrations/ai-sdk-v4-to-v5.md +1 -1
- package/.docs/guides/migrations/mastra-cloud.md +6 -6
- package/.docs/guides/migrations/network-to-supervisor.md +9 -9
- package/.docs/guides/migrations/upgrade-to-v1/agent.md +5 -5
- package/.docs/guides/migrations/upgrade-to-v1/cli.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/client.md +3 -3
- package/.docs/guides/migrations/upgrade-to-v1/evals.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/memory.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/overview.md +3 -3
- package/.docs/guides/migrations/upgrade-to-v1/processors.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/storage.md +11 -11
- package/.docs/guides/migrations/upgrade-to-v1/tools.md +3 -3
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/voice.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/workflows.md +1 -1
- package/.docs/models/environment-variables.md +1 -0
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/modal.md +73 -0
- package/.docs/models/providers.md +1 -0
- package/.docs/reference/acp/acp-agent.md +3 -3
- package/.docs/reference/acp/create-acp-tool.md +2 -2
- package/.docs/reference/agent-controller/agent-controller-class.md +36 -36
- package/.docs/reference/agent-controller/session.md +6 -6
- package/.docs/reference/agents/agent.md +7 -7
- package/.docs/reference/agents/channels.md +3 -3
- package/.docs/reference/agents/durable-agent.md +3 -3
- package/.docs/reference/agents/generate.md +3 -3
- package/.docs/reference/agents/getDefaultOptions.md +1 -1
- package/.docs/reference/agents/getDefaultStreamOptions.md +1 -1
- package/.docs/reference/agents/listScorers.md +1 -1
- package/.docs/reference/agents/listSkills.md +1 -1
- package/.docs/reference/agents/listSuspendedRuns.md +2 -2
- package/.docs/reference/ai-sdk/chat-route.md +1 -1
- package/.docs/reference/ai-sdk/network-route.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +1 -1
- package/.docs/reference/ai-sdk/workflow-route.md +1 -1
- package/.docs/reference/ai-sdk/workflow-snapshot-to-stream.md +2 -2
- package/.docs/reference/auth/auth0.md +1 -1
- package/.docs/reference/auth/fga.md +2 -2
- package/.docs/reference/auth/google.md +2 -2
- package/.docs/reference/auth/okta.md +1 -1
- package/.docs/reference/auth/workos.md +2 -2
- package/.docs/reference/browser/agent-browser.md +2 -2
- package/.docs/reference/browser/browser-viewer.md +3 -3
- package/.docs/reference/browser/mastra-browser.md +3 -3
- package/.docs/reference/browser/stagehand-browser.md +4 -4
- package/.docs/reference/channels/slack-provider.md +2 -2
- package/.docs/reference/cli/create-mastra.md +1 -1
- package/.docs/reference/cli/mastra.md +23 -23
- package/.docs/reference/client-js/agents.md +9 -9
- package/.docs/reference/client-js/memory.md +2 -2
- package/.docs/reference/client-js/workflows.md +1 -1
- package/.docs/reference/coding-agent/build-base-prompt.md +2 -2
- package/.docs/reference/coding-agent/create-coding-agent.md +2 -2
- package/.docs/reference/configuration.md +6 -6
- package/.docs/reference/core/getMCPServer.md +1 -1
- package/.docs/reference/core/getScorer.md +1 -1
- package/.docs/reference/datasets/addItem.md +1 -1
- package/.docs/reference/datasets/listItems.md +1 -1
- package/.docs/reference/deployer/netlify.md +4 -4
- package/.docs/reference/deployer/vercel.md +7 -7
- package/.docs/reference/editor/agent-builder/agent-builder-options.md +4 -4
- package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +6 -6
- package/.docs/reference/editor/agent-builder/builder-models.md +3 -3
- package/.docs/reference/editor/blob-store-provider.md +1 -1
- package/.docs/reference/editor/browser-provider.md +3 -3
- package/.docs/reference/editor/filesystem-provider.md +4 -4
- package/.docs/reference/editor/mastra-editor.md +5 -5
- package/.docs/reference/editor/processor-provider.md +3 -3
- package/.docs/reference/editor/sandbox-provider.md +4 -4
- package/.docs/reference/editor/storage-browser-ref.md +6 -6
- package/.docs/reference/editor/storage-workspace-ref.md +4 -4
- package/.docs/reference/editor/tool-provider.md +1 -1
- package/.docs/reference/evals/answer-relevancy.md +4 -4
- package/.docs/reference/evals/bias.md +3 -3
- package/.docs/reference/evals/checks.md +3 -3
- package/.docs/reference/evals/completeness.md +5 -5
- package/.docs/reference/evals/content-similarity.md +5 -5
- package/.docs/reference/evals/context-precision.md +2 -2
- package/.docs/reference/evals/context-recall.md +8 -8
- package/.docs/reference/evals/context-relevance.md +4 -4
- package/.docs/reference/evals/create-scorer.md +1 -1
- package/.docs/reference/evals/faithfulness.md +3 -3
- package/.docs/reference/evals/filter-run.md +2 -2
- package/.docs/reference/evals/hallucination.md +6 -6
- package/.docs/reference/evals/keyword-coverage.md +6 -6
- package/.docs/reference/evals/mastra-scorer.md +2 -2
- package/.docs/reference/evals/noise-sensitivity.md +5 -5
- package/.docs/reference/evals/prompt-alignment.md +5 -5
- package/.docs/reference/evals/rubric.md +1 -1
- package/.docs/reference/evals/run-evals.md +3 -3
- package/.docs/reference/evals/scorer-utils.md +4 -4
- package/.docs/reference/evals/textual-difference.md +4 -4
- package/.docs/reference/evals/tool-call-accuracy.md +1 -1
- package/.docs/reference/evals/toxicity.md +4 -4
- package/.docs/reference/evals/trajectory-accuracy.md +10 -10
- package/.docs/reference/file-based-agents/instructions.md +2 -2
- package/.docs/reference/file-based-agents/logger.md +1 -1
- package/.docs/reference/file-based-agents/observability.md +1 -1
- package/.docs/reference/file-based-agents/processors.md +1 -1
- package/.docs/reference/file-based-agents/skills.md +1 -1
- package/.docs/reference/file-based-agents/storage.md +1 -1
- package/.docs/reference/file-based-agents/studio.md +1 -1
- package/.docs/reference/file-based-agents/subagents.md +1 -1
- package/.docs/reference/file-based-agents/tools.md +1 -1
- package/.docs/reference/file-based-agents/workspace.md +1 -1
- package/.docs/reference/logging/pino-logger.md +3 -3
- package/.docs/reference/memory/clone-utilities.md +1 -1
- package/.docs/reference/memory/cloneThread.md +3 -3
- package/.docs/reference/memory/listThreads.md +1 -1
- package/.docs/reference/memory/memory-class.md +1 -1
- package/.docs/reference/memory/observational-memory.md +11 -11
- package/.docs/reference/memory/recall.md +2 -2
- package/.docs/reference/memory/serialized-memory-config.md +4 -4
- package/.docs/reference/memory/summarizeConversation.md +3 -3
- package/.docs/reference/memory/summarizeThread.md +3 -3
- package/.docs/reference/observability/feedback.md +1 -1
- package/.docs/reference/observability/metrics/automatic-metrics.md +7 -7
- package/.docs/reference/observability/tracing/bridges/datadog.md +2 -2
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +3 -3
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +4 -4
- package/.docs/reference/observability/tracing/exporters/mastra-storage-exporter.md +1 -1
- package/.docs/reference/observability/tracing/interfaces.md +1 -1
- package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +1 -1
- package/.docs/reference/observability/tracing/span-filtering.md +1 -1
- package/.docs/reference/processors/cost-guard-processor.md +1 -1
- package/.docs/reference/processors/pii-detector.md +1 -1
- package/.docs/reference/processors/processor-interface.md +12 -12
- package/.docs/reference/processors/prompt-injection-detector.md +1 -1
- package/.docs/reference/processors/provider-history-compat.md +1 -1
- package/.docs/reference/processors/regex-filter-processor.md +1 -1
- package/.docs/reference/processors/response-cache.md +8 -8
- package/.docs/reference/processors/system-prompt-scrubber.md +1 -1
- package/.docs/reference/processors/token-limiter-processor.md +1 -1
- package/.docs/reference/processors/tool-search-processor.md +7 -7
- package/.docs/reference/processors/unicode-normalizer.md +1 -1
- package/.docs/reference/project-structure.md +1 -1
- package/.docs/reference/pubsub/base.md +4 -4
- package/.docs/reference/pubsub/google-cloud-pubsub.md +2 -2
- package/.docs/reference/pubsub/lease-provider.md +4 -4
- package/.docs/reference/pubsub/redis-streams.md +1 -1
- package/.docs/reference/pubsub/unix-socket-pubsub.md +1 -1
- package/.docs/reference/rag/chunk.md +5 -5
- package/.docs/reference/rag/database-config.md +2 -2
- package/.docs/reference/rag/metadata-filters.md +2 -2
- package/.docs/reference/schedules/overview.md +1 -1
- package/.docs/reference/server/register-api-route.md +1 -1
- package/.docs/reference/server/routes.md +1 -1
- package/.docs/reference/signals/signal-provider.md +8 -8
- package/.docs/reference/storage/clickhouse.md +4 -4
- package/.docs/reference/storage/cloudflare-d1.md +4 -4
- package/.docs/reference/storage/convex.md +4 -4
- package/.docs/reference/storage/dsql.md +2 -2
- package/.docs/reference/storage/dynamodb.md +7 -7
- package/.docs/reference/storage/lance.md +1 -1
- package/.docs/reference/storage/mongodb.md +1 -1
- package/.docs/reference/storage/mssql.md +1 -1
- package/.docs/reference/storage/postgresql.md +1 -1
- package/.docs/reference/storage/retention.md +33 -33
- package/.docs/reference/storage/spanner.md +8 -8
- package/.docs/reference/streaming/ChunkType.md +2 -2
- package/.docs/reference/streaming/agents/MastraModelOutput.md +1 -1
- package/.docs/reference/streaming/agents/stream.md +1 -1
- package/.docs/reference/streaming/agents/streamUntilIdle.md +2 -2
- package/.docs/reference/streaming/workflows/observeStream.md +1 -1
- package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
- package/.docs/reference/streaming/workflows/stream.md +1 -1
- package/.docs/reference/streaming/workflows/timeTravelStream.md +2 -2
- package/.docs/reference/templates/overview.md +1 -1
- package/.docs/reference/tools/brightdata.md +1 -1
- package/.docs/reference/tools/create-tool.md +1 -1
- package/.docs/reference/tools/graph-rag-tool.md +1 -1
- package/.docs/reference/tools/mcp-client.md +13 -13
- package/.docs/reference/tools/mcp-server.md +20 -20
- package/.docs/reference/tools/submit-plan-tool.md +1 -1
- package/.docs/reference/tools/tavily.md +1 -1
- package/.docs/reference/tools/vector-query-tool.md +4 -4
- package/.docs/reference/vectors/astra.md +1 -1
- package/.docs/reference/vectors/chroma.md +2 -2
- package/.docs/reference/vectors/convex.md +2 -2
- package/.docs/reference/vectors/couchbase.md +4 -4
- package/.docs/reference/vectors/libsql.md +1 -1
- package/.docs/reference/vectors/mongodb.md +1 -1
- package/.docs/reference/vectors/pg.md +4 -4
- package/.docs/reference/vectors/qdrant.md +2 -2
- package/.docs/reference/vectors/s3vectors.md +4 -4
- package/.docs/reference/vectors/turbopuffer.md +1 -1
- package/.docs/reference/voice/aws-nova-sonic.md +1 -1
- package/.docs/reference/voice/azure.md +1 -1
- package/.docs/reference/voice/google-gemini-live.md +4 -4
- package/.docs/reference/voice/inworld-realtime.md +7 -7
- package/.docs/reference/voice/livekit.md +13 -13
- package/.docs/reference/voice/mistral.md +1 -1
- package/.docs/reference/voice/openai-realtime.md +1 -1
- package/.docs/reference/voice/sarvam.md +1 -1
- package/.docs/reference/voice/voice.addTools.md +1 -1
- package/.docs/reference/voice/voice.events.md +1 -1
- package/.docs/reference/voice/voice.getSpeakers.md +2 -2
- package/.docs/reference/voice/voice.on.md +2 -2
- package/.docs/reference/voice/xai-realtime.md +2 -2
- package/.docs/reference/workflows/run-methods/cancel.md +1 -1
- package/.docs/reference/workflows/run-methods/startAsync.md +1 -1
- package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
- package/.docs/reference/workflows/workflow-methods/foreach.md +1 -1
- package/.docs/reference/workflows/workflow-methods/sleep.md +1 -1
- package/.docs/reference/workflows/workflow-state-reader.md +2 -2
- package/.docs/reference/workspace/apple-container-sandbox.md +2 -2
- package/.docs/reference/workspace/daytona-sandbox.md +3 -3
- package/.docs/reference/workspace/docker-sandbox.md +2 -2
- package/.docs/reference/workspace/e2b-sandbox.md +2 -2
- package/.docs/reference/workspace/files-sdk-filesystem.md +3 -3
- package/.docs/reference/workspace/google-drive-filesystem.md +4 -4
- package/.docs/reference/workspace/local-filesystem.md +2 -2
- package/.docs/reference/workspace/local-sandbox.md +2 -2
- package/.docs/reference/workspace/modal-sandbox.md +1 -1
- package/.docs/reference/workspace/platform-filesystem.md +3 -3
- package/.docs/reference/workspace/platform-sandbox.md +2 -2
- package/.docs/reference/workspace/process-manager.md +1 -1
- package/.docs/reference/workspace/railway-sandbox.md +4 -4
- package/.docs/reference/workspace/s3-filesystem.md +1 -1
- package/.docs/reference/workspace/sandbox.md +1 -1
- package/.docs/reference/workspace/vercel-sandbox.md +1 -1
- package/.docs/reference/workspace/workspace-class.md +10 -10
- package/CHANGELOG.md +7 -0
- package/package.json +5 -5
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Build a research coordinator with supervisor agents
|
|
4
4
|
|
|
5
|
-
In this guide, you'll build a research coordinator that orchestrates multiple specialized agents using supervisor agents. The coordinator will delegate research tasks to a research agent and writing tasks to a writing agent, then synthesize the results into a
|
|
5
|
+
In this guide, you'll build a research coordinator that orchestrates multiple specialized agents using supervisor agents. The coordinator will delegate research tasks to a research agent and writing tasks to a writing agent, then synthesize the results into a detailed report.
|
|
6
6
|
|
|
7
|
-
You'll
|
|
7
|
+
You'll set up subagents with clear roles and configure a supervisor agent to coordinate them. You'll also use delegation hooks to control execution and scorers to validate task completion.
|
|
8
8
|
|
|
9
9
|
## Prerequisites
|
|
10
10
|
|
|
@@ -172,7 +172,7 @@ export const mastra = new Mastra({
|
|
|
172
172
|
The `defaultOptions` on the supervisor agent configure delegation hooks and iteration monitoring:
|
|
173
173
|
|
|
174
174
|
- `onDelegationStart` modifies the research agent's prompt to request recent data
|
|
175
|
-
- `onDelegationComplete` logs completion
|
|
175
|
+
- `onDelegationComplete` logs completion and stops on errors, then provides feedback
|
|
176
176
|
- `messageFilter` limits context to the last 10 messages for efficiency
|
|
177
177
|
- `onIterationComplete` monitors progress after each iteration
|
|
178
178
|
|
|
@@ -160,7 +160,7 @@ Select **Save Changes**. Slack requires you to reinstall the app after changing
|
|
|
160
160
|
|
|
161
161
|
## Test the agent
|
|
162
162
|
|
|
163
|
-
Before testing with Slack, you can refine your agent's behavior in [Studio](https://mastra.ai/docs/studio/overview). Open <http://localhost:4111/> to chat with your agent
|
|
163
|
+
Before testing with Slack, you can refine your agent's behavior in [Studio](https://mastra.ai/docs/studio/overview). Open <http://localhost:4111/> to chat with your agent and adjust its instructions. Inspect traces to see how responses are generated.
|
|
164
164
|
|
|
165
165
|
Once you're happy with the agent's responses, test the Slack integration. Invite the bot to a channel in Slack:
|
|
166
166
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Building an AI stock agent
|
|
4
4
|
|
|
5
|
-
In this guide, you'
|
|
5
|
+
In this guide, you'll create an agent that fetches the previous day's closing stock price for a symbol. You'll create a tool and add it to an agent, then use the agent to fetch stock prices.
|
|
6
6
|
|
|
7
7
|
## Prerequisites
|
|
8
8
|
|
package/.docs/guides/index.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Mastra Guides
|
|
4
4
|
|
|
5
|
-
Mastra offers
|
|
5
|
+
Mastra offers guides for building agents and workflows, using the Mastra SDK and API, and implementing different UI frameworks. Explore these guides to find the resources you need to get started and build with Mastra.
|
|
6
6
|
|
|
7
7
|
## New project
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ This guide covers only the Mastra-specific aspects of the migration.
|
|
|
13
13
|
|
|
14
14
|
## Memory and storage
|
|
15
15
|
|
|
16
|
-
Mastra automatically handles AI SDK v4 data using its internal `MessageList` class, which manages format conversion
|
|
16
|
+
Mastra automatically handles AI SDK v4 data using its internal `MessageList` class, which manages format conversion, including v4 to v5. No database migrations are required. Your existing messages are translated on the fly and continue working after you upgrade.
|
|
17
17
|
|
|
18
18
|
## Message format conversion
|
|
19
19
|
|
|
@@ -60,7 +60,7 @@ The Mastra platform replaces Mastra Cloud with separate Studio and Server produc
|
|
|
60
60
|
|
|
61
61
|
Mastra Cloud provided a managed libSQL database, backed by [Turso](https://turso.tech). The Mastra platform doesn't host a database for you, so you need to point your storage at an externally hosted instance.
|
|
62
62
|
|
|
63
|
-
If you were already using a hosted database ("bring your own"),
|
|
63
|
+
If you were already using a hosted database ("bring your own"), keep the existing database configuration. Ensure the connection string is set as an environment variable in the dashboard rather than hardcoded.
|
|
64
64
|
|
|
65
65
|
If you were using Cloud Store, follow the steps below to export your data and load it into a new libSQL database that you control.
|
|
66
66
|
|
|
@@ -68,7 +68,7 @@ If you were using Cloud Store, follow the steps below to export your data and lo
|
|
|
68
68
|
|
|
69
69
|
You can export your Cloud Store data in two ways: download it from the dashboard, or create a manual dump with the Turso CLI.
|
|
70
70
|
|
|
71
|
-
#### Option A
|
|
71
|
+
#### Option A: Export from the dashboard (recommended)
|
|
72
72
|
|
|
73
73
|
Open your project in the [Mastra dashboard](https://projects.mastra.ai) and navigate to **Runtime → Settings → Storage**. Click the **Export Database** button. The dashboard generates a full `.sql` dump of your Cloud Store and downloads it directly to your Downloads folder.
|
|
74
74
|
|
|
@@ -80,7 +80,7 @@ sqlite3 mydb.db < ~/Downloads/mastra-cloud-dump.sql
|
|
|
80
80
|
|
|
81
81
|
You now have a portable `mydb.db` file you can inspect locally, back up, or use as the source for the new database in the steps that follow.
|
|
82
82
|
|
|
83
|
-
#### Option B
|
|
83
|
+
#### Option B: Export via the Turso CLI
|
|
84
84
|
|
|
85
85
|
If you prefer to work from the command line, or need to script the export, you can dump the database directly using the [Turso CLI](https://docs.turso.tech/cli). This approach requires the database URL and an auth token, both surfaced in the dashboard.
|
|
86
86
|
|
|
@@ -269,7 +269,7 @@ Deploy your hosted Studio instance:
|
|
|
269
269
|
mastra studio deploy
|
|
270
270
|
```
|
|
271
271
|
|
|
272
|
-
The CLI builds your project
|
|
272
|
+
The CLI builds your project and uploads the artifact before deploying it. On first deploy, a `.mastra-project.json` file is created to link your local project to the platform. Commit this file to your repository.
|
|
273
273
|
|
|
274
274
|
A local env file is optional. When a `.env` or `.env.*` file is present in the project directory, the deploy bundles its environment variables.
|
|
275
275
|
|
|
@@ -283,14 +283,14 @@ See [Studio deployment](https://mastra.ai/docs/studio/deployment) for details.
|
|
|
283
283
|
|
|
284
284
|
### Multiple environments
|
|
285
285
|
|
|
286
|
-
A single Mastra platform project runs the same codebase across multiple
|
|
286
|
+
A single Mastra platform project runs the same codebase across multiple [environments](https://mastra.ai/docs/mastra-platform/environments), such as `production` and `staging`. Deploy to each with the unified [`mastra deploy`](https://mastra.ai/docs/mastra-platform/deploy) command:
|
|
287
287
|
|
|
288
288
|
```bash
|
|
289
289
|
mastra deploy --env production --yes
|
|
290
290
|
mastra deploy --env staging --env-file .env.staging --yes
|
|
291
291
|
```
|
|
292
292
|
|
|
293
|
-
Each environment
|
|
293
|
+
Each environment has a dedicated URL and environment variables, along with a separate deploy history.
|
|
294
294
|
|
|
295
295
|
## Deploy Server (optional)
|
|
296
296
|
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
Supervisor agents using `Agent.stream()` and `Agent.generate()` are the recommended approach for coordinating multiple agents, replacing the older `.network()` API. This guide walks you through each step of the migration.
|
|
6
6
|
|
|
7
|
-
> **.network() Deprecation:** `.network()` is deprecated and will be removed in a future release.
|
|
7
|
+
> **.network() Deprecation:** `.network()` is deprecated and will be removed in a future release. Existing code will continue to work until then, but development now focuses on supervisor agents. Migrate to supervisor agents as soon as possible.
|
|
8
8
|
|
|
9
9
|
## Replace `.network()` with `.stream()` or `.generate()`
|
|
10
10
|
|
|
11
|
-
The core change is replacing `.network()` calls with `.stream()` (for streaming) or `.generate()` (for non-streaming). The agent configuration stays the same
|
|
11
|
+
The core change is replacing `.network()` calls with `.stream()` (for streaming) or `.generate()` (for non-streaming). The agent configuration stays the same. You still define `agents`, `workflows`, `tools`, and `memory` on the agent. The difference is how you call it and how you process the results.
|
|
12
12
|
|
|
13
13
|
With `.network()`, you iterated over custom event types like `network-execution-event-step-finish`. With `.stream()`, you use the standard `textStream` or `fullStream` iterators.
|
|
14
14
|
|
|
@@ -50,9 +50,9 @@ console.log(result.text)
|
|
|
50
50
|
|
|
51
51
|
## Write clear supervisor instructions
|
|
52
52
|
|
|
53
|
-
With `.network()`, the routing agent relied on generic instructions and primitive descriptions to decide what to call. Supervisor agents work the same way, but clear and specific instructions
|
|
53
|
+
With `.network()`, the routing agent relied on generic instructions and primitive descriptions to decide what to call. Supervisor agents work the same way, but clear and specific instructions improve delegation accuracy.
|
|
54
54
|
|
|
55
|
-
Your supervisor's `instructions` should
|
|
55
|
+
Your supervisor's `instructions` should identify the available resources and when to use each one. They should also explain how to coordinate those resources and recognize when the task is complete.
|
|
56
56
|
|
|
57
57
|
**Before:**
|
|
58
58
|
|
|
@@ -92,7 +92,7 @@ Success criteria:
|
|
|
92
92
|
|
|
93
93
|
## Add descriptions to subagents
|
|
94
94
|
|
|
95
|
-
Each subagent should have a `description` field that explains
|
|
95
|
+
Each subagent should have a `description` field that explains its purpose and return format. The description should also state when to use the subagent. The supervisor uses these descriptions to decide which agent to delegate to.
|
|
96
96
|
|
|
97
97
|
```typescript
|
|
98
98
|
const researchAgent = new Agent({
|
|
@@ -129,7 +129,7 @@ If you were handling specific `.network()` events, update them to use the standa
|
|
|
129
129
|
|
|
130
130
|
Supervisor agents let you hook into the delegation lifecycle to monitor, modify, or reject delegations. These hooks can be configured in the agent's `defaultOptions` or passed per-call.
|
|
131
131
|
|
|
132
|
-
`onDelegationStart` is called before the supervisor delegates to a subagent. You can modify the prompt
|
|
132
|
+
`onDelegationStart` is called before the supervisor delegates to a subagent. You can modify the prompt or limit the subagent's steps. The hook can also reject the delegation entirely:
|
|
133
133
|
|
|
134
134
|
```typescript
|
|
135
135
|
const stream = await supervisorAgent.stream('Research AI in education', {
|
|
@@ -159,7 +159,7 @@ const stream = await supervisorAgent.stream('Research AI in education', {
|
|
|
159
159
|
})
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
-
`onDelegationComplete` is called after a delegation finishes.
|
|
162
|
+
`onDelegationComplete` is called after a delegation finishes. Inspect the result and call `context.bail()` when the supervisor loop should stop. You can also return feedback that gets saved to the supervisor's memory:
|
|
163
163
|
|
|
164
164
|
```typescript
|
|
165
165
|
const stream = await supervisorAgent.stream('Research AI in education', {
|
|
@@ -179,7 +179,7 @@ const stream = await supervisorAgent.stream('Research AI in education', {
|
|
|
179
179
|
|
|
180
180
|
## Add message filtering
|
|
181
181
|
|
|
182
|
-
By default, subagents receive the full conversation context from the supervisor. Use `messageFilter` to control what messages are shared
|
|
182
|
+
By default, subagents receive the full conversation context from the supervisor. Use `messageFilter` to control what messages are shared. For example, remove sensitive data or limit the number of messages:
|
|
183
183
|
|
|
184
184
|
```typescript
|
|
185
185
|
const stream = await supervisorAgent.stream('Research AI in education', {
|
|
@@ -200,7 +200,7 @@ const stream = await supervisorAgent.stream('Research AI in education', {
|
|
|
200
200
|
|
|
201
201
|
## Add iteration monitoring
|
|
202
202
|
|
|
203
|
-
`onIterationComplete` is called after each iteration of the supervisor loop.
|
|
203
|
+
`onIterationComplete` is called after each iteration of the supervisor loop. Use it to log progress or provide feedback that guides the agent. The hook can also stop execution early:
|
|
204
204
|
|
|
205
205
|
```typescript
|
|
206
206
|
const stream = await supervisorAgent.stream('Research AI in education', {
|
|
@@ -45,7 +45,7 @@ To migrate, replace all calls to `mastra.getAgents()` with `mastra.listAgents()`
|
|
|
45
45
|
|
|
46
46
|
### `RuntimeContext` to `RequestContext`
|
|
47
47
|
|
|
48
|
-
The `RuntimeContext` class has been renamed to `RequestContext` throughout the codebase.
|
|
48
|
+
The `RuntimeContext` class has been renamed to `RequestContext` throughout the codebase. The new name identifies the class as request-specific data and matches web framework conventions.
|
|
49
49
|
|
|
50
50
|
To migrate, update all imports and parameter names from `RuntimeContext`/`runtimeContext` to `RequestContext`/`requestContext`.
|
|
51
51
|
|
|
@@ -91,7 +91,7 @@ To migrate, replace property access with the corresponding getter methods.
|
|
|
91
91
|
|
|
92
92
|
### Voice methods moved to `agent.voice` namespace
|
|
93
93
|
|
|
94
|
-
Voice-related methods have
|
|
94
|
+
Voice-related methods have moved from the Agent class to the `agent.voice` namespace, which groups the voice APIs together.
|
|
95
95
|
|
|
96
96
|
To migrate, update voice method calls to use the `agent.voice` namespace.
|
|
97
97
|
|
|
@@ -112,7 +112,7 @@ To migrate, update voice method calls to use the `agent.voice` namespace.
|
|
|
112
112
|
|
|
113
113
|
### `agent.fetchMemory()` to `(await agent.getMemory()).recall()`
|
|
114
114
|
|
|
115
|
-
The `fetchMemory()` method has been replaced with
|
|
115
|
+
The `fetchMemory()` method has been replaced with an API that makes asynchronous memory access explicit.
|
|
116
116
|
|
|
117
117
|
To migrate, replace `fetchMemory()` calls with the new API.
|
|
118
118
|
|
|
@@ -167,7 +167,7 @@ Only update your imports if you want to standardize on one Zod version across yo
|
|
|
167
167
|
|
|
168
168
|
### Default options method renames for AI SDK versions
|
|
169
169
|
|
|
170
|
-
Default options methods have been renamed to
|
|
170
|
+
Default options methods have been renamed to distinguish legacy (AI SDK v4) APIs from AI SDK v5+ APIs. The method name now indicates which AI SDK version it targets.
|
|
171
171
|
|
|
172
172
|
To migrate, update method names based on which AI SDK version you're using.
|
|
173
173
|
|
|
@@ -184,7 +184,7 @@ To migrate, update method names based on which AI SDK version you're using.
|
|
|
184
184
|
|
|
185
185
|
### `modelSettings.abortSignal` to top-level `abortSignal`
|
|
186
186
|
|
|
187
|
-
The `abortSignal` option has
|
|
187
|
+
The `abortSignal` option has moved from `modelSettings` to the top level of stream and generate options. Execution control now sits outside model-specific settings.
|
|
188
188
|
|
|
189
189
|
To migrate, move `abortSignal` from `modelSettings` to the top level.
|
|
190
190
|
|
|
@@ -14,7 +14,7 @@ A new `mastra migrate` command helps run database migrations when upgrading Mast
|
|
|
14
14
|
npx mastra migrate
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
The command bundles your project
|
|
17
|
+
The command bundles your project and connects to your configured storage before running any necessary migrations. It currently supports migrating duplicate span entries that may prevent unique constraint creation.
|
|
18
18
|
|
|
19
19
|
See the [Storage migration guide](https://mastra.ai/guides/migrations/upgrade-to-v1/storage) for details on when this migration is needed.
|
|
20
20
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Client SDK
|
|
4
4
|
|
|
5
|
-
Client SDK changes align with server-side API updates including
|
|
5
|
+
Client SDK changes align with server-side API updates, including utility renames, updated pagination, and type naming conventions.
|
|
6
6
|
|
|
7
7
|
## Changed
|
|
8
8
|
|
|
@@ -126,7 +126,7 @@ To migrate, update type imports to use the new naming pattern.
|
|
|
126
126
|
|
|
127
127
|
### Pagination parameters from `offset/limit` to `page/perPage`
|
|
128
128
|
|
|
129
|
-
All client SDK methods that used `offset/limit` now use `page/perPage
|
|
129
|
+
All client SDK methods that used `offset/limit` now use `page/perPage`, matching page-based web pagination.
|
|
130
130
|
|
|
131
131
|
To migrate, update pagination parameters in all client SDK method calls. Example:
|
|
132
132
|
|
|
@@ -211,7 +211,7 @@ To migrate, use `runById()` instead, which now returns the same unified `Workflo
|
|
|
211
211
|
|
|
212
212
|
### `toAISdkFormat` function
|
|
213
213
|
|
|
214
|
-
The `toAISdkFormat()` function has been removed from `@mastra/ai-sdk`.
|
|
214
|
+
The `toAISdkFormat()` function has been removed from `@mastra/ai-sdk`. Use the stream conversion utilities shown below instead.
|
|
215
215
|
|
|
216
216
|
To migrate, use `toAISdkStream()` instead.
|
|
217
217
|
|
|
@@ -25,7 +25,7 @@ To migrate, replace all calls to `getScorers()` with `listScorers()`.
|
|
|
25
25
|
|
|
26
26
|
### `runExperiment` to `runEvals`
|
|
27
27
|
|
|
28
|
-
The `runExperiment()` function has been renamed to `runEvals()
|
|
28
|
+
The `runExperiment()` function has been renamed to `runEvals()` to identify that it runs evaluations.
|
|
29
29
|
|
|
30
30
|
To migrate, update function calls from `runExperiment` to `runEvals`.
|
|
31
31
|
|
|
@@ -152,7 +152,7 @@ import type {
|
|
|
152
152
|
|
|
153
153
|
### Message content structure to nested format
|
|
154
154
|
|
|
155
|
-
Tool invocations and text content are now accessed through a nested `content` object
|
|
155
|
+
Tool invocations and text content are now accessed through a nested `content` object instead of flat message properties. The nested structure matches the database message format and its types.
|
|
156
156
|
|
|
157
157
|
To migrate, access tool invocations via `message.content.toolInvocations` and text via `message.content.content` or use the `getTextContentFromMastraDBMessage()` helper.
|
|
158
158
|
|
|
@@ -260,7 +260,7 @@ To migrate, use `MastraDBMessage` for storage or AI SDK v5 message formats direc
|
|
|
260
260
|
|
|
261
261
|
### `processors` config from Memory constructor
|
|
262
262
|
|
|
263
|
-
The `processors` config option in the Memory constructor
|
|
263
|
+
The `processors` config option in the Memory constructor is no longer supported and throws an error. Configure processors at the Agent level, where processor behavior is scoped to agent execution.
|
|
264
264
|
|
|
265
265
|
To migrate, move processor configuration from Memory to Agent using `inputProcessors` and/or `outputProcessors`.
|
|
266
266
|
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
Mastra v1 was released in January 2026. We recommend starting any new projects with Mastra v1, or upgrading your existing project to continue receiving updates and support.
|
|
8
8
|
|
|
9
|
-
This guide
|
|
9
|
+
This guide covers the breaking changes when upgrading from Mastra 0.x to v1.0. The migration is organized by package and feature area to help you systematically update your codebase.
|
|
10
10
|
|
|
11
11
|
> **Need help?:** Need help with the migration? Join our [Discord community](https://discord.gg/BTYqqHKUrf) to ask questions.
|
|
12
12
|
|
|
13
|
-
> **Coming from Mastra Cloud?:** The legacy Mastra Cloud product has been replaced by the [Mastra platform](https://mastra.ai/docs/mastra-platform/overview), which splits hosting into two separate products: **Studio** (visual environment, observability) and **Server** (production API). Old Mastra Cloud access tokens don't work with Mastra platform
|
|
13
|
+
> **Coming from Mastra Cloud?:** The legacy Mastra Cloud product has been replaced by the [Mastra platform](https://mastra.ai/docs/mastra-platform/overview), which splits hosting into two separate products: **Studio** (visual environment, observability) and **Server** (production API). Old Mastra Cloud access tokens don't work with Mastra platform. Create new ones with `mastra auth tokens create`.
|
|
14
14
|
>
|
|
15
15
|
> If you upgrade to v1 packages without also migrating your `telemetry:` config to `observability:` and creating a Studio project, observability data will stop flowing. Follow the [Mastra Cloud migration guide](https://mastra.ai/guides/migrations/mastra-cloud) end to end.
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ This guide provides a comprehensive overview of breaking changes when upgrading
|
|
|
18
18
|
|
|
19
19
|
### Update all Mastra packages to `latest` tag
|
|
20
20
|
|
|
21
|
-
Use your package manager to update your project's versions.
|
|
21
|
+
Use your package manager to update your project's versions. Update **all** Mastra packages together to ensure compatibility (all `@mastra/*` packages and `mastra`).
|
|
22
22
|
|
|
23
23
|
Here's how you update the most commonly used packages:
|
|
24
24
|
|
|
@@ -27,7 +27,7 @@ import type { InputProcessor } from '@mastra/core/processors';
|
|
|
27
27
|
|
|
28
28
|
### Processor message types from `MastraMessageV2` to `MastraDBMessage`
|
|
29
29
|
|
|
30
|
-
Processor message types have changed from `MastraMessageV2` to `MastraDBMessage`.
|
|
30
|
+
Processor message types have changed from `MastraMessageV2` to `MastraDBMessage`. Processors and scorers now use the database message format and its types.
|
|
31
31
|
|
|
32
32
|
To migrate, update processor message type imports and usage.
|
|
33
33
|
|
|
@@ -39,7 +39,7 @@ Run the migration command which automatically deduplicates spans and adds the co
|
|
|
39
39
|
npx mastra migrate
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
The CLI bundles your project
|
|
42
|
+
The CLI bundles your project and connects to your configured storage before running the migration. It keeps the most complete record (based on `endTime` and attributes) when removing duplicates.
|
|
43
43
|
|
|
44
44
|
#### Option 2: Manual SQL (PostgreSQL)
|
|
45
45
|
|
|
@@ -144,7 +144,7 @@ To migrate, update your imports and instantiation:
|
|
|
144
144
|
});
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
> **Note:** If you're using a single store implementation (like `PostgresStore` or `LibSQLStore`) directly,
|
|
147
|
+
> **Note:** If you're using a single store implementation (like `PostgresStore` or `LibSQLStore`) directly, keep the existing configuration. This only affects code that explicitly uses `MastraStorage` for composite storage.
|
|
148
148
|
|
|
149
149
|
### Required `id` property for storage instances
|
|
150
150
|
|
|
@@ -168,7 +168,7 @@ const storage = new PostgresStore({
|
|
|
168
168
|
|
|
169
169
|
### Pagination from `offset/limit` to `page/perPage`
|
|
170
170
|
|
|
171
|
-
All pagination APIs now use `page` and `perPage` instead of `offset` and `limit
|
|
171
|
+
All pagination APIs now use `page` and `perPage` instead of `offset` and `limit`, matching page-based web pagination.
|
|
172
172
|
|
|
173
173
|
To migrate, update all pagination parameters from `offset/limit` to `page/perPage`. Note that `page` is 0-indexed.
|
|
174
174
|
|
|
@@ -388,9 +388,9 @@ To migrate, use the memory store, remove format parameters, and update code to w
|
|
|
388
388
|
|
|
389
389
|
### Vector store API from positional to named arguments
|
|
390
390
|
|
|
391
|
-
All vector store methods now use
|
|
391
|
+
All vector store methods now use an arguments object instead of positional arguments. This makes each value's purpose visible at the call site and lets method signatures evolve without relying on argument order.
|
|
392
392
|
|
|
393
|
-
To migrate, update all vector store method calls to use
|
|
393
|
+
To migrate, update all vector store method calls to use an arguments object.
|
|
394
394
|
|
|
395
395
|
```diff
|
|
396
396
|
- await vectorDB.createIndex(indexName, 3, 'cosine');
|
|
@@ -417,9 +417,9 @@ To migrate, update all vector store method calls to use named arguments.
|
|
|
417
417
|
|
|
418
418
|
### Vector store method renames
|
|
419
419
|
|
|
420
|
-
The `updateIndexById` and `deleteIndexById` methods have been renamed to `updateVector` and `deleteVector` respectively.
|
|
420
|
+
The `updateIndexById` and `deleteIndexById` methods have been renamed to `updateVector` and `deleteVector` respectively. The new names identify that these methods operate on vectors.
|
|
421
421
|
|
|
422
|
-
To migrate, rename the methods and
|
|
422
|
+
To migrate, rename the methods and pass an arguments object.
|
|
423
423
|
|
|
424
424
|
```diff
|
|
425
425
|
- await vectorDB.updateIndexById(indexName, id, update);
|
|
@@ -449,9 +449,9 @@ To migrate, pass the connection string as an object property.
|
|
|
449
449
|
|
|
450
450
|
### PGVector `defineIndex` to `buildIndex`
|
|
451
451
|
|
|
452
|
-
The `defineIndex()` method has been removed in favor of `buildIndex()
|
|
452
|
+
The `defineIndex()` method has been removed in favor of `buildIndex()`, which identifies that the method builds an index.
|
|
453
453
|
|
|
454
|
-
To migrate, rename the method and
|
|
454
|
+
To migrate, rename the method and pass an arguments object.
|
|
455
455
|
|
|
456
456
|
```diff
|
|
457
457
|
- await vectorDB.defineIndex(indexName, 'cosine', { type: 'flat' });
|
|
@@ -464,7 +464,7 @@ To migrate, rename the method and use named arguments.
|
|
|
464
464
|
|
|
465
465
|
### `PostgresStore`: `schema` to `schemaName`
|
|
466
466
|
|
|
467
|
-
The `schema` parameter has been renamed to `schemaName` in the PostgresStore constructor.
|
|
467
|
+
The `schema` parameter has been renamed to `schemaName` in the PostgresStore constructor. The new name identifies the value as the database schema's name.
|
|
468
468
|
|
|
469
469
|
To migrate, rename the parameter.
|
|
470
470
|
|
|
@@ -521,7 +521,7 @@ To migrate, use paginated methods via domain stores. For fetching all records, u
|
|
|
521
521
|
|
|
522
522
|
### `getTraces` and `getTracesPaginated`
|
|
523
523
|
|
|
524
|
-
The `getTraces()` and `getTracesPaginated()` methods have been removed from storage.
|
|
524
|
+
The `getTraces()` and `getTracesPaginated()` methods have been removed from storage. Use the observability package to access traces instead of core storage.
|
|
525
525
|
|
|
526
526
|
To migrate, use observability storage methods instead.
|
|
527
527
|
|
|
@@ -8,9 +8,9 @@ Tool execution signatures have been updated to use separate input and context pa
|
|
|
8
8
|
|
|
9
9
|
### `createTool` execute signature to `(inputData, context)` format
|
|
10
10
|
|
|
11
|
-
All `createTool` execute functions now use a
|
|
11
|
+
All `createTool` execute functions now use a signature with separate `inputData` and `context` parameters instead of a single destructured object. Tool inputs and execution context are now passed independently.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
This signature change only applies to `createTool`. For workflow `createStep` calls, keep the `async (inputData, context)` signature.
|
|
14
14
|
|
|
15
15
|
To migrate, update `createTool` signatures to use `inputData` as the first parameter (typed from `inputSchema`) and `context` as the second parameter.
|
|
16
16
|
|
|
@@ -88,7 +88,7 @@ To skip the `suspendSchema` or `resumeSchema` validation, don't define `suspendS
|
|
|
88
88
|
|
|
89
89
|
### `RuntimeContext` to `RequestContext`
|
|
90
90
|
|
|
91
|
-
The `RuntimeContext` class has been renamed to `RequestContext` throughout the tool execution context.
|
|
91
|
+
The `RuntimeContext` class has been renamed to `RequestContext` throughout the tool execution context. The new name identifies the class as request-specific data.
|
|
92
92
|
|
|
93
93
|
To migrate, update references from `runtimeContext` to `requestContext` in tool execution functions.
|
|
94
94
|
|
|
@@ -6,9 +6,9 @@ The observability system has been restructured in v1 with a dedicated `@mastra/o
|
|
|
6
6
|
|
|
7
7
|
> **Observability data stops flowing on upgrade:** If you upgrade Mastra packages to v1 without migrating your `telemetry:` config to `observability:`, the old config is ignored at runtime. Your service will start cleanly with no error, but **no traces, logs, or metrics will be sent anywhere**. If you were sending data to Mastra Cloud, the dashboard will go empty.
|
|
8
8
|
>
|
|
9
|
-
> Complete this migration in the same change that bumps your Mastra packages, and verify traces appear in [Mastra Studio](https://mastra.ai/docs/studio/observability) before considering the upgrade complete. If you previously hosted on Mastra Cloud, also follow the [Mastra Cloud migration guide](https://mastra.ai/guides/migrations/mastra-cloud)
|
|
9
|
+
> Complete this migration in the same change that bumps your Mastra packages, and verify traces appear in [Mastra Studio](https://mastra.ai/docs/studio/observability) before considering the upgrade complete. If you previously hosted on Mastra Cloud, also follow the [Mastra Cloud migration guide](https://mastra.ai/guides/migrations/mastra-cloud). The new platform requires a new access token and a Studio project before `MastraPlatformExporter` can route data to it.
|
|
10
10
|
|
|
11
|
-
> **Exporter rename:** `MastraPlatformExporter` (sends data to Mastra platform) replaces the previous `CloudExporter`, and `MastraStorageExporter` (persists data to Mastra Storage) replaces the previous `DefaultExporter`. The original classes
|
|
11
|
+
> **Exporter rename:** `MastraPlatformExporter` (sends data to Mastra platform) replaces the previous `CloudExporter`, and `MastraStorageExporter` (persists data to Mastra Storage) replaces the previous `DefaultExporter`. The original classes remain available from `@mastra/observability` and behave identically, but they're deprecated. New code should use `MastraPlatformExporter` and `MastraStorageExporter`. Existing imports of `CloudExporter` or `DefaultExporter` continue to work until they're removed in a future major version.
|
|
12
12
|
|
|
13
13
|
## Migration paths
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@ Voice packages have been renamed from speech to voice with updated class names a
|
|
|
8
8
|
|
|
9
9
|
### Voice configuration property names
|
|
10
10
|
|
|
11
|
-
Voice configuration properties have been renamed for consistency. `speakProvider` is now `output`, `listenProvider` is now `input`, and `realtimeProvider` is now `realtime`.
|
|
11
|
+
Voice configuration properties have been renamed for consistency. `speakProvider` is now `output`, `listenProvider` is now `input`, and `realtimeProvider` is now `realtime`. The new names match each property's role in voice input and output.
|
|
12
12
|
|
|
13
13
|
To migrate, update configuration property names when configuring agents with voice capabilities.
|
|
14
14
|
|
|
@@ -65,7 +65,7 @@ To migrate, rename method calls from `createRunAsync` to `createRun`.
|
|
|
65
65
|
|
|
66
66
|
### `runCount` to `retryCount` (deprecated)
|
|
67
67
|
|
|
68
|
-
The `runCount` parameter has been deprecated in favor of `retryCount` in workflow step execution.
|
|
68
|
+
The `runCount` parameter has been deprecated in favor of `retryCount` in workflow step execution. The new name identifies the value as the number of retries. The old `runCount` still works but shows deprecation warnings.
|
|
69
69
|
|
|
70
70
|
To migrate, rename `runCount` to `retryCount` in step execution functions.
|
|
71
71
|
|
|
@@ -89,6 +89,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
89
89
|
| [Mistral](https://mastra.ai/models/providers/mistral) | `mistral/*` | `MISTRAL_API_KEY` |
|
|
90
90
|
| [Mixlayer](https://mastra.ai/models/providers/mixlayer) | `mixlayer/*` | `MIXLAYER_API_KEY` |
|
|
91
91
|
| [Moark](https://mastra.ai/models/providers/moark) | `moark/*` | `MOARK_API_KEY` |
|
|
92
|
+
| [Modal](https://mastra.ai/models/providers/modal) | `modal/*` | `MODAL_PROXY_TOKEN` |
|
|
92
93
|
| [Model Oracle AI](https://mastra.ai/models/providers/model-oracle-ai) | `model-oracle-ai/*` | `MODEL_ORACLE_API_KEY` |
|
|
93
94
|
| [ModelScope](https://mastra.ai/models/providers/modelscope) | `modelscope/*` | `MODELSCOPE_API_KEY` |
|
|
94
95
|
| [Moonshot AI](https://mastra.ai/models/providers/moonshotai) | `moonshotai/*` | `MOONSHOT_API_KEY` |
|
package/.docs/models/index.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Model Providers
|
|
4
4
|
|
|
5
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
5
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 5116 models from 163 providers through a single API.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Modal
|
|
4
|
+
|
|
5
|
+
Access 1 Modal model through Mastra's model router. Authentication is handled automatically using the `MODAL_PROXY_TOKEN` environment variable.
|
|
6
|
+
|
|
7
|
+
Learn more in the [Modal documentation](https://modal.com/docs/guide/endpoints).
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
MODAL_PROXY_TOKEN=your-api-token
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Agent } from "@mastra/core/agent";
|
|
15
|
+
|
|
16
|
+
const agent = new Agent({
|
|
17
|
+
id: "my-agent",
|
|
18
|
+
name: "My Agent",
|
|
19
|
+
instructions: "You are a helpful assistant",
|
|
20
|
+
model: "modal/thinkingmachines/Inkling-NVFP4"
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Generate a response
|
|
24
|
+
const response = await agent.generate("Hello!");
|
|
25
|
+
|
|
26
|
+
// Stream a response
|
|
27
|
+
const stream = await agent.stream("Tell me a story");
|
|
28
|
+
for await (const chunk of stream) {
|
|
29
|
+
console.log(chunk);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Modal documentation](https://modal.com/docs/guide/endpoints) for details.
|
|
34
|
+
|
|
35
|
+
## Models
|
|
36
|
+
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| -------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `modal/thinkingmachines/Inkling-NVFP4` | 1.0M | | | | | | $1 | $5 |
|
|
40
|
+
|
|
41
|
+
## Advanced configuration
|
|
42
|
+
|
|
43
|
+
### Custom headers
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
const agent = new Agent({
|
|
47
|
+
id: "custom-agent",
|
|
48
|
+
name: "custom-agent",
|
|
49
|
+
model: {
|
|
50
|
+
url: "https://inference.us-west.modal.direct/v1",
|
|
51
|
+
id: "modal/thinkingmachines/Inkling-NVFP4",
|
|
52
|
+
apiKey: process.env.MODAL_PROXY_TOKEN,
|
|
53
|
+
headers: {
|
|
54
|
+
"X-Custom-Header": "value"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Dynamic model selection
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
const agent = new Agent({
|
|
64
|
+
id: "dynamic-agent",
|
|
65
|
+
name: "Dynamic Agent",
|
|
66
|
+
model: ({ requestContext }) => {
|
|
67
|
+
const useAdvanced = requestContext.task === "complex";
|
|
68
|
+
return useAdvanced
|
|
69
|
+
? "modal/thinkingmachines/Inkling-NVFP4"
|
|
70
|
+
: "modal/thinkingmachines/Inkling-NVFP4";
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
```
|
|
@@ -89,6 +89,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
89
89
|
- [MiniMax Token Plan (minimaxi.com)](https://mastra.ai/models/providers/minimax-cn-coding-plan)
|
|
90
90
|
- [Mixlayer](https://mastra.ai/models/providers/mixlayer)
|
|
91
91
|
- [Moark](https://mastra.ai/models/providers/moark)
|
|
92
|
+
- [Modal](https://mastra.ai/models/providers/modal)
|
|
92
93
|
- [Model Oracle AI](https://mastra.ai/models/providers/model-oracle-ai)
|
|
93
94
|
- [ModelScope](https://mastra.ai/models/providers/modelscope)
|
|
94
95
|
- [Moonshot AI](https://mastra.ai/models/providers/moonshotai)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# AcpAgent class
|
|
4
4
|
|
|
5
|
-
The `AcpAgent` class wraps an Agent Client Protocol (ACP)-compatible coding agent as a Mastra subagent. Use it when a parent Mastra agent should delegate repository inspection
|
|
5
|
+
The `AcpAgent` class wraps an Agent Client Protocol (ACP)-compatible coding agent as a Mastra subagent. Use it when a parent Mastra agent should delegate repository inspection and code edits. It can also delegate other ACP-backed tasks to the subagent.
|
|
6
6
|
|
|
7
7
|
If you want the parent agent to call the ACP agent as a tool instead, use [`createACPTool()`](https://mastra.ai/reference/acp/create-acp-tool).
|
|
8
8
|
|
|
@@ -143,7 +143,7 @@ await codeAgent.setModel('claude-sonnet-4-6')
|
|
|
143
143
|
|
|
144
144
|
## Session lifecycle
|
|
145
145
|
|
|
146
|
-
`AcpAgent` starts the configured `command` on first use
|
|
146
|
+
`AcpAgent` starts the configured `command` on first use and initializes the ACP client. It then creates an ACP session. By default, `persistSession` is `true`, so the process and session stay alive across `generate()`, `stream()`, `getAvailableModels()`, and `setModel()` calls.
|
|
147
147
|
|
|
148
148
|
Set `persistSession: false` when each prompt should run in a fresh ACP process:
|
|
149
149
|
|
|
@@ -220,7 +220,7 @@ export const codeAgent = new AcpAgent({
|
|
|
220
220
|
})
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
Use this callback to enforce local policy
|
|
223
|
+
Use this callback to enforce local policy or inspect the permission title. It can also route the decision to your own approval flow.
|
|
224
224
|
|
|
225
225
|
## Related
|
|
226
226
|
|