You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: Fixed bug #2331: delete memory API returned success but the memory remained searchable after deletion.
Root cause: Neo4jCommunityGraphDB.delete_node_by_prams in src/memos/graph_dbs/neo4j_community.py only removed nodes from the Neo4j graph but never purged the corresponding embedding vectors from vec_db (Qdrant). Since all search calls go through vector similarity on vec_db, stale vectors caused deleted memories to keep surfacing in search results. The clear() method and the reorganize path both cleaned vec_db correctly — delete_node_by_prams simply omitted that step.
Fix: replaced the pre-delete count query with an ID-collecting query (MATCH ... RETURN n.id AS id), then called self.vec_db.delete(collected_ids) after the graph DETACH DELETE. A vec_db failure is caught and logged as a warning rather than re-raised, so a transient vector store error does not roll back an already-committed graph deletion. Added 5 regression tests in tests/graph_dbs/test_delete_vec_cleanup.py covering delete-by-memory-ids, delete-by-filter, empty-list early-return, no-args early-return, and vec_db failure resilience. All 5 tests pass; all 36 existing graph_dbs tests continue to pass; ruff lint clean.
Activity
Memtensor-AI commentedon Sep 2, 2026
🤖 AutoDev has picked up this issue and started working on it.
Task ID:
b4115f14279d5b84Working branch:
bugfix/autodev-2331-20260902095324632Target branch:
latest dev* branchWorkflow: opsp (analysis → coding → testing → PR)
I will post the PR link here once done. If I need more information, I will ask in the comments.
fix: purge vec_db vectors in delete_node_by_prams of Neo4jCommunityGr…
Memtensor-AI commentedon Sep 2, 2026
✅ AutoDev task
b4115f14279d5b84completed.Summary: Fixed bug #2331: delete memory API returned success but the memory remained searchable after deletion.
Root cause:
Neo4jCommunityGraphDB.delete_node_by_pramsinsrc/memos/graph_dbs/neo4j_community.pyonly removed nodes from the Neo4j graph but never purged the corresponding embedding vectors fromvec_db(Qdrant). Since all search calls go through vector similarity onvec_db, stale vectors caused deleted memories to keep surfacing in search results. Theclear()method and the reorganize path both cleanedvec_dbcorrectly —delete_node_by_pramssimply omitted that step.Fix: replaced the pre-delete count query with an ID-collecting query (
MATCH ... RETURN n.id AS id), then calledself.vec_db.delete(collected_ids)after the graphDETACH DELETE. Avec_dbfailure is caught and logged as a warning rather than re-raised, so a transient vector store error does not roll back an already-committed graph deletion. Added 5 regression tests intests/graph_dbs/test_delete_vec_cleanup.pycovering delete-by-memory-ids, delete-by-filter, empty-list early-return, no-args early-return, and vec_db failure resilience. All 5 tests pass; all 36 existing graph_dbs tests continue to pass; ruff lint clean.Base branch:
mainBranch:
bugfix/autodev-2331-20260902095324632Commit:
a6d065ePR: #2332
Assigned to: @whipser030
Reviewers: @MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller
samvallad33 commentedon Oct 1, 2026
这是删除语义不完整的问题:接口返回 success 但内容仍然可被检索,说明删除动作和检索路径没有对齐。Vestige Strata 对这类问题的做法是,purge 必须同时移除内容和 embedding,只保留不含内容的审计墓碑(tombstone),并且每次删除都会返回可验证的回执(receipt)——所以「到底删没删」是一个可以用回执回答的问题,而不是一个 HTTP 状态码。检索侧我们只支持精确句柄(id/前缀/标签),被 purge 的记忆在结构上不可能再被相似度搜索捞回来。这个案例属于 MemOS 的产品 bug(已稳定复现),但对删除语义的设计有参考价值。(Disclosure: I built Strata — free and open: https://github.com/samvallad33/vestige ·
brew install samvallad33/tap/vestige)KongFUN2018 commentedon Oct 10, 2026
补充一个真实部署上的完整故障链实测(v2.0.33,neo4j-community + Qdrant):
这个 bug 的影响比"删除后仍可被检索到"更严重 —— 孤儿点会逐步淹没向量召回窗口,最终导致该用户的检索静默失效:
delete_node_by_prams每次都只删 Neo4j 节点、Qdrant 向量残留,两天积累 ~520 个孤儿点。_fetch_return_fields)把这些命中全部滤掉 → 搜索稳定返回 0 结果,但写入与向量化完全正常(vector_sync=success、点确实存在于 Qdrant)。排查时极易误判为"检索侧故障"。实测证据:
qdrant_point_ids - neo4j_node_ids,我们部署上共 668 个)后,检索立即恢复正常另外注意到本 issue 的修复 PR #2332 已 closed 且未合并(dev-v2.0.33 线上仍存在该问题),特此提醒当前主线该缺陷仍存活。
Fix MemTensor#2331: purge embeddings when delete_node_by_prams remove…
Fix #2331: 删除记忆接口返回成功但记忆未实际删除 (#2574)