Delete_all clears all memories
Why is there a self.vector.store.reset() method when the delete_all method is executed? I wanted to delete the memory of the specified user_id and run_id, but after executing the delete_all method, the collection mem0 was cleared, resulting in the loss of all memories.
Hey thanks for reporting this , Could you please confirm what version are you using ?
- Platform ? ( Cloud )
- OSS ( What config )
and any other way we can reproduce the results , thanks !
Hello, I'm using version 1.0.0. I installed it via pip and called from_confing to initialize the client. The memory is constructed by passing user_id and run_id through.However, when I want to delete this specified memory, calling the delete_all method and passing parameters will clear the entire collection. I have reviewed the source code. In the delete_all method, the self.vector_store. reset() operation was indeed executed. May I ask if this design is reasonable or if I'm using it incorrectly?
hello, I also noticed this bug and made a PR: https://github.com/mem0ai/mem0/pull/3743
Alternatively, if you want to hot fix this, you can comment line 1053 in mem0/memory/main.py.
# delete vector memories by filter
memories = self.vector_store.list(filters=filters)[0]
for memory in memories:
self._delete_memory(memory.id)
# self.vector_store.reset() # <-- This line was the problem