Skip to content

fix: remove destructive vector_store.reset() from delete_all()#4349

Merged
kartik-mem0 merged 1 commit intomainfrom
fix/delete-all-reset-bug
Mar 16, 2026
Merged

fix: remove destructive vector_store.reset() from delete_all()#4349
kartik-mem0 merged 1 commit intomainfrom
fix/delete-all-reset-bug

Conversation

@kartik-mem0
Copy link
Copy Markdown
Contributor

Description

delete_all(user_id=...) is meant to delete only memories matching the provided filters. However, after deleting individual memories it called self.vector_store.reset(), which drops the entire
collection/table — destroying ALL memories regardless of the filter.

The async version of delete_all() already omits this call, confirming it was unintentional in the sync path.

Fixes #3785

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit Test

Added regression assertion vector_store.reset.assert_not_called() to the existing test_delete_all test. Both parametrizations (v1.0/v1.1) pass.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Maintainer Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: memories table was dropped by this reset call

2 participants