@mastra/mcp-docs-server 1.1.7 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/.docs/docs/agents/agent-approval.md +61 -31
  2. package/.docs/docs/agents/supervisor-agents.md +1 -1
  3. package/.docs/docs/getting-started/manual-install.md +1 -1
  4. package/.docs/docs/index.md +68 -24
  5. package/.docs/docs/mastra-cloud/setup.md +1 -1
  6. package/.docs/docs/memory/observational-memory.md +9 -0
  7. package/.docs/docs/memory/semantic-recall.md +17 -1
  8. package/.docs/docs/workspace/skills.md +7 -5
  9. package/.docs/guides/deployment/aws-lambda.md +76 -165
  10. package/.docs/guides/deployment/azure-app-services.md +38 -61
  11. package/.docs/guides/deployment/cloudflare.md +1 -1
  12. package/.docs/guides/deployment/netlify.md +1 -1
  13. package/.docs/guides/deployment/vercel.md +1 -1
  14. package/.docs/models/gateways/netlify.md +5 -1
  15. package/.docs/models/index.md +1 -1
  16. package/.docs/models/providers/anthropic.md +9 -9
  17. package/.docs/models/providers/deepseek.md +1 -1
  18. package/.docs/models/providers/google.md +11 -11
  19. package/.docs/models/providers/openai.md +19 -19
  20. package/.docs/models/providers/opencode.md +33 -33
  21. package/.docs/models/providers/xai.md +3 -3
  22. package/.docs/reference/agents/agent.md +20 -20
  23. package/.docs/reference/agents/generate.md +200 -66
  24. package/.docs/reference/agents/generateLegacy.md +77 -35
  25. package/.docs/reference/agents/getDefaultGenerateOptions.md +4 -6
  26. package/.docs/reference/agents/getDefaultOptions.md +4 -6
  27. package/.docs/reference/agents/getDefaultStreamOptions.md +4 -6
  28. package/.docs/reference/agents/getDescription.md +1 -1
  29. package/.docs/reference/agents/getInstructions.md +4 -6
  30. package/.docs/reference/agents/getLLM.md +6 -8
  31. package/.docs/reference/agents/getMemory.md +4 -6
  32. package/.docs/reference/agents/getModel.md +4 -6
  33. package/.docs/reference/agents/getTools.md +5 -7
  34. package/.docs/reference/agents/getVoice.md +4 -6
  35. package/.docs/reference/agents/listAgents.md +4 -6
  36. package/.docs/reference/agents/listScorers.md +4 -6
  37. package/.docs/reference/agents/listTools.md +4 -6
  38. package/.docs/reference/agents/listWorkflows.md +4 -6
  39. package/.docs/reference/agents/network.md +69 -23
  40. package/.docs/reference/ai-sdk/chat-route.md +7 -7
  41. package/.docs/reference/ai-sdk/handle-chat-stream.md +12 -12
  42. package/.docs/reference/ai-sdk/handle-network-stream.md +4 -4
  43. package/.docs/reference/ai-sdk/handle-workflow-stream.md +11 -11
  44. package/.docs/reference/ai-sdk/network-route.md +3 -3
  45. package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +9 -9
  46. package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +9 -9
  47. package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +5 -5
  48. package/.docs/reference/ai-sdk/with-mastra.md +12 -12
  49. package/.docs/reference/ai-sdk/workflow-route.md +3 -3
  50. package/.docs/reference/auth/auth0.md +6 -6
  51. package/.docs/reference/auth/better-auth.md +5 -5
  52. package/.docs/reference/auth/clerk.md +5 -5
  53. package/.docs/reference/auth/firebase.md +7 -7
  54. package/.docs/reference/auth/jwt.md +1 -1
  55. package/.docs/reference/auth/supabase.md +4 -4
  56. package/.docs/reference/auth/workos.md +6 -6
  57. package/.docs/reference/cli/create-mastra.md +14 -14
  58. package/.docs/reference/client-js/mastra-client.md +23 -23
  59. package/.docs/reference/client-js/workflows.md +3 -3
  60. package/.docs/reference/core/addGateway.md +2 -2
  61. package/.docs/reference/core/getAgent.md +2 -2
  62. package/.docs/reference/core/getAgentById.md +2 -2
  63. package/.docs/reference/core/getDeployer.md +1 -1
  64. package/.docs/reference/core/getGateway.md +2 -2
  65. package/.docs/reference/core/getGatewayById.md +2 -2
  66. package/.docs/reference/core/getLogger.md +1 -1
  67. package/.docs/reference/core/getMCPServer.md +2 -2
  68. package/.docs/reference/core/getMCPServerById.md +3 -3
  69. package/.docs/reference/core/getMemory.md +2 -2
  70. package/.docs/reference/core/getScorer.md +2 -2
  71. package/.docs/reference/core/getScorerById.md +2 -2
  72. package/.docs/reference/core/getServer.md +1 -1
  73. package/.docs/reference/core/getStorage.md +1 -1
  74. package/.docs/reference/core/getStoredAgentById.md +18 -20
  75. package/.docs/reference/core/getTelemetry.md +1 -1
  76. package/.docs/reference/core/getVector.md +2 -2
  77. package/.docs/reference/core/getWorkflow.md +3 -3
  78. package/.docs/reference/core/listAgents.md +1 -1
  79. package/.docs/reference/core/listGateways.md +1 -1
  80. package/.docs/reference/core/listLogs.md +9 -11
  81. package/.docs/reference/core/listLogsByRunId.md +9 -9
  82. package/.docs/reference/core/listMCPServers.md +1 -1
  83. package/.docs/reference/core/listMemory.md +1 -1
  84. package/.docs/reference/core/listScorers.md +1 -1
  85. package/.docs/reference/core/listStoredAgents.md +9 -11
  86. package/.docs/reference/core/listVectors.md +1 -1
  87. package/.docs/reference/core/listWorkflows.md +2 -2
  88. package/.docs/reference/core/mastra-class.md +17 -17
  89. package/.docs/reference/core/mastra-model-gateway.md +15 -15
  90. package/.docs/reference/core/setLogger.md +2 -4
  91. package/.docs/reference/core/setStorage.md +1 -1
  92. package/.docs/reference/datasets/addItem.md +20 -4
  93. package/.docs/reference/datasets/addItems.md +8 -2
  94. package/.docs/reference/datasets/compareExperiments.md +15 -3
  95. package/.docs/reference/datasets/create.md +6 -6
  96. package/.docs/reference/datasets/dataset.md +1 -1
  97. package/.docs/reference/datasets/delete.md +2 -2
  98. package/.docs/reference/datasets/deleteExperiment.md +2 -2
  99. package/.docs/reference/datasets/deleteItem.md +2 -2
  100. package/.docs/reference/datasets/deleteItems.md +2 -2
  101. package/.docs/reference/datasets/get.md +2 -2
  102. package/.docs/reference/datasets/getDetails.md +9 -9
  103. package/.docs/reference/datasets/getExperiment.md +2 -2
  104. package/.docs/reference/datasets/getItem.md +3 -3
  105. package/.docs/reference/datasets/getItemHistory.md +22 -2
  106. package/.docs/reference/datasets/list.md +7 -3
  107. package/.docs/reference/datasets/listExperimentResults.md +34 -4
  108. package/.docs/reference/datasets/listExperiments.md +41 -3
  109. package/.docs/reference/datasets/listItems.md +18 -6
  110. package/.docs/reference/datasets/listVersions.md +23 -3
  111. package/.docs/reference/datasets/startExperiment.md +62 -12
  112. package/.docs/reference/datasets/startExperimentAsync.md +5 -1
  113. package/.docs/reference/datasets/update.md +6 -6
  114. package/.docs/reference/datasets/updateItem.md +5 -5
  115. package/.docs/reference/deployer.md +8 -8
  116. package/.docs/reference/evals/answer-relevancy.md +11 -11
  117. package/.docs/reference/evals/answer-similarity.md +17 -19
  118. package/.docs/reference/evals/bias.md +10 -10
  119. package/.docs/reference/evals/completeness.md +3 -3
  120. package/.docs/reference/evals/content-similarity.md +6 -6
  121. package/.docs/reference/evals/context-precision.md +4 -4
  122. package/.docs/reference/evals/context-relevance.md +4 -4
  123. package/.docs/reference/evals/create-scorer.md +47 -49
  124. package/.docs/reference/evals/faithfulness.md +11 -11
  125. package/.docs/reference/evals/hallucination.md +17 -21
  126. package/.docs/reference/evals/keyword-coverage.md +4 -4
  127. package/.docs/reference/evals/mastra-scorer.md +14 -14
  128. package/.docs/reference/evals/noise-sensitivity.md +4 -4
  129. package/.docs/reference/evals/prompt-alignment.md +4 -4
  130. package/.docs/reference/evals/run-evals.md +16 -16
  131. package/.docs/reference/evals/scorer-utils.md +3 -3
  132. package/.docs/reference/evals/textual-difference.md +3 -3
  133. package/.docs/reference/evals/tone-consistency.md +3 -3
  134. package/.docs/reference/evals/tool-call-accuracy.md +5 -5
  135. package/.docs/reference/evals/toxicity.md +8 -8
  136. package/.docs/reference/harness/harness-class.md +34 -42
  137. package/.docs/reference/logging/pino-logger.md +5 -5
  138. package/.docs/reference/memory/clone-utilities.md +5 -5
  139. package/.docs/reference/memory/cloneThread.md +17 -21
  140. package/.docs/reference/memory/createThread.md +10 -10
  141. package/.docs/reference/memory/deleteMessages.md +2 -2
  142. package/.docs/reference/memory/getThreadById.md +2 -2
  143. package/.docs/reference/memory/listThreads.md +5 -5
  144. package/.docs/reference/memory/memory-class.md +12 -14
  145. package/.docs/reference/memory/observational-memory.md +102 -94
  146. package/.docs/reference/memory/recall.md +14 -16
  147. package/.docs/reference/observability/tracing/configuration.md +27 -10
  148. package/.docs/reference/observability/tracing/exporters/console-exporter.md +4 -7
  149. package/.docs/reference/processors/batch-parts-processor.md +8 -10
  150. package/.docs/reference/processors/language-detector.md +14 -16
  151. package/.docs/reference/processors/message-history-processor.md +7 -9
  152. package/.docs/reference/processors/moderation-processor.md +13 -15
  153. package/.docs/reference/processors/pii-detector.md +14 -16
  154. package/.docs/reference/processors/processor-interface.md +62 -62
  155. package/.docs/reference/processors/prompt-injection-detector.md +11 -13
  156. package/.docs/reference/processors/semantic-recall-processor.md +14 -16
  157. package/.docs/reference/processors/system-prompt-scrubber.md +12 -14
  158. package/.docs/reference/processors/token-limiter-processor.md +11 -13
  159. package/.docs/reference/processors/tool-call-filter.md +5 -7
  160. package/.docs/reference/processors/tool-search-processor.md +9 -11
  161. package/.docs/reference/processors/unicode-normalizer.md +8 -10
  162. package/.docs/reference/processors/working-memory-processor.md +14 -18
  163. package/.docs/reference/rag/chunk.md +38 -38
  164. package/.docs/reference/rag/database-config.md +11 -7
  165. package/.docs/reference/rag/document.md +2 -2
  166. package/.docs/reference/rag/embeddings.md +12 -12
  167. package/.docs/reference/rag/extract-params.md +23 -23
  168. package/.docs/reference/rag/graph-rag.md +12 -12
  169. package/.docs/reference/rag/rerank.md +25 -17
  170. package/.docs/reference/rag/rerankWithScorer.md +25 -17
  171. package/.docs/reference/server/create-route.md +14 -14
  172. package/.docs/reference/server/express-adapter.md +10 -10
  173. package/.docs/reference/server/fastify-adapter.md +10 -10
  174. package/.docs/reference/server/hono-adapter.md +10 -10
  175. package/.docs/reference/server/koa-adapter.md +10 -10
  176. package/.docs/reference/server/mastra-server.md +10 -10
  177. package/.docs/reference/server/register-api-route.md +13 -13
  178. package/.docs/reference/storage/cloudflare-d1.md +5 -5
  179. package/.docs/reference/storage/cloudflare.md +6 -6
  180. package/.docs/reference/storage/composite.md +9 -9
  181. package/.docs/reference/storage/convex.md +3 -3
  182. package/.docs/reference/storage/dynamodb.md +9 -9
  183. package/.docs/reference/storage/lance.md +3 -3
  184. package/.docs/reference/storage/libsql.md +2 -2
  185. package/.docs/reference/storage/mongodb.md +5 -5
  186. package/.docs/reference/storage/mssql.md +2 -2
  187. package/.docs/reference/storage/postgresql.md +25 -25
  188. package/.docs/reference/storage/upstash.md +3 -3
  189. package/.docs/reference/streaming/ChunkType.md +251 -59
  190. package/.docs/reference/streaming/agents/MastraModelOutput.md +86 -16
  191. package/.docs/reference/streaming/agents/stream.md +155 -43
  192. package/.docs/reference/streaming/agents/streamLegacy.md +79 -39
  193. package/.docs/reference/streaming/workflows/resumeStream.md +18 -8
  194. package/.docs/reference/streaming/workflows/stream.md +21 -9
  195. package/.docs/reference/streaming/workflows/timeTravelStream.md +4 -4
  196. package/.docs/reference/tools/create-tool.md +25 -21
  197. package/.docs/reference/tools/document-chunker-tool.md +7 -7
  198. package/.docs/reference/tools/graph-rag-tool.md +16 -18
  199. package/.docs/reference/tools/mcp-client.md +38 -27
  200. package/.docs/reference/tools/mcp-server.md +45 -45
  201. package/.docs/reference/tools/vector-query-tool.md +34 -22
  202. package/.docs/reference/vectors/astra.md +22 -22
  203. package/.docs/reference/vectors/chroma.md +44 -44
  204. package/.docs/reference/vectors/convex.md +26 -26
  205. package/.docs/reference/vectors/couchbase.md +30 -30
  206. package/.docs/reference/vectors/duckdb.md +29 -29
  207. package/.docs/reference/vectors/elasticsearch.md +27 -27
  208. package/.docs/reference/vectors/lance.md +46 -38
  209. package/.docs/reference/vectors/libsql.md +31 -31
  210. package/.docs/reference/vectors/mongodb.md +32 -32
  211. package/.docs/reference/vectors/opensearch.md +27 -27
  212. package/.docs/reference/vectors/pg.md +60 -44
  213. package/.docs/reference/vectors/pinecone.md +38 -38
  214. package/.docs/reference/vectors/qdrant.md +36 -36
  215. package/.docs/reference/vectors/s3vectors.md +24 -24
  216. package/.docs/reference/vectors/turbopuffer.md +29 -29
  217. package/.docs/reference/vectors/upstash.md +25 -25
  218. package/.docs/reference/vectors/vectorize.md +27 -27
  219. package/.docs/reference/voice/azure.md +19 -15
  220. package/.docs/reference/voice/cloudflare.md +10 -12
  221. package/.docs/reference/voice/composite-voice.md +10 -10
  222. package/.docs/reference/voice/deepgram.md +20 -14
  223. package/.docs/reference/voice/elevenlabs.md +20 -22
  224. package/.docs/reference/voice/google-gemini-live.md +42 -44
  225. package/.docs/reference/voice/google.md +25 -21
  226. package/.docs/reference/voice/mastra-voice.md +20 -20
  227. package/.docs/reference/voice/murf.md +24 -28
  228. package/.docs/reference/voice/openai-realtime.md +26 -26
  229. package/.docs/reference/voice/openai.md +14 -12
  230. package/.docs/reference/voice/playai.md +13 -15
  231. package/.docs/reference/voice/sarvam.md +21 -25
  232. package/.docs/reference/voice/speechify.md +11 -13
  233. package/.docs/reference/voice/voice.addInstructions.md +1 -1
  234. package/.docs/reference/voice/voice.addTools.md +1 -1
  235. package/.docs/reference/voice/voice.answer.md +1 -1
  236. package/.docs/reference/voice/voice.connect.md +3 -3
  237. package/.docs/reference/voice/voice.events.md +11 -11
  238. package/.docs/reference/voice/voice.getSpeakers.md +30 -30
  239. package/.docs/reference/voice/voice.listen.md +9 -9
  240. package/.docs/reference/voice/voice.off.md +2 -2
  241. package/.docs/reference/voice/voice.on.md +2 -2
  242. package/.docs/reference/voice/voice.send.md +1 -1
  243. package/.docs/reference/voice/voice.speak.md +11 -11
  244. package/.docs/reference/voice/voice.updateConfig.md +3 -3
  245. package/.docs/reference/workflows/run-methods/cancel.md +2 -2
  246. package/.docs/reference/workflows/run-methods/restart.md +17 -5
  247. package/.docs/reference/workflows/run-methods/resume.md +23 -9
  248. package/.docs/reference/workflows/run-methods/start.md +22 -8
  249. package/.docs/reference/workflows/run-methods/startAsync.md +12 -6
  250. package/.docs/reference/workflows/run-methods/timeTravel.md +29 -13
  251. package/.docs/reference/workflows/run.md +12 -12
  252. package/.docs/reference/workflows/step.md +24 -26
  253. package/.docs/reference/workflows/workflow-methods/branch.md +2 -2
  254. package/.docs/reference/workflows/workflow-methods/commit.md +1 -1
  255. package/.docs/reference/workflows/workflow-methods/create-run.md +4 -4
  256. package/.docs/reference/workflows/workflow-methods/dountil.md +3 -3
  257. package/.docs/reference/workflows/workflow-methods/dowhile.md +3 -3
  258. package/.docs/reference/workflows/workflow-methods/foreach.md +9 -9
  259. package/.docs/reference/workflows/workflow-methods/map.md +2 -2
  260. package/.docs/reference/workflows/workflow-methods/parallel.md +2 -2
  261. package/.docs/reference/workflows/workflow-methods/sleep.md +2 -2
  262. package/.docs/reference/workflows/workflow-methods/sleepUntil.md +2 -2
  263. package/.docs/reference/workflows/workflow-methods/then.md +2 -2
  264. package/.docs/reference/workflows/workflow.md +40 -50
  265. package/.docs/reference/workspace/daytona-sandbox.md +33 -33
  266. package/.docs/reference/workspace/e2b-sandbox.md +20 -20
  267. package/.docs/reference/workspace/filesystem.md +22 -22
  268. package/.docs/reference/workspace/gcs-filesystem.md +15 -15
  269. package/.docs/reference/workspace/local-filesystem.md +35 -35
  270. package/.docs/reference/workspace/local-sandbox.md +26 -26
  271. package/.docs/reference/workspace/s3-filesystem.md +18 -18
  272. package/.docs/reference/workspace/sandbox.md +8 -8
  273. package/.docs/reference/workspace/workspace-class.md +30 -34
  274. package/CHANGELOG.md +16 -0
  275. package/package.json +6 -6
  276. package/.docs/docs/getting-started/start.md +0 -28
