mem0ai 2.2.4 → 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;
@@ -617,9 +639,6 @@ declare class MemoryVectorStore implements VectorStore {
617
639
  private dbPath;
618
640
  constructor(config: VectorStoreConfig);
619
641
  private init;
620
- private run;
621
- private all;
622
- private getOne;
623
642
  private cosineSimilarity;
624
643
  private filterVector;
625
644
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
@@ -650,6 +669,7 @@ declare class Qdrant implements VectorStore {
650
669
  private client;
651
670
  private readonly collectionName;
652
671
  private dimension;
672
+ private _initPromise?;
653
673
  constructor(config: QdrantConfig);
654
674
  private createFilter;
655
675
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
@@ -662,7 +682,9 @@ declare class Qdrant implements VectorStore {
662
682
  private generateUUID;
663
683
  getUserId(): Promise<string>;
664
684
  setUserId(userId: string): Promise<void>;
685
+ private ensureCollection;
665
686
  initialize(): Promise<void>;
687
+ private _doInitialize;
666
688
  }
667
689
 
668
690
  interface RedisConfig extends VectorStoreConfig {
@@ -677,9 +699,11 @@ declare class RedisDB implements VectorStore {
677
699
  private readonly indexName;
678
700
  private readonly indexPrefix;
679
701
  private readonly schema;
702
+ private _initPromise?;
680
703
  constructor(config: RedisConfig);
681
704
  private createIndex;
682
705
  initialize(): Promise<void>;
706
+ private _doInitialize;
683
707
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
684
708
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
685
709
  get(vectorId: string): Promise<VectorStoreResult | null>;
@@ -704,8 +728,10 @@ declare class SupabaseDB implements VectorStore {
704
728
  private readonly tableName;
705
729
  private readonly embeddingColumnName;
706
730
  private readonly metadataColumnName;
731
+ private _initPromise?;
707
732
  constructor(config: SupabaseConfig);
708
733
  initialize(): Promise<void>;
734
+ private _doInitialize;
709
735
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
710
736
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
711
737
  get(vectorId: string): Promise<VectorStoreResult | null>;
@@ -747,6 +773,7 @@ declare class VectorizeDB implements VectorStore {
747
773
  private dimensions;
748
774
  private indexName;
749
775
  private accountId;
776
+ private _initPromise?;
750
777
  constructor(config: VectorizeConfig);
751
778
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
752
779
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
@@ -759,6 +786,7 @@ declare class VectorizeDB implements VectorStore {
759
786
  getUserId(): Promise<string>;
760
787
  setUserId(userId: string): Promise<void>;
761
788
  initialize(): Promise<void>;
789
+ private _doInitialize;
762
790
  }
763
791
 
764
792
  /**
@@ -817,11 +845,13 @@ declare class AzureAISearch implements VectorStore {
817
845
  private readonly hybridSearch;
818
846
  private readonly vectorFilterMode;
819
847
  private readonly apiKey;
848
+ private _initPromise?;
820
849
  constructor(config: AzureAISearchConfig);
821
850
  /**
822
851
  * Initialize the Azure AI Search index if it doesn't exist
823
852
  */
824
853
  initialize(): Promise<void>;
854
+ private _doInitialize;
825
855
  /**
826
856
  * Create a new index in Azure AI Search
827
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;
@@ -617,9 +639,6 @@ declare class MemoryVectorStore implements VectorStore {
617
639
  private dbPath;
618
640
  constructor(config: VectorStoreConfig);
619
641
  private init;
620
- private run;
621
- private all;
622
- private getOne;
623
642
  private cosineSimilarity;
624
643
  private filterVector;
625
644
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
@@ -650,6 +669,7 @@ declare class Qdrant implements VectorStore {
650
669
  private client;
651
670
  private readonly collectionName;
652
671
  private dimension;
672
+ private _initPromise?;
653
673
  constructor(config: QdrantConfig);
654
674
  private createFilter;
655
675
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
@@ -662,7 +682,9 @@ declare class Qdrant implements VectorStore {
662
682
  private generateUUID;
663
683
  getUserId(): Promise<string>;
664
684
  setUserId(userId: string): Promise<void>;
685
+ private ensureCollection;
665
686
  initialize(): Promise<void>;
687
+ private _doInitialize;
666
688
  }
667
689
 
668
690
  interface RedisConfig extends VectorStoreConfig {
@@ -677,9 +699,11 @@ declare class RedisDB implements VectorStore {
677
699
  private readonly indexName;
678
700
  private readonly indexPrefix;
679
701
  private readonly schema;
702
+ private _initPromise?;
680
703
  constructor(config: RedisConfig);
681
704
  private createIndex;
682
705
  initialize(): Promise<void>;
706
+ private _doInitialize;
683
707
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
684
708
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
685
709
  get(vectorId: string): Promise<VectorStoreResult | null>;
@@ -704,8 +728,10 @@ declare class SupabaseDB implements VectorStore {
704
728
  private readonly tableName;
705
729
  private readonly embeddingColumnName;
706
730
  private readonly metadataColumnName;
731
+ private _initPromise?;
707
732
  constructor(config: SupabaseConfig);
708
733
  initialize(): Promise<void>;
734
+ private _doInitialize;
709
735
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
710
736
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
711
737
  get(vectorId: string): Promise<VectorStoreResult | null>;
@@ -747,6 +773,7 @@ declare class VectorizeDB implements VectorStore {
747
773
  private dimensions;
748
774
  private indexName;
749
775
  private accountId;
776
+ private _initPromise?;
750
777
  constructor(config: VectorizeConfig);
751
778
  insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
752
779
  search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
@@ -759,6 +786,7 @@ declare class VectorizeDB implements VectorStore {
759
786
  getUserId(): Promise<string>;
760
787
  setUserId(userId: string): Promise<void>;
761
788
  initialize(): Promise<void>;
789
+ private _doInitialize;
762
790
  }
763
791
 
764
792
  /**
@@ -817,11 +845,13 @@ declare class AzureAISearch implements VectorStore {
817
845
  private readonly hybridSearch;
818
846
  private readonly vectorFilterMode;
819
847
  private readonly apiKey;
848
+ private _initPromise?;
820
849
  constructor(config: AzureAISearchConfig);
821
850
  /**
822
851
  * Initialize the Azure AI Search index if it doesn't exist
823
852
  */
824
853
  initialize(): Promise<void>;
854
+ private _doInitialize;
825
855
  /**
826
856
  * Create a new index in Azure AI Search
827
857
  */