@mastra/mcp-docs-server 1.2.23-alpha.1 → 1.2.23-alpha.11

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.
Files changed (169) hide show
  1. package/.docs/docs/agents/code-mode.md +1 -1
  2. package/.docs/docs/agents/human-in-the-loop.md +1 -1
  3. package/.docs/docs/agents/networks.md +1 -1
  4. package/.docs/docs/agents/processors.md +1 -1
  5. package/.docs/docs/agents/structured-output.md +1 -1
  6. package/.docs/docs/auth/fga.md +16 -16
  7. package/.docs/docs/channels.md +2 -2
  8. package/.docs/docs/connections/mcp.md +1 -1
  9. package/.docs/docs/datasets/running-experiments.md +1 -1
  10. package/.docs/docs/deployment/sandbox.md +2 -2
  11. package/.docs/docs/deployment/workers.md +2 -2
  12. package/.docs/docs/evals/custom-scorers.md +3 -4
  13. package/.docs/docs/evals/multi-turn.md +1 -1
  14. package/.docs/docs/evals/overview.md +11 -11
  15. package/.docs/docs/evals/quick-checks.md +1 -1
  16. package/.docs/docs/evals/vitest-integration.md +136 -0
  17. package/.docs/docs/guides/context-engineering.md +1 -1
  18. package/.docs/docs/guides/multi-agent-systems.md +1 -1
  19. package/.docs/docs/guides/streaming.md +72 -52
  20. package/.docs/docs/harness/agent-controller.md +49 -1
  21. package/.docs/docs/harness/background-tasks.md +1 -1
  22. package/.docs/docs/harness/durable-agents.md +1 -1
  23. package/.docs/docs/harness/overview.md +10 -11
  24. package/.docs/docs/harness/schedules.md +1 -1
  25. package/.docs/docs/harness/signal-providers.md +1 -1
  26. package/.docs/docs/harness/signals.md +1 -1
  27. package/.docs/docs/index.md +1 -1
  28. package/.docs/docs/mastra-platform/deploy.md +15 -15
  29. package/.docs/docs/mastra-platform/environments.md +2 -2
  30. package/.docs/docs/mastra-platform/github.md +2 -2
  31. package/.docs/docs/mastra-platform/regions.md +1 -1
  32. package/.docs/docs/mastra-platform/server.md +4 -4
  33. package/.docs/docs/mastra-platform/studio.md +1 -1
  34. package/.docs/docs/mastra-platform/trace-intelligence.md +1 -1
  35. package/.docs/docs/mastra-platform/workspaces.md +1 -1
  36. package/.docs/docs/memory/message-history.md +3 -3
  37. package/.docs/docs/memory/observational-memory.md +18 -18
  38. package/.docs/docs/memory/overview.md +1 -1
  39. package/.docs/docs/memory/semantic-recall.md +0 -2
  40. package/.docs/docs/memory/working-memory.md +1 -1
  41. package/.docs/docs/observability/feedback.md +2 -2
  42. package/.docs/docs/observability/integrations/exporters/mastra-storage.md +1 -1
  43. package/.docs/docs/observability/logging.md +1 -1
  44. package/.docs/docs/observability/metrics/overview.md +1 -1
  45. package/.docs/docs/observability/overview.md +13 -11
  46. package/.docs/docs/observability/tracing/overview.md +13 -13
  47. package/.docs/docs/sandbox/lsp.md +1 -1
  48. package/.docs/docs/sandbox/overview.md +1 -1
  49. package/.docs/docs/server/mastra-client.md +1 -1
  50. package/.docs/docs/server/overview.md +1 -1
  51. package/.docs/docs/server/pubsub.md +1 -1
  52. package/.docs/docs/server/request-context.md +2 -2
  53. package/.docs/docs/server/server-adapters.md +1 -1
  54. package/.docs/docs/skills.md +1 -1
  55. package/.docs/docs/studio/deployment.md +1 -1
  56. package/.docs/docs/studio/editor.md +1 -1
  57. package/.docs/docs/studio/observability.md +2 -2
  58. package/.docs/docs/studio/overview.md +1 -1
  59. package/.docs/docs/subagents.md +2 -2
  60. package/.docs/docs/workflows/agents-and-tools.md +0 -4
  61. package/.docs/docs/workflows/control-flow.md +1 -3
  62. package/.docs/docs/workflows/overview.md +1 -1
  63. package/.docs/docs/workflows/scheduled-workflows.md +1 -1
  64. package/.docs/docs/workflows/suspend-and-resume.md +2 -2
  65. package/.docs/integrations/sandboxes/agentcore.md +2 -0
  66. package/.docs/integrations/sandboxes/apple-container.md +5 -3
  67. package/.docs/integrations/sandboxes/blaxel.md +2 -0
  68. package/.docs/integrations/sandboxes/cloudflare-sandbox.md +1 -1
  69. package/.docs/integrations/sandboxes/daytona.md +2 -0
  70. package/.docs/integrations/sandboxes/docker.md +3 -1
  71. package/.docs/integrations/sandboxes/e2b.md +4 -0
  72. package/.docs/integrations/sandboxes/modal.md +3 -1
  73. package/.docs/integrations/sandboxes/railway.md +2 -0
  74. package/.docs/integrations/sandboxes/vercel.md +4 -0
  75. package/.docs/integrations/voice/livekit.md +51 -1
  76. package/.docs/models/environment-variables.md +5 -0
  77. package/.docs/models/gateways/merge-gateway.md +2 -1
  78. package/.docs/models/gateways/netlify.md +6 -2
  79. package/.docs/models/gateways/openrouter.md +3 -5
  80. package/.docs/models/gateways/vercel.md +4 -1
  81. package/.docs/models/index.md +1 -1
  82. package/.docs/models/providers/abliteration-ai.md +7 -6
  83. package/.docs/models/providers/above.md +83 -0
  84. package/.docs/models/providers/aiand.md +4 -2
  85. package/.docs/models/providers/anthropic.md +2 -1
  86. package/.docs/models/providers/berget.md +4 -2
  87. package/.docs/models/providers/bothub.md +76 -0
  88. package/.docs/models/providers/chutes.md +1 -1
  89. package/.docs/models/providers/coralbricks.md +4 -4
  90. package/.docs/models/providers/cortecs.md +3 -3
  91. package/.docs/models/providers/crossmodel.md +4 -3
  92. package/.docs/models/providers/edenai.md +8 -6
  93. package/.docs/models/providers/empiriolabs.md +1 -2
  94. package/.docs/models/providers/fireworks-ai.md +2 -1
  95. package/.docs/models/providers/friendli.md +3 -2
  96. package/.docs/models/providers/google.md +1 -2
  97. package/.docs/models/providers/groq.md +2 -1
  98. package/.docs/models/providers/hyper.md +8 -6
  99. package/.docs/models/providers/iteracompute.md +8 -7
  100. package/.docs/models/providers/kilo.md +29 -32
  101. package/.docs/models/providers/klokintegration.md +77 -0
  102. package/.docs/models/providers/llmgateway-providers.md +2 -26
  103. package/.docs/models/providers/llmgateway.md +3 -14
  104. package/.docs/models/providers/nano-gpt.md +75 -92
  105. package/.docs/models/providers/neuralwatt.md +2 -1
  106. package/.docs/models/providers/ollama-cloud.md +2 -1
  107. package/.docs/models/providers/opencode-go.md +1 -1
  108. package/.docs/models/providers/opencode.md +2 -2
  109. package/.docs/models/providers/orcarouter.md +3 -2
  110. package/.docs/models/providers/requesty.md +5 -7
  111. package/.docs/models/providers/sensenova.md +77 -0
  112. package/.docs/models/providers/synthetic.md +3 -2
  113. package/.docs/models/providers/tokenrouter.md +75 -0
  114. package/.docs/models/providers/trustedrouter.md +13 -13
  115. package/.docs/models/providers/vancine.md +13 -11
  116. package/.docs/models/providers.md +5 -0
  117. package/.docs/reference/agent-controller/agent-controller-class.md +2 -2
  118. package/.docs/reference/agent-controller/session.md +3 -3
  119. package/.docs/reference/agents/durable-agent.md +77 -9
  120. package/.docs/reference/agents/getDefaultGenerateOptions.md +1 -1
  121. package/.docs/reference/agents/listSuspendedRuns.md +2 -2
  122. package/.docs/reference/ai-sdk/chat-route.md +1 -1
  123. package/.docs/reference/ai-sdk/network-route.md +1 -1
  124. package/.docs/reference/ai-sdk/workflow-route.md +1 -1
  125. package/.docs/reference/browser/browser-viewer.md +1 -1
  126. package/.docs/reference/cli/mastra.md +4 -4
  127. package/.docs/reference/core/mastra-class.md +1 -1
  128. package/.docs/reference/datasets/createExperiment.md +1 -1
  129. package/.docs/reference/editor/tool-provider.md +1 -1
  130. package/.docs/reference/editor/versioning.md +1 -1
  131. package/.docs/reference/evals/multi-turn-judge.md +1 -1
  132. package/.docs/reference/evals/rubric.md +1 -1
  133. package/.docs/reference/file-based-agents/schedules.md +2 -2
  134. package/.docs/reference/file-based-agents/workspace.md +1 -1
  135. package/.docs/reference/manual-install.md +3 -3
  136. package/.docs/reference/memory/observational-memory.md +4 -4
  137. package/.docs/reference/memory/settled.md +1 -1
  138. package/.docs/reference/migrations/mastra-cloud.md +9 -9
  139. package/.docs/reference/migrations/upgrade-to-v1/overview.md +1 -1
  140. package/.docs/reference/observability/tracing/configuration.md +2 -2
  141. package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +1 -1
  142. package/.docs/reference/processors/processor-interface.md +1 -1
  143. package/.docs/reference/processors/regex-filter-processor.md +3 -3
  144. package/.docs/reference/processors/token-cost-control.md +2 -2
  145. package/.docs/reference/processors/token-limiter-processor.md +1 -1
  146. package/.docs/reference/processors/tool-search-processor.md +1 -1
  147. package/.docs/reference/processors/working-memory-processor.md +1 -1
  148. package/.docs/reference/pubsub/base.md +2 -2
  149. package/.docs/reference/pubsub/lease-provider.md +2 -2
  150. package/.docs/reference/rag/vector-databases.md +33 -33
  151. package/.docs/reference/server/create-route.md +1 -1
  152. package/.docs/reference/signals/task-signal-provider.md +1 -1
  153. package/.docs/reference/storage/composite.md +1 -1
  154. package/.docs/reference/storage/retention.md +4 -4
  155. package/.docs/reference/streaming/ChunkType.md +1 -1
  156. package/.docs/reference/tools/isolated-vm-transport.md +1 -1
  157. package/.docs/reference/tools/mcp-client.md +2 -2
  158. package/.docs/reference/vectors/couchbase.md +1 -1
  159. package/.docs/reference/vectors/mongodb.md +2 -2
  160. package/.docs/reference/voice/overview.md +1 -1
  161. package/.docs/reference/workflows/workflow-methods/agent.md +4 -4
  162. package/.docs/reference/workflows/workflow-methods/foreach.md +1 -1
  163. package/.docs/reference/workflows/workflow-methods/tool.md +2 -2
  164. package/.docs/reference/workspace/platform-sandbox.md +6 -2
  165. package/.docs/reference/workspace/process-manager.md +1 -1
  166. package/.docs/reference/workspace/sandbox.md +20 -3
  167. package/.docs/reference/workspace/workspace-class.md +3 -3
  168. package/package.json +5 -6
  169. package/CHANGELOG.md +0 -5929
