Skip to content

Commit d47cb8d

Browse files
authored
Doc: Fix example in quickstart page (mem0ai#2986)
1 parent fa15db0 commit d47cb8d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/quickstart.mdx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,23 @@ const memory = new Memory();
333333
<CodeGroup>
334334
```python Code
335335
# For a user
336-
result = m.add("I like to drink coffee in the morning and go for a walk.", user_id="alice", metadata={"category": "preferences"})
336+
messages = [
337+
{
338+
"role": "user",
339+
"content": "I like to drink coffee in the morning and go for a walk"
340+
}
341+
]
342+
result = m.add(messages, user_id="alice", metadata={"category": "preferences"})
337343
```
338344

339345
```typescript TypeScript
340-
const result = memory.add("I like to drink coffee in the morning and go for a walk.", { userId: "alice", metadata: { category: "preferences" } });
346+
const messages = [
347+
{
348+
role: "user",
349+
content: "I like to drink coffee in the morning and go for a walk"
350+
}
351+
];
352+
const result = memory.add(messages, { userId: "alice", metadata: { category: "preferences" } });
341353
```
342354

343355
```json Output

0 commit comments

Comments
 (0)