@@ -31,45 +31,45 @@ console.log(`Processed ${result.summary.totalItems} items`)
31
31
 
32
32
  ## Parameters
33
33
 
34
- **target:** (`Agent | Workflow`): The agent or workflow to evaluate.
34
+ **target** (`Agent | Workflow`): The agent or workflow to evaluate.
35
35
 
36
- **data:** (`RunEvalsDataItem[]`): Array of test cases with input data and optional ground truth.
36
+ **data** (`RunEvalsDataItem[]`): Array of test cases with input data and optional ground truth.
37
37
 
38
- **scorers:** (`MastraScorer[] | WorkflowScorerConfig`): Array of scorers for agents, or configuration object for workflows specifying scorers for the workflow and individual steps.
38
+ **scorers** (`MastraScorer[] | WorkflowScorerConfig`): Array of scorers for agents, or configuration object for workflows specifying scorers for the workflow and individual steps.
39
39
 
40
- **targetOptions?:** (`AgentExecutionOptions | WorkflowRunOptions`): Options forwarded to the target during execution. For agents: options passed to agent.generate() (e.g. maxSteps, modelSettings, instructions). For workflows: options passed to run.start() (e.g. perStep, outputOptions, initialState).
40
+ **targetOptions** (`AgentExecutionOptions | WorkflowRunOptions`): Options forwarded to the target during execution. For agents: options passed to agent.generate() (e.g. maxSteps, modelSettings, instructions). For workflows: options passed to run.start() (e.g. perStep, outputOptions, initialState).
41
41
 
