Overview

User preferences, interests, and behaviors often evolve over time. The update operation lets you revise a stored memory, whether it’s updating facts and memories, rephrasing a message, or enriching metadata.

Mem0 supports both:

  • Single Memory Update for one specific memory using its ID
  • Batch Update for updating many memories at once (up to 1000)

This guide includes usage for both single update and batch update of memories through Mem0 Platform

Use Cases

  • Refine a vague or incorrect memory after a correction
  • Add or edit memory with new metadata (e.g., categories, tags)
  • Evolve factual knowledge as the user’s profile changes
  • A user profile evolves: “I love spicy food” → later says “Actually, I can’t handle spicy food.”

Updating memory ensures your agents remain accurate, adaptive, and personalized.


Update Memory

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"}
)

Batch Update

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)

Tips

  • You can update both text and metadata in the same call.
  • Use batchUpdate when you’re applying similar corrections at scale.
  • If memory is marked immutable, it must first be deleted and re-added.
  • Combine this with feedback mechanisms (e.g., user thumbs-up/down) to self-improve memory.

More Details

Refer to the full Update Memory API Reference and Batch Update Reference for schema and advanced fields.


Need help?

If you have any questions, please feel free to reach out to us using one of the following methods: