mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #13718] issue: When deleting a knowledge base, it does not delete the collections corresponding to individual documents #32535
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @qiaozhi199 on GitHub (May 9, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/13718
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
v0.6.6
Ollama Version (if applicable)
0.6.6
Operating System
CentOS
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When deleting a knowledge base, the corresponding Collection for the knowledge base, as well as the Collections for each individual document within the knowledge base, should be deleted in the vector database.
Actual Behavior
I use the Milvus vector database in the backend to store RAG data.
I noticed that when I click the delete button for a knowledge base, it only deletes the Collection in Milvus corresponding to the knowledge base ID, but does not delete the Collections for each individual document within the knowledge base. This results in many residual data entries in my Milvus database.
However, when I delete a single document within the knowledge base, it correctly deletes the corresponding Collection for that specific document in Milvus.
Additional Information
No response
@PVBLIC-F commented on GitHub (May 27, 2025):
You are correct. Files.py does not execute any vector clean up. Just physical file clean up. I'm working on adding the vector clean up.
✅ Deletes the file record from the database (Files.delete_file_by_id(id))
✅ Deletes the physical file from storage (Storage.delete_file(file.path))
❌ MISSING: Does NOT clean up vectors from the vector database
@westbrook-ai commented on GitHub (Jul 18, 2025):
Noticing the same issue while working through a new vector backend implementation. @PVBLIC-F did you ever get a PR in for this?
@PVBLIC-F commented on GitHub (Jul 18, 2025):
I tried but ended up just resolving it myself for our implementation, plus a ton of enhancements.
@Classic298 commented on GitHub (Aug 22, 2025):
Hello everyone.
I worked on a PR related to this issue.
Testing wanted!
https://github.com/open-webui/open-webui/pull/16520
@loktar00 commented on GitHub (Jan 12, 2026):
This is actually a REALLY big deal. I've had a few large knowledge bases fail that I've had to delete, and now uploading anything to a knowledge base is PAINFULLY slow. I know a PR is being worked on which is great however I'm not sure how more people aren't affected by this.