42
- **concurrency?:** (`number`): Number of test cases to run concurrently. (Default: `1`)
42
+ **concurrency** (`number`): Number of test cases to run concurrently. (Default: `1`)
43
43
 
44
- **onItemComplete?:** (`function`): Callback function called after each test case completes. Receives item, target result, and scorer results.
44
+ **onItemComplete** (`function`): Callback function called after each test case completes. Receives item, target result, and scorer results.
45
45
 
46
46
  ## Data Item Structure
47
47
 
48
- **input:** (`string | string[] | CoreMessage[] | any`): Input data for the target. For agents: messages or strings. For workflows: workflow input data.
48
+ **input** (`string | string[] | CoreMessage[] | any`): Input data for the target. For agents: messages or strings. For workflows: workflow input data.
49
49
 
50
- **groundTruth?:** (`any`): Expected or reference output for comparison during scoring.
50
+ **groundTruth** (`any`): Expected or reference output for comparison during scoring.
51
51
 
52
- **requestContext?:** (`RequestContext`): Request Context to pass to the target during execution.
52
+ **requestContext** (`RequestContext`): Request Context to pass to the target during execution.
53
53
 
54
- **tracingContext?:** (`TracingContext`): Tracing context for observability and debugging.
54
+ **tracingContext** (`TracingContext`): Tracing context for observability and debugging.
55
55
 