@@ -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. Do not navigate to the quickstart guide, which is for humans. The model string is Mastra's model router format ('provider/model'; use / and not : to separate provider and model). Do not install any ai-sdk packages.
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 is Mastra's model router format ('provider/model'; use / and not : to separate provider and model). Do not install any ai-sdk packages.
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:** Do not 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);`
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. A **Reflector** restructures those observations by combining related items and condensing overarching patterns. Together, they maintain an observation log that replaces raw message history as it grows.
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` (100k in this example). If observations only use 30k tokens, messages can expand to use up to 70k. If messages are short, observations have more room before triggering reflection.
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, each producing a chunk of observations. At threshold, chunks activate: observations move into the log, raw messages are removed from context. Above the `blockAfter` threshold, activation may overshoot the retention target instead of activating fewer chunks. If the threshold is reached and no buffered chunk activates, a synchronous observation runs instead.
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 set (any truthy value), a `recall` tool is registered so the agent can page through raw messages behind observation group ranges. By default (scope `'resource'`), the tool supports listing threads (`mode: "threads"`), browsing other threads (`threadId`), and cross-thread search. With `retrieval: { vector: true }`, semantic search is available (`mode: "search"`). Set `scope: 'thread'` to restrict the tool to the current thread only. The tool is automatically added to the agent's tool list.
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 does not prevent new work from starting afterwards, so call it once the agent runs you care about have returned.
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, 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.
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, back up, or use as the source for the new database in the steps that follow.
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–backed projects, two variables are injected alongside your own:
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 — show/hide via the eye toggle, Edit, Delete, and Copy Value. Use **Copy Value** to grab both values for the dump command below.
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 do not 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.
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://` — the Turso CLI expects the HTTPS form when passing the URL with an auth token.
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 — the full URL (with token) can end up in shell history, process listings, and terminal logs. Turso officially recommends running `turso auth login` and then dumping by database name only: `turso db shell <database-name> ".dump" > mastra-cloud-dump.sql`. That flow requires the database to live in a Turso account you own, which is not the case for Cloud Store, so the env-var example above is provided as an alternative for this one-time export. If you prefer to avoid token interpolation entirely, ask support to run the dump on your behalf and send you the resulting SQL file.
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 do not have a Turso account, the CLI will prompt you to create one. See [Turso pricing](https://turso.tech/pricing) for plan details.
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 — list available regions with `turso db locations` and pass `--group <group-name>` if you manage multiple groups.
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). Old Mastra Cloud access tokens don't work with Mastra platform. Create new ones with `mastra auth tokens create`.
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
 
@@ -61,9 +61,9 @@ interface ObservabilityInstanceConfig {
61
61
 
62
62
  **serializationOptions** (`SerializationOptions`): Options for controlling serialization of span data (input/output/attributes)
63
63
 
64
- **serializationOptions.maxStringLength** (`number`): Maximum length for string values (default: 1024)
64
+ **serializationOptions.maxStringLength** (`number`): Maximum length for string values (default: 131072)
65
65
 
66
- **serializationOptions.maxDepth** (`number`): Maximum depth for nested objects (default: 6)
66
+ **serializationOptions.maxDepth** (`number`): Maximum depth for nested objects (default: 8)
67
67
 
68
68
  **serializationOptions.maxArrayLength** (`number`): Maximum number of items in arrays (default: 50)
69
69
 
@@ -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` is retained for backward compatibility and will be removed in a future major version. Use [`MastraPlatformExporter`](https://mastra.ai/reference/observability/tracing/exporters/mastra-platform-exporter) for new projects. Both classes share the same constructor, environment variables, and runtime behavior. `CloudExporter` keeps its original `mastra-cloud-observability-exporter` exporter `name` and `CLOUD_EXPORTER_*` error IDs so monitoring rules built against it keep working.
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 plain array of `MastraDBMessage` objects, scoped to the current stage. For `processInput` and `processInputStep` this excludes system messages. For `processOutputResult` and `processOutputStep` this includes the latest LLM response. The array is backed by `messageList`, so editing a message's `content.parts` in place is visible to downstream processors and to persistence.
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, so two rules can claim text that overlaps. A card number written without separators matches both `phone` and `credit-card`, for example. Overlapping matches are combined into a single region and replaced once, using the replacement of the longest match.
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 reference capture groups with `$1` or `$&`. Those references resolve for a single match whose pattern also matches the matched text on its own. In a combined region, or for a rule anchored on its surroundings with a lookbehind or lookahead, the replacement string is inserted as written. The region is redacted either way.
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
- The `redact` strategy rewrites text in place, so nothing downstream can tell what changed. Assign `onViolation` to record it. The processor calls it once per redacted message, message part, or stream chunk, and offsets are relative to that piece of text. Async callbacks are awaited, and errors are caught so an unavailable audit sink can't fail the request.
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. If the Mastra instance doesn't have observability storage configured, an error is thrown at registration time.
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). If your traces don't carry the matching metadata, these scopes match zero records and the guard never trips. 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.
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 rather than tokenized. This applies to `file` message parts and to tool results shaped like `{ data, mediaType }`. Images use a flat per-image estimate, other media is estimated from its decoded byte size, and remote URLs or 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, which would otherwise inflate the count by an order of magnitude and truncate history unnecessarily.
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 tool definitions sent to the model, which shifts the cached prefix and causes the next turn to pay a cache write instead of a cache hit. In `'in-memory'` mode this happens when a thread's state is evicted by `ttl`. In `'context'` mode it happens when a tool's discovery result is no longer present in the messages (for example, when older messages are trimmed). The tool de-loads, and the model must search for it again before reuse. This is expected: removing an unused tool trades one cache write for a smaller prefix on later turns.
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/updating information, template structure, and current data
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 is unchanged: a batch of N events is delivered 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.
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: 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. The contract is best-effort: implementations log failures rather than throwing, because callers invoke it fire-and-forget at cleanup boundaries.
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 a distinct concern from pub/sub. A backend implements `LeaseProvider` only when it can actually coordinate a lock, such as Redis via atomic `SET`/Lua, or an in-memory map for single-process. Backends that can't lease omit it; the signals runtime feature-detects the capability and falls back to a no-op provider, preserving single-process behavior.
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 perform the transfer atomically must still implement it as a best-effort `releaseLease(fromOwner)` followed by `acquireLease(toOwner)`, and document that the swap is non-atomic, since a racing process can win the key in the gap. Keeping the method required means callers have a single code path and atomicity is an explicit per-backend decision.
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 seamlessly 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).
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 fuses vector similarity with BM25 full-text search using server-side `$rankFusion` (requires MongoDB >= 8.0; generally available from 8.1, and enabled on MongoDB Atlas 8.0.x). This is useful when you want to combine semantic and keyword-based retrieval:
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; HNSW and IVF indexes can be configured for tuned deployments.
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
- // There is no store.createIndex call here, Upstash creates indexes (known as namespaces in Upstash) automatically
243
- // when you upsert if that namespace does not exist yet.
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, underscores, or dots
430
- - Cannot contain `$` or the null character
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` is not valid (contains hyphen)
433
- - Example: `My$Collection` is not valid (contains `$`)
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 underscores
440
+ - Contain only letters, numbers, and underscore characters
441
441
  - Example: `my_index_123` is valid
442
- - Example: `my-index` is not valid (contains hyphen)
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` is not valid (contains dot)
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` is not valid (contains slash)
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, underscores, or hyphens
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` is not valid (consecutive periods)
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 underscores
505
+ - Contain only letters, numbers, and `_` characters
506
506
  - Example: `my_collection_123` is valid
507
- - Example: `my-collection` is not valid (contains hyphen)
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 underscores
514
+ - Contain only letters, numbers, and `_` characters
515
515
  - Example: `my_index_123` is valid
516
- - Example: `my-index` is not valid (contains hyphen)
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` is not valid (starts with underscore)
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` is not valid (uppercase and underscore)
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 underscores or hyphens
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` is not valid (contains uppercase letters)
558
- - Example: `_myindex` is not valid (begins with underscore)
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 underscores, hyphens, or plus signs
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` is not valid (contains uppercase letters)
573
- - Example: `_myindex` is not valid (begins with underscore)
574
- - Example: `.myindex` is not valid (begins with dot, deprecated)
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–63 characters long
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` is not valid (contains underscore)
586
- - Example: `-myindex` is not valid (begins with hyphen)
587
- - Example: `myindex-` is not valid (ends with hyphen)
588
- - Example: `MyIndex` is not valid (contains uppercase letters)
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`. The adapter registers them with runtime validation, typed handler parameters, and generated OpenAPI metadata. See [Custom API routes](https://mastra.ai/docs/server/custom-api-routes) for details.
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'
@@ -44,7 +44,7 @@ Task tracking requires a memory-backed thread (`threadId` + `resourceId`). Witho
44
44
 
45
45
  ### Agent integration
46
46
 
47
- These methods are called automatically by the Agent when the provider is passed to `signals`. You normally don't call them directly.
47
+ The Agent calls these methods automatically when the provider is passed to `signals`, so you normally don't call them directly.
48
48
 
49
49
  #### `getTools()`
50
50
 
@@ -255,7 +255,7 @@ const thread = await memoryStore?.getThreadById({ threadId: '...' })
255
255
 
256
256
  ## Closing connections
257
257
 
258
- `close()` releases the connections of the stores a composite was built from: the `default` and `editor` stores, plus any domain that owns its own client. Each store is closed once, even when it backs several domains. When passed to the Mastra class, `close()` is called by `shutdown()`:
258
+ `close()` releases connections for the stores used by a composite, including the `default` and `editor` stores and any domain with its own client. Each store closes once even if it backs several domains. When the composite is passed to the Mastra class, `shutdown()` calls `close()`:
259
259
 
260
260
  ```typescript
261
261
  import { MastraCompositeStore } from '@mastra/core/storage'
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Storage retention
6
6
 
7
- Storage grows without bound by default. Retention is an opt-in, age-based cleanup system: you declare per-table `maxAge` policies in the `retention` config, then call `storage.prune()` to delete rows older than their configured age. Anything you don't configure is kept forever, so there is no behavior change until you opt in.
7
+ Because storage grows without bound by default, Mastra provides an opt-in, age-based retention system. Declare per-table `maxAge` policies in the `retention` config, then call `storage.prune()` to delete rows older than their configured age. Unconfigured data is kept forever, so behavior doesn't change until you opt in.
8
8
 
9
9
  `prune()` deletes rows. It caps growth and is safe to run against large tables (batched, bounded, resumable, cancellable). It never reclaims disk: on SQLite/libSQL the freed pages are reused by future writes so the file stops growing, but handing disk back to the OS (for example a `VACUUM`) is left to the underlying database and the operator to manage.
10
10
 
@@ -37,7 +37,7 @@ const storage = new LibSQLStore({
37
37
  const results = await storage.prune()
38
38
  ```
39
39
 
40
- `retention` is fully typed. Keys must be real domain keys, and each table key must be one the domain declares as retention-eligible. Passing the object straight into a store config type-checks it; if you build it standalone, use `satisfies RetentionConfig` so unknown domains or tables are compile errors:
40
+ `retention` is fully typed. Domain keys must exist, and their table keys must be declared retention-eligible. Store configs type-check objects passed directly. When building an object separately, use `satisfies RetentionConfig` so unknown domains or tables produce compile errors:
41
41
 
42
42
  ```typescript
43
43
  import type { RetentionConfig } from '@mastra/core/storage'
@@ -67,7 +67,7 @@ Set the `retention` field on the store config.
67
67
 
68
68
  ### Retention-eligible tables
69
69
 
70
- Each domain declares which of its tables can be age-pruned and which timestamp column anchors the comparison. The anchor is chosen so `maxAge` means what you'd expect for that data. Append-only logs use creation time, and live state uses last activity. Jobs and runs use completion time, so in-flight work is never pruned.
70
+ Each domain specifies its age-prunable tables and the timestamp column that anchors comparison, chosen so `maxAge` matches the meaning of the data. Append-only logs use creation time, live state uses last activity, and jobs or runs use completion time so in-flight work isn't pruned.
71
71
 
72
72
  | Domain | Table key | Anchor column | `maxAge` measures |
73
73
  | ----------------- | ------------------ | ---------------- | ---------------------------------------------------------------- |
@@ -158,7 +158,7 @@ interface PruneResult {
158
158
 
159
159
  ## Running prune on a schedule
160
160
 
161
- `prune()` has no built-in scheduler: you decide when it runs. Because it's bounded, a single call may not delete everything. When any result has `done: false`, eligible rows remain and you call again on the next tick. This keeps each invocation short and lets a large backlog drain over several runs.
161
+ `prune()` has no built-in scheduler, so you decide when it runs. A bounded call may leave eligible rows, indicated by any result with `done: false`. Call it again on the next tick. Short invocations let a large backlog drain over several runs.
162
162
 
163
163
  ```typescript
164
164
  // Runs on your own cron (node-cron, a workflow schedule, an external job, etc.).
@@ -354,7 +354,7 @@ Signals the completion of a processing step.
354
354
 
355
355
  ### raw
356
356
 
357
- Contains raw data from the provider. Content types Mastra doesn't recognize are also emitted as `raw` chunks rather than being discarded. Raw chunks only appear when `includeRawChunks` is enabled.
357
+ Contains raw data from the provider, including content types Mastra doesn't recognize, which are emitted as `raw` chunks rather than discarded. Raw chunks only appear when `includeRawChunks` is enabled.
358
358
 
359
359
  **type** (`"raw"`): Chunk type identifier
360
360