mem0ai 1.0.25 → 1.0.26
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/README.md +15 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,6 +87,21 @@ client.add(messages, { agent_id: "travel-assistant" })
|
|
|
87
87
|
.catch(error => console.error(error));
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
#### Infer Memories
|
|
91
|
+
|
|
92
|
+
By default, Mem0 will infer memories based on the content of the messages. You can disable this behavior by passing `infer: false` in the options and directly store the messages.
|
|
93
|
+
|
|
94
|
+
```javascript
|
|
95
|
+
const messages = [
|
|
96
|
+
{ role: "user", content: "Hi, I'm Alex. I'm a vegetarian and I'm allergic to nuts." },
|
|
97
|
+
{ role: "assistant", content: "Hello Alex! I've noted that you're a vegetarian and have a nut allergy. I'll keep this in mind for any food-related recommendations or discussions." }
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
client.add(messages, { user_id: "alex", infer: false })
|
|
101
|
+
.then(result => console.log(result))
|
|
102
|
+
.catch(error => console.error(error));
|
|
103
|
+
```
|
|
104
|
+
|
|
90
105
|
### 4.2 Search Relevant Memories
|
|
91
106
|
|
|
92
107
|
You can search for relevant memories using both v1 and v2 of the API:
|