File tree Expand file tree Collapse file tree 3 files changed +505
-110
lines changed Expand file tree Collapse file tree 3 files changed +505
-110
lines changed Original file line number Diff line number Diff line change @@ -1780,24 +1780,26 @@ curl -X GET "https://api.mem0.ai/v1/memories/<memory-id-here>/history/" \
1780
1780
1781
1781
# ## 4.6 Update Memory
1782
1782
1783
- Update a memory with new data.
1783
+ Update a memory with new data. You can update the memory ' s text, metadata, or both.
1784
1784
1785
1785
<CodeGroup>
1786
1786
1787
1787
```python Python
1788
- message = " I recently tried chicken and I loved it. I' m thinking of trying more non-vegetarian dishes.."
1789
- client.update(memory_id, message)
1788
+ client.update(
1789
+ memory_id="<memory-id-here>",
1790
+ text="I am now a vegetarian.",
1791
+ metadata={"diet": "vegetarian"}
1792
+ )
1790
1793
```
1791
1794
1792
1795
```javascript JavaScript
1793
- const message = "I recently tried chicken and I loved it. I' m thinking of trying more non-vegetarian dishes.." ;
1794
- client.update(" memory-id-here" , message)
1796
+ client.update("memory-id-here", { text: "I am now a vegetarian.", metadata: { diet: "vegetarian" } })
1795
1797
.then(result => console.log(result))
1796
1798
.catch(error => console.error(error));
1797
1799
```
1798
1800
1799
1801
```bash cURL
1800
- curl -X PUT " https://api.mem0.ai/v1/memories/memory-id-here" \
1802
+ curl -X PUT "https://api.mem0.ai/v1/memories/< memory-id-here> " \
1801
1803
-H "Authorization: Token your-api-key" \
1802
1804
-H "Content-Type: application/json" \
1803
1805
-d ' {
You can’t perform that action at this time.
0 commit comments