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.
- package/dist/oss/index.js +11 -16
- package/dist/oss/index.js.map +1 -1
- package/dist/oss/index.mjs +9 -14
- package/dist/oss/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/oss/index.js
CHANGED
|
@@ -2523,7 +2523,7 @@ var MemoryUpdateSchema = import_zod2.z.object({
|
|
|
2523
2523
|
event: import_zod2.z.enum(["ADD", "UPDATE", "DELETE", "NONE"]).describe(
|
|
2524
2524
|
"The action taken for this memory item (ADD, UPDATE, DELETE, or NONE)."
|
|
2525
2525
|
),
|
|
2526
|
-
old_memory: import_zod2.z.string().optional().describe(
|
|
2526
|
+
old_memory: import_zod2.z.string().optional().nullable().describe(
|
|
2527
2527
|
"The previous content of the memory item if the event was UPDATE."
|
|
2528
2528
|
)
|
|
2529
2529
|
})
|
|
@@ -3682,7 +3682,8 @@ var AzureAISearch = class {
|
|
|
3682
3682
|
};
|
|
3683
3683
|
|
|
3684
3684
|
// src/oss/src/vector_stores/pgvector.ts
|
|
3685
|
-
var import_pg = require("pg");
|
|
3685
|
+
var import_pg = __toESM(require("pg"));
|
|
3686
|
+
var { Client } = import_pg.default;
|
|
3686
3687
|
var PGVector = class {
|
|
3687
3688
|
constructor(config) {
|
|
3688
3689
|
this.collectionName = config.collectionName || "memories";
|
|
@@ -3690,7 +3691,7 @@ var PGVector = class {
|
|
|
3690
3691
|
this.useHnsw = config.hnsw || false;
|
|
3691
3692
|
this.dbName = config.dbname || "vector_store";
|
|
3692
3693
|
this.config = config;
|
|
3693
|
-
this.client = new
|
|
3694
|
+
this.client = new Client({
|
|
3694
3695
|
database: "postgres",
|
|
3695
3696
|
// Initially connect to default postgres database
|
|
3696
3697
|
user: config.user,
|
|
@@ -3698,6 +3699,7 @@ var PGVector = class {
|
|
|
3698
3699
|
host: config.host,
|
|
3699
3700
|
port: config.port
|
|
3700
3701
|
});
|
|
3702
|
+
this.initialize().catch(console.error);
|
|
3701
3703
|
}
|
|
3702
3704
|
async initialize() {
|
|
3703
3705
|
try {
|
|
@@ -3707,7 +3709,7 @@ var PGVector = class {
|
|
|
3707
3709
|
await this.createDatabase(this.dbName);
|
|
3708
3710
|
}
|
|
3709
3711
|
await this.client.end();
|
|
3710
|
-
this.client = new
|
|
3712
|
+
this.client = new Client({
|
|
3711
3713
|
database: this.dbName,
|
|
3712
3714
|
user: this.config.user,
|
|
3713
3715
|
password: this.config.password,
|
|
@@ -4066,12 +4068,6 @@ var DEFAULT_MEMORY_CONFIG = {
|
|
|
4066
4068
|
url: process.env.NEO4J_URL || "neo4j://localhost:7687",
|
|
4067
4069
|
username: process.env.NEO4J_USERNAME || "neo4j",
|
|
4068
4070
|
password: process.env.NEO4J_PASSWORD || "password"
|
|
4069
|
-
},
|
|
4070
|
-
llm: {
|
|
4071
|
-
provider: "openai",
|
|
4072
|
-
config: {
|
|
4073
|
-
model: "gpt-4-turbo-preview"
|
|
4074
|
-
}
|
|
4075
4071
|
}
|
|
4076
4072
|
},
|
|
4077
4073
|
historyStore: {
|
|
@@ -4307,7 +4303,7 @@ function getDeleteMessages(existingMemoriesString, data, userId) {
|
|
|
4307
4303
|
// src/oss/src/memory/graph_memory.ts
|
|
4308
4304
|
var MemoryGraph = class {
|
|
4309
4305
|
constructor(config) {
|
|
4310
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
4306
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
4311
4307
|
this.config = config;
|
|
4312
4308
|
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)) {
|
|
4313
4309
|
throw new Error("Neo4j configuration is incomplete");
|
|
@@ -4324,17 +4320,16 @@ var MemoryGraph = class {
|
|
|
4324
4320
|
this.config.embedder.config
|
|
4325
4321
|
);
|
|
4326
4322
|
this.llmProvider = "openai";
|
|
4323
|
+
let llmConfig = this.config.llm.config;
|
|
4327
4324
|
if ((_g = this.config.llm) == null ? void 0 : _g.provider) {
|
|
4328
4325
|
this.llmProvider = this.config.llm.provider;
|
|
4329
4326
|
}
|
|
4330
4327
|
if ((_i = (_h = this.config.graphStore) == null ? void 0 : _h.llm) == null ? void 0 : _i.provider) {
|
|
4331
4328
|
this.llmProvider = this.config.graphStore.llm.provider;
|
|
4329
|
+
llmConfig = (_j = this.config.graphStore.llm.config) != null ? _j : llmConfig;
|
|
4332
4330
|
}
|
|
4333
|
-
this.llm = LLMFactory.create(this.llmProvider,
|
|
4334
|
-
this.structuredLlm = LLMFactory.create(
|
|
4335
|
-
this.llmProvider,
|
|
4336
|
-
this.config.llm.config
|
|
4337
|
-
);
|
|
4331
|
+
this.llm = LLMFactory.create(this.llmProvider, llmConfig);
|
|
4332
|
+
this.structuredLlm = LLMFactory.create(this.llmProvider, llmConfig);
|
|
4338
4333
|
this.threshold = 0.7;
|
|
4339
4334
|
}
|
|
4340
4335
|
async add(data, filters) {
|