@mastra/mcp-docs-server 0.13.8 → 0.13.9-alpha.1

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 (39) hide show
  1. package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +14 -14
  2. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +15 -15
  3. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +33 -33
  4. package/.docs/organized/changelogs/%40mastra%2Fcloud.md +15 -15
  5. package/.docs/organized/changelogs/%40mastra%2Fcore.md +38 -38
  6. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +38 -38
  7. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +36 -36
  8. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +36 -36
  9. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +39 -39
  10. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +16 -16
  11. package/.docs/organized/changelogs/%40mastra%2Fevals.md +17 -17
  12. package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +27 -27
  13. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +15 -15
  14. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +33 -33
  15. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +14 -14
  16. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +23 -23
  17. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +27 -27
  18. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +28 -1
  19. package/.docs/organized/changelogs/%40mastra%2Fpg.md +23 -23
  20. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +40 -40
  21. package/.docs/organized/changelogs/%40mastra%2Frag.md +26 -26
  22. package/.docs/organized/changelogs/%40mastra%2Fserver.md +32 -32
  23. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +15 -15
  24. package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +14 -14
  25. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +14 -14
  26. package/.docs/organized/changelogs/create-mastra.md +17 -17
  27. package/.docs/organized/changelogs/mastra.md +60 -60
  28. package/.docs/organized/code-examples/memory-per-resource-example.md +10 -10
  29. package/.docs/organized/code-examples/memory-with-libsql.md +6 -7
  30. package/.docs/organized/code-examples/memory-with-pg.md +7 -8
  31. package/.docs/raw/agents/agent-memory.mdx +11 -7
  32. package/.docs/raw/memory/semantic-recall.mdx +2 -0
  33. package/.docs/raw/memory/working-memory.mdx +1 -1
  34. package/.docs/raw/rag/chunking-and-embedding.mdx +19 -3
  35. package/.docs/raw/reference/memory/getThreadsByResourceId.mdx +1 -0
  36. package/.docs/raw/reference/memory/getThreadsByResourceIdPaginated.mdx +187 -0
  37. package/.docs/raw/reference/rag/chunk.mdx +169 -18
  38. package/.docs/raw/reference/tools/mcp-server.mdx +61 -7
  39. package/package.json +4 -4
@@ -1,5 +1,36 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 0.13.0-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ea0c5f2]
8
+ - Updated dependencies [b0e43c1]
9
+ - Updated dependencies [1fb812e]
10
+ - Updated dependencies [35c5798]
11
+ - @mastra/core@0.13.0-alpha.1
12
+
13
+ ## 0.12.2-alpha.0
14
+
15
+ ### Patch Changes
16
+
17
+ - e202b82: Add getThreadsByResourceIdPaginated to the Memory Class
18
+ - Updated dependencies [94f4812]
19
+ - Updated dependencies [e202b82]
20
+ - Updated dependencies [e00f6a0]
21
+ - @mastra/core@0.12.2-alpha.0
22
+
23
+ ## 0.12.1
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [33dcb07]
28
+ - Updated dependencies [d0d9500]
29
+ - Updated dependencies [d30b1a0]
30
+ - Updated dependencies [bff87f7]
31
+ - Updated dependencies [b4a8df0]
32
+ - @mastra/core@0.12.1
33
+
3
34
  ## 0.12.1-alpha.1
4
35
 
5
36
  ### Patch Changes
@@ -268,35 +299,4 @@
268
299
  - Updated dependencies [6c89d7f]
269
300
  - @mastra/core@0.10.15
270
301
 
271
- ## 0.10.15-alpha.1
272
-
273
- ### Patch Changes
274
-
275
- - Updated dependencies [0b56518]
276
- - Updated dependencies [2ba5b76]
277
- - Updated dependencies [c3a30de]
278
- - Updated dependencies [cf3a184]
279
- - Updated dependencies [d6bfd60]
280
- - @mastra/core@0.10.15-alpha.1
281
-
282
- ## 0.10.15-alpha.0
283
-
284
- ### Patch Changes
285
-
286
- - 626b0f4: [Cloud-126] Working Memory Playground - Added working memory to playground to allow users to view/edit working memory
287
- - Updated dependencies [db5cc15]
288
- - Updated dependencies [5237998]
289
- - Updated dependencies [37c1acd]
290
- - Updated dependencies [1aa60b1]
291
- - Updated dependencies [89ec9d4]
292
- - Updated dependencies [626b0f4]
293
- - Updated dependencies [c22a91f]
294
- - Updated dependencies [f7403ab]
295
- - Updated dependencies [6c89d7f]
296
- - @mastra/core@0.10.15-alpha.0
297
-
298
- ## 0.10.14
299
-
300
- ### Patch Changes
301
-
302
- ... 2637 more lines hidden. See full changelog in package directory.
302
+ ... 2668 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,19 @@
1
1
  # @mastra/upstash
