docs/core-concepts/memory-operations/update.mdx
Mem0’s update operation lets you fix or enrich an existing memory without deleting it. When a user changes their preference or clarifies a fact, use update to keep the knowledge base fresh.
<Info> **Why it matters** - Corrects outdated or incorrect memories immediately. - Adds new metadata so filters and rerankers stay sharp. - Works for both one-off edits and large batches (up to 1000 memories). </Info>add or search results.client = MemoryClient(api_key="your-api-key")
memory_id = "your_memory_id" client.update( memory_id=memory_id, text="Updated memory content about the user", metadata={"category": "profile-update"}, timestamp="2025-01-15T12:00:00Z" )
```javascript JavaScript
import MemoryClient from 'mem0ai';
const client = new MemoryClient({ apiKey: "your-api-key" });
const memory_id = "your_memory_id";
await client.update(memory_id, {
text: "Updated memory content about the user",
metadata: { category: "profile-update" },
timestamp: "2025-01-15T12:00:00Z"
});
Update up to 1000 memories in one call.
<CodeGroup> ```python Python from mem0 import MemoryClientclient = MemoryClient(api_key="your-api-key")
update_memories = [ {"memory_id": "id1", "text": "Watches football"}, {"memory_id": "id2", "text": "Likes to travel"} ]
response = client.batch_update(update_memories) print(response)
```javascript JavaScript
import MemoryClient from 'mem0ai';
const client = new MemoryClient({ apiKey: "your-api-key" });
const updateMemories = [
{ memoryId: "id1", text: "Watches football" },
{ memoryId: "id2", text: "Likes to travel" }
];
client.batchUpdate(updateMemories)
.then(response => console.log('Batch update response:', response))
.catch(error => console.error(error));
memory = Memory()
memory.update( memory_id="mem_123", data="Alex now prefers decaf coffee", )
</CodeGroup>
<Note>
OSS JavaScript SDK does not expose `update` yet—use the REST API or Python SDK when self-hosting.
</Note>
## Tips
- Update both `text` **and** `metadata` together to keep filters accurate.
- Batch updates are ideal after large imports or when syncing CRM corrections.
- Immutable memories must be deleted and re-added instead of updated.
- Pair updates with feedback signals (thumbs up/down) to self-heal memories automatically.
<Callout type="tip" icon="plug">
**MCP Alternative**: With <Link href="/platform/mem0-mcp">Mem0 MCP</Link>, AI agents can update their own memories when users correct information.
</Callout>
## Managed vs OSS differences
| Capability | Mem0 Platform | Mem0 OSS |
| --- | --- | --- |
| Update call | `client.update(memory_id, {...})` | `memory.update(memory_id, data=...)` |
| Batch updates | `client.batch_update` (up to 1000 memories) | Script your own loop or bulk job |
| Dashboard visibility | Inspect updates in the UI | Inspect via logs or custom tooling |
| Immutable handling | Returns descriptive error | Raises exception—delete and re-add |
## Put it into practice
- Review the <Link href="/api-reference/memory/update-memory">Update Memory API reference</Link> for request/response details.
- Combine updates with <Link href="/platform/features/feedback-mechanism">Feedback Mechanism</Link> to automate corrections.
## See it live
- <Link href="/cookbooks/operations/support-inbox">Support Inbox with Mem0</Link> uses updates to refine customer profiles.
- <Link href="/cookbooks/companions/ai-tutor">AI Tutor with Mem0</Link> demonstrates user preference corrections mid-course.
<CardGroup cols={2}>
<Card
title="Learn Delete Concepts"
description="Understand when to remove memories instead of editing them."
icon="trash"
href="/core-concepts/memory-operations/delete"
/>
<Card
title="Automate Corrections"
description="See how feedback loops trigger updates in production."
icon="rocket"
href="/platform/features/feedback-mechanism"
/>
</CardGroup>