@memori.ai/memori-api-client 5.1.1 → 5.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
 
2
2
 
3
+ ## [5.2.0](https://github.com/memori-ai/memori-api-client/compare/v5.1.1...v5.2.0) (2024-09-25)
4
+
5
+
6
+ ### Features
7
+
8
+ * added pagination search and filter apis ([419397e](https://github.com/memori-ai/memori-api-client/commit/419397e3bf4a096c6a3fcfc9e70d26e15ab9563f))
9
+
10
+
11
+ ### Maintenance
12
+
13
+ * fix typo + format code ([95bcf01](https://github.com/memori-ai/memori-api-client/commit/95bcf011079c0f9cb97dda5595c5086f43f2e27a))
14
+
3
15
  ## [5.1.1](https://github.com/memori-ai/memori-api-client/compare/v5.1.0...v5.1.1) (2024-09-10)
4
16
 
5
17
 
@@ -3,6 +3,18 @@ declare const _default: (apiUrl: string) => {
3
3
  searchMemory: (sessionId: string, query?: SearchQuery) => Promise<ResponseSpec & {
4
4
  matches: SearchMatches[];
5
5
  }>;
6
+ searchMemoryPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: SearchQuery) => Promise<ResponseSpec & {
7
+ count: number;
8
+ matches: SearchMatches[];
9
+ }>;
10
+ filterMemories: (sessionId: string, query?: SearchQuery) => Promise<ResponseSpec & {
11
+ count: number;
12
+ matches: SearchMatches[];
13
+ }>;
14
+ filterMemoriesPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: SearchQuery) => Promise<ResponseSpec & {
15
+ count: number;
16
+ matches: SearchMatches[];
17
+ }>;
6
18
  getRandomMemory: (sessionId: string, query?: SearchQuery) => Promise<ResponseSpec & {
7
19
  memories: Memory[];
8
20
  }>;
@@ -7,6 +7,21 @@ exports.default = (apiUrl) => ({
7
7
  body: query,
8
8
  apiUrl,
9
9
  }),
10
+ searchMemoryPaginated: async (sessionId, pageIndex, pageSize, query) => (0, apiFetcher_1.apiFetcher)(`/Search/${sessionId}/${pageIndex}/${pageSize}`, {
11
+ method: 'POST',
12
+ body: query,
13
+ apiUrl,
14
+ }),
15
+ filterMemories: async (sessionId, query) => (0, apiFetcher_1.apiFetcher)(`/FilterMemories/${sessionId}`, {
16
+ method: 'POST',
17
+ body: query,
18
+ apiUrl,
19
+ }),
20
+ filterMemoriesPaginated: async (sessionId, pageIndex, pageSize, query) => (0, apiFetcher_1.apiFetcher)(`/FilterMemories/${sessionId}/${pageIndex}/${pageSize}`, {
21
+ method: 'POST',
22
+ body: query,
23
+ apiUrl,
24
+ }),
10
25
  getRandomMemory: async (sessionId, query) => (0, apiFetcher_1.apiFetcher)(`/Random/${sessionId}`, {
11
26
  method: 'POST',
12
27
  body: query,
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/engine/search.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAQ3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,YAAY,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CAC7D,IAAA,uBAAU,EAAC,WAAW,SAAS,EAAE,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IAQH,eAAe,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CAChE,IAAA,uBAAU,EAAC,WAAW,SAAS,EAAE,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IASH,QAAQ,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CACzD,IAAA,uBAAU,EAAC,UAAU,SAAS,EAAE,EAAE;QAChC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IAMH,aAAa,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CACzC,IAAA,uBAAU,EAAC,eAAe,SAAS,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,QAAQ,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CACzD,IAAA,uBAAU,EAAC,UAAU,SAAS,EAAE,EAAE;QAChC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IAMH,aAAa,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CACzC,IAAA,uBAAU,EAAC,eAAe,SAAS,EAAE,EAAE;QACrC,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAIA;CACJ,CAAC,CAAC"}
package/dist/engine.d.ts CHANGED
@@ -326,6 +326,18 @@ declare const _default: (apiUrl: string) => {
326
326
  searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
327
327
  matches: import("./types").SearchMatches[];
328
328
  }>;
329
+ searchMemoryPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
330
+ count: number;
331
+ matches: import("./types").SearchMatches[];
332
+ }>;
333
+ filterMemories: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
334
+ count: number;
335
+ matches: import("./types").SearchMatches[];
336
+ }>;
337
+ filterMemoriesPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
338
+ count: number;
339
+ matches: import("./types").SearchMatches[];
340
+ }>;
329
341
  getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
330
342
  memories: import("./types").Memory[];
331
343
  }>;
@@ -339,6 +351,18 @@ declare const _default: (apiUrl: string) => {
339
351
  searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
340
352
  matches: import("./types").SearchMatches[];
341
353
  }>;
354
+ searchMemoryPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
355
+ count: number;
356
+ matches: import("./types").SearchMatches[];
357
+ }>;
358
+ filterMemories: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
359
+ count: number;
360
+ matches: import("./types").SearchMatches[];
361
+ }>;
362
+ filterMemoriesPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
363
+ count: number;
364
+ matches: import("./types").SearchMatches[];
365
+ }>;
342
366
  getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