2
2
 
3
+ ## 0.14.0-alpha.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ea0c5f2: Add store support to new score api
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [ea0c5f2]
12
+ - Updated dependencies [b0e43c1]
13
+ - Updated dependencies [1fb812e]
14
+ - Updated dependencies [35c5798]
15
+ - @mastra/core@0.13.0-alpha.1
16
+
3
17
  ## 0.13.0
4
18
 
5
19
  ### Minor Changes
@@ -284,19 +298,5 @@
284
298
 
285
299
  - 704d1ca: Thread Timestamp Auto-Update Enhancement
286
300
  Added automatic thread updatedAt timestamp updates when messages are saved across all storage providers
287
- Enhanced user experience: Threads now accurately reflect their latest activity with automatic timestamp updates when new messages are added
288
- Universal implementation: Consistent behavior across all 7 storage backends (ClickHouse, Cloudflare D1, DynamoDB, MongoDB, PostgreSQL, Upstash, LibSQL)
289
- Performance optimized: Updates execute in parallel with message saving operations for minimal performance impact
290
- Backwards compatible: No breaking changes - existing code continues to work unchanged
291
- Improved conversation ordering: Chat interfaces can now properly sort threads by actual last activity
292
- This enhancement resolves the issue where active conversations appeared stale due to outdated thread timestamps, providing better conversation management and user experience in chat applications.
293
-
294
- ### Patch Changes
295
-
296
- - 2fda031: Clarify upstash argument concepts.
297
- - e8fdbdd: Fix dynamic require of crypto using upstash.
298
- caused by a bad import was used in the monorepo
299
-
300
- Fixes #4801
301
301
 
302
- ... 1787 more lines hidden. See full changelog in package directory.
302
+ ... 1801 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,18 @@
1
1
  # @mastra/voice-murf
2
2
 
