@mastra/mcp-docs-server 0.13.8-alpha.1 → 0.13.9-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 (29) hide show
  1. package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +14 -14
  2. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +23 -23
  3. package/.docs/organized/changelogs/%40mastra%2Fcloud.md +15 -15
  4. package/.docs/organized/changelogs/%40mastra%2Fcore.md +26 -26
  5. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +24 -24
  6. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +24 -24
  7. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +24 -24
  8. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +25 -25
  9. package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +14 -14
  10. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +23 -23
  11. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +14 -14
  12. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +11 -11
  13. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +13 -13
  14. package/.docs/organized/changelogs/%40mastra%2Fpg.md +23 -23
  15. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +28 -28
  16. package/.docs/organized/changelogs/%40mastra%2Frag.md +14 -14
  17. package/.docs/organized/changelogs/%40mastra%2Fserver.md +22 -22
  18. package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +14 -14
  19. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +14 -14
  20. package/.docs/organized/changelogs/create-mastra.md +15 -15
  21. package/.docs/organized/changelogs/mastra.md +46 -46
  22. package/.docs/organized/code-examples/memory-per-resource-example.md +10 -10
  23. package/.docs/organized/code-examples/memory-with-libsql.md +6 -7
  24. package/.docs/organized/code-examples/memory-with-pg.md +7 -8
  25. package/.docs/raw/agents/agent-memory.mdx +11 -7
  26. package/.docs/raw/reference/memory/getThreadsByResourceId.mdx +1 -0
  27. package/.docs/raw/reference/memory/getThreadsByResourceIdPaginated.mdx +187 -0
  28. package/.docs/raw/reference/tools/mcp-server.mdx +61 -7
  29. package/package.json +5 -5