343
367
  memories: import("./types").Memory[];
344
368
  }>;
package/dist/index.d.ts CHANGED
@@ -335,6 +335,18 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
335
335
  searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
336
336
  matches: import("./types").SearchMatches[];
337
337
  }>;
338
+ searchMemoryPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
339
+ count: number;
340
+ matches: import("./types").SearchMatches[];
341
+ }>;
342
+ filterMemories: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
343
+ count: number;
344
+ matches: import("./types").SearchMatches[];
345
+ }>;
346
+ filterMemoriesPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
347
+ count: number;
348
+ matches: import("./types").SearchMatches[];
349
+ }>;
338
350
  getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
339
351
  memories: import("./types").Memory[];
340
352
  }>;
@@ -348,6 +360,18 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
348
360
  searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
349
361
  matches: import("./types").SearchMatches[];
350
362
  }>;
363
+ searchMemoryPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
364
+ count: number;
365
+ matches: import("./types").SearchMatches[];
366
+ }>;
367
+ filterMemories: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
368
+ count: number;
369
+ matches: import("./types").SearchMatches[];
370
+ }>;
371
+ filterMemoriesPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
372
+ count: number;
373
+ matches: import("./types").SearchMatches[];
374
+ }>;
351
375
  getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
352
376
  memories: import("./types").Memory[];
353
377
  }>;