3
+ ## 0.10.7
4
+
5
+ ### Patch Changes
6
+
7
+ - dcbfcb5: dependencies updates:
8
+ - Updated dependency [`ky@^1.8.2` ā†—ļøŽ](https://www.npmjs.com/package/ky/v/1.8.2) (from `^1.8.1`, in `dependencies`)
9
+ - Updated dependencies [33dcb07]
10
+ - Updated dependencies [d0d9500]
11
+ - Updated dependencies [d30b1a0]
12
+ - Updated dependencies [bff87f7]
13
+ - Updated dependencies [b4a8df0]
14
+ - @mastra/core@0.12.1
15
+
3
16
  ## 0.10.7-alpha.0
4
17
 
5
18
  ### Patch Changes
@@ -286,17 +299,4 @@
286
299
  - Updated dependencies [3e9c131]
287
300
  - @mastra/core@0.9.4-alpha.4
288
301
 
289
- ## 0.1.18-alpha.3
290
-
291
- ### Patch Changes
292
-
293
- - Updated dependencies [396be50]
294
- - Updated dependencies [c3bd795]
295
- - Updated dependencies [da082f8]
296
- - Updated dependencies [a5810ce]
297
- - @mastra/core@0.9.4-alpha.3
298
-
299
- ## 0.1.18-alpha.2
300
-
301
-
302
- ... 1043 more lines hidden. See full changelog in package directory.
302
+ ... 1056 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,18 @@
1
1
  # @mastra/voice-openai
2
2
 
3
+ ## 0.10.7
4
+
5
+ ### Patch Changes
6
+
7
+ - df0bf51: dependencies updates:
8
+ - Updated dependency [`openai@^5.10.2` ā†—ļøŽ](https://www.npmjs.com/package/openai/v/5.10.2) (from `^5.10.1`, in `dependencies`)
9
+ - Updated dependencies [33dcb07]
10
+ - Updated dependencies [d0d9500]
11
+ - Updated dependencies [d30b1a0]
12
+ - Updated dependencies [bff87f7]
13
+ - Updated dependencies [b4a8df0]
14
+ - @mastra/core@0.12.1
15
+
3
16
  ## 0.10.7-alpha.0
4
17
 
5
18
  ### Patch Changes
@@ -285,18 +298,5 @@
285
298
 
286
299
  ### Patch Changes
287
300
 
288
- - Updated dependencies [f53a6ac]
289
- - Updated dependencies [eabdcd9]
290
- - Updated dependencies [90be034]
291
- - Updated dependencies [99f050a]
292
- - Updated dependencies [d0ee3c6]
293
- - Updated dependencies [23f258c]
294
- - Updated dependencies [2672a05]
295
- - @mastra/core@0.9.5-alpha.0
296
-
297
- ## 0.1.19
298
-
299
- ### Patch Changes
300
-
301
301
 
302
- ... 1069 more lines hidden. See full changelog in package directory.
302
+ ... 1082 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,21 @@
1
1
  # create-mastra
2
2
 
3
+ ## 0.10.19-alpha.1
4
+
5
+ ## 0.10.19-alpha.0
6
+
7
+ ## 0.10.15
8
+
9
+ ### Patch Changes
10
+
11
+ - ad04455: Missed changeset in last release, needed to include create-mastra
12
+
13
+ ## 0.10.15-alpha.0
14
+
15
+ ### Patch Changes
16
+
17
+ - ad04455: Missed changeset in last release, needed to include create-mastra
18
+
3
19
  ## 0.10.14
4
20
 
5
21
  ### Patch Changes
@@ -282,21 +298,5 @@
282
298
  ### Patch Changes
283
299
 
284
300
  - 44ba52d: Add proper error message when installation of mastra fails
285
- - 3270d9d: Fix runtime context being undefined
286
- - fc677d7: For final result for a workflow
287
-
288
- ## 0.10.5-alpha.0
289
-
290
- ### Patch Changes
291
-
292
- - 02560d4: lift evals fetching to the playground package instead
293
- - 63f6b7d: dependencies updates:
294
- - Updated dependency [`execa@^9.6.0` ā†—ļøŽ](https://www.npmjs.com/package/execa/v/9.6.0) (from `^9.5.2`, in `dependencies`)
295
- - Updated dependency [`pino@^9.7.0` ā†—ļøŽ](https://www.npmjs.com/package/pino/v/9.7.0) (from `^9.6.0`, in `dependencies`)
296
- - Updated dependency [`posthog-node@^4.18.0` ā†—ļøŽ](https://www.npmjs.com/package/posthog-node/v/4.18.0) (from `^4.10.1`, in `dependencies`)
297
- - 311132e: move useWorkflow to playground instead of playground-ui
298
- - 53d3c37: Get workflows from an agent if not found from Mastra instance #5083
299
-
300
- ## 0.10.4
301
301
 
302
- ... 1139 more lines hidden. See full changelog in package directory.
302
+ ... 1155 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,64 @@
1
1
  # mastra
2
2
 
3
+ ## 0.10.19-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ea0c5f2: Update to support new scorer api
8
+ - 35c5798: Add support for transpilePackages option
9
+ - Updated dependencies [7b8172f]
10
+ - Updated dependencies [ea0c5f2]
11
+ - Updated dependencies [b0e43c1]
12
+ - Updated dependencies [1fb812e]
13
+ - Updated dependencies [35c5798]
14
+ - @mastra/deployer@0.13.0-alpha.1
15
+ - @mastra/core@0.13.0-alpha.1
16
+
17
+ ## 0.10.19-alpha.0
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [94f4812]
22
+ - Updated dependencies [e202b82]
23
+ - Updated dependencies [e00f6a0]
24
+ - @mastra/core@0.12.2-alpha.0
25
+ - @mastra/deployer@0.12.2-alpha.0
26
+
27
+ ## 0.10.18
28
+
29
+ ### Patch Changes
30
+
31
+ - ad04455: Missed changeset in last release, needed to include create-mastra
32
+
33
+ ## 0.10.18-alpha.0
34
+
35
+ ### Patch Changes
36
+
37
+ - ad04455: Missed changeset in last release, needed to include create-mastra
38
+
39
+ ## 0.10.17
40
+
41
+ ### Patch Changes
42
+
43
+ - 9862477: Install specific ai v4 deps when scaffolding a project
44
+ - 33dcb07: dependencies updates:
45
+ - Updated dependency [`@opentelemetry/instrumentation@^0.203.0` ā†—ļøŽ](https://www.npmjs.com/package/@opentelemetry/instrumentation/v/0.203.0) (from `^0.202.0`, in `dependencies`)
46
+ - Updated dependency [`@opentelemetry/auto-instrumentations-node@^0.62.0` ā†—ļøŽ](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node/v/0.62.0) (from `^0.60.1`, in `dependencies`)
47
+ - Updated dependency [`@opentelemetry/exporter-trace-otlp-grpc@^0.203.0` ā†—ļøŽ](https://www.npmjs.com/package/@opentelemetry/exporter-trace-otlp-grpc/v/0.203.0) (from `^0.202.0`, in `dependencies`)
48
+ - Updated dependency [`@opentelemetry/exporter-trace-otlp-http@^0.203.0` ā†—ļøŽ](https://www.npmjs.com/package/@opentelemetry/exporter-trace-otlp-http/v/0.203.0) (from `^0.202.0`, in `dependencies`)
49
+ - Updated dependency [`@opentelemetry/sdk-node@^0.203.0` ā†—ļøŽ](https://www.npmjs.com/package/@opentelemetry/sdk-node/v/0.203.0) (from `^0.202.0`, in `dependencies`)
50
+ - Updated dependency [`@opentelemetry/semantic-conventions@^1.36.0` ā†—ļøŽ](https://www.npmjs.com/package/@opentelemetry/semantic-conventions/v/1.36.0) (from `^1.34.0`, in `dependencies`)
51
+ - Updated dependencies [33dcb07]
52
+ - Updated dependencies [f90797b]
53
+ - Updated dependencies [d0d9500]
54
+ - Updated dependencies [d30b1a0]
55
+ - Updated dependencies [bff87f7]
56
+ - Updated dependencies [07fe7a2]
57
+ - Updated dependencies [b4a8df0]
58
+ - @mastra/core@0.12.1
59
+ - @mastra/mcp@0.10.9
60
+ - @mastra/deployer@0.12.1
61
+
3
62
  ## 0.10.17-alpha.1
4
63
 
5
64
  ### Patch Changes
@@ -239,64 +298,5 @@
239
298
  - Updated dependencies [45469c5]
240
299
  - Updated dependencies [40c2525]
241
300
  - Updated dependencies [e473f27]
242
- - Updated dependencies [032cb66]
243
- - Updated dependencies [24eb25c]
244
- - Updated dependencies [703ac71]
245
- - Updated dependencies [a723d69]
246
- - Updated dependencies [4c06f06]
247
- - Updated dependencies [5889a31]
248
- - Updated dependencies [65e3395]
249
- - Updated dependencies [9de6f58]
250
- - Updated dependencies [4933192]
251
- - Updated dependencies [d1c77a4]
252
- - Updated dependencies [bea9dd1]
253
- - Updated dependencies [dcd4802]
254
- - Updated dependencies [7ba91fa]
255
- - Updated dependencies [15ce274]
256
- - @mastra/core@0.11.0-alpha.2
257
- - @mastra/deployer@0.11.0-alpha.2
258
-
259
- ## 0.10.14-alpha.1
260
-
261
- ### Patch Changes
262
-
263
- - 8f89bcd: fix traces pagination + sharing trace view with cloud
264
- - 59f0dcd: Add light background color for step statuses
265
- - cf8d497: factorize tabs component between cloud and core
266
- - 80692d5: refactor: sharing only the UI and not data fetching for traces
267
- - Updated dependencies [7983e53]
268
- - @mastra/deployer@0.11.0-alpha.1
269
- - @mastra/core@0.11.0-alpha.1
270
-
271
- ## 0.10.14-alpha.0
272
-
273
- ### Patch Changes
274
-
275
- - 0bf0bc8: fix link in shared components + add e2e tests
276
- - 7827943: Handle streaming large data
277
- - 808b493: wrap runtime context with tooltip provider for usage in cloud
278
- - Updated dependencies [0938991]
279
- - Updated dependencies [6f50efd]
280
- - Updated dependencies [bf6903e]
281
- - Updated dependencies [7827943]
282
- - Updated dependencies [bf1e7e7]
283
- - Updated dependencies [cbddd18]
284
- - @mastra/deployer@0.11.0-alpha.0
285
- - @mastra/core@0.11.0-alpha.0
286
-
287
- ## 0.10.13
288
-
289
- ### Patch Changes
290
301
 
291
- - 593631d: allow to pass ref to the link abstraction
292
- - 5237998: Fix foreach output
293
- - 1aa60b1: Pipe runtimeContext to vNext network agent stream and generate steps, wire up runtimeContext for vNext Networks in cliet SDK & playground
294
- - d49334d: export tool list for usage in cloud
295
- - 9cdfcb5: fix infinite rerenders on agents table + share runtime context for cloud
296
- - 794d9f3: Fix thread creation in playground
297
- - 5130bcb: dependencies updates:
298
- - Updated dependency [`swr@^2.3.4` ā†—ļøŽ](https://www.npmjs.com/package/swr/v/2.3.4) (from `^2.3.3`, in `dependencies`)
299
- - 984887a: dependencies updates:
300
- - Updated dependency [`prettier@^3.6.2` ā†—ļøŽ](https://www.npmjs.com/package/prettier/v/3.6.2) (from `^3.5.3`, in `dependencies`)
301
-
302
- ... 4683 more lines hidden. See full changelog in package directory.
302
+ ... 4742 more lines hidden. See full changelog in package directory.
@@ -66,33 +66,33 @@ const userChoice = await new Promise<string>(resolve => {
66
66
  });
67
67
  });
68
68
 
69
- let resourceId: string;
69
+ let resource: string;
70
70
  let userName: string;
71
71
 
72
72
  switch (userChoice) {
73
73
  case '1':
74
- resourceId = USERS.alice;
74
+ resource = USERS.alice;
75
75
  userName = 'Alice';
76
76
  break;
77
77
  case '2':
78
- resourceId = USERS.bob;
78
+ resource = USERS.bob;
79
79
  userName = 'Bob';
80
80
  break;
81
81
  case '3':
82
- resourceId = USERS.demo;
82
+ resource = USERS.demo;
83
83
  userName = 'Demo User';
84
84
  break;
85
85
  default:
86
- resourceId = `user-${randomUUID()}`;
86
+ resource = `user-${randomUUID()}`;
87
87
  userName = 'Random User';
88
88
  }
89
89
 
90
90
  // Always generate a new thread ID to demonstrate cross-thread persistence
91
- const threadId = randomUUID();
91
+ const thread = randomUUID();
92
92
 
93
93
  console.log(chalk.green(`\nāœ… Simulating: ${userName}`));
94
- console.log(chalk.gray(`šŸ“§ Resource ID: ${resourceId}`));
95
- console.log(chalk.gray(`🧵 Thread ID: ${threadId}`));
94
+ console.log(chalk.gray(`šŸ“§ Resource ID: ${resource}`));
95
+ console.log(chalk.gray(`🧵 Thread ID: ${thread}`));
96
96
  console.log(chalk.bold.yellow('\nšŸ’” TIP: Run this example multiple times with the same user choice'));
97
97
  console.log(chalk.bold.yellow(' to see how working memory persists across conversation threads!\n'));
98
98
 
@@ -130,7 +130,7 @@ async function main() {
130
130
  If this is a returning user, greet them warmly and reference what you remember!`,
131
131
  },
132
132
  ],
133
- { threadId, resourceId },
133
+ { memory: { thread, resource } },
134
134
  ),
135
135
  );
136
136
 
@@ -147,7 +147,7 @@ async function main() {
147
147
  break;
148
148
  }
149
149
 
150
- await logResponse(await agent.stream(userInput, { threadId, resourceId }));
150
+ await logResponse(await agent.stream(userInput, { memory: { thread, resource } }));
151
151
  }
152
152
 
153
153
  rl.close();
@@ -21,12 +21,12 @@ import { mastra } from './mastra';
21
21
 
22
22
  const agent = mastra.getAgent('memoryAgent');
23
23
 
24
- let threadId = randomUUID();
24
+ let thread = randomUUID();
25
25
  // use this to play with a long running conversation. comment it out to get a new thread id every time
26
- threadId = `f45a59b3-d9da-4a2a-8348-9386e4e621a3`;
27
- console.log(threadId);
26
+ thread = `f45a59b3-d9da-4a2a-8348-9386e4e621a3`;
27
+ console.log(thread);
28
28
 
29
- const resourceId = 'SOME_USER_ID';
29
+ const resource = 'SOME_USER_ID';
30
30
 
31
31
  async function logRes(res: Awaited<ReturnType<typeof agent.stream>>) {
32
32
  console.log(`\nšŸ¤– Agent:`);
@@ -45,7 +45,7 @@ async function main() {
45
45
  content: `Chat with user started now ${new Date().toISOString()}. Don't mention this message. This means some time may have passed between this message and the one before. The user left and came back again. Say something to start the conversation up again. If there are no other messages besides this one then this is a new conversation.`,
46
46
  },
47
47
  ],
48
- { resourceId, threadId },
48
+ { memory: { resource, thread } },
49
49
  ),
50
50
  );
51
51
 
@@ -63,8 +63,7 @@ async function main() {
63
63
 
64
64
  await logRes(
65
65
  await agent.stream(prompt, {
66
- threadId,
67
- resourceId,
66
+ memory: { thread, resource },
68
67
  }),
69
68
  );
70
69
  }
@@ -26,13 +26,13 @@ import { mastra } from './mastra';
26
26
 
27
27
  const agent = mastra.getAgent('memoryAgent');
28
28
 
29
- let threadId = randomUUID();
29
+ let thread = randomUUID();
30
30
  // use this to play with a long running conversation. comment it out to get a new thread id every time
31
- threadId = `39873fbf-84d6-425e-8c1b-8afd798d72a4`;
32
- // threadId = `12569b14-3e16-4e31-8130-8d9676f1932c`;
33
- console.log(threadId);
31
+ thread = `39873fbf-84d6-425e-8c1b-8afd798d72a4`;
32
+ // thread = `12569b14-3e16-4e31-8130-8d9676f1932c`;
33
+ console.log(thread);
34
34
 
35
- const resourceId = 'SOME_USER_ID';
35
+ const resource = 'SOME_USER_ID';
36
36
 
37
37
  async function logRes(res: Awaited<ReturnType<typeof agent.stream>>) {
38
38
  console.log(`\nšŸ¤– Agent:`);
@@ -51,7 +51,7 @@ async function main() {
51
51
  content: `Chat with user started now ${new Date().toISOString()}. Don't mention this message. This means some time may have passed between this message and the one before. The user left and came back again. Say something to start the conversation up again.`,
52
52
  },
53
53
  ],
54
- { resourceId, threadId },
54
+ { memory: { resource, thread } },
55
55
  ),
56
56
  );
57
57
 
@@ -69,8 +69,7 @@ async function main() {
69
69
 
70
70
  await logRes(
71
71
  await agent.stream(prompt, {
72
- threadId,
73
- resourceId,
72
+ memory: { thread, resource },
74
73
  }),
75
74
  );
76
75
  }
@@ -165,22 +165,26 @@ const response = await agent.generate("Remember my favorite color is blue.", {
165
165
 
166
166
  ## Using Memory in Agent Calls
167
167
 
168
- To utilize memory during interactions, you **must** provide `resourceId` and `threadId` when calling the agent's `stream()` or `generate()` methods.
168
+ To utilize memory during interactions, you **must** provide a `memory` object with `resource` and `thread` properties when calling the agent's `stream()` or `generate()` methods.
169
169
 
170
- - `resourceId`: Typically identifies the user or entity (e.g., `user_123`).
171
- - `threadId`: Identifies a specific conversation thread (e.g., `support_chat_456`).
170
+ - `resource`: Typically identifies the user or entity (e.g., `user_123`).
171
+ - `thread`: Identifies a specific conversation thread (e.g., `support_chat_456`).
172
172
 
173
173
  ```typescript
174
174
  // Example agent call using memory
175
175
  await agent.stream("Remember my favorite color is blue.", {
176
- resourceId: "user_alice",
177
- threadId: "preferences_thread",
176
+ memory: {
177
+ resource: "user_alice",
178
+ thread: "preferences_thread",
179
+ },
178
180
  });
179
181
 
180
182
  // Later in the same thread...
181
183
  const response = await agent.stream("What's my favorite color?", {
182
- resourceId: "user_alice",
183
- threadId: "preferences_thread",
184
+ memory: {
185
+ resource: "user_alice",
186
+ thread: "preferences_thread",
187
+ },
184
188
  });
185
189
  // Agent will use memory to recall the favorite color.
186
190
  ```
@@ -2,6 +2,8 @@
2
2
 
3
3
  If you ask your friend what they did last weekend, they will search in their memory for events associated with "last weekend" and then tell you what they did. That's sort of like how semantic recall works in Mastra.
4
4
 
5
+ > **šŸ“¹ Watch**: What semantic recall is, how it works, and how to configure it in Mastra → [YouTube (5 minutes)](https://youtu.be/UVZtK8cK8xQ)
6
+
5
7
  ## How Semantic Recall Works
6
8
 
7
9
  Semantic recall is RAG-based search that helps agents maintain context across longer interactions when messages are no longer within [recent conversation history](./overview.mdx#conversation-history).
@@ -43,7 +43,7 @@ const agent = new Agent({
43
43
 
44
44
  Working memory is a block of Markdown text that the agent is able to update over time to store continuously relevant information:
45
45
 
46
- <YouTube id="ik-ld_XA96s" />
46
+ <YouTube id="UMy_JHLf1n8" />
47
47
 
48
48
  ## Memory Persistence Scopes
49
49
 
@@ -25,21 +25,37 @@ Use `chunk` to split documents into manageable pieces. Mastra supports multiple
25
25
  - `html`: HTML structure-aware splitting
26
26
  - `json`: JSON structure-aware splitting
27
27
  - `latex`: LaTeX structure-aware splitting
28
+ - `sentence`: Sentence-aware splitting
29
+
30
+ **Note:** Each strategy accepts different parameters optimized for its chunking approach.
28
31
 
29
32
  Here's an example of how to use the `recursive` strategy:
30
33
 
31
34
  ```ts showLineNumbers copy
32
35
  const chunks = await doc.chunk({
33
36
  strategy: "recursive",
34
- size: 512,
37
+ maxSize: 512,
35
38
  overlap: 50,
36
- separator: "\n",
39
+ separators: ["\n"],
37
40
  extract: {
38
41
  metadata: true, // Optionally extract metadata
39
42
  },
40
43
  });
41
44
  ```
42
45
 
46
+ For text where preserving sentence structure is important, here's an example of how to use the `sentence` strategy:
47
+
48
+ ```ts showLineNumbers copy
49
+ const chunks = await doc.chunk({
50
+ strategy: "sentence",
51
+ maxSize: 450,
52
+ minSize: 50,
53
+ overlap: 0,
54
+ sentenceEnders: ["."],
55
+ keepSeparator: true,
56
+ });
57
+ ```
58
+
43
59
  **Note:** Metadata extraction may use LLM calls, so ensure your API key is set.
44
60
 
45
61
  We go deeper into chunking strategies in our [chunk documentation](/reference/rag/chunk.mdx).
@@ -130,7 +146,7 @@ const doc = MDocument.fromText(`
130
146
  // Create chunks
131
147
  const chunks = await doc.chunk({
132
148
  strategy: "recursive",
133
- size: 256,
149
+ maxSize: 256,
134
150
  overlap: 50,
135
151
  });
136
152
 
@@ -75,6 +75,7 @@ interface ThreadSortOptions {
75
75
  ### Related
76
76
 
77
77
  - [Memory Class Reference](/reference/memory/Memory.mdx)
78
+ - [getThreadsByResourceIdPaginated](/reference/memory/getThreadsByResourceIdPaginated.mdx) - Paginated version
78
79
  - [Getting Started with Memory](/docs/memory/overview.mdx) (Covers threads/resources concept)
79
80
  - [createThread](/reference/memory/createThread.mdx)
80
81
  - [getThreadById](/reference/memory/getThreadById.mdx)