mem0ai 2.0.2 → 2.1.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,11 +15,21 @@ interface VectorStoreConfig {
15
15
  [key: string]: any;
16
16
  }
17
17
  interface LLMConfig {
18
- apiKey: string;
18
+ provider?: string;
19
+ config?: Record<string, any>;
20
+ apiKey?: string;
19
21
  model?: string;
20
22
  }
23
+ interface Neo4jConfig {
24
+ url: string;
25
+ username: string;
26
+ password: string;
27
+ }
21
28
  interface GraphStoreConfig {
22
- config?: any;
29
+ provider: string;
30
+ config: Neo4jConfig;
31
+ llm?: LLMConfig;
32
+ customPrompt?: string;
23
33
  }
24
34
  interface MemoryConfig {
25
35
  version?: string;
@@ -38,6 +48,7 @@ interface MemoryConfig {
38
48
  historyDbPath?: string;
39
49
  customPrompt?: string;
40
50
  graphStore?: GraphStoreConfig;
51
+ enableGraph?: boolean;
41
52
  }
42
53
  interface MemoryItem {
43
54
  id: string;
@@ -146,12 +157,57 @@ declare const MemoryConfigSchema: z.ZodObject<{
146
157
  }>;
147
158
  historyDbPath: z.ZodOptional<z.ZodString>;
148
159
  customPrompt: z.ZodOptional<z.ZodString>;
160
+ enableGraph: z.ZodOptional<z.ZodBoolean>;
149
161
  graphStore: z.ZodOptional<z.ZodObject<{
150
- config: z.ZodOptional<z.ZodAny>;
162
+ provider: z.ZodString;
163
+ config: z.ZodObject<{
164
+ url: z.ZodString;
165
+ username: z.ZodString;
166
+ password: z.ZodString;
167
+ }, "strip", z.ZodTypeAny, {
168
+ url: string;
169
+ username: string;
170
+ password: string;
171
+ }, {
172
+ url: string;
173
+ username: string;
174
+ password: string;
175
+ }>;
176
+ llm: z.ZodOptional<z.ZodObject<{
177
+ provider: z.ZodString;
178
+ config: z.ZodRecord<z.ZodString, z.ZodAny>;
179
+ }, "strip", z.ZodTypeAny, {
180
+ provider: string;
181
+ config: Record<string, any>;
182
+ }, {
183
+ provider: string;
184
+ config: Record<string, any>;
185
+ }>>;
186
+ customPrompt: z.ZodOptional<z.ZodString>;
151
187
  }, "strip", z.ZodTypeAny, {
152
- config?: any;
188
+ provider: string;
189
+ config: {
190
+ url: string;
191
+ username: string;
192
+ password: string;
193
+ };
194
+ llm?: {
195
+ provider: string;
196
+ config: Record<string, any>;
197
+ } | undefined;
198
+ customPrompt?: string | undefined;
153
199
  }, {
154
- config?: any;
200
+ provider: string;
201
+ config: {
202
+ url: string;
203
+ username: string;
204
+ password: string;
205
+ };
206
+ llm?: {
207
+ provider: string;
208
+ config: Record<string, any>;
209
+ } | undefined;
210
+ customPrompt?: string | undefined;
155
211
  }>>;
156
212
  }, "strip", z.ZodTypeAny, {
157
213
  embedder: {
@@ -180,8 +236,19 @@ declare const MemoryConfigSchema: z.ZodObject<{
180
236
  version?: string | undefined;
181
237
  historyDbPath?: string | undefined;
182
238
  customPrompt?: string | undefined;
239
+ enableGraph?: boolean | undefined;
183
240
  graphStore?: {
184
- config?: any;
241
+ provider: string;
242
+ config: {
243
+ url: string;
244
+ username: string;
245
+ password: string;
246
+ };
247
+ llm?: {
248
+ provider: string;
249
+ config: Record<string, any>;
250
+ } | undefined;
251
+ customPrompt?: string | undefined;
185
252
  } | undefined;
186
253
  }, {
187
254
  embedder: {
@@ -210,8 +277,19 @@ declare const MemoryConfigSchema: z.ZodObject<{
210
277
  version?: string | undefined;
211
278
  historyDbPath?: string | undefined;
212
279
  customPrompt?: string | undefined;
280
+ enableGraph?: boolean | undefined;
213
281
  graphStore?: {
214
- config?: any;
282
+ provider: string;
283
+ config: {
284
+ url: string;
285
+ username: string;
286
+ password: string;
287
+ };
288
+ llm?: {
289
+ provider: string;
290
+ config: Record<string, any>;
291
+ } | undefined;
292
+ customPrompt?: string | undefined;
215
293
  } | undefined;
216
294
  }>;
217
295
 
@@ -244,6 +322,8 @@ declare class Memory {
244
322
  private db;
245
323
  private collectionName;
246
324
  private apiVersion;
325
+ private graphMemory?;
326
+ private enableGraph;
247
327
  constructor(config?: Partial<MemoryConfig>);
248
328
  static fromConfig(configDict: Record<string, any>): Memory;
249
329
  add(messages: string | Message[], config: AddMemoryOptions): Promise<SearchResult>;
@@ -283,11 +363,18 @@ declare class OpenAIEmbedder implements Embedder {
283
363
  interface LLMResponse {
284
364
  content: string;
285
365
  role: string;
366
+ toolCalls?: Array<{
367
+ name: string;
368
+ arguments: string;
369
+ }>;
286
370
  }
287
371
  interface LLM {
288
- generateResponse(messages: Message[], responseFormat?: {
372
+ generateResponse(messages: Array<{
373
+ role: string;
374
+ content: string;
375
+ }>, response_format: {
289
376
  type: string;
290
- }): Promise<string>;
377
+ }, tools?: any[]): Promise<any>;
291
378
  generateChat(messages: Message[]): Promise<LLMResponse>;
292
379
  }
293
380
 
@@ -297,17 +384,17 @@ declare class OpenAILLM implements LLM {
297
384
  constructor(config: LLMConfig);
298
385
  generateResponse(messages: Message[], responseFormat?: {
299
386
  type: string;
300
- }): Promise<string>;
387
+ }, tools?: any[]): Promise<string | LLMResponse>;
301
388
  generateChat(messages: Message[]): Promise<LLMResponse>;
302
389
  }
303
390
 
304
391
  declare class OpenAIStructuredLLM implements LLM {
305
- private client;
392
+ private openai;
306
393
  private model;
307
394
  constructor(config: LLMConfig);
308
395
  generateResponse(messages: Message[], responseFormat?: {
309
396
  type: string;
310
- }): Promise<string>;
397
+ } | null, tools?: any[]): Promise<string | LLMResponse>;
311
398
  generateChat(messages: Message[]): Promise<LLMResponse>;
312
399
  }
313
400
 
@@ -422,4 +509,4 @@ declare class VectorStoreFactory {
422
509
  static create(provider: string, config: VectorStoreConfig): VectorStore;
423
510
  }
424
511
 
425
- 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, OpenAIEmbedder, OpenAILLM, OpenAIStructuredLLM, Qdrant, RedisDB, type SearchFilters, type SearchMemoryOptions, type SearchResult, type VectorStore, type VectorStoreConfig, VectorStoreFactory, type VectorStoreResult };
512
+ 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 Neo4jConfig, OpenAIEmbedder, OpenAILLM, OpenAIStructuredLLM, Qdrant, RedisDB, type SearchFilters, type SearchMemoryOptions, type SearchResult, type VectorStore, type VectorStoreConfig, VectorStoreFactory, type VectorStoreResult };
@@ -15,11 +15,21 @@ interface VectorStoreConfig {
15
15
  [key: string]: any;
16
16
  }
17
17
  interface LLMConfig {
18
- apiKey: string;
18
+ provider?: string;
19
+ config?: Record<string, any>;
20
+ apiKey?: string;
19
21
  model?: string;
20
22
  }
23
+ interface Neo4jConfig {
24
+ url: string;
25
+ username: string;
26
+ password: string;
27
+ }
21
28
  interface GraphStoreConfig {
22
- config?: any;
29
+ provider: string;
30
+ config: Neo4jConfig;
31
+ llm?: LLMConfig;
32
+ customPrompt?: string;
23
33
  }
24
34
  interface MemoryConfig {
25
35
  version?: string;
@@ -38,6 +48,7 @@ interface MemoryConfig {
38
48
  historyDbPath?: string;
39
49
  customPrompt?: string;
40
50
  graphStore?: GraphStoreConfig;
51
+ enableGraph?: boolean;
41
52
  }
42
53
  interface MemoryItem {
43
54
  id: string;
@@ -146,12 +157,57 @@ declare const MemoryConfigSchema: z.ZodObject<{
146
157
  }>;
147
158
  historyDbPath: z.ZodOptional<z.ZodString>;
148
159
  customPrompt: z.ZodOptional<z.ZodString>;
160
+ enableGraph: z.ZodOptional<z.ZodBoolean>;
149
161
  graphStore: z.ZodOptional<z.ZodObject<{
150
- config: z.ZodOptional<z.ZodAny>;
162
+ provider: z.ZodString;
163
+ config: z.ZodObject<{
164
+ url: z.ZodString;
165
+ username: z.ZodString;
166
+ password: z.ZodString;
167
+ }, "strip", z.ZodTypeAny, {
168
+ url: string;
169
+ username: string;
170
+ password: string;
171
+ }, {
172
+ url: string;
173
+ username: string;
174
+ password: string;
175
+ }>;
176
+ llm: z.ZodOptional<z.ZodObject<{
177
+ provider: z.ZodString;
178
+ config: z.ZodRecord<z.ZodString, z.ZodAny>;
179
+ }, "strip", z.ZodTypeAny, {
180
+ provider: string;
181
+ config: Record<string, any>;
182
+ }, {
183
+ provider: string;
184
+ config: Record<string, any>;
185
+ }>>;
186
+ customPrompt: z.ZodOptional<z.ZodString>;
151
187
  }, "strip", z.ZodTypeAny, {
152
- config?: any;
188
+ provider: string;
189
+ config: {
190
+ url: string;
191
+ username: string;
192
+ password: string;
193
+ };
194
+ llm?: {
195
+ provider: string;
196
+ config: Record<string, any>;
197
+ } | undefined;
198
+ customPrompt?: string | undefined;
153
199
  }, {
154
- config?: any;
200
+ provider: string;
201
+ config: {
202
+ url: string;
203
+ username: string;
204
+ password: string;
205
+ };
206
+ llm?: {
207
+ provider: string;
208
+ config: Record<string, any>;
209
+ } | undefined;
210
+ customPrompt?: string | undefined;
155
211
  }>>;
156
212
  }, "strip", z.ZodTypeAny, {
157
213
  embedder: {
@@ -180,8 +236,19 @@ declare const MemoryConfigSchema: z.ZodObject<{
180
236
  version?: string | undefined;
181
237
  historyDbPath?: string | undefined;
182
238
  customPrompt?: string | undefined;
239
+ enableGraph?: boolean | undefined;
183
240
  graphStore?: {
184
- config?: any;
241
+ provider: string;
242
+ config: {
243
+ url: string;
244
+ username: string;
245
+ password: string;
246
+ };
247
+ llm?: {
248
+ provider: string;
249
+ config: Record<string, any>;
250
+ } | undefined;
251
+ customPrompt?: string | undefined;
185
252
  } | undefined;
186
253
  }, {
187
254
  embedder: {
@@ -210,8 +277,19 @@ declare const MemoryConfigSchema: z.ZodObject<{
210
277
  version?: string | undefined;
211
278
  historyDbPath?: string | undefined;
212
279
  customPrompt?: string | undefined;
280
+ enableGraph?: boolean | undefined;
213
281
  graphStore?: {
214
- config?: any;
282
+ provider: string;
283
+ config: {
284
+ url: string;
285
+ username: string;
286
+ password: string;
287
+ };
288
+ llm?: {
289
+ provider: string;
290
+ config: Record<string, any>;
291
+ } | undefined;
292
+ customPrompt?: string | undefined;
215
293
  } | undefined;
216
294
  }>;
217
295
 
@@ -244,6 +322,8 @@ declare class Memory {
244
322
  private db;
245
323
  private collectionName;
246
324
  private apiVersion;
325
+ private graphMemory?;
326
+ private enableGraph;
247
327
  constructor(config?: Partial<MemoryConfig>);
248
328
  static fromConfig(configDict: Record<string, any>): Memory;
249
329
  add(messages: string | Message[], config: AddMemoryOptions): Promise<SearchResult>;
@@ -283,11 +363,18 @@ declare class OpenAIEmbedder implements Embedder {
283
363
  interface LLMResponse {
284
364
  content: string;
285
365
  role: string;
366
+ toolCalls?: Array<{
367
+ name: string;
368
+ arguments: string;
369
+ }>;
286
370
  }
287
371
  interface LLM {
288
- generateResponse(messages: Message[], responseFormat?: {
372
+ generateResponse(messages: Array<{
373
+ role: string;
374
+ content: string;
375
+ }>, response_format: {
289
376
  type: string;
290
- }): Promise<string>;
377
+ }, tools?: any[]): Promise<any>;
291
378
  generateChat(messages: Message[]): Promise<LLMResponse>;
292
379
  }
293
380
 
@@ -297,17 +384,17 @@ declare class OpenAILLM implements LLM {
297
384
  constructor(config: LLMConfig);
298
385
  generateResponse(messages: Message[], responseFormat?: {
299
386
  type: string;
300
- }): Promise<string>;
387
+ }, tools?: any[]): Promise<string | LLMResponse>;
301
388
  generateChat(messages: Message[]): Promise<LLMResponse>;
302
389
  }
303
390
 
304
391
  declare class OpenAIStructuredLLM implements LLM {
305
- private client;
392
+ private openai;
306
393
  private model;
307
394
  constructor(config: LLMConfig);
308
395
  generateResponse(messages: Message[], responseFormat?: {
309
396
  type: string;
310
- }): Promise<string>;
397
+ } | null, tools?: any[]): Promise<string | LLMResponse>;
311
398
  generateChat(messages: Message[]): Promise<LLMResponse>;
312
399
  }
313
400
 
@@ -422,4 +509,4 @@ declare class VectorStoreFactory {
422
509
  static create(provider: string, config: VectorStoreConfig): VectorStore;
423
510
  }
424
511
 
425
- 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, OpenAIEmbedder, OpenAILLM, OpenAIStructuredLLM, Qdrant, RedisDB, type SearchFilters, type SearchMemoryOptions, type SearchResult, type VectorStore, type VectorStoreConfig, VectorStoreFactory, type VectorStoreResult };
512
+ 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 Neo4jConfig, OpenAIEmbedder, OpenAILLM, OpenAIStructuredLLM, Qdrant, RedisDB, type SearchFilters, type SearchMemoryOptions, type SearchResult, type VectorStore, type VectorStoreConfig, VectorStoreFactory, type VectorStoreResult };