mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

Delete_all clears all memories

Open songby1024 opened this issue 1 month ago • 3 comments

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.

songby1024 avatar Nov 13 '25 03:11 songby1024

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 !

parthshr370 avatar Nov 13 '25 18:11 parthshr370

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?

Image

songby1024 avatar Nov 14 '25 00:11 songby1024

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

peisong13 avatar Nov 14 '25 02:11 peisong13