Skip to main content

Keep Memories Accurate with Update

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.
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).

Key terms

  • memory_id – Unique identifier returned by add or search results.
  • text / data – New content that replaces the stored memory value.
  • metadata – Optional key-value pairs you update alongside the text.
  • batch_update – Platform API that edits multiple memories in a single request.
  • immutable – Flagged memories that must be deleted and re-added instead of updated.

How the update flow works

1

Locate the memory

Use search or dashboard inspection to capture the memory_id you want to change.
2

Submit the update

Call update (or batch_update) with new text and optional metadata. Mem0 overwrites the stored value and adjusts indexes.
3

Verify

Check the response or re-run search to ensure the revised memory appears with the new content.

Single memory update (Platform)

from mem0 import MemoryClient

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"}
)
Expect a confirmation message and the updated memory to appear in the dashboard almost instantly.

Batch update (Platform)

Update up to 1000 memories in one call.
from mem0 import MemoryClient

client = 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)

Update with Mem0 OSS

from mem0 import Memory

memory = Memory()

memory.update(
    memory_id="mem_123",
    data="Alex now prefers decaf coffee",
)
OSS JavaScript SDK does not expose update yet—use the REST API or Python SDK when self-hosting.

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.

Managed vs OSS differences

CapabilityMem0 PlatformMem0 OSS
Update callclient.update(memory_id, {...})memory.update(memory_id, data=...)
Batch updatesclient.batch_update (up to 1000 memories)Script your own loop or bulk job
Dashboard visibilityInspect updates in the UIInspect via logs or custom tooling
Immutable handlingReturns descriptive errorRaises exception—delete and re-add

Put it into practice

See it live