@@ -1,5 +1,32 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 5.1.18-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [94f4812]
8
+ - Updated dependencies [e202b82]
9
+ - Updated dependencies [e00f6a0]
10
+ - @mastra/core@0.12.2-alpha.0
11
+ - @mastra/client-js@0.10.19-alpha.0
12
+
13
+ ## 5.1.17
14
+
15
+ ### Patch Changes
16
+
17
+ - d8e8349: dependencies updates:
18
+ - Updated dependency [`@xyflow/react@^12.8.2` ↗︎](https://www.npmjs.com/package/@xyflow/react/v/12.8.2) (from `^12.8.1`, in `dependencies`)
19
+ - c8924b6: dependencies updates:
20
+ - Updated dependency [`motion@^12.23.9` ↗︎](https://www.npmjs.com/package/motion/v/12.23.9) (from `^12.23.0`, in `dependencies`)
21
+ - Updated dependencies [6690a16]
22
+ - Updated dependencies [33dcb07]
23
+ - Updated dependencies [d0d9500]
24
+ - Updated dependencies [d30b1a0]
25
+ - Updated dependencies [bff87f7]
26
+ - Updated dependencies [b4a8df0]
27
+ - @mastra/client-js@0.10.18
28
+ - @mastra/core@0.12.1
29
+
3
30
  ## 5.1.17-alpha.0
4
31
 
5
32
  ### Patch Changes
@@ -271,32 +298,5 @@
271
298
  - d49334d: export tool list for usage in cloud
272
299
  - 9cdfcb5: fix infinite rerenders on agents table + share runtime context for cloud
273
300
  - 45174f3: share network list between core and cloud
274
- - 48f5532: export workflow list for usage in cloud
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
- - @mastra/client-js@0.10.14-alpha.1
282
-
283
- ## 5.1.13-alpha.0
284
-
285
- ### Patch Changes
286
-
287
- - 5130bcb: dependencies updates:
288
- - Updated dependency [`swr@^2.3.4` ↗︎](https://www.npmjs.com/package/swr/v/2.3.4) (from `^2.3.3`, in `dependencies`)
289
- - 984887a: dependencies updates:
290
- - Updated dependency [`prettier@^3.6.2` ↗︎](https://www.npmjs.com/package/prettier/v/3.6.2) (from `^3.5.3`, in `dependencies`)
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
- - aa9528a: Display reasoning in playground
295
- - 626b0f4: [Cloud-126] Working Memory Playground - Added working memory to playground to allow users to view/edit working memory
296
- - e1d0080: abstract Link component between cloud and core
297
- - f9b1508: add the same agent table as in cloud and export it from the playground
298
- - Updated dependencies [31f9f6b]
299
- - Updated dependencies [db5cc15]
300
- - Updated dependencies [5237998]
301
301
 
302
- ... 2278 more lines hidden. See full changelog in package directory.
302
+ ... 2305 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,18 @@
1
1
  # @mastra/rag
2
2
 
3
+ ## 1.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 613eec3: dependencies updates:
8
+ - Updated dependency [`node-html-better-parser@^1.5.2` ↗︎](https://www.npmjs.com/package/node-html-better-parser/v/1.5.2) (from `^1.5.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
  ## 1.0.6-alpha.0
4
17
 
5
18
  ### Patch Changes
@@ -285,18 +298,5 @@
285
298
  - Updated dependencies [82090c1]
286
299
  - Updated dependencies [1b443fd]
287
300
  - Updated dependencies [ce97900]
288
- - Updated dependencies [14a2566]
289
- - @mastra/core@0.10.4-alpha.0
290
-
291
- ## 0.10.2
292
-
293
- ### Patch Changes
294
-
295
- - a60d630: Adds runtime and initialization DB specific configuration to createVectorQueryTool to account for different configuration between db providers.
296
- - f0d559f: Fix peerdeps for alpha channel
297
- - Updated dependencies [ee77e78]
298
- - Updated dependencies [592a2db]
299
- - Updated dependencies [e5dc18d]
300
- - Updated dependencies [ab5adbe]
301
301
 
302
- ... 2324 more lines hidden. See full changelog in package directory.
302
+ ... 2337 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,26 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 0.12.2-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - e202b82: Add getThreadsByResourceIdPaginated to the Memory Class
8
+ - Updated dependencies [94f4812]
9
+ - Updated dependencies [e202b82]
10
+ - Updated dependencies [e00f6a0]
11
+ - @mastra/core@0.12.2-alpha.0
12
+
13
+ ## 0.12.1
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [33dcb07]
18
+ - Updated dependencies [d0d9500]
19
+ - Updated dependencies [d30b1a0]
20
+ - Updated dependencies [bff87f7]
21
+ - Updated dependencies [b4a8df0]
22
+ - @mastra/core@0.12.1
23
+
3
24
  ## 0.12.1-alpha.1
4
25
 
5
26
  ### Patch Changes
@@ -277,26 +298,5 @@
277
298
  - Updated dependencies [c3a30de]
278
299
  - Updated dependencies [cf3a184]
279
300
  - 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
301
 
302
- ... 2637 more lines hidden. See full changelog in package directory.
302
+ ... 2658 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,19 @@
1
1
  # create-mastra
2
2
 
3
+ ## 0.10.19-alpha.0
4
+
5
+ ## 0.10.15
6
+
7
+ ### Patch Changes
8
+
9
+ - ad04455: Missed changeset in last release, needed to include create-mastra
10
+
11
+ ## 0.10.15-alpha.0
12
+
13
+ ### Patch Changes
14
+
15
+ - ad04455: Missed changeset in last release, needed to include create-mastra
16
+
3
17
  ## 0.10.14
4
18
 
5
19
  ### Patch Changes
@@ -285,18 +299,4 @@
285
299
  - 3270d9d: Fix runtime context being undefined
286
300
  - fc677d7: For final result for a workflow
287
301
 
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
-
302
- ... 1139 more lines hidden. See full changelog in package directory.
302
+ ... 1153 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,50 @@
1
1
  # mastra
2
2
 
3
+ ## 0.10.19-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [94f4812]
8
+ - Updated dependencies [e202b82]
9
+ - Updated dependencies [e00f6a0]
10
+ - @mastra/core@0.12.2-alpha.0
11
+ - @mastra/deployer@0.12.2-alpha.0
12
+
13
+ ## 0.10.18
14
+
15
+ ### Patch Changes
16
+
17
+ - ad04455: Missed changeset in last release, needed to include create-mastra
18
+
19
+ ## 0.10.18-alpha.0
20
+
21
+ ### Patch Changes
22
+
23
+ - ad04455: Missed changeset in last release, needed to include create-mastra
24
+
25
+ ## 0.10.17
26
+
27
+ ### Patch Changes
28
+
29
+ - 9862477: Install specific ai v4 deps when scaffolding a project
30
+ - 33dcb07: dependencies updates:
31
+ - Updated dependency [`@opentelemetry/instrumentation@^0.203.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/instrumentation/v/0.203.0) (from `^0.202.0`, in `dependencies`)
32
+ - 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`)
33
+ - 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`)
34
+ - 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`)
35
+ - 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`)
36
+ - 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`)
37
+ - Updated dependencies [33dcb07]
38
+ - Updated dependencies [f90797b]
39
+ - Updated dependencies [d0d9500]
40
+ - Updated dependencies [d30b1a0]
41
+ - Updated dependencies [bff87f7]
42
+ - Updated dependencies [07fe7a2]
43
+ - Updated dependencies [b4a8df0]
44
+ - @mastra/core@0.12.1
45
+ - @mastra/mcp@0.10.9
46
+ - @mastra/deployer@0.12.1
47
+
3
48
  ## 0.10.17-alpha.1
4
49
 
5
50
  ### Patch Changes
@@ -253,50 +298,5 @@
253
298
  - Updated dependencies [dcd4802]
254
299
  - Updated dependencies [7ba91fa]
255
300
  - 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
+ ... 4728 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
  ```
@@ -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)