@mastra/mcp-docs-server 1.2.11 → 1.2.12-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/.docs/docs/agents/using-tools.md +25 -0
  2. package/.docs/guides/build-your-ui/ai-sdk-ui.md +5 -5
  3. package/.docs/guides/build-your-ui/copilotkit/generative-ui.md +8 -8
  4. package/.docs/guides/build-your-ui/copilotkit/overview.md +2 -2
  5. package/.docs/guides/build-your-ui/openui.md +1 -1
  6. package/.docs/guides/concepts/multi-agent-systems.md +5 -5
  7. package/.docs/guides/concepts/streaming.md +9 -9
  8. package/.docs/guides/deployment/amazon-ec2.md +1 -1
  9. package/.docs/guides/deployment/aws-lambda.md +1 -1
  10. package/.docs/guides/deployment/azure-app-services.md +1 -1
  11. package/.docs/guides/deployment/cloudflare.md +1 -1
  12. package/.docs/guides/deployment/inngest.md +6 -6
  13. package/.docs/guides/deployment/temporal.md +1 -1
  14. package/.docs/guides/deployment/vercel.md +1 -1
  15. package/.docs/guides/getting-started/astro.md +1 -1
  16. package/.docs/guides/getting-started/electron.md +1 -1
  17. package/.docs/guides/getting-started/nestjs.md +5 -5
  18. package/.docs/guides/getting-started/vite-react.md +1 -1
  19. package/.docs/guides/guide/chef-michel.md +1 -1
  20. package/.docs/guides/guide/code-review-bot.md +1 -1
  21. package/.docs/guides/guide/coding-agent.md +4 -4
  22. package/.docs/guides/guide/dev-assistant.md +1 -1
  23. package/.docs/guides/guide/docs-manager.md +3 -3
  24. package/.docs/guides/guide/github-actions-pr-description.md +4 -4
  25. package/.docs/guides/guide/research-assistant.md +3 -3
  26. package/.docs/guides/guide/research-coordinator.md +3 -3
  27. package/.docs/guides/guide/slack-assistant.md +1 -1
  28. package/.docs/guides/guide/stock-agent.md +1 -1
  29. package/.docs/guides/index.md +1 -1
  30. package/.docs/guides/migrations/ai-sdk-v4-to-v5.md +1 -1
  31. package/.docs/guides/migrations/mastra-cloud.md +6 -6
  32. package/.docs/guides/migrations/network-to-supervisor.md +9 -9
  33. package/.docs/guides/migrations/upgrade-to-v1/agent.md +5 -5
  34. package/.docs/guides/migrations/upgrade-to-v1/cli.md +1 -1
  35. package/.docs/guides/migrations/upgrade-to-v1/client.md +3 -3
  36. package/.docs/guides/migrations/upgrade-to-v1/evals.md +2 -2
  37. package/.docs/guides/migrations/upgrade-to-v1/memory.md +1 -1
  38. package/.docs/guides/migrations/upgrade-to-v1/overview.md +3 -3
  39. package/.docs/guides/migrations/upgrade-to-v1/processors.md +1 -1
  40. package/.docs/guides/migrations/upgrade-to-v1/storage.md +11 -11
  41. package/.docs/guides/migrations/upgrade-to-v1/tools.md +3 -3
  42. package/.docs/guides/migrations/upgrade-to-v1/tracing.md +2 -2
  43. package/.docs/guides/migrations/upgrade-to-v1/voice.md +1 -1
  44. package/.docs/guides/migrations/upgrade-to-v1/workflows.md +1 -1
  45. package/.docs/models/environment-variables.md +1 -0
  46. package/.docs/models/index.md +1 -1
  47. package/.docs/models/providers/modal.md +73 -0
  48. package/.docs/models/providers.md +1 -0
  49. package/.docs/reference/acp/acp-agent.md +3 -3
  50. package/.docs/reference/acp/create-acp-tool.md +2 -2
  51. package/.docs/reference/agent-controller/agent-controller-class.md +36 -36
  52. package/.docs/reference/agent-controller/session.md +6 -6
  53. package/.docs/reference/agents/agent.md +7 -7
  54. package/.docs/reference/agents/channels.md +3 -3
  55. package/.docs/reference/agents/durable-agent.md +3 -3
  56. package/.docs/reference/agents/generate.md +3 -3
  57. package/.docs/reference/agents/getDefaultOptions.md +1 -1
  58. package/.docs/reference/agents/getDefaultStreamOptions.md +1 -1
  59. package/.docs/reference/agents/listScorers.md +1 -1
  60. package/.docs/reference/agents/listSkills.md +1 -1
  61. package/.docs/reference/agents/listSuspendedRuns.md +2 -2
  62. package/.docs/reference/ai-sdk/chat-route.md +1 -1
  63. package/.docs/reference/ai-sdk/network-route.md +1 -1
  64. package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +1 -1
  65. package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +1 -1
  66. package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +1 -1
  67. package/.docs/reference/ai-sdk/workflow-route.md +1 -1
  68. package/.docs/reference/ai-sdk/workflow-snapshot-to-stream.md +2 -2
  69. package/.docs/reference/auth/auth0.md +1 -1
  70. package/.docs/reference/auth/fga.md +2 -2
  71. package/.docs/reference/auth/google.md +2 -2
  72. package/.docs/reference/auth/okta.md +1 -1
  73. package/.docs/reference/auth/workos.md +2 -2
  74. package/.docs/reference/browser/agent-browser.md +2 -2
  75. package/.docs/reference/browser/browser-viewer.md +3 -3
  76. package/.docs/reference/browser/mastra-browser.md +3 -3
  77. package/.docs/reference/browser/stagehand-browser.md +4 -4
  78. package/.docs/reference/channels/slack-provider.md +2 -2
  79. package/.docs/reference/cli/create-mastra.md +1 -1
  80. package/.docs/reference/cli/mastra.md +23 -23
  81. package/.docs/reference/client-js/agents.md +9 -9
  82. package/.docs/reference/client-js/memory.md +2 -2
  83. package/.docs/reference/client-js/workflows.md +1 -1
  84. package/.docs/reference/coding-agent/build-base-prompt.md +2 -2
  85. package/.docs/reference/coding-agent/create-coding-agent.md +2 -2
  86. package/.docs/reference/configuration.md +6 -6
  87. package/.docs/reference/core/getMCPServer.md +1 -1
  88. package/.docs/reference/core/getScorer.md +1 -1
  89. package/.docs/reference/datasets/addItem.md +1 -1
  90. package/.docs/reference/datasets/listItems.md +1 -1
  91. package/.docs/reference/deployer/netlify.md +4 -4
  92. package/.docs/reference/deployer/vercel.md +7 -7
  93. package/.docs/reference/editor/agent-builder/agent-builder-options.md +4 -4
  94. package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +6 -6
  95. package/.docs/reference/editor/agent-builder/builder-models.md +3 -3
  96. package/.docs/reference/editor/blob-store-provider.md +1 -1
  97. package/.docs/reference/editor/browser-provider.md +3 -3
  98. package/.docs/reference/editor/filesystem-provider.md +4 -4
  99. package/.docs/reference/editor/mastra-editor.md +5 -5
  100. package/.docs/reference/editor/processor-provider.md +3 -3
  101. package/.docs/reference/editor/sandbox-provider.md +4 -4
  102. package/.docs/reference/editor/storage-browser-ref.md +6 -6
  103. package/.docs/reference/editor/storage-workspace-ref.md +4 -4
  104. package/.docs/reference/editor/tool-provider.md +1 -1
  105. package/.docs/reference/evals/answer-relevancy.md +4 -4
  106. package/.docs/reference/evals/bias.md +3 -3
  107. package/.docs/reference/evals/checks.md +3 -3
  108. package/.docs/reference/evals/completeness.md +5 -5
  109. package/.docs/reference/evals/content-similarity.md +5 -5
  110. package/.docs/reference/evals/context-precision.md +2 -2
  111. package/.docs/reference/evals/context-recall.md +8 -8
  112. package/.docs/reference/evals/context-relevance.md +4 -4
  113. package/.docs/reference/evals/create-scorer.md +1 -1
  114. package/.docs/reference/evals/faithfulness.md +3 -3
  115. package/.docs/reference/evals/filter-run.md +2 -2
  116. package/.docs/reference/evals/hallucination.md +6 -6
  117. package/.docs/reference/evals/keyword-coverage.md +6 -6
  118. package/.docs/reference/evals/mastra-scorer.md +2 -2
  119. package/.docs/reference/evals/noise-sensitivity.md +5 -5
  120. package/.docs/reference/evals/prompt-alignment.md +5 -5
  121. package/.docs/reference/evals/rubric.md +1 -1
  122. package/.docs/reference/evals/run-evals.md +3 -3
  123. package/.docs/reference/evals/scorer-utils.md +4 -4
  124. package/.docs/reference/evals/textual-difference.md +4 -4
  125. package/.docs/reference/evals/tool-call-accuracy.md +1 -1
  126. package/.docs/reference/evals/toxicity.md +4 -4
  127. package/.docs/reference/evals/trajectory-accuracy.md +10 -10
  128. package/.docs/reference/file-based-agents/instructions.md +2 -2
  129. package/.docs/reference/file-based-agents/logger.md +1 -1
  130. package/.docs/reference/file-based-agents/observability.md +1 -1
  131. package/.docs/reference/file-based-agents/processors.md +1 -1
  132. package/.docs/reference/file-based-agents/skills.md +1 -1
  133. package/.docs/reference/file-based-agents/storage.md +1 -1
  134. package/.docs/reference/file-based-agents/studio.md +1 -1
  135. package/.docs/reference/file-based-agents/subagents.md +1 -1
  136. package/.docs/reference/file-based-agents/tools.md +1 -1
  137. package/.docs/reference/file-based-agents/workspace.md +1 -1
  138. package/.docs/reference/logging/pino-logger.md +3 -3
  139. package/.docs/reference/memory/clone-utilities.md +1 -1
  140. package/.docs/reference/memory/cloneThread.md +3 -3
  141. package/.docs/reference/memory/listThreads.md +1 -1
  142. package/.docs/reference/memory/memory-class.md +1 -1
  143. package/.docs/reference/memory/observational-memory.md +11 -11
  144. package/.docs/reference/memory/recall.md +2 -2
  145. package/.docs/reference/memory/serialized-memory-config.md +4 -4
  146. package/.docs/reference/memory/summarizeConversation.md +3 -3
  147. package/.docs/reference/memory/summarizeThread.md +3 -3
  148. package/.docs/reference/observability/feedback.md +1 -1
  149. package/.docs/reference/observability/metrics/automatic-metrics.md +7 -7
  150. package/.docs/reference/observability/tracing/bridges/datadog.md +2 -2
  151. package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +3 -3
  152. package/.docs/reference/observability/tracing/exporters/default-exporter.md +1 -1
  153. package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +4 -4
  154. package/.docs/reference/observability/tracing/exporters/mastra-storage-exporter.md +1 -1
  155. package/.docs/reference/observability/tracing/interfaces.md +1 -1
  156. package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +1 -1
  157. package/.docs/reference/observability/tracing/span-filtering.md +1 -1
  158. package/.docs/reference/processors/cost-guard-processor.md +1 -1
  159. package/.docs/reference/processors/pii-detector.md +1 -1
  160. package/.docs/reference/processors/processor-interface.md +12 -12
  161. package/.docs/reference/processors/prompt-injection-detector.md +1 -1
  162. package/.docs/reference/processors/provider-history-compat.md +1 -1
  163. package/.docs/reference/processors/regex-filter-processor.md +1 -1
  164. package/.docs/reference/processors/response-cache.md +8 -8
  165. package/.docs/reference/processors/system-prompt-scrubber.md +1 -1
  166. package/.docs/reference/processors/token-limiter-processor.md +1 -1
  167. package/.docs/reference/processors/tool-search-processor.md +7 -7
  168. package/.docs/reference/processors/unicode-normalizer.md +1 -1
  169. package/.docs/reference/project-structure.md +1 -1
  170. package/.docs/reference/pubsub/base.md +4 -4
  171. package/.docs/reference/pubsub/google-cloud-pubsub.md +2 -2
  172. package/.docs/reference/pubsub/lease-provider.md +4 -4
  173. package/.docs/reference/pubsub/redis-streams.md +1 -1
  174. package/.docs/reference/pubsub/unix-socket-pubsub.md +1 -1
  175. package/.docs/reference/rag/chunk.md +5 -5
  176. package/.docs/reference/rag/database-config.md +2 -2
  177. package/.docs/reference/rag/metadata-filters.md +2 -2
  178. package/.docs/reference/schedules/overview.md +1 -1
  179. package/.docs/reference/server/register-api-route.md +1 -1
  180. package/.docs/reference/server/routes.md +1 -1
  181. package/.docs/reference/signals/signal-provider.md +8 -8
  182. package/.docs/reference/storage/clickhouse.md +4 -4
  183. package/.docs/reference/storage/cloudflare-d1.md +4 -4
  184. package/.docs/reference/storage/convex.md +4 -4
  185. package/.docs/reference/storage/dsql.md +2 -2
  186. package/.docs/reference/storage/dynamodb.md +7 -7
  187. package/.docs/reference/storage/lance.md +1 -1
  188. package/.docs/reference/storage/mongodb.md +1 -1
  189. package/.docs/reference/storage/mssql.md +1 -1
  190. package/.docs/reference/storage/postgresql.md +1 -1
  191. package/.docs/reference/storage/retention.md +33 -33
  192. package/.docs/reference/storage/spanner.md +8 -8
  193. package/.docs/reference/streaming/ChunkType.md +2 -2
  194. package/.docs/reference/streaming/agents/MastraModelOutput.md +1 -1
  195. package/.docs/reference/streaming/agents/stream.md +1 -1
  196. package/.docs/reference/streaming/agents/streamUntilIdle.md +2 -2
  197. package/.docs/reference/streaming/workflows/observeStream.md +1 -1
  198. package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
  199. package/.docs/reference/streaming/workflows/stream.md +1 -1
  200. package/.docs/reference/streaming/workflows/timeTravelStream.md +2 -2
  201. package/.docs/reference/templates/overview.md +1 -1
  202. package/.docs/reference/tools/brightdata.md +1 -1
  203. package/.docs/reference/tools/create-tool.md +1 -1
  204. package/.docs/reference/tools/graph-rag-tool.md +1 -1
  205. package/.docs/reference/tools/mcp-client.md +13 -13
  206. package/.docs/reference/tools/mcp-server.md +20 -20
  207. package/.docs/reference/tools/submit-plan-tool.md +1 -1
  208. package/.docs/reference/tools/tavily.md +1 -1
  209. package/.docs/reference/tools/vector-query-tool.md +4 -4
  210. package/.docs/reference/vectors/astra.md +1 -1
  211. package/.docs/reference/vectors/chroma.md +2 -2
  212. package/.docs/reference/vectors/convex.md +2 -2
  213. package/.docs/reference/vectors/couchbase.md +4 -4
  214. package/.docs/reference/vectors/libsql.md +1 -1
  215. package/.docs/reference/vectors/mongodb.md +1 -1
  216. package/.docs/reference/vectors/pg.md +4 -4
  217. package/.docs/reference/vectors/qdrant.md +2 -2
  218. package/.docs/reference/vectors/s3vectors.md +4 -4
  219. package/.docs/reference/vectors/turbopuffer.md +1 -1
  220. package/.docs/reference/voice/aws-nova-sonic.md +1 -1
  221. package/.docs/reference/voice/azure.md +1 -1
  222. package/.docs/reference/voice/google-gemini-live.md +4 -4
  223. package/.docs/reference/voice/inworld-realtime.md +7 -7
  224. package/.docs/reference/voice/livekit.md +13 -13
  225. package/.docs/reference/voice/mistral.md +1 -1
  226. package/.docs/reference/voice/openai-realtime.md +1 -1
  227. package/.docs/reference/voice/sarvam.md +1 -1
  228. package/.docs/reference/voice/voice.addTools.md +1 -1
  229. package/.docs/reference/voice/voice.events.md +1 -1
  230. package/.docs/reference/voice/voice.getSpeakers.md +2 -2
  231. package/.docs/reference/voice/voice.on.md +2 -2
  232. package/.docs/reference/voice/xai-realtime.md +2 -2
  233. package/.docs/reference/workflows/run-methods/cancel.md +1 -1
  234. package/.docs/reference/workflows/run-methods/startAsync.md +1 -1
  235. package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
  236. package/.docs/reference/workflows/workflow-methods/foreach.md +1 -1
  237. package/.docs/reference/workflows/workflow-methods/sleep.md +1 -1
  238. package/.docs/reference/workflows/workflow-state-reader.md +2 -2
  239. package/.docs/reference/workspace/apple-container-sandbox.md +2 -2
  240. package/.docs/reference/workspace/daytona-sandbox.md +3 -3
  241. package/.docs/reference/workspace/docker-sandbox.md +2 -2
  242. package/.docs/reference/workspace/e2b-sandbox.md +2 -2
  243. package/.docs/reference/workspace/files-sdk-filesystem.md +3 -3
  244. package/.docs/reference/workspace/google-drive-filesystem.md +4 -4
  245. package/.docs/reference/workspace/local-filesystem.md +2 -2
  246. package/.docs/reference/workspace/local-sandbox.md +2 -2
  247. package/.docs/reference/workspace/modal-sandbox.md +1 -1
  248. package/.docs/reference/workspace/platform-filesystem.md +3 -3
  249. package/.docs/reference/workspace/platform-sandbox.md +2 -2
  250. package/.docs/reference/workspace/process-manager.md +1 -1
  251. package/.docs/reference/workspace/railway-sandbox.md +4 -4
  252. package/.docs/reference/workspace/s3-filesystem.md +1 -1
  253. package/.docs/reference/workspace/sandbox.md +1 -1
  254. package/.docs/reference/workspace/vercel-sandbox.md +1 -1
  255. package/.docs/reference/workspace/workspace-class.md +10 -10
  256. package/CHANGELOG.md +7 -0
  257. package/package.json +5 -5
