mem0ai 2.3.0 → 2.4.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.
@@ -15,6 +15,7 @@ interface Message {
15
15
  interface EmbeddingConfig {
16
16
  apiKey?: string;
17
17
  model?: string | any;
18
+ baseURL?: string;
18
19
  url?: string;
19
20
  embeddingDims?: number;
20
21
  modelProperties?: Record<string, any>;
@@ -22,6 +23,7 @@ interface EmbeddingConfig {
22
23
  interface VectorStoreConfig {
23
24
  collectionName?: string;
24
25
  dimension?: number;
26
+ dbPath?: string;
25
27
  client?: any;
26
28
  instance?: any;
27
29
  [key: string]: any;
@@ -38,6 +40,7 @@ interface HistoryStoreConfig {
38
40
  interface LLMConfig {
39
41
  provider?: string;
40
42
  baseURL?: string;
43
+ url?: string;
41
44
  config?: Record<string, any>;
42
45
  apiKey?: string;
43
46
  model?: string | any;
@@ -151,14 +154,17 @@ declare const MemoryConfigSchema: z.ZodObject<{
151
154
  config: z.ZodObject<{
152
155
  collectionName: z.ZodOptional<z.ZodString>;
153
156
  dimension: z.ZodOptional<z.ZodNumber>;
157
+ dbPath: z.ZodOptional<z.ZodString>;
154
158
  client: z.ZodOptional<z.ZodAny>;
155
159
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
156
160
  collectionName: z.ZodOptional<z.ZodString>;
157
161
  dimension: z.ZodOptional<z.ZodNumber>;
162
+ dbPath: z.ZodOptional<z.ZodString>;
158
163
  client: z.ZodOptional<z.ZodAny>;
159
164
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
160
165
  collectionName: z.ZodOptional<z.ZodString>;
161
166
  dimension: z.ZodOptional<z.ZodNumber>;
167
+ dbPath: z.ZodOptional<z.ZodString>;
162
168
  client: z.ZodOptional<z.ZodAny>;
163
169
  }, z.ZodTypeAny, "passthrough">>;
164
170
  }, "strip", z.ZodTypeAny, {
@@ -166,6 +172,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
166
172
  config: {
167
173
  collectionName?: string | undefined;
168
174
  dimension?: number | undefined;
175
+ dbPath?: string | undefined;
169
176
  client?: any;
170
177
  } & {
171
178
  [k: string]: unknown;
@@ -175,6 +182,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
175
182
  config: {
176
183
  collectionName?: string | undefined;
177
184
  dimension?: number | undefined;
185
+ dbPath?: string | undefined;
178
186
  client?: any;
179
187
  } & {
180
188
  [k: string]: unknown;
@@ -187,16 +195,19 @@ declare const MemoryConfigSchema: z.ZodObject<{
187
195
  model: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodAny]>>;
188
196
  modelProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
189
197
  baseURL: z.ZodOptional<z.ZodString>;
198
+ url: z.ZodOptional<z.ZodString>;
190
199
  }, "strip", z.ZodTypeAny, {
191
200
  modelProperties?: Record<string, any> | undefined;
192
201
  apiKey?: string | undefined;
193
202
  model?: any;
194
203
  baseURL?: string | undefined;
204
+ url?: string | undefined;
195
205
  }, {
196
206
  modelProperties?: Record<string, any> | undefined;
197
207
  apiKey?: string | undefined;
198
208
  model?: any;
199
209
  baseURL?: string | undefined;
210
+ url?: string | undefined;
200
211
  }>;
201
212
  }, "strip", z.ZodTypeAny, {
202
213
  provider: string;
@@ -205,6 +216,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
205
216
  apiKey?: string | undefined;
206
217
  model?: any;
207
218
  baseURL?: string | undefined;
219
+ url?: string | undefined;
208
220
  };
209
221
  }, {
210
222
  provider: string;
@@ -213,6 +225,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
213
225
  apiKey?: string | undefined;
214
226
  model?: any;
215
227
  baseURL?: string | undefined;
228
+ url?: string | undefined;
216
229
  };
217
230
  }>;
218
231
  historyDbPath: z.ZodOptional<z.ZodString>;
@@ -297,6 +310,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
297
310
  config: {
298
311
  collectionName?: string | undefined;
299
312
  dimension?: number | undefined;
313
+ dbPath?: string | undefined;
300
314
  client?: any;
301
315
  } & {
302
316
  [k: string]: unknown;
@@ -309,6 +323,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
309
323
  apiKey?: string | undefined;
310
324
  model?: any;
311
325
  baseURL?: string | undefined;
326
+ url?: string | undefined;
312
327
  };
313
328
  };
314
329
  version?: string | undefined;
@@ -350,6 +365,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
350
365
  config: {
351
366
  collectionName?: string | undefined;
352
367
  dimension?: number | undefined;
368
+ dbPath?: string | undefined;
353
369
  client?: any;
354
370
  } & {
355
371
  [k: string]: unknown;
@@ -362,6 +378,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
362
378
  apiKey?: string | undefined;
363
379
  model?: any;
364
380
  baseURL?: string | undefined;
381
+ url?: string | undefined;
365
382
  };
366
383
  };
367
384
  version?: string | undefined;
@@ -420,7 +437,20 @@ declare class Memory {
420
437
  private graphMemory?;
421
438
  private enableGraph;
422
439
  telemetryId: string;
440
+ private _initPromise;
441
+ private _initError?;
423
442
  constructor(config?: Partial<MemoryConfig>);
443
+ /**
444
+ * If no explicit dimension was provided, runs a probe embedding to
445
+ * detect it. Then creates and initializes the vector store.
446
+ */
447
+ private _autoInitialize;
448
+ /**
449
+ * Ensures that auto-initialization (dimension detection + vector store
450
+ * creation) has completed before any public method proceeds.
451
+ * If a previous init attempt failed, retries automatically.
452
+ */
453
+ private _ensureInitialized;
424
454
  private _initializeTelemetry;
425
455
  private _getTelemetryId;
426
456
  private _captureEvent;
@@ -647,6 +677,7 @@ declare class Qdrant implements VectorStore {
647
677
  private client;
648
678
  private readonly collectionName;
649
679
  private dimension;
680
+ private _initPromise?;
650
681
  constructor(config: QdrantConfig);
651
682
  private createFilter;
652
683
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
@@ -659,7 +690,9 @@ declare class Qdrant implements VectorStore {
659
690
  private generateUUID;
660
691
  getUserId(): Promise<string>;
661
692
  setUserId(userId: string): Promise<void>;
693
+ private ensureCollection;
662
694
  initialize(): Promise<void>;
695
+ private _doInitialize;
663
696
  }
664
697
 
665
698
  interface RedisConfig extends VectorStoreConfig {
@@ -674,9 +707,11 @@ declare class RedisDB implements VectorStore {
674
707
  private readonly indexName;
675
708
  private readonly indexPrefix;
676
709
  private readonly schema;
710
+ private _initPromise?;
677
711
  constructor(config: RedisConfig);
678
712
  private createIndex;
679
713
  initialize(): Promise<void>;
714
+ private _doInitialize;
680
715
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
681
716
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
682
717
  get(vectorId: string): Promise<VectorStoreResult | null>;
@@ -701,8 +736,10 @@ declare class SupabaseDB implements VectorStore {
701
736
  private readonly tableName;
702
737
  private readonly embeddingColumnName;
703
738
  private readonly metadataColumnName;
739
+ private _initPromise?;
704
740
  constructor(config: SupabaseConfig);
705
741
  initialize(): Promise<void>;
742
+ private _doInitialize;
706
743
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
707
744
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
708
745
  get(vectorId: string): Promise<VectorStoreResult | null>;
@@ -744,6 +781,7 @@ declare class VectorizeDB implements VectorStore {
744
781
  private dimensions;
745
782
  private indexName;
746
783
  private accountId;
784
+ private _initPromise?;
747
785
  constructor(config: VectorizeConfig);
748
786
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
749
787
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
@@ -756,6 +794,7 @@ declare class VectorizeDB implements VectorStore {
756
794
  getUserId(): Promise<string>;
757
795
  setUserId(userId: string): Promise<void>;
758
796
  initialize(): Promise<void>;
797
+ private _doInitialize;
759
798
  }
760
799
 
761
800
  /**
@@ -814,11 +853,13 @@ declare class AzureAISearch implements VectorStore {
814
853
  private readonly hybridSearch;
815
854
  private readonly vectorFilterMode;
816
855
  private readonly apiKey;
856
+ private _initPromise?;
817
857
  constructor(config: AzureAISearchConfig);
818
858
  /**
819
859
  * Initialize the Azure AI Search index if it doesn't exist
820
860
  */
821
861
  initialize(): Promise<void>;
862
+ private _doInitialize;
822
863
  /**
823
864
  * Create a new index in Azure AI Search
824
865
  */
@@ -15,6 +15,7 @@ interface Message {
15
15
  interface EmbeddingConfig {
16
16
  apiKey?: string;
17
17
  model?: string | any;
18
+ baseURL?: string;
18
19
  url?: string;
19
20
  embeddingDims?: number;
20
21
  modelProperties?: Record<string, any>;
@@ -22,6 +23,7 @@ interface EmbeddingConfig {
22
23
  interface VectorStoreConfig {
23
24
  collectionName?: string;
24
25
  dimension?: number;
26
+ dbPath?: string;
25
27
  client?: any;
26
28
  instance?: any;
27
29
  [key: string]: any;
@@ -38,6 +40,7 @@ interface HistoryStoreConfig {
38
40
  interface LLMConfig {
39
41
  provider?: string;
40
42
  baseURL?: string;
43
+ url?: string;
41
44
  config?: Record<string, any>;
42
45
  apiKey?: string;
43
46
  model?: string | any;
@@ -151,14 +154,17 @@ declare const MemoryConfigSchema: z.ZodObject<{
151
154
  config: z.ZodObject<{
152
155
  collectionName: z.ZodOptional<z.ZodString>;
153
156
  dimension: z.ZodOptional<z.ZodNumber>;
157
+ dbPath: z.ZodOptional<z.ZodString>;
154
158
  client: z.ZodOptional<z.ZodAny>;
155
159
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
156
160
  collectionName: z.ZodOptional<z.ZodString>;
157
161
  dimension: z.ZodOptional<z.ZodNumber>;
162
+ dbPath: z.ZodOptional<z.ZodString>;
158
163
  client: z.ZodOptional<z.ZodAny>;
159
164
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
160
165
  collectionName: z.ZodOptional<z.ZodString>;
161
166
  dimension: z.ZodOptional<z.ZodNumber>;
167
+ dbPath: z.ZodOptional<z.ZodString>;
162
168
  client: z.ZodOptional<z.ZodAny>;
163
169
  }, z.ZodTypeAny, "passthrough">>;
164
170
  }, "strip", z.ZodTypeAny, {
@@ -166,6 +172,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
166
172
  config: {
167
173
  collectionName?: string | undefined;
168
174
  dimension?: number | undefined;
175
+ dbPath?: string | undefined;
169
176
  client?: any;
170
177
  } & {
171
178
  [k: string]: unknown;
@@ -175,6 +182,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
175
182
  config: {
176
183
  collectionName?: string | undefined;
177
184
  dimension?: number | undefined;
185
+ dbPath?: string | undefined;
178
186
  client?: any;
179
187
  } & {
180
188
  [k: string]: unknown;
@@ -187,16 +195,19 @@ declare const MemoryConfigSchema: z.ZodObject<{
187
195
  model: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodAny]>>;
188
196
  modelProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
189
197
  baseURL: z.ZodOptional<z.ZodString>;
198
+ url: z.ZodOptional<z.ZodString>;
190
199
  }, "strip", z.ZodTypeAny, {
191
200
  modelProperties?: Record<string, any> | undefined;
192
201
  apiKey?: string | undefined;
193
202
  model?: any;
194
203
  baseURL?: string | undefined;
204
+ url?: string | undefined;
195
205
  }, {
196
206
  modelProperties?: Record<string, any> | undefined;
197
207
  apiKey?: string | undefined;
198
208
  model?: any;
199
209
  baseURL?: string | undefined;
210
+ url?: string | undefined;
200
211
  }>;
201
212
  }, "strip", z.ZodTypeAny, {
202
213
  provider: string;
@@ -205,6 +216,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
205
216
  apiKey?: string | undefined;
206
217
  model?: any;
207
218
  baseURL?: string | undefined;
219
+ url?: string | undefined;
208
220
  };
209
221
  }, {
210
222
  provider: string;
@@ -213,6 +225,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
213
225
  apiKey?: string | undefined;
214
226
  model?: any;
215
227
  baseURL?: string | undefined;
228
+ url?: string | undefined;
216
229
  };
217
230
  }>;
218
231
  historyDbPath: z.ZodOptional<z.ZodString>;
@@ -297,6 +310,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
297
310
  config: {
298
311
  collectionName?: string | undefined;
299
312
  dimension?: number | undefined;
313
+ dbPath?: string | undefined;
300
314
  client?: any;
301
315
  } & {
302
316
  [k: string]: unknown;
@@ -309,6 +323,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
309
323
  apiKey?: string | undefined;
310
324
  model?: any;
311
325
  baseURL?: string | undefined;
326
+ url?: string | undefined;
312
327
  };
313
328
  };
314
329
  version?: string | undefined;
@@ -350,6 +365,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
350
365
  config: {
351
366
  collectionName?: string | undefined;
352
367
  dimension?: number | undefined;
368
+ dbPath?: string | undefined;
353
369
  client?: any;
354
370
  } & {
355
371
  [k: string]: unknown;
@@ -362,6 +378,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
362
378
  apiKey?: string | undefined;
363
379
  model?: any;
364
380
  baseURL?: string | undefined;
381
+ url?: string | undefined;
365
382
  };
366
383
  };
367
384
  version?: string | undefined;
@@ -420,7 +437,20 @@ declare class Memory {
420
437
  private graphMemory?;
421
438
  private enableGraph;
422
439
  telemetryId: string;
440
+ private _initPromise;
441
+ private _initError?;
423
442
  constructor(config?: Partial<MemoryConfig>);
443
+ /**
444
+ * If no explicit dimension was provided, runs a probe embedding to
445
+ * detect it. Then creates and initializes the vector store.
446
+ */
447
+ private _autoInitialize;
448
+ /**
449
+ * Ensures that auto-initialization (dimension detection + vector store
450
+ * creation) has completed before any public method proceeds.
451
+ * If a previous init attempt failed, retries automatically.
452
+ */
453
+ private _ensureInitialized;
424
454
  private _initializeTelemetry;
425
455
  private _getTelemetryId;
426
456
  private _captureEvent;
@@ -647,6 +677,7 @@ declare class Qdrant implements VectorStore {
647
677
  private client;
648
678
  private readonly collectionName;
649
679
  private dimension;
680
+ private _initPromise?;
650
681
  constructor(config: QdrantConfig);
651
682
  private createFilter;
652
683
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
@@ -659,7 +690,9 @@ declare class Qdrant implements VectorStore {
659
690
  private generateUUID;
660
691
  getUserId(): Promise<string>;
661
692
  setUserId(userId: string): Promise<void>;
693
+ private ensureCollection;
662
694
  initialize(): Promise<void>;
695
+ private _doInitialize;
663
696
  }
664
697
 
665
698
  interface RedisConfig extends VectorStoreConfig {
@@ -674,9 +707,11 @@ declare class RedisDB implements VectorStore {
674
707
  private readonly indexName;
675
708
  private readonly indexPrefix;
676
709
  private readonly schema;
710
+ private _initPromise?;
677
711
  constructor(config: RedisConfig);
678
712
  private createIndex;
679
713
  initialize(): Promise<void>;
714
+ private _doInitialize;
680
715
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
681
716
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
682
717
  get(vectorId: string): Promise<VectorStoreResult | null>;
@@ -701,8 +736,10 @@ declare class SupabaseDB implements VectorStore {
701
736
  private readonly tableName;
702
737
  private readonly embeddingColumnName;
703
738
  private readonly metadataColumnName;
739
+ private _initPromise?;
704
740
  constructor(config: SupabaseConfig);
705
741
  initialize(): Promise<void>;
742
+ private _doInitialize;
706
743
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
707
744
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
708
745
  get(vectorId: string): Promise<VectorStoreResult | null>;
@@ -744,6 +781,7 @@ declare class VectorizeDB implements VectorStore {
744
781
  private dimensions;
745
782
  private indexName;
746
783
  private accountId;
784
+ private _initPromise?;
747
785
  constructor(config: VectorizeConfig);
748
786
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
749
787
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
@@ -756,6 +794,7 @@ declare class VectorizeDB implements VectorStore {
756
794
  getUserId(): Promise<string>;
757
795
  setUserId(userId: string): Promise<void>;
758
796
  initialize(): Promise<void>;
797
+ private _doInitialize;
759
798
  }
760
799
 
761
800
  /**
@@ -814,11 +853,13 @@ declare class AzureAISearch implements VectorStore {
814
853
  private readonly hybridSearch;
815
854
  private readonly vectorFilterMode;
816
855
  private readonly apiKey;
856
+ private _initPromise?;
817
857
  constructor(config: AzureAISearchConfig);
818
858
  /**
819
859
  * Initialize the Azure AI Search index if it doesn't exist
820
860
  */
821
861
  initialize(): Promise<void>;
862
+ private _doInitialize;
822
863
  /**
823
864
  * Create a new index in Azure AI Search
824
865
  */