[GH-ISSUE #24431] issue: Qdrant – deleted memory points not removed from vector DB, causing stale data in RAG #74903

Closed
opened 2026-05-13 07:46:18 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @jomauso on GitHub (May 7, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24431

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

0.9.2

Ollama Version (if applicable)

No response

Operating System

Ubuntu 24.04

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 provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

When deleting a memory via the UI, model tool call or API:

  • The memory entry should be removed from PostgreSQL (works correctly)
  • The corresponding point should be removed from Qdrant vector database (does NOT happen)
  • Deleted content must NOT appear in future semantic search results / RAG retrieval (but it does)

Actual Behavior

  • PostgreSQL: Memory entry is deleted correctly
  • Qdrant: Point remains in the collection as orphaned data
  • RAG retrieval: Orphaned points are still returned in search results and injected into chat contexts

This means deleted memories remain accessible to the assistant and can appear in responses even though users explicitly deleted them. Only "Delete All Memories" works correctly because it drops the entire Qdrant collection.

Steps to Reproduce

  1. Deploy Open WebUI via Docker with Qdrant as vector database
  2. Enable Memories feature in Settings → Personalization → Memory
  3. Create 5-10 memories via the UI (Settings → Personalization → Memory → Add Memory)
  4. Delete individual memories one by one via the trash icon in the UI
  5. Use the memory search/query function OR start a new chat that triggers memory retrieval
  6. Observe: Deleted memory content is still returned and injected into the conversation

Logs & Screenshots

I can provide on request:

  • PostgreSQL row count vs Qdrant point count comparison showing the mismatch
  • Example of deleted memory content being returned in search results
  • Qdrant collection stats showing orphaned points

Note: This requires direct database access to demonstrate, which is why I'm including the technical analysis below.

Additional Information

Technical Analysis: (I'm not a developer but analyzed this with AI assistance by reviewing the Open WebUI source code)

The bug appears to be in: backend/open_webui/retrieval/vector/dbs/qdrant.py, method delete() (lines 157-175)

Current implementation deletes points via a payload filter on metadata.id instead of using direct point ID deletion. If the metadata field is missing, not indexed, or Qdrant's index is stale, the delete operation silently affects 0 points while the API returns success.

Proposed Fix: Use Qdrant's PointIdsList for direct ID-based deletion:

if ids:
return self.client.delete(
collection_name=f'{self.collection_prefix}_{collection_name}',
points_selector=models.PointIdsList(points=ids), # Direct ID deletion
)

Environment:

  • Open WebUI: 0.9.2
  • Qdrant: 1.17.1
  • Vector DB: Qdrant (ChromaDB users are NOT affected)
  • Database: PostgreSQL

This has data integrity implications as deleted personal/company information remains accessible via RAG.

Originally created by @jomauso on GitHub (May 7, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/24431 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version 0.9.2 ### Ollama Version (if applicable) _No response_ ### Operating System Ubuntu 24.04 ### 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 **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior When deleting a memory via the UI, model tool call or API: - The memory entry should be removed from PostgreSQL (works correctly) - The corresponding point should be removed from Qdrant vector database (does NOT happen) - Deleted content must NOT appear in future semantic search results / RAG retrieval (but it does) ### Actual Behavior - PostgreSQL: Memory entry is deleted correctly - Qdrant: Point remains in the collection as orphaned data - RAG retrieval: Orphaned points are still returned in search results and injected into chat contexts This means deleted memories remain accessible to the assistant and can appear in responses even though users explicitly deleted them. Only "Delete All Memories" works correctly because it drops the entire Qdrant collection. ### Steps to Reproduce 1. Deploy Open WebUI via Docker with Qdrant as vector database 2. Enable Memories feature in Settings → Personalization → Memory 3. Create 5-10 memories via the UI (Settings → Personalization → Memory → Add Memory) 4. Delete individual memories one by one via the trash icon in the UI 5. Use the memory search/query function OR start a new chat that triggers memory retrieval 6. Observe: Deleted memory content is still returned and injected into the conversation ### Logs & Screenshots I can provide on request: - PostgreSQL row count vs Qdrant point count comparison showing the mismatch - Example of deleted memory content being returned in search results - Qdrant collection stats showing orphaned points Note: This requires direct database access to demonstrate, which is why I'm including the technical analysis below. ### Additional Information **Technical Analysis:** (I'm not a developer but analyzed this with AI assistance by reviewing the Open WebUI source code) The bug appears to be in: backend/open_webui/retrieval/vector/dbs/qdrant.py, method delete() (lines 157-175) Current implementation deletes points via a payload filter on metadata.id instead of using direct point ID deletion. If the metadata field is missing, not indexed, or Qdrant's index is stale, the delete operation silently affects 0 points while the API returns success. **Proposed Fix:** Use Qdrant's PointIdsList for direct ID-based deletion: if ids: return self.client.delete( collection_name=f'{self.collection_prefix}_{collection_name}', points_selector=models.PointIdsList(points=ids), # Direct ID deletion ) **Environment:** - Open WebUI: 0.9.2 - Qdrant: 1.17.1 - Vector DB: Qdrant (ChromaDB users are NOT affected) - Database: PostgreSQL This has data integrity implications as deleted personal/company information remains accessible via RAG.
GiteaMirror added the bug label 2026-05-13 07:46:18 -05:00
Author
Owner

@owui-terminator[bot] commented on GitHub (May 7, 2026):

🔍 Related Issues Found

I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:

  1. 🟣 #20558 issue: RAG Knowledge file when modify/update, older data is available
    This is closely related because it reports stale RAG data remaining after a knowledge source is modified, which is the same class of bug: old vector-store entries are not removed/overwritten and continue to appear in retrieval results.
    by n4gY1 · bug

  2. 🟢 #24142 issue: Knowledge collection (selected via #) disappears after page reload / chat switch
    This is related to the broader knowledge/RAG attachment lifecycle in chats. While it is about attachment persistence rather than deletion, it concerns the same retrieval/knowledge subsystem and may share state-management or indexing issues.
    by taka817123 · bug


💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.

This comment was generated automatically. React with 👍 if helpful, 👎 if not.

<!-- gh-comment-id:4397913637 --> @owui-terminator[bot] commented on GitHub (May 7, 2026): <!-- terminator-bot:related-issues-reply --> 🔍 **Related Issues Found** I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions: 1. 🟣 [#20558](https://github.com/open-webui/open-webui/issues/20558) **issue: RAG Knowledge file when modify/update, older data is available** *This is closely related because it reports stale RAG data remaining after a knowledge source is modified, which is the same class of bug: old vector-store entries are not removed/overwritten and continue to appear in retrieval results.* *by n4gY1 · `bug`* 2. 🟢 [#24142](https://github.com/open-webui/open-webui/issues/24142) **issue: Knowledge collection (selected via #) disappears after page reload / chat switch** *This is related to the broader knowledge/RAG attachment lifecycle in chats. While it is about attachment persistence rather than deletion, it concerns the same retrieval/knowledge subsystem and may share state-management or indexing issues.* *by taka817123 · `bug`* --- 💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead. *This comment was generated automatically.* React with 👍 if helpful, 👎 if not.
Author
Owner

@Classic298 commented on GitHub (May 7, 2026):

Fiftieth duplicate or so - and non-deletion from the Vector DB is currently intended behaviour due to data retention

solution: https://github.com/Classic298/prune-open-webui

<!-- gh-comment-id:4397960073 --> @Classic298 commented on GitHub (May 7, 2026): Fiftieth duplicate or so - and non-deletion from the Vector DB is currently intended behaviour due to data retention solution: https://github.com/Classic298/prune-open-webui
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#74903