Fix memory deletion not removing from vector store#3610
Merged
prateekchhikara merged 1 commit intomem0ai:mainfrom Oct 18, 2025
Merged
Fix memory deletion not removing from vector store#3610prateekchhikara merged 1 commit intomem0ai:mainfrom
prateekchhikara merged 1 commit intomem0ai:mainfrom
Conversation
- MCP delete_all_memories: Convert UUID to string for vector store deletion - REST delete_memories: Add vector store deletion before DB state update - Both endpoints now properly delete from Qdrant and PostgreSQL
Contributor
|
Hey @frederikb96 Good catch! Thanks a lot for this fix. CC: @VikramIyer125 Can you review this? |
VikramIyer125
approved these changes
Oct 18, 2025
garciaba79
pushed a commit
to garciaba79/mem0
that referenced
this pull request
Feb 12, 2026
jamebobob
pushed a commit
to jamebobob/mem0-vigil-recall
that referenced
this pull request
Mar 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Memory deletion endpoints only updated PostgreSQL state but never deleted from Qdrant vector store. This caused:
What was broken:
DELETE /api/v1/memories/): Only calledupdate_memory_state()to mark as deleted in DBdelete_all_memories): Calledmemory_client.delete(memory_id)but passed UUID instead of stringHow It Works Elsewhere
The
add_memoriesflow (both REST and MCP) properly syncs:memory_client.add()Deletion should mirror this - remove from both stores.
The Fix
MCP API (
delete_all_memoriesin mcp_server.py):memory_client.delete(str(memory_id))REST API (
delete_memoriesin memories.py):memory_client.delete(str(memory_id))Both endpoints now properly sync deletions across storage layers.
Type of change
How Has This Been Tested?
Checklist: