Update a memory by ID. Args: memory_id (str): ID of the memory to update. data (dict): Data to update the memory with. Returns: dict: Updated memory.
(self, memory_id, data)
| 632 | return original_memories |
| 633 | |
| 634 | def update(self, memory_id, data): |
| 635 | """ |
| 636 | Update a memory by ID. |
| 637 | |
| 638 | Args: |
| 639 | memory_id (str): ID of the memory to update. |
| 640 | data (dict): Data to update the memory with. |
| 641 | |
| 642 | Returns: |
| 643 | dict: Updated memory. |
| 644 | """ |
| 645 | capture_event("mem0.update", self, {"memory_id": memory_id}) |
| 646 | |
| 647 | existing_embeddings = {data: self.embedding_model.embed(data, "update")} |
| 648 | |
| 649 | self._update_memory(memory_id, data, existing_embeddings) |
| 650 | return {"message": "Memory updated successfully!"} |
| 651 | |
| 652 | def delete(self, memory_id): |
| 653 | """ |