mem0ai 2.3.0 → 2.4.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.
@@ -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;
@@ -151,14 +153,17 @@ declare const MemoryConfigSchema: z.ZodObject<{
151
153
  config: z.ZodObject<{
152
154
  collectionName: z.ZodOptional<z.ZodString>;
153
155
  dimension: z.ZodOptional<z.ZodNumber>;
156
+ dbPath: z.ZodOptional<z.ZodString>;
154
157
  client: z.ZodOptional<z.ZodAny>;
155
158
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
156
159
  collectionName: z.ZodOptional<z.ZodString>;
157
160
  dimension: z.ZodOptional<z.ZodNumber>;
161
+ dbPath: z.ZodOptional<z.ZodString>;
158
162
  client: z.ZodOptional<z.ZodAny>;
159
163
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
160
164
  collectionName: z.ZodOptional<z.ZodString>;
161
165
  dimension: z.ZodOptional<z.ZodNumber>;
166
+ dbPath: z.ZodOptional<z.ZodString>;
162
167
  client: z.ZodOptional<z.ZodAny>;
163
168
  }, z.ZodTypeAny, "passthrough">>;
164
169
  }, "strip", z.ZodTypeAny, {
@@ -166,6 +171,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
166
171
  config: {
167
172
  collectionName?: string | undefined;
168
173
  dimension?: number | undefined;
174
+ dbPath?: string | undefined;
169
175
  client?: any;
170
176
  } & {
171
177
  [k: string]: unknown;
@@ -175,6 +181,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
175
181
  config: {
176
182
  collectionName?: string | undefined;
177
183
  dimension?: number | undefined;
184
+ dbPath?: string | undefined;
178
185
  client?: any;
179
186
  } & {
180
187
  [k: string]: unknown;
@@ -297,6 +304,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
297
304
  config: {
298
305
  collectionName?: string | undefined;
299
306
  dimension?: number | undefined;
307
+ dbPath?: string | undefined;
300
308
  client?: any;
301
309
  } & {
302
310
  [k: string]: unknown;
@@ -350,6 +358,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
350
358
  config: {
351
359
  collectionName?: string | undefined;
352
360
  dimension?: number | undefined;
361
+ dbPath?: string | undefined;
353
362
  client?: any;
354
363
  } & {
355
364
  [k: string]: unknown;
@@ -420,7 +429,20 @@ declare class Memory {
420
429
  private graphMemory?;
421
430
  private enableGraph;
422
431
  telemetryId: string;
432
+ private _initPromise;
433
+ private _initError?;
423
434
  constructor(config?: Partial<MemoryConfig>);
435
+ /**
436
+ * If no explicit dimension was provided, runs a probe embedding to
437
+ * detect it. Then creates and initializes the vector store.
438
+ */
439
+ private _autoInitialize;
440
+ /**
441
+ * Ensures that auto-initialization (dimension detection + vector store
442
+ * creation) has completed before any public method proceeds.
443
+ * If a previous init attempt failed, retries automatically.
444
+ */
445
+ private _ensureInitialized;
424
446
  private _initializeTelemetry;
425
447
  private _getTelemetryId;
426
448
  private _captureEvent;
@@ -647,6 +669,7 @@ declare class Qdrant implements VectorStore {
647
669
  private client;
648
670
  private readonly collectionName;
649
671
  private dimension;
672
+ private _initPromise?;
650
673
  constructor(config: QdrantConfig);
651
674
  private createFilter;
652
675
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
@@ -659,7 +682,9 @@ declare class Qdrant implements VectorStore {
659
682
  private generateUUID;
660
683
  getUserId(): Promise<string>;
661
684
  setUserId(userId: string): Promise<void>;
685
+ private ensureCollection;
662
686
  initialize(): Promise<void>;
687
+ private _doInitialize;
663
688
  }
664
689
 
665
690
  interface RedisConfig extends VectorStoreConfig {
@@ -674,9 +699,11 @@ declare class RedisDB implements VectorStore {
674
699
  private readonly indexName;
675
700
  private readonly indexPrefix;
676
701
  private readonly schema;
702
+ private _initPromise?;
677
703
  constructor(config: RedisConfig);
678
704
  private createIndex;
679
705
  initialize(): Promise<void>;
706
+ private _doInitialize;
680
707
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
681
708
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
682
709
  get(vectorId: string): Promise<VectorStoreResult | null>;
@@ -701,8 +728,10 @@ declare class SupabaseDB implements VectorStore {
701
728
  private readonly tableName;
702
729
  private readonly embeddingColumnName;
703
730
  private readonly metadataColumnName;
731
+ private _initPromise?;
704
732
  constructor(config: SupabaseConfig);
705
733
  initialize(): Promise<void>;
734
+ private _doInitialize;
706
735
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
707
736
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
708
737
  get(vectorId: string): Promise<VectorStoreResult | null>;
@@ -744,6 +773,7 @@ declare class VectorizeDB implements VectorStore {
744
773
  private dimensions;
745
774
  private indexName;
746
775
  private accountId;
776
+ private _initPromise?;
747
777
  constructor(config: VectorizeConfig);
748
778
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
749
779
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
@@ -756,6 +786,7 @@ declare class VectorizeDB implements VectorStore {
756
786
  getUserId(): Promise<string>;
757
787
  setUserId(userId: string): Promise<void>;
758
788
  initialize(): Promise<void>;
789
+ private _doInitialize;
759
790
  }
760
791
 
761
792
  /**
@@ -814,11 +845,13 @@ declare class AzureAISearch implements VectorStore {
814
845
  private readonly hybridSearch;
815
846
  private readonly vectorFilterMode;
816
847
  private readonly apiKey;
848
+ private _initPromise?;
817
849
  constructor(config: AzureAISearchConfig);
818
850
  /**
819
851
  * Initialize the Azure AI Search index if it doesn't exist
820
852
  */
821
853
  initialize(): Promise<void>;
854
+ private _doInitialize;
822
855
  /**
823
856
  * Create a new index in Azure AI Search
824
857
  */
@@ -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;
@@ -151,14 +153,17 @@ declare const MemoryConfigSchema: z.ZodObject<{
151
153
  config: z.ZodObject<{
152
154
  collectionName: z.ZodOptional<z.ZodString>;
153
155
  dimension: z.ZodOptional<z.ZodNumber>;
156
+ dbPath: z.ZodOptional<z.ZodString>;
154
157
  client: z.ZodOptional<z.ZodAny>;
155
158
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
156
159
  collectionName: z.ZodOptional<z.ZodString>;
157
160
  dimension: z.ZodOptional<z.ZodNumber>;
161
+ dbPath: z.ZodOptional<z.ZodString>;
158
162
  client: z.ZodOptional<z.ZodAny>;
159
163
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
160
164
  collectionName: z.ZodOptional<z.ZodString>;
161
165
  dimension: z.ZodOptional<z.ZodNumber>;
166
+ dbPath: z.ZodOptional<z.ZodString>;
162
167
  client: z.ZodOptional<z.ZodAny>;
163
168
  }, z.ZodTypeAny, "passthrough">>;
164
169
  }, "strip", z.ZodTypeAny, {
@@ -166,6 +171,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
166
171
  config: {
167
172
  collectionName?: string | undefined;
168
173
  dimension?: number | undefined;
174
+ dbPath?: string | undefined;
169
175
  client?: any;
170
176
  } & {
171
177
  [k: string]: unknown;
@@ -175,6 +181,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
175
181
  config: {
176
182
  collectionName?: string | undefined;
177
183
  dimension?: number | undefined;
184
+ dbPath?: string | undefined;
178
185
  client?: any;
179
186
  } & {
180
187
  [k: string]: unknown;
@@ -297,6 +304,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
297
304
  config: {
298
305
  collectionName?: string | undefined;
299
306
  dimension?: number | undefined;
307
+ dbPath?: string | undefined;
300
308
  client?: any;
301
309
  } & {
302
310
  [k: string]: unknown;
@@ -350,6 +358,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
350
358
  config: {
351
359
  collectionName?: string | undefined;
352
360
  dimension?: number | undefined;
361
+ dbPath?: string | undefined;
353
362
  client?: any;
354
363
  } & {
355
364
  [k: string]: unknown;
@@ -420,7 +429,20 @@ declare class Memory {
420
429
  private graphMemory?;
421
430
  private enableGraph;
422
431
  telemetryId: string;
432
+ private _initPromise;
433
+ private _initError?;
423
434
  constructor(config?: Partial<MemoryConfig>);
435
+ /**
436
+ * If no explicit dimension was provided, runs a probe embedding to
437
+ * detect it. Then creates and initializes the vector store.
438
+ */
439
+ private _autoInitialize;
440
+ /**
441
+ * Ensures that auto-initialization (dimension detection + vector store
442
+ * creation) has completed before any public method proceeds.
443
+ * If a previous init attempt failed, retries automatically.
444
+ */
445
+ private _ensureInitialized;
424
446
  private _initializeTelemetry;
425
447
  private _getTelemetryId;
426
448
  private _captureEvent;
@@ -647,6 +669,7 @@ declare class Qdrant implements VectorStore {
647
669
  private client;
648
670
  private readonly collectionName;
649
671
  private dimension;
672
+ private _initPromise?;
650
673
  constructor(config: QdrantConfig);
651
674
  private createFilter;
652
675
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
@@ -659,7 +682,9 @@ declare class Qdrant implements VectorStore {
659
682
  private generateUUID;
660
683
  getUserId(): Promise<string>;
661
684
  setUserId(userId: string): Promise<void>;
685
+ private ensureCollection;
662
686
  initialize(): Promise<void>;
687
+ private _doInitialize;
663
688
  }
664
689
 
665
690
  interface RedisConfig extends VectorStoreConfig {
@@ -674,9 +699,11 @@ declare class RedisDB implements VectorStore {
674
699
  private readonly indexName;
675
700
  private readonly indexPrefix;
676
701
  private readonly schema;
702
+ private _initPromise?;
677
703
  constructor(config: RedisConfig);
678
704
  private createIndex;
679
705
  initialize(): Promise<void>;
706
+ private _doInitialize;
680
707
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
681
708
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
682
709
  get(vectorId: string): Promise<VectorStoreResult | null>;
@@ -701,8 +728,10 @@ declare class SupabaseDB implements VectorStore {
701
728
  private readonly tableName;
702
729
  private readonly embeddingColumnName;
703
730
  private readonly metadataColumnName;
731
+ private _initPromise?;
704
732
  constructor(config: SupabaseConfig);
705
733
  initialize(): Promise<void>;
734
+ private _doInitialize;
706
735
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
707
736
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
708
737
  get(vectorId: string): Promise<VectorStoreResult | null>;
@@ -744,6 +773,7 @@ declare class VectorizeDB implements VectorStore {
744
773
  private dimensions;
745
774
  private indexName;
746
775
  private accountId;
776
+ private _initPromise?;
747
777
  constructor(config: VectorizeConfig);
748
778
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
749
779
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
@@ -756,6 +786,7 @@ declare class VectorizeDB implements VectorStore {
756
786
  getUserId(): Promise<string>;
757
787
  setUserId(userId: string): Promise<void>;
758
788
  initialize(): Promise<void>;
789
+ private _doInitialize;
759
790
  }
760
791
 
761
792
  /**
@@ -814,11 +845,13 @@ declare class AzureAISearch implements VectorStore {
814
845
  private readonly hybridSearch;
815
846
  private readonly vectorFilterMode;
816
847
  private readonly apiKey;
848
+ private _initPromise?;
817
849
  constructor(config: AzureAISearchConfig);
818
850
  /**
819
851
  * Initialize the Azure AI Search index if it doesn't exist
820
852
  */
821
853
  initialize(): Promise<void>;
854
+ private _doInitialize;
822
855
  /**
823
856
  * Create a new index in Azure AI Search
824
857
  */