package/dist/types.d.ts CHANGED
@@ -453,6 +453,7 @@ export type SearchQuery = {
453
453
  tag?: string;
454
454
  ignoreLastRead?: boolean;
455
455
  excludedMemoryIDs?: string[];
456
+ startFrom?: number;
456
457
  numberOfResults?: number;
457
458
  contextVars?: {
458
459
  [variable: string]: string;
@@ -3,6 +3,18 @@ declare const _default: (apiUrl: string) => {
3
3
  searchMemory: (sessionId: string, query?: SearchQuery) => Promise<ResponseSpec & {
4
4
  matches: SearchMatches[];
5
5
  }>;
6
+ searchMemoryPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: SearchQuery) => Promise<ResponseSpec & {
7
+ count: number;
8
+ matches: SearchMatches[];
9
+ }>;
10
+ filterMemories: (sessionId: string, query?: SearchQuery) => Promise<ResponseSpec & {
11
+ count: number;
12
+ matches: SearchMatches[];
13
+ }>;
14
+ filterMemoriesPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: SearchQuery) => Promise<ResponseSpec & {
15
+ count: number;
16
+ matches: SearchMatches[];
17
+ }>;
6
18
  getRandomMemory: (sessionId: string, query?: SearchQuery) => Promise<ResponseSpec & {
7
19
  memories: Memory[];
8
20
  }>;
@@ -5,6 +5,21 @@ export default (apiUrl) => ({
5
5
  body: query,
6
6
  apiUrl,
7
7
  }),
8
+ searchMemoryPaginated: async (sessionId, pageIndex, pageSize, query) => apiFetcher(`/Search/${sessionId}/${pageIndex}/${pageSize}`, {
9
+ method: 'POST',
10
+ body: query,
11
+ apiUrl,
12
+ }),
13
+ filterMemories: async (sessionId, query) => apiFetcher(`/FilterMemories/${sessionId}`, {
14
+ method: 'POST',
15
+ body: query,
16
+ apiUrl,
17
+ }),
18
+ filterMemoriesPaginated: async (sessionId, pageIndex, pageSize, query) => apiFetcher(`/FilterMemories/${sessionId}/${pageIndex}/${pageSize}`, {
19
+ method: 'POST',
20
+ body: query,
21
+ apiUrl,
22
+ }),
8
23
  getRandomMemory: async (sessionId, query) => apiFetcher(`/Random/${sessionId}`, {
9
24
  method: 'POST',
10
25
  body: query,
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/engine/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,YAAY,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CAC7D,UAAU,CAAC,WAAW,SAAS,EAAE,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IAQH,eAAe,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CAChE,UAAU,CAAC,WAAW,SAAS,EAAE,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IASH,QAAQ,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CACzD,UAAU,CAAC,UAAU,SAAS,EAAE,EAAE;QAChC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX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W,SAAS,EAAE,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IASH,QAAQ,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CACzD,UAAU,CAAC,UAAU,SAAS,EAAE,EAAE;QAChC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IAMH,aAAa,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CACzC,UAAU,CAAC,eAAe,SAAS,EAAE,EAAE;QACrC,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAIA;CACJ,CAAC,CAAC"}
package/esm/engine.d.ts CHANGED
@@ -326,6 +326,18 @@ declare const _default: (apiUrl: string) => {
326
326
  searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
327
327
  matches: import("./types").SearchMatches[];
328
328
  }>;
329
+ searchMemoryPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
330
+ count: number;
331
+ matches: import("./types").SearchMatches[];
332
+ }>;
333
+ filterMemories: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
334
+ count: number;
335
+ matches: import("./types").SearchMatches[];
336
+ }>;
337
+ filterMemoriesPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
338
+ count: number;
339
+ matches: import("./types").SearchMatches[];
340
+ }>;
329
341
  getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
330
342
  memories: import("./types").Memory[];
331
343
  }>;
@@ -339,6 +351,18 @@ declare const _default: (apiUrl: string) => {
339
351
  searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
340
352
  matches: import("./types").SearchMatches[];
341
353
  }>;
354
+ searchMemoryPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
355
+ count: number;
356
+ matches: import("./types").SearchMatches[];
357
+ }>;
358
+ filterMemories: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
359
+ count: number;
360
+ matches: import("./types").SearchMatches[];
361
+ }>;
362
+ filterMemoriesPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
363
+ count: number;
364
+ matches: import("./types").SearchMatches[];
365
+ }>;
342
366
  getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
343
367
  memories: import("./types").Memory[];
344
368
  }>;
package/esm/index.d.ts CHANGED
@@ -335,6 +335,18 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
335
335
  searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
336
336
  matches: import("./types").SearchMatches[];
337
337
  }>;
338
+ searchMemoryPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
339
+ count: number;
340
+ matches: import("./types").SearchMatches[];
341
+ }>;
342
+ filterMemories: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
343
+ count: number;
344
+ matches: import("./types").SearchMatches[];
345
+ }>;
346
+ filterMemoriesPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
347
+ count: number;
348
+ matches: import("./types").SearchMatches[];
349
+ }>;
338
350
  getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
339
351
  memories: import("./types").Memory[];
340
352
  }>;
@@ -348,6 +360,18 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
348
360
  searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
349
361
  matches: import("./types").SearchMatches[];
350
362
  }>;
363
+ searchMemoryPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
364
+ count: number;
365
+ matches: import("./types").SearchMatches[];
366
+ }>;
367
+ filterMemories: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
368
+ count: number;
369
+ matches: import("./types").SearchMatches[];
370
+ }>;
371
+ filterMemoriesPaginated: (sessionId: string, pageIndex: number, pageSize: number, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
372
+ count: number;
373
+ matches: import("./types").SearchMatches[];
374
+ }>;
351
375
  getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
