mem0ai 2.1.8 → 2.1.10
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/oss/index.d.mts +67 -2
- package/dist/oss/index.d.ts +67 -2
- package/dist/oss/index.js +571 -70
- package/dist/oss/index.js.map +1 -1
- package/dist/oss/index.mjs +568 -70
- package/dist/oss/index.mjs.map +1 -1
- package/package.json +17 -5
package/dist/oss/index.d.mts
CHANGED
|
@@ -12,14 +12,24 @@ interface Message {
|
|
|
12
12
|
content: string | MultiModalMessages;
|
|
13
13
|
}
|
|
14
14
|
interface EmbeddingConfig {
|
|
15
|
-
apiKey
|
|
15
|
+
apiKey?: string;
|
|
16
16
|
model?: string;
|
|
17
|
+
url?: string;
|
|
17
18
|
}
|
|
18
19
|
interface VectorStoreConfig {
|
|
19
20
|
collectionName: string;
|
|
20
21
|
dimension?: number;
|
|
21
22
|
[key: string]: any;
|
|
22
23
|
}
|
|
24
|
+
interface HistoryStoreConfig {
|
|
25
|
+
provider: string;
|
|
26
|
+
config: {
|
|
27
|
+
historyDbPath?: string;
|
|
28
|
+
supabaseUrl?: string;
|
|
29
|
+
supabaseKey?: string;
|
|
30
|
+
tableName?: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
23
33
|
interface LLMConfig {
|
|
24
34
|
provider?: string;
|
|
25
35
|
config?: Record<string, any>;
|
|
@@ -51,6 +61,8 @@ interface MemoryConfig {
|
|
|
51
61
|
provider: string;
|
|
52
62
|
config: LLMConfig;
|
|
53
63
|
};
|
|
64
|
+
historyStore?: HistoryStoreConfig;
|
|
65
|
+
disableHistory?: boolean;
|
|
54
66
|
historyDbPath?: string;
|
|
55
67
|
customPrompt?: string;
|
|
56
68
|
graphStore?: GraphStoreConfig;
|
|
@@ -215,6 +227,17 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
215
227
|
} | undefined;
|
|
216
228
|
customPrompt?: string | undefined;
|
|
217
229
|
}>>;
|
|
230
|
+
historyStore: z.ZodOptional<z.ZodObject<{
|
|
231
|
+
provider: z.ZodString;
|
|
232
|
+
config: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
233
|
+
}, "strip", z.ZodTypeAny, {
|
|
234
|
+
provider: string;
|
|
235
|
+
config: Record<string, any>;
|
|
236
|
+
}, {
|
|
237
|
+
provider: string;
|
|
238
|
+
config: Record<string, any>;
|
|
239
|
+
}>>;
|
|
240
|
+
disableHistory: z.ZodOptional<z.ZodBoolean>;
|
|
218
241
|
}, "strip", z.ZodTypeAny, {
|
|
219
242
|
embedder: {
|
|
220
243
|
provider: string;
|
|
@@ -256,6 +279,11 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
256
279
|
} | undefined;
|
|
257
280
|
customPrompt?: string | undefined;
|
|
258
281
|
} | undefined;
|
|
282
|
+
historyStore?: {
|
|
283
|
+
provider: string;
|
|
284
|
+
config: Record<string, any>;
|
|
285
|
+
} | undefined;
|
|
286
|
+
disableHistory?: boolean | undefined;
|
|
259
287
|
}, {
|
|
260
288
|
embedder: {
|
|
261
289
|
provider: string;
|
|
@@ -297,6 +325,11 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
297
325
|
} | undefined;
|
|
298
326
|
customPrompt?: string | undefined;
|
|
299
327
|
} | undefined;
|
|
328
|
+
historyStore?: {
|
|
329
|
+
provider: string;
|
|
330
|
+
config: Record<string, any>;
|
|
331
|
+
} | undefined;
|
|
332
|
+
disableHistory?: boolean | undefined;
|
|
300
333
|
}>;
|
|
301
334
|
|
|
302
335
|
interface Entity {
|
|
@@ -366,6 +399,16 @@ declare class OpenAIEmbedder implements Embedder {
|
|
|
366
399
|
embedBatch(texts: string[]): Promise<number[][]>;
|
|
367
400
|
}
|
|
368
401
|
|
|
402
|
+
declare class OllamaEmbedder implements Embedder {
|
|
403
|
+
private ollama;
|
|
404
|
+
private model;
|
|
405
|
+
private initialized;
|
|
406
|
+
constructor(config: EmbeddingConfig);
|
|
407
|
+
embed(text: string): Promise<number[]>;
|
|
408
|
+
embedBatch(texts: string[]): Promise<number[][]>;
|
|
409
|
+
private ensureModelExists;
|
|
410
|
+
}
|
|
411
|
+
|
|
369
412
|
interface LLMResponse {
|
|
370
413
|
content: string;
|
|
371
414
|
role: string;
|
|
@@ -424,6 +467,18 @@ declare class GroqLLM implements LLM {
|
|
|
424
467
|
generateChat(messages: Message[]): Promise<LLMResponse>;
|
|
425
468
|
}
|
|
426
469
|
|
|
470
|
+
declare class OllamaLLM implements LLM {
|
|
471
|
+
private ollama;
|
|
472
|
+
private model;
|
|
473
|
+
private initialized;
|
|
474
|
+
constructor(config: LLMConfig);
|
|
475
|
+
generateResponse(messages: Message[], responseFormat?: {
|
|
476
|
+
type: string;
|
|
477
|
+
}, tools?: any[]): Promise<string | LLMResponse>;
|
|
478
|
+
generateChat(messages: Message[]): Promise<LLMResponse>;
|
|
479
|
+
private ensureModelExists;
|
|
480
|
+
}
|
|
481
|
+
|
|
427
482
|
interface VectorStore {
|
|
428
483
|
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
429
484
|
search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
@@ -505,6 +560,13 @@ declare class RedisDB implements VectorStore {
|
|
|
505
560
|
close(): Promise<void>;
|
|
506
561
|
}
|
|
507
562
|
|
|
563
|
+
interface HistoryManager {
|
|
564
|
+
addHistory(memoryId: string, previousValue: string | null, newValue: string | null, action: string, createdAt?: string, updatedAt?: string, isDeleted?: number): Promise<void>;
|
|
565
|
+
getHistory(memoryId: string): Promise<any[]>;
|
|
566
|
+
reset(): Promise<void>;
|
|
567
|
+
close(): void;
|
|
568
|
+
}
|
|
569
|
+
|
|
508
570
|
declare class EmbedderFactory {
|
|
509
571
|
static create(provider: string, config: EmbeddingConfig): Embedder;
|
|
510
572
|
}
|
|
@@ -514,5 +576,8 @@ declare class LLMFactory {
|
|
|
514
576
|
declare class VectorStoreFactory {
|
|
515
577
|
static create(provider: string, config: VectorStoreConfig): VectorStore;
|
|
516
578
|
}
|
|
579
|
+
declare class HistoryManagerFactory {
|
|
580
|
+
static create(provider: string, config: HistoryStoreConfig): HistoryManager;
|
|
581
|
+
}
|
|
517
582
|
|
|
518
|
-
export { type AddMemoryOptions, AnthropicLLM, type DeleteAllMemoryOptions, type Embedder, EmbedderFactory, type EmbeddingConfig, type Entity, type GetAllMemoryOptions, type GraphStoreConfig, GroqLLM, type LLM, type LLMConfig, LLMFactory, type LLMResponse, Memory, type MemoryConfig, MemoryConfigSchema, type MemoryItem, MemoryVectorStore, type Message, type MultiModalMessages, type Neo4jConfig, OpenAIEmbedder, OpenAILLM, OpenAIStructuredLLM, Qdrant, RedisDB, type SearchFilters, type SearchMemoryOptions, type SearchResult, type VectorStore, type VectorStoreConfig, VectorStoreFactory, type VectorStoreResult };
|
|
583
|
+
export { type AddMemoryOptions, AnthropicLLM, type DeleteAllMemoryOptions, type Embedder, EmbedderFactory, type EmbeddingConfig, type Entity, type GetAllMemoryOptions, type GraphStoreConfig, GroqLLM, HistoryManagerFactory, type HistoryStoreConfig, type LLM, type LLMConfig, LLMFactory, type LLMResponse, Memory, type MemoryConfig, MemoryConfigSchema, type MemoryItem, MemoryVectorStore, type Message, type MultiModalMessages, type Neo4jConfig, OllamaEmbedder, OllamaLLM, OpenAIEmbedder, OpenAILLM, OpenAIStructuredLLM, Qdrant, RedisDB, type SearchFilters, type SearchMemoryOptions, type SearchResult, type VectorStore, type VectorStoreConfig, VectorStoreFactory, type VectorStoreResult };
|
package/dist/oss/index.d.ts
CHANGED
|
@@ -12,14 +12,24 @@ interface Message {
|
|
|
12
12
|
content: string | MultiModalMessages;
|
|
13
13
|
}
|
|
14
14
|
interface EmbeddingConfig {
|
|
15
|
-
apiKey
|
|
15
|
+
apiKey?: string;
|
|
16
16
|
model?: string;
|
|
17
|
+
url?: string;
|
|
17
18
|
}
|
|
18
19
|
interface VectorStoreConfig {
|
|
19
20
|
collectionName: string;
|
|
20
21
|
dimension?: number;
|
|
21
22
|
[key: string]: any;
|
|
22
23
|
}
|
|
24
|
+
interface HistoryStoreConfig {
|
|
25
|
+
provider: string;
|
|
26
|
+
config: {
|
|
27
|
+
historyDbPath?: string;
|
|
28
|
+
supabaseUrl?: string;
|
|
29
|
+
supabaseKey?: string;
|
|
30
|
+
tableName?: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
23
33
|
interface LLMConfig {
|
|
24
34
|
provider?: string;
|
|
25
35
|
config?: Record<string, any>;
|
|
@@ -51,6 +61,8 @@ interface MemoryConfig {
|
|
|
51
61
|
provider: string;
|
|
52
62
|
config: LLMConfig;
|
|
53
63
|
};
|
|
64
|
+
historyStore?: HistoryStoreConfig;
|
|
65
|
+
disableHistory?: boolean;
|
|
54
66
|
historyDbPath?: string;
|
|
55
67
|
customPrompt?: string;
|
|
56
68
|
graphStore?: GraphStoreConfig;
|
|
@@ -215,6 +227,17 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
215
227
|
} | undefined;
|
|
216
228
|
customPrompt?: string | undefined;
|
|
217
229
|
}>>;
|
|
230
|
+
historyStore: z.ZodOptional<z.ZodObject<{
|
|
231
|
+
provider: z.ZodString;
|
|
232
|
+
config: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
233
|
+
}, "strip", z.ZodTypeAny, {
|
|
234
|
+
provider: string;
|
|
235
|
+
config: Record<string, any>;
|
|
236
|
+
}, {
|
|
237
|
+
provider: string;
|
|
238
|
+
config: Record<string, any>;
|
|
239
|
+
}>>;
|
|
240
|
+
disableHistory: z.ZodOptional<z.ZodBoolean>;
|
|
218
241
|
}, "strip", z.ZodTypeAny, {
|
|
219
242
|
embedder: {
|
|
220
243
|
provider: string;
|
|
@@ -256,6 +279,11 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
256
279
|
} | undefined;
|
|
257
280
|
customPrompt?: string | undefined;
|
|
258
281
|
} | undefined;
|
|
282
|
+
historyStore?: {
|
|
283
|
+
provider: string;
|
|
284
|
+
config: Record<string, any>;
|
|
285
|
+
} | undefined;
|
|
286
|
+
disableHistory?: boolean | undefined;
|
|
259
287
|
}, {
|
|
260
288
|
embedder: {
|
|
261
289
|
provider: string;
|
|
@@ -297,6 +325,11 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
297
325
|
} | undefined;
|
|
298
326
|
customPrompt?: string | undefined;
|
|
299
327
|
} | undefined;
|
|
328
|
+
historyStore?: {
|
|
329
|
+
provider: string;
|
|
330
|
+
config: Record<string, any>;
|
|
331
|
+
} | undefined;
|
|
332
|
+
disableHistory?: boolean | undefined;
|
|
300
333
|
}>;
|
|
301
334
|
|
|
302
335
|
interface Entity {
|
|
@@ -366,6 +399,16 @@ declare class OpenAIEmbedder implements Embedder {
|
|
|
366
399
|
embedBatch(texts: string[]): Promise<number[][]>;
|
|
367
400
|
}
|
|
368
401
|
|
|
402
|
+
declare class OllamaEmbedder implements Embedder {
|
|
403
|
+
private ollama;
|
|
404
|
+
private model;
|
|
405
|
+
private initialized;
|
|
406
|
+
constructor(config: EmbeddingConfig);
|
|
407
|
+
embed(text: string): Promise<number[]>;
|
|
408
|
+
embedBatch(texts: string[]): Promise<number[][]>;
|
|
409
|
+
private ensureModelExists;
|
|
410
|
+
}
|
|
411
|
+
|
|
369
412
|
interface LLMResponse {
|
|
370
413
|
content: string;
|
|
371
414
|
role: string;
|
|
@@ -424,6 +467,18 @@ declare class GroqLLM implements LLM {
|
|
|
424
467
|
generateChat(messages: Message[]): Promise<LLMResponse>;
|
|
425
468
|
}
|
|
426
469
|
|
|
470
|
+
declare class OllamaLLM implements LLM {
|
|
471
|
+
private ollama;
|
|
472
|
+
private model;
|
|
473
|
+
private initialized;
|
|
474
|
+
constructor(config: LLMConfig);
|
|
475
|
+
generateResponse(messages: Message[], responseFormat?: {
|
|
476
|
+
type: string;
|
|
477
|
+
}, tools?: any[]): Promise<string | LLMResponse>;
|
|
478
|
+
generateChat(messages: Message[]): Promise<LLMResponse>;
|
|
479
|
+
private ensureModelExists;
|
|
480
|
+
}
|
|
481
|
+
|
|
427
482
|
interface VectorStore {
|
|
428
483
|
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
429
484
|
search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
@@ -505,6 +560,13 @@ declare class RedisDB implements VectorStore {
|
|
|
505
560
|
close(): Promise<void>;
|
|
506
561
|
}
|
|
507
562
|
|
|
563
|
+
interface HistoryManager {
|
|
564
|
+
addHistory(memoryId: string, previousValue: string | null, newValue: string | null, action: string, createdAt?: string, updatedAt?: string, isDeleted?: number): Promise<void>;
|
|
565
|
+
getHistory(memoryId: string): Promise<any[]>;
|
|
566
|
+
reset(): Promise<void>;
|
|
567
|
+
close(): void;
|
|
568
|
+
}
|
|
569
|
+
|
|
508
570
|
declare class EmbedderFactory {
|
|
509
571
|
static create(provider: string, config: EmbeddingConfig): Embedder;
|
|
510
572
|
}
|
|
@@ -514,5 +576,8 @@ declare class LLMFactory {
|
|
|
514
576
|
declare class VectorStoreFactory {
|
|
515
577
|
static create(provider: string, config: VectorStoreConfig): VectorStore;
|
|
516
578
|
}
|
|
579
|
+
declare class HistoryManagerFactory {
|
|
580
|
+
static create(provider: string, config: HistoryStoreConfig): HistoryManager;
|
|
581
|
+
}
|
|
517
582
|
|
|
518
|
-
export { type AddMemoryOptions, AnthropicLLM, type DeleteAllMemoryOptions, type Embedder, EmbedderFactory, type EmbeddingConfig, type Entity, type GetAllMemoryOptions, type GraphStoreConfig, GroqLLM, type LLM, type LLMConfig, LLMFactory, type LLMResponse, Memory, type MemoryConfig, MemoryConfigSchema, type MemoryItem, MemoryVectorStore, type Message, type MultiModalMessages, type Neo4jConfig, OpenAIEmbedder, OpenAILLM, OpenAIStructuredLLM, Qdrant, RedisDB, type SearchFilters, type SearchMemoryOptions, type SearchResult, type VectorStore, type VectorStoreConfig, VectorStoreFactory, type VectorStoreResult };
|
|
583
|
+
export { type AddMemoryOptions, AnthropicLLM, type DeleteAllMemoryOptions, type Embedder, EmbedderFactory, type EmbeddingConfig, type Entity, type GetAllMemoryOptions, type GraphStoreConfig, GroqLLM, HistoryManagerFactory, type HistoryStoreConfig, type LLM, type LLMConfig, LLMFactory, type LLMResponse, Memory, type MemoryConfig, MemoryConfigSchema, type MemoryItem, MemoryVectorStore, type Message, type MultiModalMessages, type Neo4jConfig, OllamaEmbedder, OllamaLLM, OpenAIEmbedder, OpenAILLM, OpenAIStructuredLLM, Qdrant, RedisDB, type SearchFilters, type SearchMemoryOptions, type SearchResult, type VectorStore, type VectorStoreConfig, VectorStoreFactory, type VectorStoreResult };
|