← All questions
Retrieval & EmbeddingsVery Hard· HNSW· LSH· System Design

We’re replacing HNSW with LSH. The corpus takes 2M inse...

LSH allows for exact inserts and deletes because buckets are computed from the document alone, whereas HNSW and IVF are fit to the corpus structure. Before switching, compare the memory overhead (LSH is roughly 14x larger for equal recall) and candidate list size. If the rebuild window is the primary issue, consider segment-based indexing or a hybrid approach using LSH for hot data and a graph index for the cold majority.

Code playground (Python)