352
376
  memories: import("./types").Memory[];
353
377
  }>;
package/esm/types.d.ts CHANGED
@@ -453,6 +453,7 @@ export type SearchQuery = {
453
453
  tag?: string;
454
454
  ignoreLastRead?: boolean;
455
455
  excludedMemoryIDs?: string[];
456
+ startFrom?: number;
456
457
  numberOfResults?: number;
457
458
  contextVars?: {
458
459
  [variable: string]: string;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.1.1",
2
+ "version": "5.2.0",
3
3
  "name": "@memori.ai/memori-api-client",
4
4
  "description": "React library to integrate a Memori in your app or website",
5
5
  "license": "Apache-2.0",
@@ -24,6 +24,71 @@ export default (apiUrl: string) => ({
24
24
  }
25
25
  >,
26
26
 
27
+ /**
28
+ * Searches for matching Memory objects using the same algorithm employed in the Text Entered event of the R1 state of the Dialog State Machine.
29
+ * @param {string} sessionId The session ID
30
+ * @param {number} pageIndex The page index
31
+ * @param {number} pageSize The page size
32
+ * @param {SearchQuery} query Search query params
33
+ */
34
+ searchMemoryPaginated: async (
35
+ sessionId: string,
36
+ pageIndex: number,
37
+ pageSize: number,
38
+ query?: SearchQuery
39
+ ) =>
40
+ apiFetcher(`/Search/${sessionId}/${pageIndex}/${pageSize}`, {
41
+ method: 'POST',
42
+ body: query,
43
+ apiUrl,
44
+ }) as Promise<
45
+ ResponseSpec & {
46
+ count: number;
47
+ matches: SearchMatches[];
48
+ }
49
+ >,
50
+
51
+ /**
52
+ * Filters Memory objects
53
+ * @param {string} sessionId The session ID
54
+ * @param {SearchQuery} query Search query params
55
+ */
56
+ filterMemories: async (sessionId: string, query?: SearchQuery) =>
57
+ apiFetcher(`/FilterMemories/${sessionId}`, {
58
+ method: 'POST',
59
+ body: query,
60
+ apiUrl,
61
+ }) as Promise<
62
+ ResponseSpec & {
63
+ count: number;
64
+ matches: SearchMatches[];
65
+ }
66
+ >,
67
+
68
+ /**
69
+ * Filters Memory objects, with pagination
70
+ * @param {string} sessionId The session ID
71
+ * @param {number} pageIndex The page index
72
+ * @param {number} pageSize The page size
73
+ * @param {SearchQuery} query Search query params
74
+ */
75
+ filterMemoriesPaginated: async (
76
+ sessionId: string,
77
+ pageIndex: number,
78
+ pageSize: number,
79
+ query?: SearchQuery
80
+ ) =>
81
+ apiFetcher(`/FilterMemories/${sessionId}/${pageIndex}/${pageSize}`, {
82
+ method: 'POST',
83
+ body: query,
84
+ apiUrl,
85
+ }) as Promise<
86
+ ResponseSpec & {
87
+ count: number;
88
+ matches: SearchMatches[];
89
+ }
90
+ >,
91
+
27
92
  /**
28
93
  * Picks up to 5 random Memory objects using the same algorithm employed in the
29
94
  * Timeout event of the R1 state of the Dialog State Machine.
package/src/types.ts CHANGED
@@ -595,6 +595,9 @@ export declare type Asset = {
595
595
  };
596
596
 
597
597
  export type SearchQuery = {
598
+
599
+
600
+
598
601
  /**
599
602
  * @type {string}
600
603
  * Search query. If omitted, either a Date or a Place must be set. Used only for Search, ignored for Random picking and Memory Hints.
@@ -664,6 +667,12 @@ export type SearchQuery = {
664
667
  */
665
668
  excludedMemoryIDs?: string[];
666
669
 
670
+ /**
671
+ * @type {number=0}
672
+ * Index of the first Memory to return. Used for pagination.
673
+ */
674
+ startFrom?: number;
675
+
667
676
  /**
668
677
  * @type {?number=5}
669
678
  * Optional number of results. If omitted defaults to 5.