@@ -730,10 +730,14 @@ def update(self, memory_id, data):
730
730
731
731
Args:
732
732
memory_id (str): ID of the memory to update.
733
- data (dict ): Data to update the memory with.
733
+ data (str ): New content to update the memory with.
734
734
735
735
Returns:
736
- dict: Updated memory.
736
+ dict: Success message indicating the memory was updated.
737
+
738
+ Example:
739
+ >>> m.update(memory_id="mem_123", data="Likes to play tennis on weekends")
740
+ {'message': 'Memory updated successfully!'}
737
741
"""
738
742
capture_event ("mem0.update" , self , {"memory_id" : memory_id , "sync_type" : "sync" })
739
743
@@ -994,6 +998,15 @@ def __init__(self, config: MemoryConfig = MemoryConfig()):
994
998
else :
995
999
self .graph = None
996
1000
1001
+ self .config .vector_store .config .collection_name = "mem0migrations"
1002
+ if self .config .vector_store .provider in ["faiss" , "qdrant" ]:
1003
+ provider_path = f"migrations_{ self .config .vector_store .provider } "
1004
+ self .config .vector_store .config .path = os .path .join (mem0_dir , provider_path )
1005
+ os .makedirs (self .config .vector_store .config .path , exist_ok = True )
1006
+ self ._telemetry_vector_store = VectorStoreFactory .create (
1007
+ self .config .vector_store .provider , self .config .vector_store .config
1008
+ )
1009
+
997
1010
capture_event ("mem0.init" , self , {"sync_type" : "async" })
998
1011
999
1012
@classmethod
@@ -1580,10 +1593,14 @@ async def update(self, memory_id, data):
1580
1593
1581
1594
Args:
1582
1595
memory_id (str): ID of the memory to update.
1583
- data (dict ): Data to update the memory with.
1596
+ data (str ): New content to update the memory with.
1584
1597
1585
1598
Returns:
1586
- dict: Updated memory.
1599
+ dict: Success message indicating the memory was updated.
1600
+
1601
+ Example:
1602
+ >>> await m.update(memory_id="mem_123", data="Likes to play tennis on weekends")
1603
+ {'message': 'Memory updated successfully!'}
1587
1604
"""
1588
1605
capture_event ("mem0.update" , self , {"memory_id" : memory_id , "sync_type" : "async" })
1589
1606
0 commit comments