@mastra/mcp-docs-server 1.2.23-alpha.6 → 1.2.23-alpha.8
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/code-mode.md +1 -1
- package/.docs/docs/agents/human-in-the-loop.md +1 -1
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/processors.md +1 -1
- package/.docs/docs/agents/structured-output.md +1 -1
- package/.docs/docs/auth/fga.md +1 -1
- package/.docs/docs/channels.md +2 -2
- package/.docs/docs/connections/mcp.md +1 -1
- package/.docs/docs/datasets/running-experiments.md +1 -1
- package/.docs/docs/deployment/sandbox.md +2 -2
- package/.docs/docs/deployment/workers.md +2 -2
- package/.docs/docs/evals/custom-scorers.md +1 -1
- package/.docs/docs/evals/multi-turn.md +1 -1
- package/.docs/docs/evals/overview.md +2 -2
- package/.docs/docs/evals/quick-checks.md +1 -1
- package/.docs/docs/evals/vitest-integration.md +136 -0
- package/.docs/docs/guides/context-engineering.md +1 -1
- package/.docs/docs/guides/multi-agent-systems.md +1 -1
- package/.docs/docs/guides/streaming.md +72 -52
- package/.docs/docs/harness/agent-controller.md +1 -1
- package/.docs/docs/harness/background-tasks.md +1 -1
- package/.docs/docs/harness/durable-agents.md +1 -1
- package/.docs/docs/harness/schedules.md +1 -1
- package/.docs/docs/harness/signal-providers.md +1 -1
- package/.docs/docs/harness/signals.md +1 -1
- package/.docs/docs/index.md +1 -1
- package/.docs/docs/mastra-platform/deploy.md +15 -15
- package/.docs/docs/mastra-platform/environments.md +2 -2
- package/.docs/docs/mastra-platform/github.md +2 -2
- package/.docs/docs/mastra-platform/regions.md +1 -1
- package/.docs/docs/mastra-platform/server.md +4 -4
- package/.docs/docs/mastra-platform/studio.md +1 -1
- package/.docs/docs/mastra-platform/trace-intelligence.md +1 -1
- package/.docs/docs/mastra-platform/workspaces.md +1 -1
- package/.docs/docs/memory/message-history.md +3 -3
- package/.docs/docs/memory/observational-memory.md +18 -18
- package/.docs/docs/memory/overview.md +1 -1
- package/.docs/docs/memory/working-memory.md +1 -1
- package/.docs/docs/observability/feedback.md +1 -1
- package/.docs/docs/observability/logging.md +1 -1
- package/.docs/docs/observability/tracing/overview.md +1 -1
- package/.docs/docs/sandbox/lsp.md +1 -1
- package/.docs/docs/sandbox/overview.md +1 -1
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/overview.md +1 -1
- package/.docs/docs/server/pubsub.md +1 -1
- package/.docs/docs/server/request-context.md +2 -2
- package/.docs/docs/server/server-adapters.md +1 -1
- package/.docs/docs/skills.md +1 -1
- package/.docs/docs/studio/deployment.md +1 -1
- package/.docs/docs/studio/editor.md +1 -1
- package/.docs/docs/studio/overview.md +1 -1
- package/.docs/docs/subagents.md +2 -2
- package/.docs/docs/workflows/control-flow.md +1 -1
- package/.docs/docs/workflows/overview.md +1 -1
- package/.docs/docs/workflows/scheduled-workflows.md +1 -1
- package/.docs/docs/workflows/suspend-and-resume.md +2 -2
- package/.docs/integrations/sandboxes/agentcore.md +2 -0
- package/.docs/integrations/sandboxes/apple-container.md +4 -2
- package/.docs/integrations/sandboxes/blaxel.md +2 -0
- package/.docs/integrations/sandboxes/cloudflare-sandbox.md +1 -1
- package/.docs/integrations/sandboxes/daytona.md +2 -0
- package/.docs/integrations/sandboxes/docker.md +3 -1
- package/.docs/integrations/sandboxes/e2b.md +2 -0
- package/.docs/integrations/sandboxes/modal.md +3 -1
- package/.docs/integrations/sandboxes/railway.md +2 -0
- package/.docs/integrations/sandboxes/vercel.md +4 -0
- package/.docs/models/gateways/vercel.md +2 -1
- package/.docs/models/providers/chutes.md +1 -1
- package/.docs/models/providers/cortecs.md +3 -4
- package/.docs/models/providers/edenai.md +2 -1
- package/.docs/models/providers/iteracompute.md +8 -7
- package/.docs/models/providers/kilo.md +4 -4
- package/.docs/models/providers/vancine.md +4 -6
- package/.docs/reference/agent-controller/agent-controller-class.md +2 -2
- package/.docs/reference/agent-controller/session.md +3 -3
- package/.docs/reference/agents/durable-agent.md +1 -1
- package/.docs/reference/agents/getDefaultGenerateOptions.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/workflow-route.md +1 -1
- package/.docs/reference/browser/browser-viewer.md +1 -1
- package/.docs/reference/cli/mastra.md +4 -4
- package/.docs/reference/core/mastra-class.md +1 -1
- package/.docs/reference/datasets/createExperiment.md +1 -1
- package/.docs/reference/editor/tool-provider.md +1 -1
- package/.docs/reference/editor/versioning.md +1 -1
- package/.docs/reference/evals/multi-turn-judge.md +1 -1
- package/.docs/reference/evals/rubric.md +1 -1
- package/.docs/reference/file-based-agents/schedules.md +2 -2
- package/.docs/reference/file-based-agents/workspace.md +1 -1
- package/.docs/reference/manual-install.md +3 -3
- package/.docs/reference/memory/observational-memory.md +4 -4
- package/.docs/reference/memory/settled.md +1 -1
- package/.docs/reference/migrations/mastra-cloud.md +9 -9
- package/.docs/reference/migrations/upgrade-to-v1/overview.md +1 -1
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +1 -1
- package/.docs/reference/processors/processor-interface.md +1 -1
- package/.docs/reference/processors/regex-filter-processor.md +3 -3
- package/.docs/reference/processors/token-cost-control.md +2 -2
- package/.docs/reference/processors/token-limiter-processor.md +1 -1
- package/.docs/reference/processors/tool-search-processor.md +1 -1
- package/.docs/reference/processors/working-memory-processor.md +1 -1
- package/.docs/reference/pubsub/base.md +2 -2
- package/.docs/reference/pubsub/lease-provider.md +2 -2
- package/.docs/reference/rag/vector-databases.md +33 -33
- package/.docs/reference/server/create-route.md +1 -1
- package/.docs/reference/signals/task-signal-provider.md +1 -1
- package/.docs/reference/storage/composite.md +1 -1
- package/.docs/reference/storage/retention.md +4 -4
- package/.docs/reference/streaming/ChunkType.md +1 -1
- package/.docs/reference/tools/isolated-vm-transport.md +1 -1
- package/.docs/reference/tools/mcp-client.md +2 -2
- package/.docs/reference/vectors/couchbase.md +1 -1
- package/.docs/reference/vectors/mongodb.md +2 -2
- package/.docs/reference/voice/overview.md +1 -1
- package/.docs/reference/workflows/workflow-methods/foreach.md +1 -1
- package/.docs/reference/workspace/platform-sandbox.md +3 -1
- package/.docs/reference/workspace/process-manager.md +1 -1
- package/.docs/reference/workspace/sandbox.md +20 -3
- package/.docs/reference/workspace/workspace-class.md +3 -3
- package/package.json +6 -7
- package/CHANGELOG.md +0 -5936
|
@@ -73,7 +73,7 @@ Visit the [Configuration reference](https://mastra.ai/reference/configuration) f
|
|
|
73
73
|
|
|
74
74
|
**observability** (`ObservabilityEntrypoint`): Observability configuration for tracing and monitoring
|
|
75
75
|
|
|
76
|
-
**environment** (`string`): Deployment environment name (e.g. production, staging, development). When set, automatically attached to all observability signals so they can be filtered by environment without passing tracingOptions.metadata.environment on each call.
|
|
76
|
+
**environment** (`string`): Deployment environment name (e.g. production, staging, development). When set, automatically attached to all observability signals so they can be filtered by environment without passing tracingOptions.metadata.environment on each call. When unset, resolves to development for mastra dev runs, then falls back to process.env.NODE\_ENV; left undefined if none are set. Per-call tracingOptions.metadata.environment always takes precedence.
|
|
77
77
|
|
|
78
78
|
**deployer** (`MastraDeployer`): An instance of a MastraDeployer for managing deployments.
|
|
79
79
|
|
|
@@ -32,7 +32,7 @@ const { experimentId, totalItems, datasetVersion } = await dataset.createExperim
|
|
|
32
32
|
})
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Passing your own `id` makes creation idempotent
|
|
35
|
+
Passing your own `id` makes creation idempotent, so another call with the same `id` returns the existing experiment and keeps a retried workflow activity safe. The call throws an `EXPERIMENT_ID_CONFLICT` error if the `id` belongs to an experiment on another dataset or one with a different target.
|
|
36
36
|
|
|
37
37
|
`targetType` and `targetId` must be provided together, and the target must exist in the Mastra registry at create time. `scorers` requires a target because Mastra never scores target-less experiments; submit flat scores through `submitExperimentResult` instead.
|
|
38
38
|
|
|
@@ -252,4 +252,4 @@ Arcade tools use `Toolkit.ToolName` format: `Github.GetRepository`, `Slack.SendM
|
|
|
252
252
|
|
|
253
253
|
### Authentication
|
|
254
254
|
|
|
255
|
-
The legacy Arcade resolver uses `resourceId` from request context when available
|
|
255
|
+
The legacy Arcade resolver uses `resourceId` from request context when available, falling back to the supplied `userId` and then to a shared `default` identity. Reserve `default` for intentionally shared integrations, and provide a trusted, stable `resourceId` or explicit `userId` in tenant-isolated deployments because omitting both doesn't isolate callers.
|
|
@@ -10,7 +10,7 @@ See [Editor versioning](https://mastra.ai/docs/studio/editor) for release and ex
|
|
|
10
10
|
|
|
11
11
|
## Database lifecycle
|
|
12
12
|
|
|
13
|
-
The resource record stores an `activeVersionId
|
|
13
|
+
The resource record stores an `activeVersionId`, while individual snapshots don't store a lifecycle status.
|
|
14
14
|
|
|
15
15
|
| Term | Meaning |
|
|
16
16
|
| ---------- | -------------------------------------------------------------------------------------------- |
|
|
@@ -88,7 +88,7 @@ See [Score persistence](https://mastra.ai/docs/evals/overview) for the full requ
|
|
|
88
88
|
|
|
89
89
|
The scorer runs in two phases:
|
|
90
90
|
|
|
91
|
-
1. **Grade**:
|
|
91
|
+
1. **Grade**: The assistant messages in `run.output` form a numbered transcript that the judge evaluates as a whole against the criterion. Turns containing only tool calls or otherwise lacking text are skipped.
|
|
92
92
|
2. **Score**: A `satisfied` verdict scores `1` and anything else scores `0`, multiplied by `scale`.
|
|
93
93
|
|
|
94
94
|
The judge only sees what the assistant said. The user's turns and any tool results aren't included, so write criteria in terms of the agent's responses. This keeps the graded text limited to the agent's own output, but it also means a reply that only makes sense next to the question that prompted it ("Yes, bring one.") can't be judged on its own. For criteria that depend on the user's turns, grade each turn with `turns[].scorers` or write a [custom scorer](https://mastra.ai/docs/evals/multi-turn) that renders both roles.
|
|
@@ -106,7 +106,7 @@ If no rubric resolves, the scorer returns `1` and doesn't gate the loop.
|
|
|
106
106
|
The scorer runs in two phases:
|
|
107
107
|
|
|
108
108
|
1. **Grade**: The judge model evaluates each criterion independently and returns a per-criterion verdict (`satisfied` / not) with reasoning.
|
|
109
|
-
2. **Score**: The
|
|
109
|
+
2. **Score**: The scorer returns `1` only when every required criterion is `satisfied` and treats every criterion as required when none are marked. All other results receive `0`.
|
|
110
110
|
|
|
111
111
|
The `reason` summarizes the result and lists each criterion with its verdict, so a failing grade gives the agent targeted, useful feedback rather than a generic "try again".
|
|
112
112
|
|
|
@@ -181,9 +181,9 @@ Schedules created at runtime through `mastra.schedules.create(...)` live in a se
|
|
|
181
181
|
|
|
182
182
|
## Limits
|
|
183
183
|
|
|
184
|
-
**Root agents only.**
|
|
184
|
+
**Root agents only.** Declare schedules on a top-level agent. A `schedules/` directory under `subagents/` causes a build error because subagents are wired into their parent instead of being registered on the Mastra instance, leaving the scheduler unable to resolve them as targets. Give the parent the schedule and let it delegate.
|
|
185
185
|
|
|
186
|
-
**Storage required.**
|
|
186
|
+
**Storage required.** Because schedules are persisted rows and rows in an in-memory store don't survive a restart, the instance needs [storage](https://mastra.ai/reference/file-based-agents/storage) configured.
|
|
187
187
|
|
|
188
188
|
**Hosting.** The scheduler runs as a background worker inside the Mastra process, so it needs a host that keeps that process alive. Long-running Node servers and containers work. Environments that freeze or recycle the process between requests, which includes most serverless function platforms, will miss fires. Use the platform's own cron to call the run endpoint there instead.
|
|
189
189
|
|
|
@@ -71,7 +71,7 @@ For provider patterns and runtime behavior, see the [sandbox guide](https://mast
|
|
|
71
71
|
|
|
72
72
|
## Runtime boundary
|
|
73
73
|
|
|
74
|
-
The workspace filesystem controls
|
|
74
|
+
The workspace filesystem controls file-tool access, and the sandbox determines where shell commands run. Unless it explicitly calls workspace or sandbox APIs, application runtime code still runs in your app or server process, including code in [`tools/`](https://mastra.ai/reference/file-based-agents/tools).
|
|
75
75
|
|
|
76
76
|
## Seed files
|
|
77
77
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Manual install
|
|
6
6
|
|
|
7
|
-
**For AI agents:** Use this guide when tasked to create a runnable Mastra project from scratch without a CLI/boilerplate. It provides code examples for agents, tools, model configuration and how to install dependencies.
|
|
7
|
+
**For AI agents:** Use this guide when tasked to create a runnable Mastra project from scratch without a CLI/boilerplate. It provides code examples for agents, tools, model configuration and how to install dependencies. Don't use the quickstart guide, which is for humans. The model string is Mastra's model router format (`provider/model`). Use `/`, not `:`, to separate the provider and model. Don't install any AI SDK packages.
|
|
8
8
|
|
|
9
9
|
Use this guide to manually build a standalone Mastra server step by step. In most cases, use the [`create-mastra`](https://mastra.ai/reference/cli/create-mastra) command described in [Get started](https://mastra.ai/docs). For existing projects, you can also use [`mastra init`](https://mastra.ai/reference/cli/mastra).
|
|
10
10
|
|
|
@@ -167,7 +167,7 @@ If you prefer not to use our automatic CLI tool, you can set up your project you
|
|
|
167
167
|
mkdir -p src/mastra/agents && touch src/mastra/agents/weather-agent.ts
|
|
168
168
|
```
|
|
169
169
|
|
|
170
|
-
Use `import { Agent } from "@mastra/core/agent"`. Constructor takes `{ id, name, instructions, model: 'openai/gpt-5.6-sol' }`. The model string
|
|
170
|
+
Use `import { Agent } from "@mastra/core/agent"`. Constructor takes `{ id, name, instructions, model: 'openai/gpt-5.6-sol' }`. The model string uses Mastra's model router format, 'provider/model', with / rather than : between the provider and model. Don't install any AI SDK packages.
|
|
171
171
|
|
|
172
172
|
Add the following code:
|
|
173
173
|
|
|
@@ -212,7 +212,7 @@ If you prefer not to use our automatic CLI tool, you can set up your project you
|
|
|
212
212
|
})
|
|
213
213
|
```
|
|
214
214
|
|
|
215
|
-
7. **For AI agents:**
|
|
215
|
+
7. **For AI agents:** don't launch Studio when working on a script that e.g. should print to the console. Studio is a long-running web-based interfaced for humans. Instead, call the agent.generate() method directly. Example: `import { mastra } from './src/mastra/index.ts'; const agent = mastra.getAgentById('weather-agent'); const response = await agent.generate('Weather in SF'); console.log(response.text);`
|
|
216
216
|
|
|
217
217
|
You can now launch [Studio](https://mastra.ai/docs/studio/overview) and test your agent.
|
|
218
218
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**Added in:** `@mastra/memory@1.1.0`
|
|
8
8
|
|
|
9
|
-
Observational Memory (OM) is Mastra's memory system for long-context agentic memory. An **Observer** watches conversations and creates observations
|
|
9
|
+
Observational Memory (OM) is Mastra's memory system for long-context agentic memory. An **Observer** watches conversations and creates observations, which a **Reflector** restructures by combining related items and condensing overarching patterns. Together, they maintain an observation log that replaces raw message history as it grows.
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -245,7 +245,7 @@ export const agent = new Agent({
|
|
|
245
245
|
|
|
246
246
|
### Shared token budget
|
|
247
247
|
|
|
248
|
-
When `shareTokenBudget` is enabled, the total budget is `observation.messageTokens + reflection.observationTokens
|
|
248
|
+
When `shareTokenBudget` is enabled, the total budget is `observation.messageTokens + reflection.observationTokens`, which is 100k in this example. Observations that use only 30k tokens leave up to 70k for messages, while short messages give observations more room before reflection starts.
|
|
249
249
|
|
|
250
250
|
```typescript
|
|
251
251
|
import { Memory } from '@mastra/memory'
|
|
@@ -359,7 +359,7 @@ export const agent = new Agent({
|
|
|
359
359
|
|
|
360
360
|
Async buffering is **enabled by default**. It pre-computes observations in the background as the conversation grows: when the `messageTokens` threshold is reached, buffered observations activate instantly with no blocking LLM call.
|
|
361
361
|
|
|
362
|
-
The lifecycle follows **buffer → activate → remove messages → repeat**. Background Observer calls run at `bufferTokens` intervals
|
|
362
|
+
The lifecycle follows **buffer → activate → remove messages → repeat**. Background Observer calls run at `bufferTokens` intervals and produce chunks of observations. At the threshold, activation moves observations into the log and removes raw messages from context. Above `blockAfter`, activation may overshoot the retention target instead of activating fewer chunks. A synchronous observation runs if the threshold is reached without activating a buffered chunk.
|
|
363
363
|
|
|
364
364
|
Default settings:
|
|
365
365
|
|
|
@@ -765,7 +765,7 @@ The standalone `ObservationalMemory` class accepts all the same options as the `
|
|
|
765
765
|
|
|
766
766
|
## Recall tool
|
|
767
767
|
|
|
768
|
-
When `retrieval` is
|
|
768
|
+
When `retrieval` is truthy, Mastra registers a `recall` tool that pages through raw messages behind observation group ranges. With the default resource scope, the tool can list threads (`mode: "threads"`) and browse another thread through `threadId`. It also supports cross-thread search. Set `retrieval: { vector: true }` for semantic search (`mode: "search"`), or use `scope: 'thread'` to restrict the tool to the current thread. The tool is automatically added to the agent.
|
|
769
769
|
|
|
770
770
|
Mastra also injects scope-aware usage instructions into the agent's context. For resource scope with `vector: true`, these cover routing between `search`, `threads`, and `messages`, including fallback to thread discovery when search results are unsuitable. Without `vector: true`, the instructions only cover `threads` and `messages` browsing, so the agent isn't steered toward a search mode that isn't configured. Resource-scoped instructions are injected even before any observation group exists, so the agent can browse other threads from the first message. Use `retrieval: { instructions: '...' }` to append application-specific guidance after the built-in instructions.
|
|
771
771
|
|
|
@@ -50,7 +50,7 @@ await memory.settled()
|
|
|
50
50
|
await store.close()
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
> **Note:** `settled()` joins the work that had started by the time you called it, plus any work that work enqueues. It
|
|
53
|
+
> **Note:** `settled()` joins the work that had started by the time you called it, plus any work that work enqueues. It doesn't prevent new work from starting afterwards, so call it once the agent runs you care about have returned.
|
|
54
54
|
|
|
55
55
|
## Related
|
|
56
56
|
|
|
@@ -60,7 +60,7 @@ The Mastra platform replaces Mastra Cloud with separate Studio and Server produc
|
|
|
60
60
|
|
|
61
61
|
## Replace Mastra Cloud Store with a hosted database
|
|
62
62
|
|
|
63
|
-
Mastra Cloud provided a managed libSQL database
|
|
63
|
+
Unlike Mastra Cloud, which provided a managed libSQL database backed by [Turso](https://turso.tech), the Mastra platform doesn't host a database for you. Point your storage at an externally hosted instance.
|
|
64
64
|
|
|
65
65
|
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.
|
|
66
66
|
|
|
@@ -80,7 +80,7 @@ Once the download completes, convert the dump into a SQLite database file:
|
|
|
80
80
|
sqlite3 mydb.db < ~/Downloads/mastra-cloud-dump.sql
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
You now have a portable `mydb.db` file you can inspect locally
|
|
83
|
+
You now have a portable `mydb.db` file that you can inspect locally or back up before using it as the source for the new database in the following steps.
|
|
84
84
|
|
|
85
85
|
#### Option B: Export via the Turso CLI
|
|
86
86
|
|
|
@@ -88,16 +88,16 @@ If you prefer to work from the command line, or need to script the export, you c
|
|
|
88
88
|
|
|
89
89
|
1. Retrieve your Cloud Store credentials from the dashboard.
|
|
90
90
|
|
|
91
|
-
Open your project in the [Mastra dashboard](https://projects.mastra.ai) and navigate to **Runtime → Settings → Env Variables**. For Cloud Store
|
|
91
|
+
Open your project in the [Mastra dashboard](https://projects.mastra.ai) and navigate to **Runtime → Settings → Env Variables**. For projects backed by Cloud Store, two variables are injected alongside your own:
|
|
92
92
|
|
|
93
93
|
- `MASTRA_STORAGE_URL`: A libSQL connection string (e.g. `libsql://<db-name>-<org>.turso.io`).
|
|
94
94
|
- `MASTRA_STORAGE_AUTH_TOKEN`: A read-capable auth token scoped to that database.
|
|
95
95
|
|
|
96
|
-
Each row supports the standard environment variable actions
|
|
96
|
+
Each row supports the standard environment variable actions: show or hide via the eye toggle, Edit, Delete, and Copy Value. Use **Copy Value** to grab both values for the dump command below.
|
|
97
97
|
|
|
98
98
|
> **Note:** These variables only appear for projects that were provisioned with Cloud Store. If you brought your own database to Mastra Cloud, you already have these credentials and can skip ahead to [Point your Mastra app at the new database](#point-your-mastra-app-at-the-new-database).
|
|
99
99
|
|
|
100
|
-
> **Note:** If the variables are missing, the values
|
|
100
|
+
> **Note:** If the variables are missing, the values don't decrypt, or the Turso CLI rejects the token, email <support@mastra.ai> from the address associated with your Mastra Cloud account and ask for the libSQL URL and auth token for the project you want to export. Include the project name/ID. Support can also run the dump on your behalf if CLI access is blocked on your network.
|
|
101
101
|
|
|
102
102
|
2. Install the Turso CLI.
|
|
103
103
|
|
|
@@ -113,7 +113,7 @@ If you prefer to work from the command line, or need to script the export, you c
|
|
|
113
113
|
|
|
114
114
|
3. Export the database to a SQL dump.
|
|
115
115
|
|
|
116
|
-
Set the credentials provided by support (or use the dashboard values if you already copied them earlier) as environment variables, then dump the database to a local file. If you copied the URL from the dashboard, swap the `libsql://` scheme for `https://`
|
|
116
|
+
Set the credentials provided by support (or use the dashboard values if you already copied them earlier) as environment variables, then dump the database to a local file. If you copied the URL from the dashboard, swap the `libsql://` scheme for `https://` because the Turso CLI expects the HTTPS form when passing the URL with an auth token.
|
|
117
117
|
|
|
118
118
|
```bash
|
|
119
119
|
export MASTRA_STORAGE_URL="https://<db-name>-<org>.turso.io"
|
|
@@ -122,7 +122,7 @@ If you prefer to work from the command line, or need to script the export, you c
|
|
|
122
122
|
turso db shell "$MASTRA_STORAGE_URL?authToken=$MASTRA_STORAGE_AUTH_TOKEN" ".dump" > mastra-cloud-dump.sql
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
> **Warning:** Embedding the auth token in the connection string is less secure than Turso's recommended pattern
|
|
125
|
+
> **Warning:** Embedding the auth token in the connection string is less secure than Turso's recommended pattern because the full URL, including the token, can appear in command history and in process or terminal output. Turso recommends running `turso auth login` and dumping by database name only: `turso db shell <database-name> ".dump" > mastra-cloud-dump.sql`. That flow requires the database to belong to a Turso account you own, which isn't true for Cloud Store, so the environment-variable example above provides an alternative for this one-time export. To avoid token interpolation entirely, ask support to run the dump and send you the resulting SQL file.
|
|
126
126
|
|
|
127
127
|
The resulting `mastra-cloud-dump.sql` contains the full schema and data: thread and message history, workflow snapshots, traces, and eval scores. Store it somewhere safe before continuing.
|
|
128
128
|
|
|
@@ -136,7 +136,7 @@ The dump is a standard SQL file and can be loaded into any libSQL-compatible dat
|
|
|
136
136
|
turso auth login
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
If you
|
|
139
|
+
If you don't have a Turso account, the CLI will prompt you to create one. See [Turso pricing](https://turso.tech/pricing) for plan details.
|
|
140
140
|
|
|
141
141
|
2. Create a new database and load the dump in one step.
|
|
142
142
|
|
|
@@ -144,7 +144,7 @@ The dump is a standard SQL file and can be loaded into any libSQL-compatible dat
|
|
|
144
144
|
turso db create mastra-migrated --from-dump ./mastra-cloud-dump.sql
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
`--from-dump` restores a local SQLite/libSQL dump at create time, which is faster and safer than piping statements through `turso db shell` after the fact. Pick a region close to where your Mastra Server runs to minimize latency
|
|
147
|
+
`--from-dump` restores a local SQLite/libSQL dump at create time, which is faster and safer than piping statements through `turso db shell` after the fact. Pick a region close to where your Mastra Server runs to minimize latency. List available regions with `turso db locations` and pass `--group <group-name>` if you manage multiple groups.
|
|
148
148
|
|
|
149
149
|
For multi-gigabyte dumps, add `--wait` so the CLI blocks until the database is fully available.
|
|
150
150
|
|
|
@@ -12,7 +12,7 @@ This guide covers the breaking changes when upgrading from Mastra 0.x to v1.0. T
|
|
|
12
12
|
|
|
13
13
|
> **Need help?:** Need help with the migration? Join our [Discord community](https://discord.gg/BTYqqHKUrf) to ask questions.
|
|
14
14
|
|
|
15
|
-
> **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).
|
|
15
|
+
> **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). Because old Mastra Cloud access tokens don't work with Mastra platform, create new ones with `mastra auth tokens create`.
|
|
16
16
|
>
|
|
17
17
|
> 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/reference/migrations/mastra-cloud) end to end.
|
|
18
18
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**Added in:** `@mastra/observability@1.8.0`. **Deprecated in `1.12.0`** in favor of [`MastraPlatformExporter`](https://mastra.ai/reference/observability/tracing/exporters/mastra-platform-exporter).
|
|
8
8
|
|
|
9
|
-
> **Deprecated:** `CloudExporter`
|
|
9
|
+
> **Deprecated:** `CloudExporter` remains available for backward compatibility but will be removed in a future major version, so use [`MastraPlatformExporter`](https://mastra.ai/reference/observability/tracing/exporters/mastra-platform-exporter) for new projects. The classes have identical constructors and share environment variables and runtime behavior. To preserve existing monitoring rules, `CloudExporter` retains its original `mastra-cloud-observability-exporter` exporter `name` and `CLOUD_EXPORTER_*` error IDs.
|
|
10
10
|
|
|
11
11
|
Sends tracing spans, logs, metrics, scores, and feedback to the Mastra platform for online visualization and monitoring.
|
|
12
12
|
|
|
@@ -165,7 +165,7 @@ Most processor methods receive both `messages` and `messageList`. They point to
|
|
|
165
165
|
|
|
166
166
|
### `messages` vs `messageList`
|
|
167
167
|
|
|
168
|
-
- `messages`: A
|
|
168
|
+
- `messages`: A stage-scoped array of `MastraDBMessage` objects. For input processing, `processInput` and `processInputStep` exclude system messages. For output processing, `processOutputResult` and `processOutputStep` include the latest LLM response. The array is backed by `messageList`, so in-place edits to a message's `content.parts` remain visible to downstream processors and persistence.
|
|
169
169
|
- `messageList`: The live `MessageList` instance backing the run. It exposes filtered views (input, response, remembered, all), multiple output formats (db, ui, core), and methods for mutating the conversation.
|
|
170
170
|
|
|
171
171
|
Use `messages` when you only need to read, map over, or lightly edit fields on the current stage's messages. Use `messageList` when you need to:
|
|
@@ -132,7 +132,7 @@ When the `block` strategy is active (default), `RegexFilterProcessor` throws a `
|
|
|
132
132
|
|
|
133
133
|
## Redaction behavior
|
|
134
134
|
|
|
135
|
-
Every rule is matched independently,
|
|
135
|
+
Every rule is matched independently, which lets two rules claim overlapping text. For example, a card number without separators matches both `phone` and `credit-card`. Overlapping matches are combined into one region and replaced once with the replacement from the longest match.
|
|
136
136
|
|
|
137
137
|
```typescript
|
|
138
138
|
const filter = new RegexFilterProcessor({
|
|
@@ -143,11 +143,11 @@ const filter = new RegexFilterProcessor({
|
|
|
143
143
|
// "Charge 4111111111111111 today" becomes "Charge [CREDIT_CARD] today"
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
A replacement string can
|
|
146
|
+
A replacement string can use `$1` or `$&` to reference capture groups for an independent single match. When matches form a combined region, the replacement string is inserted as written. The same applies when a rule relies on surrounding text through a lookbehind or lookahead. The region is redacted in either case.
|
|
147
147
|
|
|
148
148
|
## Redaction reporting
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
Because the `redact` strategy rewrites text in place, downstream code can't determine what changed. Assign `onViolation` to record the change for each redacted message or message part and for each stream chunk, with offsets relative to that text. Async callbacks are awaited, while errors are caught so an unavailable audit sink can't fail the request.
|
|
151
151
|
|
|
152
152
|
```typescript
|
|
153
153
|
import { RegexFilterProcessor, type RegexRedactionDetail } from '@mastra/core/processors'
|
|
@@ -145,12 +145,12 @@ Numbers interpolated into violation messages are normalized to at most 6 decimal
|
|
|
145
145
|
| `organization` | Yes | `organizationId` + time window | `organizationId` key in `RequestContext` |
|
|
146
146
|
| `session` | Yes | `sessionId` + time window | `sessionId` key in `RequestContext` |
|
|
147
147
|
|
|
148
|
-
All scopes require observability storage with `getMetricAggregate` support
|
|
148
|
+
All scopes require observability storage with `getMetricAggregate` support; without configured observability storage, the Mastra instance throws an error at registration time.
|
|
149
149
|
|
|
150
150
|
For `run` scope, the processor reads the trace ID from the current span's tracing context. If no tracing context is available, the check is skipped (fail-open).
|
|
151
151
|
|
|
152
152
|
For all other scopes, if the required context ID is missing at runtime, the check is skipped. Observability query failures are handled with a fail-open strategy: if a query fails, a warning is logged through the Mastra logger and the step proceeds.
|
|
153
153
|
|
|
154
|
-
> **The `user`, `organization`, and `session` scopes require annotated traces.** These scopes match metric records by their `userId`, `organizationId`, and `sessionId` fields, which are populated from span metadata on the trace (for example, via tracing options metadata).
|
|
154
|
+
> **The `user`, `organization`, and `session` scopes require annotated traces.** These scopes match metric records by their `userId`, `organizationId`, and `sessionId` fields, which are populated from span metadata on the trace (for example, via tracing options metadata). Without matching trace metadata, these scopes match zero records and the guard never trips, because setting the RequestContext key alone isn't enough: both the RequestContext key (for scope resolution) and the span metadata (for cost attribution) must be present.
|
|
155
155
|
|
|
156
156
|
> **Note on metric persistence delay.** The observability pipeline uses buffered exporters that flush metrics asynchronously. A short delay exists between when an LLM call completes and when its cost metrics are available for query. During high-frequency agent execution, the cost control may not detect a limit breach until one or more steps after the actual cost exceeded the threshold.
|
|
@@ -68,7 +68,7 @@ for await (const part of stream.fullStream) {
|
|
|
68
68
|
|
|
69
69
|
## Media token counting
|
|
70
70
|
|
|
71
|
-
Images and file attachments are estimated
|
|
71
|
+
Images and file attachments are estimated instead of tokenized, including `file` message parts and tool results shaped like `{ data, mediaType }`. Images use a flat per-image estimate; other media uses decoded byte size, while remote URLs and provider file ids use a flat fallback because their size isn't known locally. Encoded payloads such as base64 data are never counted as text, avoiding an inflated count that could truncate history unnecessarily.
|
|
72
72
|
|
|
73
73
|
## Error behavior
|
|
74
74
|
|
|
@@ -253,7 +253,7 @@ const toolSearch = new ToolSearchProcessor({
|
|
|
253
253
|
|
|
254
254
|
Loading tools is cache-friendly in both modes: loads are append-only, so the cached prompt prefix stays stable for providers that support prompt caching.
|
|
255
255
|
|
|
256
|
-
Unloading a tool changes the
|
|
256
|
+
Unloading a tool changes the definitions sent to the model, shifting the cached prefix so the next turn pays for a cache write instead of receiving a cache hit. In `'in-memory'` mode, this happens when `ttl` evicts a thread's state; in `'context'` mode, it happens when older-message trimming removes the tool's discovery result. The model must then search for the unloaded tool before reuse. This expected tradeoff exchanges one cache write for a smaller prefix on later turns.
|
|
257
257
|
|
|
258
258
|
## Combining with other processors
|
|
259
259
|
|
|
@@ -130,7 +130,7 @@ const processor = new WorkingMemory({
|
|
|
130
130
|
|
|
131
131
|
4. Generates system instructions based on mode:
|
|
132
132
|
|
|
133
|
-
- **Normal mode**: Includes guidelines for storing
|
|
133
|
+
- **Normal mode**: Includes guidelines for storing and updating information, along with the template structure and current data
|
|
134
134
|
- **Read-only mode** (`readOnly: true`): Includes only the current data as context without update instructions
|
|
135
135
|
|
|
136
136
|
5. Adds the instruction as a system message with `source: 'memory'` tag
|
|
@@ -79,7 +79,7 @@ await pubsub.publish('my-topic', {
|
|
|
79
79
|
|
|
80
80
|
Registers a callback to receive events published to a topic. When `options.group` is set, subscribers in the same group compete for messages and each event is delivered to one member. Without a group, every subscriber receives every event.
|
|
81
81
|
|
|
82
|
-
Pass `options.batch` to opt in to batched delivery. The callback signature
|
|
82
|
+
Pass `options.batch` to opt in to batched delivery. The unchanged callback signature delivers a batch of N events as N consecutive `cb(event, ack, nack)` calls in publish order. Batching is honored only when the backend's [`supportsNativeBatching`](#properties) is `true`. Other backends ignore the option and deliver events one at a time.
|
|
83
83
|
|
|
84
84
|
Set `options.startFrom` to `"latest"` to receive only events published after a new consumer group is created. The default, `"earliest"`, includes retained events. Existing consumer groups keep their current checkpoint.
|
|
85
85
|
|
|
@@ -113,7 +113,7 @@ await pubsub.flush()
|
|
|
113
113
|
|
|
114
114
|
Deletes all retained state for a topic (cached history, persistent stream entries, and consumer groups) once no more events will be published to it. Mastra's run lifecycles (durable agents and the evented workflow engine) call this automatically when a run reaches a terminal state, so per-run topics don't accumulate on transports that retain messages.
|
|
115
115
|
|
|
116
|
-
The default implementation is a no-op
|
|
116
|
+
The default implementation is a no-op because transports that retain nothing per topic, such as `EventEmitterPubSub`, have nothing to clear. Backends that persist messages, like [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams), override it. Implementations follow a best-effort contract and log failures instead of throwing because callers invoke cleanup without awaiting it.
|
|
117
117
|
|
|
118
118
|
```typescript
|
|
119
119
|
await pubsub.clearTopic('workflow.events.v2.run-123')
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
`LeaseProvider` is the distributed leasing contract, separate from event delivery ([`PubSub`](https://mastra.ai/reference/pubsub/base)). Mastra's [signals layer](https://mastra.ai/docs/harness/signals) uses it to elect a single owner across multiple processes (for example, serverless invocations) for a resource, most commonly a thread key. The owner is the process that wakes and runs the agent stream, so other processes route follow-up work to it instead of starting a competing run.
|
|
8
8
|
|
|
9
|
-
Leasing is
|
|
9
|
+
Leasing is separate from pub/sub. A `LeaseProvider` implementation needs actual lock coordination, whether through an atomic Redis operation such as `SET` or Lua or through an in-memory map for a single process. For backends that omit leasing, the signals runtime preserves single-process behavior with a no-op provider.
|
|
10
10
|
|
|
11
11
|
The built-in [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams) implements `LeaseProvider`, which is what enables signals to coordinate across instances in distributed and serverless deployments.
|
|
12
12
|
|
|
@@ -119,7 +119,7 @@ if (!transferred) {
|
|
|
119
119
|
|
|
120
120
|
Returns: `Promise<boolean>`
|
|
121
121
|
|
|
122
|
-
> **Warning:** Backends that can't
|
|
122
|
+
> **Warning:** Backends that can't transfer a lease atomically must use a best-effort `releaseLease(fromOwner)` followed by `acquireLease(toOwner)`. They must document that the swap is non-atomic because another process can claim the key between those calls. Keeping the method required gives callers one code path while making atomicity an explicit per-backend decision.
|
|
123
123
|
|
|
124
124
|
## Capability detection
|
|
125
125
|
|
|
@@ -35,11 +35,11 @@ MongoDB Vector Search is a good solution for teams who want to consolidate vecto
|
|
|
35
35
|
|
|
36
36
|
### Using VoyageAI with MongoDB
|
|
37
37
|
|
|
38
|
-
MongoDB works
|
|
38
|
+
MongoDB works directly with VoyageAI's embedding models, which are optimized for retrieval tasks. For complete examples and specialized models, see the [VoyageAI embeddings documentation](https://mastra.ai/models/embeddings) and [MongoDB vector reference](https://mastra.ai/reference/vectors/mongodb).
|
|
39
39
|
|
|
40
40
|
### Hybrid Search (Vector + Full-Text)
|
|
41
41
|
|
|
42
|
-
MongoDB supports hybrid search that
|
|
42
|
+
MongoDB supports hybrid search that combines vector similarity with BM25 full-text search through server-side `$rankFusion`. It requires MongoDB 8.0 or later, is generally available from 8.1, and is enabled on MongoDB Atlas 8.0.x. Use it to combine semantic retrieval with keyword-based results:
|
|
43
43
|
|
|
44
44
|
```ts
|
|
45
45
|
await store.createSearchIndex({ indexName: 'myCollection', fields: ['text'] })
|
|
@@ -107,7 +107,7 @@ await store.upsert({
|
|
|
107
107
|
|
|
108
108
|
### Using Oracle Database Vector Search
|
|
109
109
|
|
|
110
|
-
OracleDB stores embeddings in native `VECTOR` columns and metadata in Oracle JSON. Exact search is the default
|
|
110
|
+
OracleDB stores embeddings in native `VECTOR` columns and metadata in Oracle JSON. Exact search is the default. HNSW and IVF indexes can be configured for tuned deployments.
|
|
111
111
|
|
|
112
112
|
**Pinecone**:
|
|
113
113
|
|
|
@@ -239,8 +239,8 @@ const store = new UpstashVector({
|
|
|
239
239
|
token: process.env.UPSTASH_TOKEN,
|
|
240
240
|
})
|
|
241
241
|
|
|
242
|
-
//
|
|
243
|
-
// when you upsert if that namespace
|
|
242
|
+
// Upstash creates indexes (known as namespaces) automatically, so no store.createIndex call is needed here
|
|
243
|
+
// when you upsert if that namespace doesn't exist yet.
|
|
244
244
|
await store.upsert({
|
|
245
245
|
indexName: 'myCollection', // the namespace name in Upstash
|
|
246
246
|
vectors: embeddings,
|
|
@@ -426,20 +426,20 @@ Collection and index names must:
|
|
|
426
426
|
|
|
427
427
|
- Start with a letter or underscore
|
|
428
428
|
- Be up to 120 bytes long
|
|
429
|
-
- Contain only letters, numbers,
|
|
430
|
-
-
|
|
429
|
+
- Contain only letters, numbers, underscore characters, or dots
|
|
430
|
+
- Can't contain `$` or the null character
|
|
431
431
|
- Example: `my_collection.123` is valid
|
|
432
|
-
- Example: `my-index`
|
|
433
|
-
- Example: `My$Collection`
|
|
432
|
+
- Example: `my-index` isn't valid (contains hyphen)
|
|
433
|
+
- Example: `My$Collection` isn't valid (contains `$`)
|
|
434
434
|
|
|
435
435
|
**PgVector**:
|
|
436
436
|
|
|
437
437
|
Index names must:
|
|
438
438
|
|
|
439
439
|
- Start with a letter or underscore
|
|
440
|
-
- Contain only letters, numbers, and
|
|
440
|
+
- Contain only letters, numbers, and underscore characters
|
|
441
441
|
- Example: `my_index_123` is valid
|
|
442
|
-
- Example: `my-index`
|
|
442
|
+
- Example: `my-index` isn't valid (contains hyphen)
|
|
443
443
|
|
|
444
444
|
**OracleDB**:
|
|
445
445
|
|
|
@@ -466,7 +466,7 @@ Index names must:
|
|
|
466
466
|
- Have a combined length (with project ID) under 52 characters
|
|
467
467
|
|
|
468
468
|
- Example: `my-index-123` is valid
|
|
469
|
-
- Example: `my.index`
|
|
469
|
+
- Example: `my.index` isn't valid (contains dot)
|
|
470
470
|
|
|
471
471
|
**Qdrant**:
|
|
472
472
|
|
|
@@ -482,7 +482,7 @@ Collection names must:
|
|
|
482
482
|
|
|
483
483
|
- Example: `my_collection_123` is valid
|
|
484
484
|
|
|
485
|
-
- Example: `my/collection`
|
|
485
|
+
- Example: `my/collection` isn't valid (contains slash)
|
|
486
486
|
|
|
487
487
|
**Chroma**:
|
|
488
488
|
|
|
@@ -490,11 +490,11 @@ Collection names must:
|
|
|
490
490
|
|
|
491
491
|
- Be 3-63 characters long
|
|
492
492
|
- Start and end with a letter or number
|
|
493
|
-
- Contain only letters, numbers,
|
|
493
|
+
- Contain only letters, numbers, underscore characters, or hyphens
|
|
494
494
|
- Not contain consecutive periods (..)
|
|
495
495
|
- Not be a valid IPv4 address
|
|
496
496
|
- Example: `my-collection-123` is valid
|
|
497
|
-
- Example: `my..collection`
|
|
497
|
+
- Example: `my..collection` isn't valid (consecutive periods)
|
|
498
498
|
|
|
499
499
|
**Astra**:
|
|
500
500
|
|
|
@@ -502,18 +502,18 @@ Collection names must:
|
|
|
502
502
|
|
|
503
503
|
- Not be empty
|
|
504
504
|
- Be 48 characters or less
|
|
505
|
-
- Contain only letters, numbers, and
|
|
505
|
+
- Contain only letters, numbers, and `_` characters
|
|
506
506
|
- Example: `my_collection_123` is valid
|
|
507
|
-
- Example: `my-collection`
|
|
507
|
+
- Example: `my-collection` isn't valid (contains hyphen)
|
|
508
508
|
|
|
509
509
|
**libSQL**:
|
|
510
510
|
|
|
511
511
|
Index names must:
|
|
512
512
|
|
|
513
513
|
- Start with a letter or underscore
|
|
514
|
-
- Contain only letters, numbers, and
|
|
514
|
+
- Contain only letters, numbers, and `_` characters
|
|
515
515
|
- Example: `my_index_123` is valid
|
|
516
|
-
- Example: `my-index`
|
|
516
|
+
- Example: `my-index` isn't valid (contains hyphen)
|
|
517
517
|
|
|
518
518
|
**Upstash**:
|
|
519
519
|
|
|
@@ -532,7 +532,7 @@ Namespace names must:
|
|
|
532
532
|
|
|
533
533
|
- Example: `MyNamespace123` is valid
|
|
534
534
|
|
|
535
|
-
- Example: `_namespace`
|
|
535
|
+
- Example: `_namespace` isn't valid (starts with underscore)
|
|
536
536
|
|
|
537
537
|
**Cloudflare**:
|
|
538
538
|
|
|
@@ -543,19 +543,19 @@ Index names must:
|
|
|
543
543
|
- Contain only lowercase ASCII letters, numbers, and dashes
|
|
544
544
|
- Use dashes instead of spaces
|
|
545
545
|
- Example: `my-index-123` is valid
|
|
546
|
-
- Example: `My_Index`
|
|
546
|
+
- Example: `My_Index` isn't valid (uppercase and underscore)
|
|
547
547
|
|
|
548
548
|
**OpenSearch**:
|
|
549
549
|
|
|
550
550
|
Index names must:
|
|
551
551
|
|
|
552
552
|
- Use only lowercase letters
|
|
553
|
-
- Not begin with
|
|
553
|
+
- Not begin with underscore characters or hyphens
|
|
554
554
|
- Not contain spaces, commas
|
|
555
555
|
- Not contain special characters (e.g. `:`, `"`, `*`, `+`, `/`, `\`, `|`, `?`, `#`, `>`, `<`)
|
|
556
556
|
- Example: `my-index-123` is valid
|
|
557
|
-
- Example: `My_Index`
|
|
558
|
-
- Example: `_myindex`
|
|
557
|
+
- Example: `My_Index` isn't valid (contains uppercase letters)
|
|
558
|
+
- Example: `_myindex` isn't valid (begins with underscore)
|
|
559
559
|
|
|
560
560
|
**Elasticsearch**:
|
|
561
561
|
|
|
@@ -563,29 +563,29 @@ Index names must:
|
|
|
563
563
|
|
|
564
564
|
- Use only lowercase letters
|
|
565
565
|
- Not exceed 255 bytes (counting multi-byte characters)
|
|
566
|
-
- Not begin with
|
|
566
|
+
- Not begin with underscore characters, hyphens, or plus signs
|
|
567
567
|
- Not contain spaces, commas
|
|
568
568
|
- Not contain special characters (e.g. `:`, `"`, `*`, `+`, `/`, `\`, `|`, `?`, `#`, `>`, `<`)
|
|
569
569
|
- Not be "." or ".."
|
|
570
570
|
- Not start with "." (deprecated except for system/hidden indices)
|
|
571
571
|
- Example: `my-index-123` is valid
|
|
572
|
-
- Example: `My_Index`
|
|
573
|
-
- Example: `_myindex`
|
|
574
|
-
- Example: `.myindex`
|
|
572
|
+
- Example: `My_Index` isn't valid (contains uppercase letters)
|
|
573
|
+
- Example: `_myindex` isn't valid (begins with underscore)
|
|
574
|
+
- Example: `.myindex` isn't valid (begins with dot, deprecated)
|
|
575
575
|
|
|
576
576
|
**S3 Vectors**:
|
|
577
577
|
|
|
578
578
|
Index names must:
|
|
579
579
|
|
|
580
580
|
- Be unique within the same vector bucket
|
|
581
|
-
- Be 3
|
|
581
|
+
- Be between 3 and 63 characters long
|
|
582
582
|
- Use only lowercase letters (`a–z`), numbers (`0–9`), hyphens (`-`), and dots (`.`)
|
|
583
583
|
- Begin and end with a letter or number
|
|
584
584
|
- Example: `my-index.123` is valid
|
|
585
|
-
- Example: `my_index`
|
|
586
|
-
- Example: `-myindex`
|
|
587
|
-
- Example: `myindex-`
|
|
588
|
-
- Example: `MyIndex`
|
|
585
|
+
- Example: `my_index` isn't valid (contains underscore)
|
|
586
|
+
- Example: `-myindex` isn't valid (begins with hyphen)
|
|
587
|
+
- Example: `myindex-` isn't valid (ends with hyphen)
|
|
588
|
+
- Example: `MyIndex` isn't valid (contains uppercase letters)
|
|
589
589
|
|
|
590
590
|
### Upserting Embeddings
|
|
591
591
|
|
|
@@ -80,7 +80,7 @@ Returns a `ServerRoute` object that can be registered with an adapter or passed
|
|
|
80
80
|
|
|
81
81
|
### Register through `server.apiRoutes`
|
|
82
82
|
|
|
83
|
-
Routes created with `createRoute()` can be passed to `server.apiRoutes
|
|
83
|
+
Routes created with `createRoute()` can be passed to `server.apiRoutes`, where the adapter adds runtime validation and typed handler parameters while generating OpenAPI metadata. See [Custom API routes](https://mastra.ai/docs/server/custom-api-routes) for details.
|
|
84
84
|
|
|
85
85
|
```typescript
|
|
86
86
|
import { Mastra } from '@mastra/core'
|