---
title: "Comment by Ahmet Özel on \"The DSAR Problem in RAG Pipelines: Why Pre-Embedding Local Sanitization Beats Vector Unlearning\" | Hashnode"
description: "Moving erasure out of HNSW segments into a relational mapping table solves a compliance headache that vector databases were never designed to handle cleanly. Wa"
url: "https://hashnode.com/posts/the-dsar-problem-in-rag-pipelines-why-pre-embedding-local-sanitization-beats-vector-unlearning/6aff269e04f21ee6388b72ef/comment/6b01753de4383966bf2d3467"
---

[Discussion](https://hashnode.com/posts/the-dsar-problem-in-rag-pipelines-why-pre-embedding-local-sanitization-beats-vector-unlearning/6aff269e04f21ee6388b72ef)

Comment [The DSAR Problem in RAG Pipelines: Why Pre-Embedding Local Sanitization Beats Vector Unlearning](https://hashnode.com/posts/the-dsar-problem-in-rag-pipelines-why-pre-embedding-local-sanitization-beats-vector-unlearning/6aff269e04f21ee6388b72ef)

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Nov 21](https://hashnode.com/posts/the-dsar-problem-in-rag-pipelines-why-pre-embedding-local-sanitization-beats-vector-unlearning/6aff269e04f21ee6388b72ef/comment/6b01753de4383966bf2d3467)

Moving erasure out of HNSW segments into a relational mapping table solves a compliance headache that vector databases were never designed to handle cleanly. Waiting for graph compaction or scrubbing semantic caches on every deletion request leaves awkward audit gaps.

At 0.11 to 0.15 ms median overhead, inline surrogate replacement is practically free next to embedding network latency. One retrieval nuance to test carefully is entity-specific queries: when an authorized user asks directly about a specific invoice or client email, the query path has to apply the exact same deterministic surrogate mapping before embedding so the placeholder tokens still align.

[Ilya Sibiryakov](https://hashnode.com/@ztds)

[Nov 22](https://hashnode.com/posts/the-dsar-problem-in-rag-pipelines-why-pre-embedding-local-sanitization-beats-vector-unlearning/6aff269e04f21ee6388b72ef/comment/6b01753de4383966bf2d3467#reply-6b035c21dc1f44e7d212d7f4)

Good catch — that query-path symmetry is the exact boundary between ephemeral chat redaction and persistent RAG retrieval.

In practice, two patterns hold up well without re-introducing raw identifiers into the vector index:

1.  **Per-tenant scoped surrogates on the query path:** authorized queries pass through the same local tenant-isolated mapping boundary before embedding, so an entity-specific lookup resolves to the matching placeholder token while remaining unlinkable across tenants.
2.  **Hybrid metadata + semantic retrieval:** keep exact lookups (invoice numbers, account IDs, emails) as opaque local filters resolved against the relational mapping table, and let HNSW handle only the semantic intent over the de-identified chunks.

Both keep GDPR Art. 17 erasure an O(1) relational deletion or tenant-key revocation with zero HNSW re-indexing.

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Nov 23](https://hashnode.com/posts/the-dsar-problem-in-rag-pipelines-why-pre-embedding-local-sanitization-beats-vector-unlearning/6aff269e04f21ee6388b72ef/comment/6b01753de4383966bf2d3467#reply-6b04bc9416fb4652c1e3f57f)

That hybrid pattern—routing exact identifiers through the local relational mapping table while keeping HNSW purely semantic—is the cleanest separation of concerns. It avoids asking dense embeddings to preserve arbitrary invoice or account strings they were never good at matching anyway, while keeping per-tenant surrogate isolation intact and GDPR erasure strictly O(1) in the relational store.
