Mem0 TS Spec/Docs Update (#2275)

This commit is contained in:
Saket Aryan
2025-02-28 21:43:51 +05:30
committed by GitHub
parent d9b48191de
commit c1aba35884
9 changed files with 157 additions and 78 deletions
@@ -84,7 +84,7 @@ In this example, we are adding a memory of a user ordering a laptop. As seen in
<CodeGroup>
```typescript Code
await memory.add('Yesterday, I ordered a laptop, the order id is 12345', 'user123');
await memory.add('Yesterday, I ordered a laptop, the order id is 12345', { userId: "user123" });
```
```json Output
@@ -117,7 +117,7 @@ Hence, the memory is not added.
<CodeGroup>
```typescript Code
await memory.add('I like going to hikes', 'user123');
await memory.add('I like going to hikes', { userId: "user123" });
```
```json Output
@@ -135,7 +135,7 @@ const messages = [
{ role: 'assistant', content: 'I understand you\'re concerned about your order #54321. Let me help track that for you.' }
];
await memory.add(messages, 'user123');
await memory.add(messages, { userId: "user123" });
```
The custom prompt will process both the user and assistant messages to extract relevant information according to the defined format.