PUT /memory/update
Update an existing memory’s content. This endpoint allows you to modify the stored information for a specific memory while preserving its ID and metadata.Request Body
The unique identifier of the memory to update.
The new content for the memory. This will replace the existing memory content.
Response
Indicates whether the operation was successful.
The result from mem0 containing update confirmation and metadata.
Example Request
Example Response
Updating Memory Type
The
PUT /memory/update endpoint only updates the memory content (data field). Memory type and other metadata cannot be updated through this endpoint. To change metadata, you need to delete the memory and create a new one with the desired metadata.Use Cases
Correcting Information Update a memory when you realize the stored information is incorrect:Error Responses
Error message describing what went wrong.
- Invalid Memory ID: The provided
memory_iddoesn’t exist - Empty Data: The
datafield cannot be empty - Database Connection: Failure to connect to the vector store
Memory History
Mem0 maintains a history of memory changes. To view the history of updates for a memory, use the history endpoint:Implementation Details
- Source:
backend/main.py:320 - Vector Update: The update triggers re-embedding of the new content
- Metadata Preservation: Existing metadata (including memory_type) is preserved
- Atomic Operation: Updates are atomic to prevent partial modifications