[GH-ISSUE #13718] issue: When deleting a knowledge base, it does not delete the collections corresponding to individual documents #55672

Open
opened 2026-05-05 17:48:29 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @qiaozhi199 on GitHub (May 9, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/13718

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

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

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

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

Originally created by @qiaozhi199 on GitHub (May 9, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/13718 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### 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 - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### 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_
GiteaMirror added the bug label 2026-05-05 17:48:29 -05:00
Author
Owner

@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

<!-- gh-comment-id:2914021719 --> @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
Author
Owner

@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?

<!-- gh-comment-id:3090627502 --> @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?
Author
Owner

@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.

<!-- gh-comment-id:3090686912 --> @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.
Author
Owner

@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

<!-- gh-comment-id:3215514607 --> @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
Author
Owner

@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.

<!-- gh-comment-id:3739768821 --> @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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#55672