@memnexus-ai/typescript-sdk 1.16.0 → 1.17.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/dist/index.cjs CHANGED
@@ -41,6 +41,9 @@ __export(index_exports, {
41
41
  addMemoryToNarrativeRequest: () => addMemoryToNarrativeRequest,
42
42
  apiKey: () => apiKey,
43
43
  artifact: () => artifact,
44
+ batchGetMemoriesMeta: () => batchGetMemoriesMeta,
45
+ batchGetMemoriesRequest: () => batchGetMemoriesRequest,
46
+ batchGetMemoriesResponse: () => batchGetMemoriesResponse,
44
47
  community: () => community,
45
48
  conversation: () => conversation,
46
49
  createArtifactRequest: () => createArtifactRequest,
@@ -1941,6 +1944,35 @@ var MemoriesService = class extends BaseService {
1941
1944
  }
1942
1945
  return this.client.call(request);
1943
1946
  }
1947
+ /**
1948
+ * Get multiple memories by IDs
1949
+ * Retrieve multiple memories by their IDs in a single request.
1950
+ More efficient than making multiple individual GET requests.
1951
+
1952
+ Returns memories in the order requested, with metadata about
1953
+ which IDs were found or missing.
1954
+
1955
+ * @param body - Request body
1956
+ */
1957
+ async getMemoriesBatch(body) {
1958
+ const request = new Request({
1959
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
1960
+ method: "POST",
1961
+ path: "/api/memories/batch",
1962
+ config: this.config,
1963
+ retry: {
1964
+ attempts: 3,
1965
+ delayMs: 150,
1966
+ maxDelayMs: 5e3,
1967
+ jitterMs: 50,
1968
+ backoffFactor: 2
1969
+ }
1970
+ });
1971
+ if (body !== void 0) {
1972
+ request.addBody(body);
1973
+ }
1974
+ return this.client.call(request);
1975
+ }
1944
1976
  /**
1945
1977
  * Find similar memories
1946
1978
  * Find memories that are semantically similar to the given memory.
@@ -3735,6 +3767,22 @@ var relatedMemoryResult = import_zod.z.object({
3735
3767
  var getMemoryResponse = import_zod.z.lazy(() => import_zod.z.object({
3736
3768
  data: memory
3737
3769
  }));
3770
+ var batchGetMemoriesRequest = import_zod.z.object({
3771
+ /** Array of memory IDs to retrieve */
3772
+ ids: import_zod.z.array(import_zod.z.string().uuid()).min(1).max(100)
3773
+ });
3774
+ var batchGetMemoriesMeta = import_zod.z.object({
3775
+ /** Number of IDs requested */
3776
+ requested: import_zod.z.number(),
3777
+ /** Number of memories found */
3778
+ found: import_zod.z.number(),
3779
+ /** IDs that were not found */
3780
+ missing: import_zod.z.array(import_zod.z.string())
3781
+ });
3782
+ var batchGetMemoriesResponse = import_zod.z.lazy(() => import_zod.z.object({
3783
+ data: import_zod.z.array(memory),
3784
+ meta: batchGetMemoriesMeta
3785
+ }));
3738
3786
  var graphRAGQueryRequest = import_zod.z.object({
3739
3787
  /** GraphRAG query string */
3740
3788
  query: import_zod.z.string().min(1),
@@ -4417,6 +4465,9 @@ var index_default = Memnexus;
4417
4465
  addMemoryToNarrativeRequest,
4418
4466
  apiKey,
4419
4467
  artifact,
4468
+ batchGetMemoriesMeta,
4469
+ batchGetMemoriesRequest,
4470
+ batchGetMemoriesResponse,
4420
4471
  community,
4421
4472
  conversation,
4422
4473
  createArtifactRequest,