Update a memory (creates new version)
memories.update_memory(MemoryUpdateMemoryParams**kwargs) -> MemoryUpdateMemoryResponse
PATCH/v4/memories
Update a memory by creating a new version. The original memory is preserved with isLatest=false.
Parameters
content: Optional[str]
Exact content match of the memory entry to operate on. Use this when you don’t have the ID.
forget_after: Optional[str]
ISO 8601 datetime string. The memory will be auto-forgotten after this time. Pass null to clear an existing expiry. Omit to inherit from the previous version.
formatdatetime
Update a memory (creates new version)
import os
from supermemory import Supermemory
client = Supermemory(
api_key=os.environ.get("SUPERMEMORY_API_KEY"), # This is the default and can be omitted
)
response = client.memories.update_memory(
container_tag="user_123",
new_content="John now prefers light mode",
)
print(response.id){
"id": "mem_xyz789",
"createdAt": "createdAt",
"forgetAfter": "forgetAfter",
"forgetReason": "forgetReason",
"memory": "John now prefers light mode",
"parentMemoryId": "mem_abc123",
"rootMemoryId": "mem_abc123",
"version": 2
}Returns Examples
{
"id": "mem_xyz789",
"createdAt": "createdAt",
"forgetAfter": "forgetAfter",
"forgetReason": "forgetReason",
"memory": "John now prefers light mode",
"parentMemoryId": "mem_abc123",
"rootMemoryId": "mem_abc123",
"version": 2
}