mem0ai 2.4.6 → 3.0.0-beta.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.d.mts +92 -120
- package/dist/index.d.ts +92 -120
- package/dist/index.js +93 -169
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +93 -169
- package/dist/index.mjs.map +1 -1
- package/dist/oss/index.d.mts +31 -36
- package/dist/oss/index.d.ts +31 -36
- package/dist/oss/index.js +114 -74
- package/dist/oss/index.js.map +1 -1
- package/dist/oss/index.mjs +114 -74
- package/dist/oss/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/oss/index.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ interface GraphStoreConfig {
|
|
|
55
55
|
provider: string;
|
|
56
56
|
config: Neo4jConfig;
|
|
57
57
|
llm?: LLMConfig;
|
|
58
|
-
|
|
58
|
+
customInstructions?: string;
|
|
59
59
|
}
|
|
60
60
|
interface MemoryConfig {
|
|
61
61
|
version?: string;
|
|
@@ -74,9 +74,8 @@ interface MemoryConfig {
|
|
|
74
74
|
historyStore?: HistoryStoreConfig;
|
|
75
75
|
disableHistory?: boolean;
|
|
76
76
|
historyDbPath?: string;
|
|
77
|
-
|
|
77
|
+
customInstructions?: string;
|
|
78
78
|
graphStore?: GraphStoreConfig;
|
|
79
|
-
enableGraph?: boolean;
|
|
80
79
|
}
|
|
81
80
|
interface MemoryItem {
|
|
82
81
|
id: string;
|
|
@@ -229,8 +228,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
229
228
|
};
|
|
230
229
|
}>;
|
|
231
230
|
historyDbPath: z.ZodOptional<z.ZodString>;
|
|
232
|
-
|
|
233
|
-
enableGraph: z.ZodOptional<z.ZodBoolean>;
|
|
231
|
+
customInstructions: z.ZodOptional<z.ZodString>;
|
|
234
232
|
graphStore: z.ZodOptional<z.ZodObject<{
|
|
235
233
|
provider: z.ZodString;
|
|
236
234
|
config: z.ZodObject<{
|
|
@@ -256,7 +254,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
256
254
|
provider: string;
|
|
257
255
|
config: Record<string, any>;
|
|
258
256
|
}>>;
|
|
259
|
-
|
|
257
|
+
customInstructions: z.ZodOptional<z.ZodString>;
|
|
260
258
|
}, "strip", z.ZodTypeAny, {
|
|
261
259
|
provider: string;
|
|
262
260
|
config: {
|
|
@@ -268,7 +266,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
268
266
|
provider: string;
|
|
269
267
|
config: Record<string, any>;
|
|
270
268
|
} | undefined;
|
|
271
|
-
|
|
269
|
+
customInstructions?: string | undefined;
|
|
272
270
|
}, {
|
|
273
271
|
provider: string;
|
|
274
272
|
config: {
|
|
@@ -280,7 +278,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
280
278
|
provider: string;
|
|
281
279
|
config: Record<string, any>;
|
|
282
280
|
} | undefined;
|
|
283
|
-
|
|
281
|
+
customInstructions?: string | undefined;
|
|
284
282
|
}>>;
|
|
285
283
|
historyStore: z.ZodOptional<z.ZodObject<{
|
|
286
284
|
provider: z.ZodString;
|
|
@@ -328,8 +326,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
328
326
|
};
|
|
329
327
|
version?: string | undefined;
|
|
330
328
|
historyDbPath?: string | undefined;
|
|
331
|
-
|
|
332
|
-
enableGraph?: boolean | undefined;
|
|
329
|
+
customInstructions?: string | undefined;
|
|
333
330
|
graphStore?: {
|
|
334
331
|
provider: string;
|
|
335
332
|
config: {
|
|
@@ -341,7 +338,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
341
338
|
provider: string;
|
|
342
339
|
config: Record<string, any>;
|
|
343
340
|
} | undefined;
|
|
344
|
-
|
|
341
|
+
customInstructions?: string | undefined;
|
|
345
342
|
} | undefined;
|
|
346
343
|
historyStore?: {
|
|
347
344
|
provider: string;
|
|
@@ -383,8 +380,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
383
380
|
};
|
|
384
381
|
version?: string | undefined;
|
|
385
382
|
historyDbPath?: string | undefined;
|
|
386
|
-
|
|
387
|
-
enableGraph?: boolean | undefined;
|
|
383
|
+
customInstructions?: string | undefined;
|
|
388
384
|
graphStore?: {
|
|
389
385
|
provider: string;
|
|
390
386
|
config: {
|
|
@@ -396,7 +392,7 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
396
392
|
provider: string;
|
|
397
393
|
config: Record<string, any>;
|
|
398
394
|
} | undefined;
|
|
399
|
-
|
|
395
|
+
customInstructions?: string | undefined;
|
|
400
396
|
} | undefined;
|
|
401
397
|
historyStore?: {
|
|
402
398
|
provider: string;
|
|
@@ -416,18 +412,18 @@ interface AddMemoryOptions extends Entity {
|
|
|
416
412
|
infer?: boolean;
|
|
417
413
|
}
|
|
418
414
|
interface SearchMemoryOptions extends Entity {
|
|
419
|
-
|
|
415
|
+
topK?: number;
|
|
420
416
|
filters?: SearchFilters;
|
|
421
417
|
}
|
|
422
418
|
interface GetAllMemoryOptions extends Entity {
|
|
423
|
-
|
|
419
|
+
topK?: number;
|
|
424
420
|
}
|
|
425
421
|
interface DeleteAllMemoryOptions extends Entity {
|
|
426
422
|
}
|
|
427
423
|
|
|
428
424
|
declare class Memory {
|
|
429
425
|
private config;
|
|
430
|
-
private
|
|
426
|
+
private customInstructions;
|
|
431
427
|
private embedder;
|
|
432
428
|
private vectorStore;
|
|
433
429
|
private llm;
|
|
@@ -435,7 +431,6 @@ declare class Memory {
|
|
|
435
431
|
private collectionName;
|
|
436
432
|
private apiVersion;
|
|
437
433
|
private graphMemory?;
|
|
438
|
-
private enableGraph;
|
|
439
434
|
telemetryId: string;
|
|
440
435
|
private _initPromise;
|
|
441
436
|
private _initError?;
|
|
@@ -647,12 +642,12 @@ declare class LangchainLLM implements LLM {
|
|
|
647
642
|
|
|
648
643
|
interface VectorStore {
|
|
649
644
|
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
650
|
-
search(query: number[],
|
|
645
|
+
search(query: number[], topK?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
651
646
|
get(vectorId: string): Promise<VectorStoreResult | null>;
|
|
652
647
|
update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
|
|
653
648
|
delete(vectorId: string): Promise<void>;
|
|
654
649
|
deleteCol(): Promise<void>;
|
|
655
|
-
list(filters?: SearchFilters,
|
|
650
|
+
list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>;
|
|
656
651
|
getUserId(): Promise<string>;
|
|
657
652
|
setUserId(userId: string): Promise<void>;
|
|
658
653
|
initialize(): Promise<void>;
|
|
@@ -667,12 +662,12 @@ declare class MemoryVectorStore implements VectorStore {
|
|
|
667
662
|
private cosineSimilarity;
|
|
668
663
|
private filterVector;
|
|
669
664
|
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
670
|
-
search(query: number[],
|
|
665
|
+
search(query: number[], topK?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
671
666
|
get(vectorId: string): Promise<VectorStoreResult | null>;
|
|
672
667
|
update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
|
|
673
668
|
delete(vectorId: string): Promise<void>;
|
|
674
669
|
deleteCol(): Promise<void>;
|
|
675
|
-
list(filters?: SearchFilters,
|
|
670
|
+
list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>;
|
|
676
671
|
getUserId(): Promise<string>;
|
|
677
672
|
setUserId(userId: string): Promise<void>;
|
|
678
673
|
initialize(): Promise<void>;
|
|
@@ -712,12 +707,12 @@ declare class Qdrant implements VectorStore {
|
|
|
712
707
|
constructor(config: QdrantConfig);
|
|
713
708
|
private createFilter;
|
|
714
709
|
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
715
|
-
search(query: number[],
|
|
710
|
+
search(query: number[], topK?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
716
711
|
get(vectorId: string): Promise<VectorStoreResult | null>;
|
|
717
712
|
update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
|
|
718
713
|
delete(vectorId: string): Promise<void>;
|
|
719
714
|
deleteCol(): Promise<void>;
|
|
720
|
-
list(filters?: SearchFilters,
|
|
715
|
+
list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>;
|
|
721
716
|
private generateUUID;
|
|
722
717
|
getUserId(): Promise<string>;
|
|
723
718
|
setUserId(userId: string): Promise<void>;
|
|
@@ -744,12 +739,12 @@ declare class RedisDB implements VectorStore {
|
|
|
744
739
|
initialize(): Promise<void>;
|
|
745
740
|
private _doInitialize;
|
|
746
741
|
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
747
|
-
search(query: number[],
|
|
742
|
+
search(query: number[], topK?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
748
743
|
get(vectorId: string): Promise<VectorStoreResult | null>;
|
|
749
744
|
update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
|
|
750
745
|
delete(vectorId: string): Promise<void>;
|
|
751
746
|
deleteCol(): Promise<void>;
|
|
752
|
-
list(filters?: SearchFilters,
|
|
747
|
+
list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>;
|
|
753
748
|
close(): Promise<void>;
|
|
754
749
|
getUserId(): Promise<string>;
|
|
755
750
|
setUserId(userId: string): Promise<void>;
|
|
@@ -772,12 +767,12 @@ declare class SupabaseDB implements VectorStore {
|
|
|
772
767
|
initialize(): Promise<void>;
|
|
773
768
|
private _doInitialize;
|
|
774
769
|
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
775
|
-
search(query: number[],
|
|
770
|
+
search(query: number[], topK?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
776
771
|
get(vectorId: string): Promise<VectorStoreResult | null>;
|
|
777
772
|
update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
|
|
778
773
|
delete(vectorId: string): Promise<void>;
|
|
779
774
|
deleteCol(): Promise<void>;
|
|
780
|
-
list(filters?: SearchFilters,
|
|
775
|
+
list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>;
|
|
781
776
|
getUserId(): Promise<string>;
|
|
782
777
|
setUserId(userId: string): Promise<void>;
|
|
783
778
|
}
|
|
@@ -791,11 +786,11 @@ declare class LangchainVectorStore implements VectorStore {
|
|
|
791
786
|
private storeUserId;
|
|
792
787
|
constructor(config: LangchainStoreConfig);
|
|
793
788
|
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
794
|
-
search(query: number[],
|
|
789
|
+
search(query: number[], topK?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
795
790
|
get(vectorId: string): Promise<VectorStoreResult | null>;
|
|
796
791
|
update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
|
|
797
792
|
delete(vectorId: string): Promise<void>;
|
|
798
|
-
list(filters?: SearchFilters,
|
|
793
|
+
list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>;
|
|
799
794
|
deleteCol(): Promise<void>;
|
|
800
795
|
getUserId(): Promise<string>;
|
|
801
796
|
setUserId(userId: string): Promise<void>;
|
|
@@ -815,12 +810,12 @@ declare class VectorizeDB implements VectorStore {
|
|
|
815
810
|
private _initPromise?;
|
|
816
811
|
constructor(config: VectorizeConfig);
|
|
817
812
|
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
818
|
-
search(query: number[],
|
|
813
|
+
search(query: number[], topK?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
819
814
|
get(vectorId: string): Promise<VectorStoreResult | null>;
|
|
820
815
|
update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
|
|
821
816
|
delete(vectorId: string): Promise<void>;
|
|
822
817
|
deleteCol(): Promise<void>;
|
|
823
|
-
list(filters?: SearchFilters,
|
|
818
|
+
list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>;
|
|
824
819
|
private generateUUID;
|
|
825
820
|
getUserId(): Promise<string>;
|
|
826
821
|
setUserId(userId: string): Promise<void>;
|
|
@@ -919,7 +914,7 @@ declare class AzureAISearch implements VectorStore {
|
|
|
919
914
|
/**
|
|
920
915
|
* Search for similar vectors
|
|
921
916
|
*/
|
|
922
|
-
search(query: number[],
|
|
917
|
+
search(query: number[], topK?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
923
918
|
/**
|
|
924
919
|
* Delete a vector by ID
|
|
925
920
|
*/
|
|
@@ -947,7 +942,7 @@ declare class AzureAISearch implements VectorStore {
|
|
|
947
942
|
/**
|
|
948
943
|
* List all vectors in the index
|
|
949
944
|
*/
|
|
950
|
-
list(filters?: SearchFilters,
|
|
945
|
+
list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>;
|
|
951
946
|
/**
|
|
952
947
|
* Generate a random user ID
|
|
953
948
|
*/
|
|
@@ -991,13 +986,13 @@ declare class PGVector implements VectorStore {
|
|
|
991
986
|
private createDatabase;
|
|
992
987
|
private createCol;
|
|
993
988
|
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
994
|
-
search(query: number[],
|
|
989
|
+
search(query: number[], topK?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
995
990
|
get(vectorId: string): Promise<VectorStoreResult | null>;
|
|
996
991
|
update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
|
|
997
992
|
delete(vectorId: string): Promise<void>;
|
|
998
993
|
deleteCol(): Promise<void>;
|
|
999
994
|
private listCols;
|
|
1000
|
-
list(filters?: SearchFilters,
|
|
995
|
+
list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>;
|
|
1001
996
|
close(): Promise<void>;
|
|
1002
997
|
getUserId(): Promise<string>;
|
|
1003
998
|
setUserId(userId: string): Promise<void>;
|