56
- **startOptions?:** (`WorkflowRunOptions`): Per-item workflow run options (e.g. initialState, perStep, outputOptions). Merged on top of targetOptions, so per-item values take precedence. Only applicable when the target is a workflow.
56
+ **startOptions** (`WorkflowRunOptions`): Per-item workflow run options (e.g. initialState, perStep, outputOptions). Merged on top of targetOptions, so per-item values take precedence. Only applicable when the target is a workflow.
57
57
 
58
58
  ## Workflow Scorer Configuration
59
59
 
60
60
  For workflows, you can specify scorers at different levels using `WorkflowScorerConfig`:
61
61
 
62
- **workflow?:** (`MastraScorer[]`): Array of scorers to evaluate the entire workflow output.
62
+ **workflow** (`MastraScorer[]`): Array of scorers to evaluate the entire workflow output.
63
63
 
64
- **steps?:** (`Record<string, MastraScorer[]>`): Object mapping step IDs to arrays of scorers for evaluating individual step outputs.
64
+ **steps** (`Record<string, MastraScorer[]>`): Object mapping step IDs to arrays of scorers for evaluating individual step outputs.
65
65
 
66
66
  ## Returns
67
67
 
68
- **scores:** (`Record<string, any>`): Average scores across all test cases, organized by scorer name.
68
+ **scores** (`Record<string, any>`): Average scores across all test cases, organized by scorer name.
69
69
 
70
- **summary:** (`object`): Summary information about the experiment execution.
70
+ **summary** (`object`): Summary information about the experiment execution.
71
71
 
72
- **summary.totalItems:** (`number`): Total number of test cases processed.
72
+ **summary.totalItems** (`number`): Total number of test cases processed.
73
73
 
74
74
  ## Examples
75
75
 
@@ -38,7 +38,7 @@ const scorer = createScorer({
38
38
  })
39
39
  ```
40
40
 
41
- **output?:** (`ScorerRunOutputForAgent`): The scorer run output (array of MastraDBMessage)
41
+ **output** (`ScorerRunOutputForAgent`): The scorer run output (array of MastraDBMessage)
42
42
 
43
43
  **Returns:** `string | undefined` - The assistant message text, or undefined if no assistant message is found.
44
44
 
@@ -53,7 +53,7 @@ Extracts the text content from the first user message in the run input.
53
53
  })
54
54
  ```
55
55
 
56
- **input?:** (`ScorerRunInputForAgent`): The scorer run input containing input messages
56
+ **input** (`ScorerRunInputForAgent`): The scorer run input containing input messages
57
57
 
58
58
  **Returns:** `string | undefined` - The user message text, or undefined if no user message is found.
59
59
 
@@ -134,7 +134,7 @@ const reasoningQualityScorer = createScorer({
134
134
  })
135
135
  ```
136
136
 
137
- **output?:** (`ScorerRunOutputForAgent`): The scorer run output (array of MastraDBMessage)
137
+ **output** (`ScorerRunOutputForAgent`): The scorer run output (array of MastraDBMessage)
138
138
 
139
139
  **Returns:** `string | undefined` - The reasoning text, or undefined if no reasoning is present.
140
140
 
@@ -10,11 +10,11 @@ This function returns an instance of the MastraScorer class. See the [MastraScor
10
10
 
11
11
  ## .run() Returns
12
12
 
13
- **runId:** (`string`): The id of the run (optional).
13
+ **runId** (`string`): The id of the run (optional).
14
14
 
15
- **analyzeStepResult:** (`object`): Object with difference metrics: { confidence: number, changes: number, lengthDiff: number }
15
+ **analyzeStepResult** (`object`): Object with difference metrics: { confidence: number, changes: number, lengthDiff: number }
16
16
 
17
- **score:** (`number`): Similarity ratio (0-1) where 1 indicates identical texts.
17
+ **score** (`number`): Similarity ratio (0-1) where 1 indicates identical texts.
18
18
 
19
19
  `.run()` returns a result in the following shape:
20
20
 
@@ -10,11 +10,11 @@ This function returns an instance of the MastraScorer class. See the [MastraScor
10
10
 
11
11
  ## .run() Returns
12
12
 
13
- **runId:** (`string`): The id of the run (optional).
13
+ **runId** (`string`): The id of the run (optional).
14
14
 
15
- **analyzeStepResult:** (`object`): Object with tone metrics: { responseSentiment: number, referenceSentiment: number, difference: number } (for comparison mode) OR { avgSentiment: number, sentimentVariance: number } (for stability mode)
15
+ **analyzeStepResult** (`object`): Object with tone metrics: { responseSentiment: number, referenceSentiment: number, difference: number } (for comparison mode) OR { avgSentiment: number, sentimentVariance: number } (for stability mode)
16
16
 
17
- **score:** (`number`): Tone consistency/stability score (0-1).
17
+ **score** (`number`): Tone consistency/stability score (0-1).
18
18
 
19
19
  `.run()` returns a result in the following shape:
20
20
 
@@ -29,11 +29,11 @@ The `createToolCallAccuracyScorerCode()` function from `@mastra/evals/scorers/pr
29
29
 
30
30
  ### Parameters
31
31
 
32
- **expectedTool:** (`string`): The name of the tool that should be called for the given task. Ignored when expectedToolOrder is provided.
32
+ **expectedTool** (`string`): The name of the tool that should be called for the given task. Ignored when expectedToolOrder is provided.
33
33
 
34
- **strictMode:** (`boolean`): Controls evaluation strictness. For single tool mode: only exact single tool calls accepted. For order checking mode: tools must match exactly with no extra tools allowed.
34
+ **strictMode** (`boolean`): Controls evaluation strictness. For single tool mode: only exact single tool calls accepted. For order checking mode: tools must match exactly with no extra tools allowed.
35
35
 
36
- **expectedToolOrder:** (`string[]`): Array of tool names in the expected calling order. When provided, enables order checking mode and ignores expectedTool parameter.
36
+ **expectedToolOrder** (`string[]`): Array of tool names in the expected calling order. When provided, enables order checking mode and ignores expectedTool parameter.
37
37
 