@@ -2,7 +2,7 @@
2
2
 
3
3
  # .chunk()
4
4
 
5
- The `.chunk()` function splits documents into smaller segments using various strategies and options.
5
+ The `.chunk()` function splits documents into smaller segments using strategies and options.
6
6
 
7
7
  ## Example
8
8
 
@@ -39,11 +39,11 @@ const chunksWithMetadata = await doc.chunk({
39
39
 
40
40
  ## Parameters
41
41
 
42
- The following parameters are available for all chunking strategies. **Important:** Each strategy will only utilize a subset of these parameters relevant to its specific use case.
42
+ The following parameters are available for all chunking strategies. Each strategy will only utilize a subset of these parameters relevant to its specific use case.
43
43
 
44
44
  **strategy** (`'recursive' | 'character' | 'token' | 'markdown' | 'semantic-markdown' | 'html' | 'json' | 'latex' | 'sentence'`): The chunking strategy to use. If not specified, defaults based on document type. Depending on the chunking strategy, there are additional optionals. Defaults: .md files → 'markdown', .html/.htm → 'html', .json → 'json', .tex → 'latex', others → 'recursive'
45
45
 
46
- **maxSize** (`number`): Maximum size of each chunk. \*\*Note:\*\* Some strategy configurations (markdown with headers, HTML with headers) ignore this parameter. (Default: `4000`)
46
+ **maxSize** (`number`): Maximum size of each chunk. Some strategy configurations (markdown with headers, HTML with headers) ignore this parameter. (Default: `4000`)
47
47
 
48
48
  **overlap** (`number`): Number of characters/tokens that overlap between chunks. (Default: `50`)
49
49
 
@@ -162,7 +162,7 @@ The options documented below are passed directly at the top level of the configu
162
162
 
163
163
  **returnEachLine** (`boolean`): Whether to return each line as a separate chunk
164
164
 
165
- **Important:** When using the HTML strategy, all general options are ignored. Use `headers` for header-based splitting or `sections` for section-based splitting. If used together, `sections` will be ignored.
165
+ When using the HTML strategy, all general options are ignored. Use `headers` for header-based splitting or `sections` for section-based splitting. If used together, `sections` will be ignored.
166
166
 
167
167
  ### Markdown
168
168
 
@@ -172,7 +172,7 @@ The options documented below are passed directly at the top level of the configu
172
172
 
173
173
  **returnEachLine** (`boolean`): Whether to return each line as a separate chunk
174
174
 
175
- **Important:** When using the `headers` option, the markdown strategy ignores all general options and content is split based on the markdown header structure. To use size-based chunking with markdown, omit the `headers` parameter.
175
+ When using the `headers` option, the markdown strategy ignores all general options and content is split based on the markdown header structure. To use size-based chunking with markdown, omit the `headers` parameter.
176
176
 
177
177
  ### Semantic Markdown
178
178
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # DatabaseConfig
4
4
 
5
- The `DatabaseConfig` type allows you to specify database-specific configurations when using vector query tools. These configurations enable you to leverage unique features and optimizations offered by different vector stores.
5
+ The `DatabaseConfig` type allows you to specify database-specific configurations when using vector query tools. These configurations enable you to use features and optimizations offered by different vector stores.
6
6
 
7
7
  ## Type definition
8
8
 
@@ -252,7 +252,7 @@ const vectorTool = createVectorQueryTool({
252
252
  1. **Environment Configuration**: Use different namespaces or configurations for different environments
253
253
  2. **Performance Tuning**: Start with default values and adjust based on your specific needs
254
254
  3. **Quality Filtering**: Use minScore to filter out low-quality results
255
- 4. **Runtime Flexibility**: Override configurations at runtime for dynamic scenarios
255
+ 4. **Runtime Flexibility**: Override configurations at runtime for runtime-defined scenarios
256
256
  5. **Documentation**: Document your specific configuration choices for team members
257
257
 
258
258
  ## Migration guide
@@ -194,8 +194,8 @@ const results = await store.query({
194
194
 
195
195
  - Equality values must be primitives (string/number/boolean). `null`/`undefined`, arrays, objects, and Date aren't allowed for equality. Range operators accept numbers or Date (Dates are normalized to epoch ms).
196
196
  - `$in`/`$nin` require **non-empty arrays of primitives**; Date elements are allowed and normalized to epoch ms. **Array equality** isn't supported.
197
- - Implicit AND is canonicalized (`{a:1,b:2}` → `{$and:[{a:1},{b:2}]}`). Logical operators must contain field conditions, use non-empty arrays, and appear only at the root or within other logical operators (not inside field values).
198
- - Keys listed in `nonFilterableMetadataKeys` at index creation are stored but not filterable; this setting is immutable.
197
+ - Implicit AND is canonicalized (`{a:1,b:2}` → `{$and:[{a:1},{b:2}]`). Logical operators must contain field conditions and use non-empty arrays. They may appear only at the root or within other logical operators (not inside field values).
198
+ - Keys listed in `nonFilterableMetadataKeys` at index creation are stored but not filterable. This setting is immutable.
199
199
  - $exists requires a boolean value.
200
200
  - undefined/null/empty filters are treated as no filter.
201
201
  - Each metadata key name limited to 63 characters.
@@ -150,7 +150,7 @@ const updated = await mastra.schedules.update('pinger', {
150
150
  })
151
151
  ```
152
152
 
153
- Agent schedule patches can update `cron`, `timezone`, `prompt`, `name`, `signalType`, `tagName`, `attributes`, `providerOptions`, `ifActive`, `ifIdle`, `metadata`, and `status`. `threadId` and `resourceId` aren't patchable; create a new schedule when the thread target needs to change.
153
+ Agent schedule patches can update `cron`, `timezone`, `prompt`, `name`, `signalType`, `tagName`, `attributes`, `providerOptions`, `ifActive`, `ifIdle`, `metadata`, and `status`. `threadId` and `resourceId` aren't patchable. Create a new schedule when the thread target needs to change.
154
154
 
155
155
  Workflow schedule patches can update `cron`, `timezone`, `inputData`, `initialState`, `requestContext`, `metadata`, and `status`. Agent-only patch fields such as `prompt`, `signalType`, and `ifIdle` throw on workflow schedules.
156
156
 
@@ -20,7 +20,7 @@ The URL path for the route. Supports path parameters using `:param` syntax.
20
20
  registerApiRoute("/items/:itemId", { ... })
21
21
  ```
22
22
 
23
- **Note:** Custom route paths can't start with the server's configured `apiPrefix` (default: `/api`), as that prefix is reserved for built-in Mastra routes. If you set a custom `apiPrefix`, only that prefix is reserved for example, with `apiPrefix: '/mastra/api'`, paths like `/api/my-endpoint` are allowed.
23
+ Custom route paths can't start with the server's configured `apiPrefix` (default: `/api`), as that prefix is reserved for built-in Mastra routes. If you set a custom `apiPrefix`, only that prefix is reserved. For example, with `apiPrefix: '/mastra/api'`, paths like `/api/my-endpoint` are allowed.
24
24
 
25
25
  ### options
26
26
 
@@ -28,7 +28,7 @@ Server adapters register these routes when you call `server.init()`. All routes
28
28
  | Parameter | Type | Default | Description |
29
29
  | ----------- | ------------------------ | --------- | ---------------------------------------------------------------------------------------------------------------------- |
30
30
  | `status` | `'draft' \| 'published'` | `'draft'` | Which stored version to resolve. `draft` returns the latest version, `published` returns the active published version. |
31
- | `versionId` | `string` | | A specific version ID to resolve. Takes precedence over `status`. |
31
+ | `versionId` | `string` | None | A specific version ID to resolve. Takes precedence over `status`. |
32
32
 
33
33
  ```bash
34
34
  # Get agent with latest draft overrides (default)
@@ -51,7 +51,7 @@ const agent = new Agent({
51
51
  })
52
52
  ```
53
53
 
54
- The agent calls `connect(this)`, registers any processors or tools the provider returns, and starts polling.
54
+ The agent calls `connect(this)` and registers any processors or tools the provider returns. It then starts polling.
55
55
 
56
56
  ## Constructor parameters
57
57
 
@@ -142,7 +142,7 @@ Returns: `Record<string, unknown>`
142
142
 
143
143
  #### `subscribe(target, externalResourceId, metadata?)`
144
144
 
145
- Subscribe a thread to an external resource. This is a protected method call it from within your provider implementation.
145
+ Subscribe a thread to an external resource. This is a protected method: call it from within your provider implementation.
146
146
 
147
147
  ```typescript
148
148
  const sub = this.subscribe(
@@ -152,7 +152,7 @@ const sub = this.subscribe(
152
152
  )
153
153
  ```
154
154
 
155
- Returns: `SignalSubscription` the created subscription, or the existing one with merged metadata.
155
+ Returns: `SignalSubscription`: the created subscription, or the existing one with merged metadata.
156
156
 
157
157
  **target** (`SignalProviderTarget`): The thread to subscribe. Must include threadId and resourceId.
158
158
 
@@ -171,7 +171,7 @@ const removed = this.unsubscribe(
171
171
  )
172
172
  ```
173
173
 
174
- Returns: `boolean` `true` if removed, `false` if no matching subscription existed.
174
+ Returns: `boolean`: `true` if removed, `false` if no matching subscription existed.
175
175
 
176
176
  #### `getSubscriptions()`
177
177
 
@@ -235,7 +235,7 @@ const removed = this.unsubscribeAll({
235
235
  })
236
236
  ```
237
237
 
238
- Returns: `number` count of removed subscriptions.
238
+ Returns: `number`: count of removed subscriptions.
239
239
 
240
240
  #### `subscriptionCount`
241
241
 
@@ -253,7 +253,7 @@ Returns: `number`
253
253
 
254
254
  #### `poll(subscriptions)`
255
255
 
256
- Called on each poll cycle with all active subscriptions. Override to check external sources and emit notifications. The framework prevents overlapping poll cycles if a `poll()` call takes longer than `pollInterval`, the next cycle is skipped.
256
+ Called on each poll cycle with all active subscriptions. Override to check external sources and emit notifications. The framework prevents overlapping poll cycles: if a `poll()` call takes longer than `pollInterval`, the next cycle is skipped.
257
257
 
258
258
  ```typescript
259
259
  async poll(subscriptions: SignalSubscription[]) {
@@ -271,7 +271,7 @@ async poll(subscriptions: SignalSubscription[]) {
271
271
 
272
272
  #### `startPolling()`
273
273
 
274
- Start the polling timer. Called by the Agent after `connect()`. Idempotent calling multiple times has no effect.
274
+ Start the polling timer. Called by the Agent after `connect()`. Idempotent: calling multiple times has no effect.
275
275
 
276
276
  ```typescript
277
277
  provider.startPolling()
@@ -289,7 +289,7 @@ provider.stopPolling()
289
289
 
290
290
  #### `handleWebhook(request)`
291
291
 
292
- Handle an incoming webhook request. Override to parse the payload, match it to subscriptions, and emit notification signals. See [`WebhookSignalProvider`](https://mastra.ai/reference/signals/webhook-signal-provider) for a ready-to-use implementation.
292
+ Handle an incoming webhook request. Override to parse the payload and match it to subscriptions. Then emit notification signals. See [`WebhookSignalProvider`](https://mastra.ai/reference/signals/webhook-signal-provider) for a ready-to-use implementation.
293
293
 
294
294
  ```typescript
295
295
  async handleWebhook(request) {
@@ -129,7 +129,7 @@ yarn dlx mastra migrate
129
129
  bun x mastra migrate
130
130
  ```
131
131
 
132
- The migration copies span data from `mastra_ai_spans` into `mastra_span_events` in day-sized batches. It handles column mapping, deduplicates legacy rows, and preserves the original table as a backup. After migration, traces appear in Studio through the vNext adapter.
132
+ The migration copies span data from `mastra_ai_spans` into `mastra_span_events` in day-sized batches. It handles column mapping and deduplicates legacy rows. The original table remains as a backup. After migration, traces appear in Studio through the vNext adapter.
133
133
 
134
134
  > **Note:** The legacy table isn't deleted. Drop it manually after verifying the migration.
135
135
 
@@ -261,7 +261,7 @@ Set `cluster` to add `ON CLUSTER` to Mastra-owned DDL such as table creation, ma
261
261
 
262
262
  Manual maintenance such as `optimizeTable()` and `materializeTtl()` runs on every replica when `cluster` is set. These operations can be expensive on a large cluster. Prefer running them outside peak hours, and let routine merges happen on the background merge queue rather than triggering them on every restart.
263
263
 
264
- If existing Mastra tables use local `MergeTree` or `ReplacingMergeTree` engines, initialization fails while `replication` is enabled. Mastra refuses to silently convert local tables because copy-and-swap is unsafe across replicas. To migrate, recreate the affected tables as `Replicated*` before enabling replication. The typical sequence is: rename the local table, run `CREATE TABLE ... ENGINE = ReplicatedMergeTree(...) ON CLUSTER ...`, run `INSERT INTO ... SELECT * FROM <renamed_local>`, then drop the renamed local table.
264
+ If existing Mastra tables use local `MergeTree` or `ReplacingMergeTree` engines, initialization fails while `replication` is enabled. Mastra refuses to silently convert local tables because copy-and-swap is unsafe across replicas. To migrate, recreate the affected tables as `Replicated*` before enabling replication. To migrate safely, rename the local table, run `CREATE TABLE ... ENGINE = ReplicatedMergeTree(...) ON CLUSTER ...`, run `INSERT INTO ... SELECT * FROM <renamed_local>`, then drop `<renamed_local>`.
265
265
 
266
266
  Don't set `replication` on ClickHouse Cloud. Cloud rewrites `MergeTree` to `SharedMergeTree` server-side, and explicit `ReplicatedMergeTree` engines produce incorrect DDL. `replication` is only for self-managed multi-replica clusters.
267
267
 
@@ -271,7 +271,7 @@ Don't set `replication` on ClickHouse Cloud. Cloud rewrites `MergeTree` to `Shar
271
271
 
272
272
  ## Hosting options
273
273
 
274
- ClickHouse runs anywhere you can reach it over HTTP. Two common choices:
274
+ ClickHouse runs anywhere you can reach it over HTTP. Common choices include:
275
275
 
276
276
  - **[ClickHouse Cloud](https://clickhouse.com/cloud)**: Managed service with a free trial tier. Provides connection details directly compatible with `url`, `username`, and `password`.
277
277
  - **Self-hosted**: Run the official [`clickhouse/clickhouse-server`](https://hub.docker.com/r/clickhouse/clickhouse-server) container or install from the [official packages](https://clickhouse.com/docs/en/install). Suitable for VPS, dedicated hardware, or Kubernetes.
@@ -333,7 +333,7 @@ export const mastra = new Mastra({
333
333
  })
334
334
  ```
335
335
 
336
- Two ways to provision the database:
336
+ Provision the database with either option:
337
337
 
338
338
  - **Managed**: Use ClickHouse Cloud. Set `CLICKHOUSE_URL`, `CLICKHOUSE_USERNAME`, and `CLICKHOUSE_PASSWORD` as environment variables in your hosting platform.
339
339
  - **Self-hosted on Railway**: Add a ClickHouse service to your Railway project from the official Docker image, then reference it in the application service through Railway's private networking.
@@ -61,11 +61,11 @@ export const mastra = new Mastra({
61
61
  })
62
62
  ```
63
63
 
64
- > **Note:** When using `import { env } from 'cloudflare:workers'`, `D1Store` must be initialized inline inside `new Mastra({...})` not extracted to a module-level variable. Alternatively, initialize `D1Store` inside the `fetch` handler after `env` is available. See [CloudflareDeployer reference](https://mastra.ai/reference/deployer/cloudflare) for details.
64
+ > **Note:** When using `import { env } from 'cloudflare:workers'`, `D1Store` must be initialized inline inside `new Mastra({...})`: not extracted to a module-level variable. Alternatively, initialize `D1Store` inside the `fetch` handler after `env` is available. See [CloudflareDeployer reference](https://mastra.ai/reference/deployer/cloudflare) for details.
65
65
 
66
66
  ### Using in a Cloudflare Worker without HTTP routes
67
67
 
68
- If you want to call Mastra directly in a Worker for example, to run an agent or trigger a workflow without serving HTTP routes, you don't need `CloudflareDeployer`. Access the D1 binding from the worker's `env` parameter and call Mastra programmatically.
68
+ If you want to call Mastra directly in a Worker (for example, to run an agent or trigger a workflow) without serving HTTP routes, you don't need `CloudflareDeployer`. Access the D1 binding from the worker's `env` parameter and call Mastra programmatically.
69
69
 
70
70
  ```typescript
71
71
  import { D1Store } from '@mastra/cloudflare-d1'
@@ -213,8 +213,8 @@ export default {
213
213
 
214
214
  ### Transactions & Consistency
215
215
 
216
- Cloudflare D1 provides transactional guarantees for single-row operations. This means that multiple operations can be executed as a single, all-or-nothing unit of work.
216
+ Cloudflare D1 provides transactional guarantees for single-row operations. Multiple operations can be executed as a single, all-or-nothing unit of work.
217
217
 
218
218
  ### Table Creation & Migrations
219
219
 
220
- Tables are created automatically when storage is initialized (and can be isolated per environment using the `tablePrefix` option), but advanced schema changes—such as adding columns, changing data types, or modifying indexes—require manual migration and careful planning to avoid data loss.
220
+ Tables are created automatically when storage is initialized (and can be isolated per environment using the `tablePrefix` option), but advanced schema changes require manual migration and careful planning. Examples include adding columns or changing data types and indexes to avoid data loss.
@@ -182,7 +182,7 @@ During batched cleanup, cache metadata can temporarily use an internal `deleted`
182
182
 
183
183
  `clear()` only removes rows whose stored `keyPrefix` exactly matches the configured `keyPrefix`. It doesn't clear nested prefixes by string prefix matching. Each `listPush()` refreshes the list TTL using the cache's configured `ttlMs`.
184
184
 
185
- Use a non-empty `keyPrefix` unless you intentionally want `clear()` to remove every cache key in the deployment. Expired list rows are reclaimed incrementally during reads and writes; `clear()` removes all rows for the prefix.
185
+ Use a non-empty `keyPrefix` unless you intentionally want `clear()` to remove every cache key in the deployment. Expired list rows are reclaimed incrementally during reads and writes. `clear()` removes all rows for the prefix.
186
186
 
187
187
  `ConvexServerCache` works best for durable replay of moderate-frequency events. For high-frequency token streams, prefer batching events or using a lower-latency cache backend.
188
188
 
@@ -217,14 +217,14 @@ All typed tables include:
217
217
  - An `id` field for Mastra's record ID (distinct from Convex's auto-generated `_id`)
218
218
  - A `by_record_id` index for efficient lookups by Mastra ID
219
219
 
220
- This design ensures compatibility with Mastra's storage contract while leveraging Convex's automatic indexing and real-time capabilities.
220
+ This design ensures compatibility with Mastra's storage contract while using Convex's automatic indexing and real-time capabilities.
221
221
 
222
222
  ### Environment variables
223
223
 
224
224
  Set these environment variables for your deployment:
225
225
 
226
- - `CONVEX_URL` Your Convex deployment URL
227
- - `CONVEX_ADMIN_KEY` Admin authentication token (get from Convex dashboard)
226
+ - `CONVEX_URL`: Your Convex deployment URL
227
+ - `CONVEX_ADMIN_KEY`: Admin authentication token (get from Convex dashboard)
228
228
 
229
229
  ## Related
230
230
 
@@ -183,7 +183,7 @@ storage.db // Database client for executing queries
183
183
  storage.pool // Underlying pg.Pool instance
184
184
  ```
185
185
 
186
- This enables direct queries and custom transaction management. When using these fields:
186
+ It supports direct queries and custom transaction management. When using these fields:
187
187
 
188
188
  - You are responsible for proper connection and transaction handling.
189
189
  - Closing the store (`storage.close()`) will destroy the connection pool if it was created by the store.
@@ -199,7 +199,7 @@ Connections are authenticated with IAM. No database passwords are required. `@ma
199
199
 
200
200
  #### Single database, schema-based isolation
201
201
 
202
- Each cluster exposes a single database named `postgres`. Logical separation is done via schemas. The `schemaName` option controls where Mastra tables are created.
202
+ Each cluster exposes a single database `postgres`. Logical separation is done via schemas. The `schemaName` option controls where Mastra tables are created.
203
203
 
204
204
  #### No PostgreSQL extensions
205
205
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # DynamoDB storage
4
4
 
5
- The DynamoDB storage implementation provides a scalable and performant NoSQL database solution for Mastra, leveraging a single-table design pattern with [ElectroDB](https://electrodb.dev/).
5
+ The DynamoDB storage implementation provides a high-capacity and performant NoSQL database solution for Mastra, using a single-table design pattern with [ElectroDB](https://electrodb.dev/).
6
6
 
7
7
  > **Observability Not Supported:** DynamoDB storage **doesn't support the observability domain**. Traces from the `MastraStorageExporter` can't be persisted to DynamoDB, and [Studio's](https://mastra.ai/docs/studio/overview) observability features won't work with DynamoDB as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse.
8
8
 
@@ -124,7 +124,7 @@ For local development, you can use [DynamoDB Local](https://docs.aws.amazon.com/
124
124
 
125
125
  ## TTL (time to live) configuration
126
126
 
127
- DynamoDB TTL allows you to automatically delete items after a specified time period. This is useful for:
127
+ DynamoDB TTL allows you to automatically delete items after a specified duration for these use cases:
128
128
 
129
129
  - **Cost optimization**: Automatically remove old data to reduce storage costs
130
130
  - **Data lifecycle management**: Implement retention policies for compliance
@@ -259,19 +259,19 @@ Before diving into the architectural details, keep these key points in mind when
259
259
 
260
260
  ## Architectural approach
261
261
 
262
- This storage adapter utilizes a **single-table design pattern** leveraging [ElectroDB](https://electrodb.dev/), a common and recommended approach for DynamoDB. This differs architecturally from relational database adapters (like `@mastra/pg` or `@mastra/libsql`) that typically use multiple tables, each dedicated to a specific entity (threads, messages, etc.).
262
+ This storage adapter utilizes a **single-table design pattern** with [ElectroDB](https://electrodb.dev/), a common and recommended approach for DynamoDB. This differs architecturally from relational database adapters (like `@mastra/pg` or `@mastra/libsql`) that typically use multiple tables, each dedicated to a specific entity (threads, messages, etc.).
263
263
 
264
264
  Key aspects of this approach:
265
265
 
266
- - **DynamoDB Native:** The single-table design is optimized for DynamoDB's key-value and query capabilities, often leading to better performance and scalability compared to mimicking relational models.
266
+ - **DynamoDB Native:** The single-table design is optimized for DynamoDB's key-value and query capabilities, often leading to better performance and capacity compared to mimicking relational models.
267
267
  - **External Table Management:** Unlike some adapters that might offer helper functions to create tables via code, this adapter **expects the DynamoDB table and its associated Global Secondary Indexes (GSIs) to be provisioned externally** before use. Please refer to [TABLE\_SETUP.md](https://github.com/mastra-ai/mastra/blob/main/stores/dynamodb/TABLE_SETUP.md) for detailed instructions using tools like AWS CloudFormation or CDK. The adapter focuses solely on interacting with the pre-existing table structure.
268
268
  - **Consistency via Interface:** While the underlying storage model differs, this adapter adheres to the same `MastraStorage` interface as other adapters, ensuring it can be used interchangeably within the Mastra `Memory` component.
269
269
 
270
270
  ### Mastra Data in the Single Table
271
271
 
272
- Within the single DynamoDB table, different Mastra data entities (such as Threads, Messages, Traces, Evals, and Workflows) are managed and distinguished using ElectroDB. ElectroDB defines specific models for each entity type, which include unique key structures and attributes. This allows the adapter to store and retrieve diverse data types efficiently within the same table.
272
+ Within the single DynamoDB table, different Mastra data entities (such as Threads, Messages, Traces, Evals, and Workflows) are managed and distinguished using ElectroDB. ElectroDB defines specific models for each entity type, which include unique key structures and attributes. It allows the adapter to store and retrieve diverse data types efficiently within the same table.
273
273
 
274
- For example, a `Thread` item might have a primary key like `THREAD#<threadId>`, while a `Message` item belonging to that thread might use `THREAD#<threadId>` as a partition key and `MESSAGE#<messageId>` as a sort key. The Global Secondary Indexes (GSIs), detailed in `TABLE_SETUP.md`, are strategically designed to support common access patterns across these different entities, such as fetching all messages for a thread or querying traces associated with a particular workflow.
274
+ For example, a `Thread` item might have a primary key like `THREAD#<threadId>`, while a `Message` item belonging to that thread might use `THREAD#<threadId>` as a partition key and `MESSAGE#<messageId>` as a sort key. The Global Secondary Indexes (GSIs), detailed in `TABLE_SETUP.md`, are strategically designed to support common access patterns across these different entities, such as fetching all messages for a thread or querying traces associated with a workflow.
275
275
 
276
276
  ### Advantages of Single-Table Design
277
277
 
@@ -279,6 +279,6 @@ This implementation uses a single-table design pattern with ElectroDB, which off
279
279
 
280
280
  1. **Lower cost (potentially):** Fewer tables can simplify Read/Write Capacity Unit (RCU/WCU) provisioning and management, especially with on-demand capacity.
281
281
  2. **Better performance:** Related data can be co-located or accessed efficiently through GSIs, enabling fast lookups for common access patterns.
282
- 3. **Simplified administration:** Fewer distinct tables to monitor, back up, and manage.
282
+ 3. **Simplified administration:** Fewer distinct tables to monitor and back up, with less to manage.
283
283
  4. **Reduced complexity in access patterns:** ElectroDB helps manage the complexity of item types and access patterns on a single table.
284
284
  5. **Transaction support:** DynamoDB transactions can be used across different "entity" types stored within the same table if needed.
@@ -117,7 +117,7 @@ LanceDB storage can be configured for different deployment scenarios:
117
117
  ```text
118
118
  db://host:port
119
119
  ```
120
- - **S3 Storage**: Use Amazon S3 for scalable cloud storage
120
+ - **S3 Storage**: Use Amazon S3 for high-capacity cloud storage
121
121
  ```text
122
122
  s3://bucket/db
123
123
  ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MongoDB storage
4
4
 
5
- The MongoDB storage implementation provides a scalable storage solution using MongoDB databases with support for both document storage and vector operations.
5
+ The MongoDB storage implementation provides a high-capacity storage solution using MongoDB databases with support for both document storage and vector operations.
6
6
 
7
7
  ## Installation
8
8
 
@@ -150,7 +150,7 @@ const thread = await memoryStore?.getThreadById({ threadId: '...' })
150
150
  store.pool // mssql connection pool instance
151
151
  ```
152
152
 
153
- This enables direct queries and custom transaction management. When using these fields:
153
+ It supports direct queries and custom transaction management. When using these fields:
154
154
 
155
155
  - You are responsible for proper connection and transaction handling.
156
156
  - Closing the store (`store.close()`) will destroy the associated connection pool.
@@ -317,7 +317,7 @@ export const mastra = new Mastra({
317
317
  })
318
318
  ```
319
319
 
320
- This pattern ensures only one `PostgresStore` instance is created regardless of how many times the module is reloaded during development. The same pattern can be applied to other storage providers like `LibSQLStore`.
320
+ The pattern ensures only one `PostgresStore` instance is created regardless of how many times the module is reloaded during development. The same pattern can be applied to other storage providers like `LibSQLStore`.
321
321
 
322
322
  > **Tip:** This singleton pattern is only necessary during local development with HMR. In production builds, modules are only loaded once.
323
323
 
@@ -4,9 +4,9 @@
4
4
 
5
5
  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.
6
6
 
7
- `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.
7
+ `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.
8
8
 
9
- Retention covers **growth tables** only tables that accumulate rows unbounded as a side effect of normal operation (conversation history, telemetry, job and run records, schedule fire history, event feeds). User-authored artifacts and config (agents, skills, workspaces, prompt blocks, datasets, schedule definitions, channel installations, and so on) grow with user intent and are edited or deleted explicitly, so they're not valid retention keys.
9
+ Retention covers **growth tables** only: tables that accumulate rows unbounded as a side effect of normal operation (conversation history, telemetry, job and run records, schedule fire history, event feeds). User-authored artifacts and config (agents, skills, workspaces, prompt blocks, datasets, schedule definitions, channel installations, and so on) grow with user intent and are edited or deleted explicitly, so they're not valid retention keys.
10
10
 
11
11
  The reference implementations are [libSQL](https://mastra.ai/reference/storage/libsql), [PostgreSQL](https://mastra.ai/reference/storage/postgresql), and [MongoDB](https://mastra.ai/reference/storage/mongodb). Other adapters keep rows forever until they implement retention.
12
12
 
@@ -31,7 +31,7 @@ const storage = new LibSQLStore({
31
31
  },
32
32
  })
33
33
 
34
- // Wire this to your own cron/scheduler Mastra never runs it for you.
34
+ // Wire this to your own cron/scheduler: Mastra never runs it for you.
35
35
  const results = await storage.prune()
36
36
  ```
37
37
 
@@ -65,35 +65,35 @@ Set the `retention` field on the store config.
65
65
 
66
66
  ### Retention-eligible tables
67
67
 
68
- 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: creation time for append-only logs, last activity for live state, and completion time for jobs and runs (so in-flight work is never pruned).
69
-
70
- | Domain | Table key | Anchor column | `maxAge` measures |
71
- | ----------------- | ------------------ | ---------------- | ----------------------------------------------------------------- |
72
- | `memory` | `threads` | `createdAt` | Thread age |
73
- | `memory` | `messages` | `createdAt` | Message age |
74
- | `memory` | `resources` | `createdAt` | Resource age |
75
- | `threadState` | `threadState` | `updatedAt` | Inactivity state for still-active threads survives |
76
- | `observability` | `spans` | `startedAt` | Span age |
77
- | `observability` | `metrics` | `timestamp` | Metric event age (v-next only) |
78
- | `observability` | `logs` | `timestamp` | Log event age (v-next only) |
79
- | `observability` | `scores` | `timestamp` | Score event age (v-next only) |
80
- | `observability` | `feedback` | `timestamp` | Feedback event age (v-next only) |
81
- | `scores` | `scorers` | `createdAt` | Score record age |
82
- | `workflows` | `workflowSnapshot` | `updatedAt` | Inactivity suspended or long-running workflows survive |
83
- | `backgroundTasks` | `backgroundTasks` | `completedAt` | Time since completion in-flight tasks (`NULL`) are never pruned |
84
- | `experiments` | `experiments` | `completedAt` | Time since completion running experiments are never pruned |
85
- | `notifications` | `notifications` | `createdAt` | Notification age |
86
- | `harness` | `sessions` | `createdAt` | Session record age |
87
- | `schedules` | `triggers` | `actual_fire_at` | Fire-history age (epoch-ms column) |
68
+ 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.
69
+
70
+ | Domain | Table key | Anchor column | `maxAge` measures |
71
+ | ----------------- | ------------------ | ---------------- | ---------------------------------------------------------------- |
72
+ | `memory` | `threads` | `createdAt` | Thread age |
73
+ | `memory` | `messages` | `createdAt` | Message age |
74
+ | `memory` | `resources` | `createdAt` | Resource age |
75
+ | `threadState` | `threadState` | `updatedAt` | Inactivity: state for still-active threads survives |
76
+ | `observability` | `spans` | `startedAt` | Span age |
77
+ | `observability` | `metrics` | `timestamp` | Metric event age (v-next only) |
78
+ | `observability` | `logs` | `timestamp` | Log event age (v-next only) |
79
+ | `observability` | `scores` | `timestamp` | Score event age (v-next only) |
80
+ | `observability` | `feedback` | `timestamp` | Feedback event age (v-next only) |
81
+ | `scores` | `scorers` | `createdAt` | Score record age |
82
+ | `workflows` | `workflowSnapshot` | `updatedAt` | Inactivity, suspended or long-running workflows survive |
83
+ | `backgroundTasks` | `backgroundTasks` | `completedAt` | Time since completion, in-flight tasks (`NULL`) are never pruned |
84
+ | `experiments` | `experiments` | `completedAt` | Time since completion, running experiments are never pruned |
85
+ | `notifications` | `notifications` | `createdAt` | Notification age |
86
+ | `harness` | `sessions` | `createdAt` | Session record age |
87
+ | `schedules` | `triggers` | `actual_fire_at` | Fire-history age (epoch-ms column) |
88
88
 
89
89
  > **Note:**
90
90
  >
91
91
  > - The memory `observational_memory` table has no timestamp anchor, so it can't be age-pruned and isn't a valid retention key.
92
92
  > - Experiments prune as whole units: an aged experiment's result rows are deleted together with it (results cascade with their parent), so a run is never left partially deleted. Retention doesn't have a separate `results` key.
93
- > - For `schedules`, the growth table is the fire history (`schedule_triggers`, one row per fire) schedule definitions are config and aren't pruned.
93
+ > - For `schedules`, the growth table is the fire history (`schedule_triggers`, one row per fire): schedule definitions are config and aren't pruned.
94
94
  > - On PostgreSQL, timestamp anchors use the timezone-aware mirror columns (for example `createdAtZ`, `completedAtZ`).
95
95
  > - LibSQL supports all domains above; PostgreSQL and MongoDB support all except `threadState` and `harness`, which they don't implement.
96
- > - The v-next PostgreSQL observability domain stores signal events in day-partitioned tables (`spans`, `metrics`, `logs`, `scores`, `feedback`). For it, `prune()` drops whole day partitions (or TimescaleDB chunks) that are entirely older than the cutoff instead of deleting rows effective granularity is one day, and a partition is only dropped once its entire day is past `maxAge`. `PruneResult.deleted` reports the number of rows in the dropped partitions.
96
+ > - The v-next PostgreSQL observability domain stores signal events in day-partitioned tables (`spans`, `metrics`, `logs`, `scores`, `feedback`). For it, `prune()` drops whole day partitions (or TimescaleDB chunks) that are entirely older than the cutoff instead of deleting rows: effective level of detail is one day, and a partition is only dropped once its entire day is past `maxAge`. `PruneResult.deleted` reports the number of rows in the dropped partitions.
97
97
 
98
98
  ## Methods
99
99
 
@@ -103,11 +103,11 @@ Each domain declares which of its tables can be age-pruned and which timestamp c
103
103
 
104
104
  Deletes rows older than their configured `maxAge` across every domain that has a policy in `retention`. Returns one `PruneResult` per table touched. With no `retention` configured it's a no-op returning `[]`.
105
105
 
106
- `prune()` is designed to be safe on tables with millions of rows. It deletes in bounded, batched chunks each batch is its own transaction so it never takes a long lock or bloats the transaction log. It never runs a `VACUUM`.
106
+ `prune()` is designed to be safe on tables with millions of rows. It deletes in bounded, batched chunks (each batch is its own transaction) so it never takes a long lock or bloats the transaction log. It never runs a `VACUUM`.
107
107
 
108
- Pass `options.retention` to replace the configured policies for that call only for example to skip a domain (keep chat history) or prune more aggressively than the standing config. The store's configured `retention` is unchanged.
108
+ Pass `options.retention` to replace the configured policies for that call only: for example to skip a domain (keep chat history) or prune more aggressively than the standing config. The store's configured `retention` is unchanged.
109
109
 
110
- Anchor-column indexes are created lazily on the first `prune()` call for each table with a policy never at `init()` so deployments that don't configure retention pay no extra index write or disk overhead. The first prune of an existing large table pays a one-time index build; subsequent prunes reuse the index.
110
+ Anchor-column indexes are created lazily on the first `prune()` call for each table with a policy (never at `init()`) so deployments that don't configure retention pay no extra index write or disk overhead. The first prune of an existing large table pays a one-time index build. Subsequent prunes reuse the index.
111
111
 
112
112
  ```typescript
113
113
  const results = await storage.prune({
@@ -156,7 +156,7 @@ interface PruneResult {
156
156
 
157
157
  ## Running prune on a schedule
158
158
 
159
- `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.
159
+ `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.
160
160
 
161
161
  ```typescript
162
162
  // Runs on your own cron (node-cron, a workflow schedule, an external job, etc.).
@@ -173,7 +173,7 @@ async function retentionTick() {
173
173
  }
174
174
  ```
175
175
 
176
- You can also cancel a long-running prune with an `AbortSignal` the loop stops between batches and returns partial results with `done: false`, so the next run resumes cleanly.
176
+ You can also cancel a long-running prune with an `AbortSignal`: the loop stops between batches and returns partial results with `done: false`, so the next run resumes cleanly.
177
177
 
178
178
  ## MongoDB TTL indexes (alternative to prune)
179
179
 
@@ -192,7 +192,7 @@ MongoDB offers native [TTL (Time-To-Live) indexes](https://www.mongodb.com/docs/
192
192
  > - You need resumable, cancellable cleanup operations
193
193
  > - You're using composite storage with multiple databases
194
194
  >
195
- > Both approaches are valid. TTL is simpler; `prune()` gives more control.
195
+ > Both approaches are valid. TTL is simpler. `prune()` gives more control.
196
196
 
197
197
  ### Setting up TTL indexes on MongoDB
198
198
 
@@ -232,9 +232,9 @@ const storage = new MongoDBStore({
232
232
 
233
233
  ## Reclaiming disk
234
234
 
235
- `prune()` deletes rows but doesn't shrink the database file. On SQLite/libSQL the freed pages go on a freelist and are reused by future writes, so the file stops growing for most users this alone solves the unbounded-growth problem.
235
+ `prune()` deletes rows but doesn't shrink the database file. On SQLite/libSQL the freed pages go on a freelist and are reused by future writes, so the file stops growing: for most users this alone solves the unbounded-growth problem.
236
236
 
237
- Handing that free space back to the OS is a separate concern that Mastra doesn't manage. If you specifically need to shrink the file, run the underlying database's compaction (for example `VACUUM` on self-hosted libSQL) yourself, in a maintenance window a full `VACUUM` locks the file and needs roughly twice the file size in free disk. On PostgreSQL, autovacuum reclaims dead tuples for reuse automatically; a manual `VACUUM FULL` is only needed if you must return disk to the OS.
237
+ Handing that free space back to the OS is a separate concern that Mastra doesn't manage. If you specifically need to shrink the file, run the underlying database's compaction (for example `VACUUM` on self-hosted libSQL) yourself in a maintenance window. A full `VACUUM` locks the file and needs roughly twice the file size in free disk. On PostgreSQL, autovacuum reclaims dead tuples for reuse automatically; a manual `VACUUM FULL` is only needed if you must return disk to the OS.
238
238
 
239
239
  For MongoDB, deleted documents are reused by future insertions. To reclaim disk space, run [`db.runCommand({ compact: "collection_name" })`](https://www.mongodb.com/docs/manual/reference/command/compact/) during a maintenance window.
240
240
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Google Cloud Spanner storage
4
4
 
5
- The Google Cloud Spanner storage implementation provides a horizontally scalable, strongly consistent storage backend for Mastra. It targets the GoogleSQL dialect of Cloud Spanner.
5
+ The Google Cloud Spanner storage implementation provides a horizontally high-capacity, strongly consistent storage backend for Mastra. It targets the GoogleSQL dialect of Cloud Spanner.
6
6
 
7
7
  ## Installation
8
8
 
@@ -133,14 +133,14 @@ The storage adapter creates the following tables, all using the GoogleSQL dialec
133
133
 
134
134
  Tables are created with `STRING(MAX)` for text and JSON payloads, `INT64`, `FLOAT64`, `BOOL`, and `TIMESTAMP`.
135
135
 
136
- Two tables also carry Spanner-specific `STORED` generated columns that the adapter populates from JSON payloads so common filters can use a regular secondary index instead of a `JSON_VALUE` scan:
136
+ The following tables carry Spanner-specific `STORED` generated columns that the adapter populates from JSON payloads so common filters can use a regular secondary index instead of a `JSON_VALUE` scan:
137
137
 
138
- - `mastra_workflow_snapshot.snapshotStatus` extracts `$.status` from `snapshot`; backs `listWorkflowRuns({ status })`.
139
- - `mastra_schedules.target_workflow_id` extracts `$.workflowId` from `target`; backs `listSchedules({ workflowId })`.
138
+ - `mastra_workflow_snapshot.snapshotStatus`: Extracts `$.status` from `snapshot`. Backs `listWorkflowRuns({ status })`.
139
+ - `mastra_schedules.target_workflow_id`: Extracts `$.workflowId` from `target`. Backs `listSchedules({ workflowId })`.
140
140
 
141
141
  Both are added via `ALTER TABLE ... ADD COLUMN IF NOT EXISTS` during `init()` and skipped under `initMode: 'validate'` (where the schema is owned externally). When the column is absent, the adapter falls back to a `JSON_VALUE` filter at runtime.
142
142
 
143
- The adapter doesn't create or use named schemas; use a dedicated database for isolation.
143
+ The adapter doesn't create or use schemas. Use a dedicated database for isolation.
144
144
 
145
145
  ### Initialization
146
146
 
@@ -184,11 +184,11 @@ const thread = await memory?.getThreadById({ threadId: '...' })
184
184
  A few behaviors differ from other relational adapters:
185
185
 
186
186
  - Upserts use `INSERT OR UPDATE`. Spanner doesn't provide a `RETURNING` clause for upserts, so callers needing the post-write state must read it back.
187
- - No `TRUNCATE` exists; `dangerouslyClearAll()` issues `DELETE WHERE TRUE`.
187
+ - No `TRUNCATE` exists. `dangerouslyClearAll()` issues `DELETE WHERE TRUE`.
188
188
  - Identifiers are quoted with backticks.
189
189
  - DDL is applied through `database.updateSchema(...)`, which is asynchronous (long-running operation).
190
190
  - `NULLS FIRST/LAST` isn't supported. Ordering with NULL handling is emulated through an `IS NULL` ordering key.
191
- - JSON containment isn't supported natively. `listTraces` `metadata` and `scope` filters compile to per-key `JSON_VALUE(...) = @v` equality checks, and `tags` filters compile to `EXISTS` over `JSON_QUERY_ARRAY(...)`. This differs from Postgres' `@>` containment operator (which can match nested structure in a single index scan) most one-shot lookups still work but deeply nested structural matches aren't expressible.
191
+ - JSON containment isn't supported natively. `listTraces` `metadata` and `scope` filters compile to per-key `JSON_VALUE(...) = @v` equality checks, and `tags` filters compile to `EXISTS` over `JSON_QUERY_ARRAY(...)`. This differs from Postgres' `@>` containment operator (which can match nested structure in a single index scan): most one-shot lookups still work but deeply nested structural matches aren't expressible.
192
192
 
193
193
  ### Direct database access
194
194
 
@@ -217,4 +217,4 @@ gcloud spanner instances create test-instance --config=emulator-config --nodes=1
217
217
  gcloud spanner databases create test-db --instance=test-instance
218
218
  ```
219
219
 
220
- Then connect with the same env var set in your Node.js process; the `@google-cloud/spanner` client detects the emulator automatically.
220
+ Then connect with the same env var set in your Node.js process. The `@google-cloud/spanner` client detects the emulator automatically.
@@ -522,9 +522,9 @@ Emitted when the task throws or times out. Triggers a continuation turn when con
522
522
 
523
523
  ### background-task-suspended
524
524
 
525
- Emitted when a tool calls `suspend()` from inside its background execution. Pauses the task's workflow run with its snapshot persisted; resume with `mastra.backgroundTaskManager.resume(taskId, resumeData)`.
525
+ Emitted when a tool calls `suspend()` from inside its background execution. Pauses the task's workflow run with its snapshot persisted. Resume with `mastra.backgroundTaskManager.resume(taskId, resumeData)`.
526
526
 
527
- When consumed by [`Agent.streamUntilIdle()`](https://mastra.ai/reference/streaming/agents/streamUntilIdle), this chunk drops the task from the loop's wait set without queuing a continuation the agent's response ends, and the resumed task's eventual completion injects into the message list for the next user turn.
527
+ When consumed by [`Agent.streamUntilIdle()`](https://mastra.ai/reference/streaming/agents/streamUntilIdle), this chunk drops the task from the loop's wait set without queuing a continuation. The agent's response ends, and the resumed task's eventual completion injects into the message list for the next user turn.
528
528
 
529
529
  **type** (`"background-task-suspended"`): Chunk type identifier
530
530
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MastraModelOutput
4
4
 
5
- The `MastraModelOutput` class is returned by [.stream()](https://mastra.ai/reference/streaming/agents/stream) and provides both streaming and promise-based access to model outputs. It supports structured output generation, tool calls, reasoning, and comprehensive usage tracking.
5
+ The `MastraModelOutput` class is returned by [.stream()](https://mastra.ai/reference/streaming/agents/stream) and provides both streaming and promise-based access to model outputs. It supports structured output generation, tool calls, reasoning, and detailed usage tracking.
6
6
 
7
7
  ```typescript
8
8
  // MastraModelOutput is returned by agent.stream()
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Agent.stream()
4
4
 
5
- The `.stream()` method enables real-time streaming of responses from an agent with enhanced capabilities and format flexibility. This method accepts messages and optional streaming options, providing a next-generation streaming experience with support for both Mastra's native format and AI SDK v5+ compatibility.
5
+ The `.stream()` method enables real-time streaming of responses from an agent with enhanced capabilities and format flexibility. This method accepts messages and optional streaming options, providing a current streaming experience with support for both Mastra's native format and AI SDK v5+ compatibility.
6
6
 
7
7
  ## Usage example
8
8