mem0ai 2.4.2 → 2.4.3

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.
@@ -2463,7 +2463,7 @@ var MemoryUpdateSchema = z2.object({
2463
2463
  event: z2.enum(["ADD", "UPDATE", "DELETE", "NONE"]).describe(
2464
2464
  "The action taken for this memory item (ADD, UPDATE, DELETE, or NONE)."
2465
2465
  ),
2466
- old_memory: z2.string().optional().describe(
2466
+ old_memory: z2.string().optional().nullable().describe(
2467
2467
  "The previous content of the memory item if the event was UPDATE."
2468
2468
  )
2469
2469
  })
@@ -3626,7 +3626,8 @@ var AzureAISearch = class {
3626
3626
  };
3627
3627
 
3628
3628
  // src/oss/src/vector_stores/pgvector.ts
3629
- import { Client } from "pg";
3629
+ import pkg from "pg";
3630
+ var { Client } = pkg;
3630
3631
  var PGVector = class {
3631
3632
  constructor(config) {
3632
3633
  this.collectionName = config.collectionName || "memories";
@@ -3642,6 +3643,7 @@ var PGVector = class {
3642
3643
  host: config.host,
3643
3644
  port: config.port
3644
3645
  });
3646
+ this.initialize().catch(console.error);
3645
3647
  }
3646
3648
  async initialize() {
3647
3649
  try {
@@ -4010,12 +4012,6 @@ var DEFAULT_MEMORY_CONFIG = {
4010
4012
  url: process.env.NEO4J_URL || "neo4j://localhost:7687",
4011
4013
  username: process.env.NEO4J_USERNAME || "neo4j",
4012
4014
  password: process.env.NEO4J_PASSWORD || "password"
4013
- },
4014
- llm: {
4015
- provider: "openai",
4016
- config: {
4017
- model: "gpt-4-turbo-preview"
4018
- }
4019
4015
  }
4020
4016
  },
4021
4017
  historyStore: {
@@ -4251,7 +4247,7 @@ function getDeleteMessages(existingMemoriesString, data, userId) {
4251
4247
  // src/oss/src/memory/graph_memory.ts
4252
4248
  var MemoryGraph = class {
4253
4249
  constructor(config) {
4254
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i;
4250
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
4255
4251
  this.config = config;
4256
4252
  if (!((_b = (_a2 = config.graphStore) == null ? void 0 : _a2.config) == null ? void 0 : _b.url) || !((_d = (_c = config.graphStore) == null ? void 0 : _c.config) == null ? void 0 : _d.username) || !((_f = (_e = config.graphStore) == null ? void 0 : _e.config) == null ? void 0 : _f.password)) {
4257
4253
  throw new Error("Neo4j configuration is incomplete");
@@ -4268,17 +4264,16 @@ var MemoryGraph = class {
4268
4264
  this.config.embedder.config
4269
4265
  );
4270
4266
  this.llmProvider = "openai";
4267
+ let llmConfig = this.config.llm.config;
4271
4268
  if ((_g = this.config.llm) == null ? void 0 : _g.provider) {
4272
4269
  this.llmProvider = this.config.llm.provider;
4273
4270
  }
4274
4271
  if ((_i = (_h = this.config.graphStore) == null ? void 0 : _h.llm) == null ? void 0 : _i.provider) {
4275
4272
  this.llmProvider = this.config.graphStore.llm.provider;
4273
+ llmConfig = (_j = this.config.graphStore.llm.config) != null ? _j : llmConfig;
4276
4274
  }
4277
- this.llm = LLMFactory.create(this.llmProvider, this.config.llm.config);
4278
- this.structuredLlm = LLMFactory.create(
4279
- this.llmProvider,
4280
- this.config.llm.config
4281
- );
4275
+ this.llm = LLMFactory.create(this.llmProvider, llmConfig);
4276
+ this.structuredLlm = LLMFactory.create(this.llmProvider, llmConfig);
4282
4277
  this.threshold = 0.7;
4283
4278
  }
4284
4279
  async add(data, filters) {