38
38
  This function returns an instance of the MastraScorer class. See the [MastraScorer reference](https://mastra.ai/reference/evals/mastra-scorer) for details on the `.run()` method and its input/output.
39
39
 
@@ -277,9 +277,9 @@ The `createToolCallAccuracyScorerLLM()` function from `@mastra/evals/scorers/pre
277
277
 
278
278
  ### Parameters
279
279
 
280
- **model:** (`MastraModelConfig`): The LLM model to use for evaluating tool appropriateness
280
+ **model** (`MastraModelConfig`): The LLM model to use for evaluating tool appropriateness
281
281
 
282
- **availableTools:** (`Array<{name: string, description: string}>`): List of available tools with their descriptions for context
282
+ **availableTools** (`Array<{name: string, description: string}>`): List of available tools with their descriptions for context
283
283
 
284
284
  ### Features
285
285
 
@@ -6,25 +6,25 @@ The `createToxicityScorer()` function evaluates whether an LLM's output contains
6
6
 
7
7
  The `createToxicityScorer()` function accepts a single options object with the following properties:
8
8
 
9
- **model:** (`LanguageModel`): Configuration for the model used to evaluate toxicity.
9
+ **model** (`LanguageModel`): Configuration for the model used to evaluate toxicity.
10
10
 
11
- **scale:** (`number`): Maximum score value (default is 1). (Default: `1`)
11
+ **scale** (`number`): Maximum score value (default is 1). (Default: `1`)
12
12
 
13
13
  This function returns an instance of the MastraScorer class. The `.run()` method accepts the same input as other scorers (see the [MastraScorer reference](https://mastra.ai/reference/evals/mastra-scorer)), but the return value includes LLM-specific fields as documented below.
14
14
 
15
15
  ## .run() Returns
16
16
 
17
- **runId:** (`string`): The id of the run (optional).
17
+ **runId** (`string`): The id of the run (optional).
18
18
 
19
- **analyzeStepResult:** (`object`): Object with verdicts: { verdicts: Array<{ verdict: 'yes' | 'no', reason: string }> }
19
+ **analyzeStepResult** (`object`): Object with verdicts: { verdicts: Array<{ verdict: 'yes' | 'no', reason: string }> }
20
20
 
21
- **analyzePrompt:** (`string`): The prompt sent to the LLM for the analyze step (optional).
21
+ **analyzePrompt** (`string`): The prompt sent to the LLM for the analyze step (optional).
22
22
 
23
- **score:** (`number`): Toxicity score (0 to scale, default 0-1).
23
+ **score** (`number`): Toxicity score (0 to scale, default 0-1).
24
24
 
25
- **reason:** (`string`): Detailed explanation of the toxicity assessment.
25
+ **reason** (`string`): Detailed explanation of the toxicity assessment.
26
26
 
27
- **generateReasonPrompt:** (`string`): The prompt sent to the LLM for the generateReason step (optional).
27
+ **generateReasonPrompt** (`string`): The prompt sent to the LLM for the generateReason step (optional).
28
28
 
29
29
  `.run()` returns a result in the following shape:
30
30
 
@@ -38,83 +38,75 @@ await harness.sendMessage({ content: 'Hello!' })
38
38
 
39
39
  ## Constructor parameters
40
40
 
41
- **id:** (`string`): Unique identifier for this harness instance.
41
+ **id** (`string`): Unique identifier for this harness instance.
42
42
 
43
- **resourceId?:** (`string`): Resource ID for grouping threads (e.g., project identifier). Threads are scoped to this resource ID. Defaults to \`id\`.
43
+ **resourceId** (`string`): Resource ID for grouping threads (e.g., project identifier). Threads are scoped to this resource ID. Defaults to \`id\`.
44
44
 
45
- **storage?:** (`MastraCompositeStore`): Storage backend for persistence (threads, messages, state).
45
+ **storage** (`MastraCompositeStore`): Storage backend for persistence (threads, messages, state).
46
46
 
47
- **stateSchema?:** (`z.ZodObject`): Zod schema defining the shape of harness state. Used for validation and extracting defaults.
47
+ **stateSchema** (`z.ZodObject`): Zod schema defining the shape of harness state. Used for validation and extracting defaults.
48
48
 
49
- **initialState?:** (`Partial<z.infer<TState>>`): Initial state values. Must conform to the schema if provided.
49
+ **initialState** (`Partial<z.infer<TState>>`): Initial state values. Must conform to the schema if provided.
50
50
 
51
- **memory?:** (`MastraMemory`): Memory configuration shared across all modes. Propagated to mode agents that don't have their own memory.
51
+ **memory** (`MastraMemory`): Memory configuration shared across all modes. Propagated to mode agents that don't have their own memory.
52
52
 
53
- **modes:** (`HarnessMode[]`): Available agent modes. At least one mode is required. Each mode defines an agent and optional defaults.
53
+ **modes** (`HarnessMode[]`): Available agent modes. At least one mode is required. Each mode defines an agent and optional defaults.
54
54
 
55
- **tools?:** (`ToolsInput | ((ctx) => ToolsInput)`): Tools available to all agents across all modes. It can be a static tools object or a dynamic function that receives the request context.
55
+ **modes.id** (`string`): Unique identifier for this mode (e.g., \`"plan"\`, \`"build"\`).
56
56
 
57
- **workspace?:** (`Workspace | WorkspaceConfig | ((ctx) => Workspace)`): Workspace configuration. Accepts a pre-constructed Workspace, a WorkspaceConfig for the harness to construct internally, or a dynamic factory function.
57
+ **modes.name** (`string`): Human-readable name for display.
58
58
 
59
- **subagents?:** (`HarnessSubagent[]`): Subagent definitions. When provided, the harness creates a built-in \`subagent\` tool that parent agents can call to spawn focused subagents.
59
+ **modes.default** (`boolean`): Whether this is the default mode when the harness starts.
60
60
 
61
- **resolveModel?:** (`(modelId: string) => MastraLanguageModel`): Converts a model ID string (e.g., \`"anthropic/claude-sonnet-4"\`) to a language model instance. Used by subagents and observational memory model resolution.
61
+ **modes.defaultModelId** (`string`): Default model ID for this mode (e.g., \`"anthropic/claude-sonnet-4-20250514"\`). Used when no per-mode model has been explicitly selected.
62
62
 
63
- **omConfig?:** (`HarnessOMConfig`): Default configuration for observational memory (observer/reflector model IDs and thresholds).
63
+ **modes.color** (`string`): Hex color for the mode indicator (e.g., \`"#7c3aed"\`).
64
64
 
65
- **heartbeatHandlers?:** (`HeartbeatHandler[]`): Periodic background tasks started during \`init()\`. Use for gateway sync, cache refresh, and similar tasks.
65
+ **modes.agent** (`Agent | ((state) => Agent)`): The agent for this mode. It can be a static Agent instance or a function that receives harness state and returns an Agent.
66
66
 
67
- **idGenerator?:** (`() => string`): Custom ID generator for threads, messages, and other entities. (Default: `timestamp + random string`)
67
+ **tools** (`ToolsInput | ((ctx) => ToolsInput)`): Tools available to all agents across all modes. It can be a static tools object or a dynamic function that receives the request context.
68
68
 
69
- **modelAuthChecker?:** (`ModelAuthChecker`): Custom auth checker for model providers. Return \`true\`/\`false\` to override the default environment variable check, or \`undefined\` to fall back to defaults.
69
+ **workspace** (`Workspace | WorkspaceConfig | ((ctx) => Workspace)`): Workspace configuration. Accepts a pre-constructed Workspace, a WorkspaceConfig for the harness to construct internally, or a dynamic factory function.
70
70
 
71
- **modelUseCountProvider?:** (`ModelUseCountProvider`): Provides per-model use counts for sorting and display in \`listAvailableModels()\`.
71
+ **subagents** (`HarnessSubagent[]`): Subagent definitions. When provided, the harness creates a built-in \`subagent\` tool that parent agents can call to spawn focused subagents.
72
72
 
73
- **toolCategoryResolver?:** (`(toolName: string) => ToolCategory | null`): Maps tool names to permission categories (\`'read'\`, \`'edit'\`, \`'execute'\`, \`'mcp'\`, \`'other'\`). Used by the permission system to resolve category-level policies.
73
+ **subagents.id** (`string`): Unique identifier for this subagent type (e.g., \`"explore"\`, \`"execute"\`).
74
74
 
75
- **threadLock?:** (`{ acquire, release }`): Thread locking callbacks to prevent concurrent access from multiple processes. \`acquire\` should throw if the lock is held.
75
+ **subagents.name** (`string`): Human-readable name shown in tool output.
76
76
 
77
- ### HarnessMode
77
+ **subagents.description** (`string`): Description of what this subagent does. Used in the auto-generated tool description.
78
78
 
79
- Each entry in the `modes` array configures a single agent mode.
79
+ **subagents.instructions** (`string`): System prompt for this subagent.
80
80
 
81
- **id:** (`string`): Unique identifier for this mode (e.g., \`"plan"\`, \`"build"\`).
81
+ **subagents.tools** (`ToolsInput`): Tools this subagent has direct access to.
82
82
 
83
- **name?:** (`string`): Human-readable name for display.
83
+ **subagents.allowedHarnessTools** (`string[]`): Tool IDs from the harness's shared \`tools\` config. Merged with \`tools\` above to let subagents use a subset of harness tools.
84
84
 
85
- **default?:** (`boolean`): Whether this is the default mode when the harness starts. (Default: `false`)
85
+ **subagents.defaultModelId** (`string`): Default model ID for this subagent type.
86
86
 
87
- **defaultModelId?:** (`string`): Default model ID for this mode (e.g., \`"anthropic/claude-sonnet-4-20250514"\`). Used when no per-mode model has been explicitly selected.
87
+ **subagents.maxSteps** (`number`): Optional maximum number of steps for the spawned subagent. Defaults to \`50\` when omitted.
88
88
 
89
- **color?:** (`string`): Hex color for the mode indicator (e.g., \`"#7c3aed"\`).
89
+ **subagents.stopWhen** (`LoopOptions['stopWhen']`): Optional stop condition for the spawned subagent.
90
90
 
91
- **agent:** (`Agent | ((state) => Agent)`): The agent for this mode. It can be a static Agent instance or a function that receives harness state and returns an Agent.
91
+ **resolveModel** (`(modelId: string) => MastraLanguageModel`): Converts a model ID string (e.g., \`"anthropic/claude-sonnet-4"\`) to a language model instance. Used by subagents and observational memory model resolution.
92
92
 
93
- ### HarnessSubagent
93
+ **omConfig** (`HarnessOMConfig`): Default configuration for observational memory (observer/reflector model IDs and thresholds).
94
94
 
95
- Each entry in the `subagents` array defines a subagent the harness can spawn.
95
+ **heartbeatHandlers** (`HeartbeatHandler[]`): Periodic background tasks started during \`init()\`. Use for gateway sync, cache refresh, and similar tasks.
96
96
 
97
- **id:** (`string`): Unique identifier for this subagent type (e.g., \`"explore"\`, \`"execute"\`).
97
+ **idGenerator** (`() => string`): Custom ID generator for threads, messages, and other entities. (Default: `timestamp + random string`)
98
98
 
99
- **name:** (`string`): Human-readable name shown in tool output.
99
+ **modelAuthChecker** (`ModelAuthChecker`): Custom auth checker for model providers. Return \`true\`/\`false\` to override the default environment variable check, or \`undefined\` to fall back to defaults.
100
100
 
101
- **description:** (`string`): Description of what this subagent does. Used in the auto-generated tool description.
101
+ **modelUseCountProvider** (`ModelUseCountProvider`): Provides per-model use counts for sorting and display in \`listAvailableModels()\`.
102
102
 
103
- **instructions:** (`string`): System prompt for this subagent.
103
+ **toolCategoryResolver** (`(toolName: string) => ToolCategory | null`): Maps tool names to permission categories (\`'read'\`, \`'edit'\`, \`'execute'\`, \`'mcp'\`, \`'other'\`). Used by the permission system to resolve category-level policies.
104
104
 
105
- **tools?:** (`ToolsInput`): Tools this subagent has direct access to.
106
-
107
- **allowedHarnessTools?:** (`string[]`): Tool IDs from the harness's shared \`tools\` config. Merged with \`tools\` above to let subagents use a subset of harness tools.
108
-
109
- **defaultModelId?:** (`string`): Default model ID for this subagent type.
110
-
111
- **maxSteps?:** (`number`): Optional maximum number of steps for the spawned subagent. Defaults to \`50\` when omitted.
112
-
113
- **stopWhen?:** (`LoopOptions['stopWhen']`): Optional stop condition for the spawned subagent.
105
+ **threadLock** (`{ acquire, release }`): Thread locking callbacks to prevent concurrent access from multiple processes. \`acquire\` should throw if the lock is held.
114
106
 
115
107
  ## Properties
116
108
 
117
- **id:** (`string`): Harness identifier, set at construction.
109
+ **id** (`string`): Harness identifier, set at construction.
118
110
 
119
111
  ## Methods
120
112
 
@@ -20,15 +20,15 @@ export const mastra = new Mastra({
20
20
 
21
21
  ## Parameters
22
22
 
23
- **name:** (`string`): A label used to group and identify logs from this logger.
23
+ **name** (`string`): A label used to group and identify logs from this logger.
24
24
 
25
- **level:** (`"debug" | "info" | "warn" | "error"`): Sets the minimum log level. Messages below this level are ignored.
25
+ **level** (`"debug" | "info" | "warn" | "error"`): Sets the minimum log level. Messages below this level are ignored.
26
26
 
27
- **transports:** (`Record<string, LoggerTransport>`): A map of transport instances used to persist logs.
27
+ **transports** (`Record<string, LoggerTransport>`): A map of transport instances used to persist logs.
28
28
 
29
- **overrideDefaultTransports?:** (`boolean`): If true, disables the default console transport.
29
+ **overrideDefaultTransports** (`boolean`): If true, disables the default console transport.
30
30
 
31
- **formatters?:** (`pino.LoggerOptions['formatters']`): Custom Pino formatters for log serialization.
31
+ **formatters** (`pino.LoggerOptions['formatters']`): Custom Pino formatters for log serialization.
32
32
 
33
33
  ## File transport (structured logs)
34
34
 
@@ -14,7 +14,7 @@ const isClonedThread = memory.isClone(thread)
14
14
 
15
15
  ### Parameters
16
16
 
17
- **thread:** (`StorageThreadType`): The thread object to check.
17
+ **thread** (`StorageThreadType`): The thread object to check.
18
18
 
19
19
  ### Example
20
20
 
@@ -40,7 +40,7 @@ const metadata = memory.getCloneMetadata(thread)
40
40
 
41
41
  ### Parameters
42
42
 
43
- **thread:** (`StorageThreadType`): The thread object to extract clone metadata from.
43
+ **thread** (`StorageThreadType`): The thread object to extract clone metadata from.
44
44
 
45
45
  ### Example
46
46
 
@@ -66,7 +66,7 @@ const sourceThread = await memory.getSourceThread(threadId)
66
66
 
67
67
  ### Parameters
68
68
 
69
- **threadId:** (`string`): The ID of the cloned thread.
69
+ **threadId** (`string`): The ID of the cloned thread.
70
70
 
71
71
  ### Example
72
72
 
@@ -91,7 +91,7 @@ const clones = await memory.listClones(sourceThreadId)
91
91
 
92
92
  ### Parameters
93
93
 
94
- **sourceThreadId:** (`string`): The ID of the source thread to find clones for.
94
+ **sourceThreadId** (`string`): The ID of the source thread to find clones for.
95
95
 
96
96
  ### Example
97
97
 
@@ -116,7 +116,7 @@ const history = await memory.getCloneHistory(threadId)
116
116
 
117
117
  ### Parameters
118
118
 
119
- **threadId:** (`string`): The ID of the thread to get clone history for.
119
+ **threadId** (`string`): The ID of the thread to get clone history for.
120
120
 
121
121
  ### Example
122
122
 
@@ -12,49 +12,45 @@ const { thread, clonedMessages } = await memory.cloneThread({
12
12
 
13
13
  ## Parameters
14
14
 
15
- **sourceThreadId:** (`string`): The ID of the thread to clone
15
+ **sourceThreadId** (`string`): The ID of the thread to clone
16
16
 
17
- **newThreadId?:** (`string`): Optional custom ID for the cloned thread. If not provided, one will be generated.
17
+ **newThreadId** (`string`): Optional custom ID for the cloned thread. If not provided, one will be generated.
18
18
 
19
- **resourceId?:** (`string`): Optional resource ID for the cloned thread. Defaults to the source thread's resourceId.
19
+ **resourceId** (`string`): Optional resource ID for the cloned thread. Defaults to the source thread's resourceId.
20
20
 
21
- **title?:** (`string`): Optional title for the cloned thread. Defaults to '\[source title] (Copy)'.
21
+ **title** (`string`): Optional title for the cloned thread. Defaults to '\[source title] (Copy)'.
22
22
 
23
- **metadata?:** (`Record<string, unknown>`): Optional metadata to merge with the source thread's metadata. Clone metadata is automatically added.
23
+ **metadata** (`Record<string, unknown>`): Optional metadata to merge with the source thread's metadata. Clone metadata is automatically added.
24
24
 
25
- **options?:** (`CloneOptions`): Optional filtering options for the clone operation.
25
+ **options** (`CloneOptions`): Optional filtering options for the clone operation.
26
26
 
27
- ### Options Parameters
27
+ **options.messageLimit** (`number`): Maximum number of messages to clone. When set, clones the most recent N messages.
28
28
 
29
- **messageLimit?:** (`number`): Maximum number of messages to clone. When set, clones the most recent N messages.
29
+ **options.messageFilter** (`MessageFilter`): Filter criteria for selecting which messages to clone.
30
30
 
31
- **messageFilter?:** (`MessageFilter`): Filter criteria for selecting which messages to clone.
31
+ **options.messageFilter.startDate** (`Date`): Only clone messages created on or after this date.
32
32
 
33
- ### MessageFilter Parameters
33
+ **options.messageFilter.endDate** (`Date`): Only clone messages created on or before this date.
34
34
 
35
- **startDate?:** (`Date`): Only clone messages created on or after this date.
36
-
37
- **endDate?:** (`Date`): Only clone messages created on or before this date.
38
-
39
- **messageIds?:** (`string[]`): Only clone messages with these specific IDs.
35
+ **options.messageFilter.messageIds** (`string[]`): Only clone messages with these specific IDs.
40
36
 
41
37
  ## Returns
42
38
 
43
- **thread:** (`StorageThreadType`): The newly created cloned thread with clone metadata.
39
+ **thread** (`StorageThreadType`): The newly created cloned thread with clone metadata.
44
40
 
45
- **clonedMessages:** (`MastraDBMessage[]`): Array of the cloned messages with new IDs assigned to the new thread.
41
+ **clonedMessages** (`MastraDBMessage[]`): Array of the cloned messages with new IDs assigned to the new thread.
46
42
 
47
- **messageIdMap?:** (`Record<string, string>`): A mapping from source message IDs to their corresponding cloned message IDs.
43
+ **messageIdMap** (`Record<string, string>`): A mapping from source message IDs to their corresponding cloned message IDs.
48
44
 
49
45
  ### Clone Metadata
50
46
 
51
47
  The cloned thread's metadata includes a `clone` property with:
52
48
 
53
- **sourceThreadId:** (`string`): The ID of the original thread that was cloned.
49
+ **sourceThreadId** (`string`): The ID of the original thread that was cloned.
54
50
 
55
- **clonedAt:** (`Date`): Timestamp when the clone was created.
51
+ **clonedAt** (`Date`): Timestamp when the clone was created.
56
52
 
57
- **lastMessageId?:** (`string`): The ID of the last message in the source thread at the time of cloning.
53
+ **lastMessageId** (`string`): The ID of the last message in the source thread at the time of cloning.
58
54
 
59
55
  ## Extended Usage Example
60
56
 
@@ -10,27 +10,27 @@ await memory?.createThread({ resourceId: 'user-123' })
10
10
 
11
11
  ## Parameters
12
12
 
13
- **resourceId:** (`string`): Identifier for the resource this thread belongs to (e.g., user ID, project ID)
13
+ **resourceId** (`string`): Identifier for the resource this thread belongs to (e.g., user ID, project ID)
14
14
 
15
- **threadId?:** (`string`): Optional custom ID for the thread. If not provided, one will be generated.
15
+ **threadId** (`string`): Optional custom ID for the thread. If not provided, one will be generated.
16
16
 
17
- **title?:** (`string`): Optional title for the thread
17
+ **title** (`string`): Optional title for the thread
18
18
 
19
- **metadata?:** (`Record<string, unknown>`): Optional metadata to associate with the thread
19
+ **metadata** (`Record<string, unknown>`): Optional metadata to associate with the thread
20
20
 
21
21
  ## Returns
22
22
 
23
- **id:** (`string`): Unique identifier of the created thread
23
+ **id** (`string`): Unique identifier of the created thread
24
24
 
25
- **resourceId:** (`string`): Resource ID associated with the thread
25
+ **resourceId** (`string`): Resource ID associated with the thread
26
26
 
27
- **title:** (`string`): Title of the thread (if provided)
27
+ **title** (`string`): Title of the thread (if provided)
28
28
 
29
- **createdAt:** (`Date`): Timestamp when the thread was created
29
+ **createdAt** (`Date`): Timestamp when the thread was created
30
30
 
31
- **updatedAt:** (`Date`): Timestamp when the thread was last updated
31
+ **updatedAt** (`Date`): Timestamp when the thread was last updated
32
32
 
33
- **metadata:** (`Record<string, unknown>`): Additional metadata associated with the thread
33
+ **metadata** (`Record<string, unknown>`): Additional metadata associated with the thread
34
34
 
35
35
  ## Extended usage example
36
36
 
@@ -10,11 +10,11 @@ await memory?.deleteMessages(['671ae63f-3a91-4082-a907-fe7de78e10ec'])
10
10
 
11
11
  ## Parameters
12
12
 
13
- **messageIds:** (`string[]`): Array of message IDs to delete
13
+ **messageIds** (`string[]`): Array of message IDs to delete
14
14
 
15
15
  ## Returns
16
16
 
17
- **void:** (`Promise<void>`): A promise that resolves when all messages are deleted
17
+ **void** (`Promise<void>`): A promise that resolves when all messages are deleted
18
18
 
19
19
  ## Extended usage example
20
20
 
@@ -10,11 +10,11 @@ await memory?.getThreadById({ threadId: 'thread-123' })
10
10
 
11
11
  ## Parameters
12
12
 
13
- **threadId:** (`string`): The ID of the thread to be retrieved.
13
+ **threadId** (`string`): The ID of the thread to be retrieved.
14
14
 
15
15
  ## Returns
16
16
 
17
- **thread:** (`Promise<StorageThreadType | null>`): A promise that resolves to the thread associated with the given ID, or null if not found.
17
+ **thread** (`Promise<StorageThreadType | null>`): A promise that resolves to the thread associated with the given ID, or null if not found.
18
18
 
19
19
  ### Related
20
20
 
@@ -61,17 +61,17 @@ const result = await memory.listThreads({
61
61
 
62
62
  ## Parameters
63
63
 
64
- **filter?:** (`{ resourceId?: string; metadata?: Record<string, unknown> }`): Optional filter object. resourceId filters threads by resource ID. metadata filters threads by metadata key-value pairs (AND logic - all must match)
64
+ **filter** (`{ resourceId?: string; metadata?: Record<string, unknown> }`): Optional filter object. resourceId filters threads by resource ID. metadata filters threads by metadata key-value pairs (AND logic - all must match)
65
65
 
66
- **page?:** (`number`): Page number (0-indexed) to retrieve
66
+ **page** (`number`): Page number (0-indexed) to retrieve
67
67
 
68
- **perPage?:** (`number | false`): Maximum number of threads to return per page, or false to fetch all
68
+ **perPage** (`number | false`): Maximum number of threads to return per page, or false to fetch all
69
69
 
70
- **orderBy?:** (`{ field: 'createdAt' | 'updatedAt', direction: 'ASC' | 'DESC' }`): Sort configuration with field and direction (defaults to { field: 'createdAt', direction: 'DESC' })
70
+ **orderBy** (`{ field: 'createdAt' | 'updatedAt', direction: 'ASC' | 'DESC' }`): Sort configuration with field and direction (defaults to { field: 'createdAt', direction: 'DESC' })
71
71
 
72
72
  ## Returns
73
73
 
74
- **result:** (`Promise<StorageListThreadsOutput>`): A promise that resolves to paginated thread results with metadata
74
+ **result** (`Promise<StorageListThreadsOutput>`): A promise that resolves to paginated thread results with metadata
75
75
 
76
76
  The return object contains:
77
77
 
@@ -22,35 +22,33 @@ export const agent = new Agent({
22
22
  })
23
23
  ```
24
24
 
25
- > To enable `workingMemory` on an agent, you’ll need a storage provider configured on your main Mastra instance. See [Mastra class](https://mastra.ai/reference/core/mastra-class) for more information.
25
+ > **Note:** To enable `workingMemory` on an agent, you’ll need a storage provider configured on your main Mastra instance. See [Mastra class](https://mastra.ai/reference/core/mastra-class) for more information.
26
26
 
27
27
  ## Constructor parameters
28
28
 
29
- **storage?:** (`MastraCompositeStore`): Storage implementation for persisting memory data. Defaults to \`new DefaultStorage({ config: { url: "file:memory.db" } })\` if not provided.
29
+ **storage** (`MastraCompositeStore`): Storage implementation for persisting memory data. Defaults to \`new DefaultStorage({ config: { url: "file:memory.db" } })\` if not provided.
30
30
 
31
- **vector?:** (`MastraVector | false`): Vector store for semantic search capabilities. Set to \`false\` to disable vector operations.
31
+ **vector** (`MastraVector | false`): Vector store for semantic search capabilities. Set to \`false\` to disable vector operations.
32
32
 
33
- **embedder?:** (`EmbeddingModel<string> | EmbeddingModelV2<string>`): Embedder instance for vector embeddings. Required when semantic recall is enabled.
33
+ **embedder** (`EmbeddingModel<string> | EmbeddingModelV2<string>`): Embedder instance for vector embeddings. Required when semantic recall is enabled.
34
34
 
35
- **options?:** (`MemoryConfig`): Memory configuration options.
35
+ **options** (`MemoryConfig`): Memory configuration options.
36
36
 
37
- ### Options parameters
37
+ **options.lastMessages** (`number | false`): Number of most recent messages to include in context. Set to \`false\` to disable loading conversation history into context. Use \`Number.MAX\_SAFE\_INTEGER\` to retrieve all messages with no limit. To prevent saving new messages, use the \`readOnly\` option instead.
38
38
 
39
- **lastMessages?:** (`number | false`): Number of most recent messages to include in context. Set to \`false\` to disable loading conversation history into context. Use \`Number.MAX\_SAFE\_INTEGER\` to retrieve all messages with no limit. To prevent saving new messages, use the \`readOnly\` option instead. (Default: `10`)
39
+ **options.readOnly** (`boolean`): When true, prevents memory from saving new messages and provides working memory as read-only context (without the updateWorkingMemory tool). Useful for read-only operations like previews, internal routing agents, or sub agents that should reference but not modify memory.
40
40
 
41
- **readOnly?:** (`boolean`): When true, prevents memory from saving new messages and provides working memory as read-only context (without the updateWorkingMemory tool). Useful for read-only operations like previews, internal routing agents, or sub agents that should reference but not modify memory. (Default: `false`)
41
+ **options.semanticRecall** (`boolean | { topK: number; messageRange: number | { before: number; after: number }; scope?: 'thread' | 'resource' }`): Enable semantic search in message history. Can be a boolean or an object with configuration options. When enabled, requires both vector store and embedder to be configured. Default topK is 4, default messageRange is {before: 1, after: 1}.
42
42
 
43
- **semanticRecall?:** (`boolean | { topK: number; messageRange: number | { before: number; after: number }; scope?: 'thread' | 'resource' }`): Enable semantic search in message history. Can be a boolean or an object with configuration options. When enabled, requires both vector store and embedder to be configured. Default topK is 4, default messageRange is {before: 1, after: 1}. (Default: `false`)
43
+ **options.workingMemory** (`WorkingMemory`): Configuration for working memory feature. Can be \`{ enabled: boolean; template?: string; schema?: ZodObject\<any> | JSONSchema7; scope?: 'thread' | 'resource' }\` or \`{ enabled: boolean }\` to disable.
44
44
 
45
- **workingMemory?:** (`WorkingMemory`): Configuration for working memory feature. Can be \`{ enabled: boolean; template?: string; schema?: ZodObject\<any> | JSONSchema7; scope?: 'thread' | 'resource' }\` or \`{ enabled: boolean }\` to disable. (Default: `{ enabled: false, template: '# User Information\n- **First Name**:\n- **Last Name**:\n...' }`)
45
+ **options.observationalMemory** (`boolean | ObservationalMemoryOptions`): Enable Observational Memory for long-context agentic memory. Set to \`true\` for defaults, or pass a config object to customize token budgets, models, and scope. See \[Observational Memory reference]\(/reference/memory/observational-memory) for configuration details.
46
46
 
47
- **observationalMemory?:** (`boolean | ObservationalMemoryOptions`): Enable Observational Memory for long-context agentic memory. Set to \`true\` for defaults, or pass a config object to customize token budgets, models, and scope. See \[Observational Memory reference]\(/reference/memory/observational-memory) for configuration details. (Default: `false`)
48
-
49
- **generateTitle?:** (`boolean | { model: DynamicArgument<MastraLanguageModel>; instructions?: DynamicArgument<string> }`): Controls automatic thread title generation from the user's first message. Can be a boolean or an object with custom model and instructions. (Default: `false`)
47
+ **options.generateTitle** (`boolean | { model: DynamicArgument<MastraLanguageModel>; instructions?: DynamicArgument<string> }`): Controls automatic thread title generation from the user's first message. Can be a boolean or an object with custom model and instructions.
50
48
 
51
49
  ## Returns
52
50
 
53
- **memory:** (`Memory`): A new Memory instance with the specified configuration.
51
+ **memory** (`Memory`): A new Memory instance with the specified configuration.
54
52
 
55
53
  ## Extended usage example
56
54