The idea to keep with you
To keep the architecture evolvable without sacrificing reliability, track tombstone ratio per HNSW segment and trigger background compaction + atomic swap before tombstones exceed 15–20%.
TL;DR30-second simplified summary▾
HNSW soft deletes leave tombstone nodes that pollute efSearch beams and inflate hop counts under heavy daily churn. Partitioning into 1.5M-vector segments, triggering async compaction at >20% tombstones with a >=0.95 recall gate, and content-hash diffing upserts restores 0.96 Recall@10 and 12 ms p99.
Before you begin · Building blocksAlready know these? Jump to Stage 01 ↓
HNSW Vector Indexing & Approximate Nearest Neighbors
HNSW organizes high-dimensional vectors into a hierarchy of proximity graphs—sparse long-range highways on top and a dense base graph on Layer 0—delivering O(log N) search at >98% recall.
Embedding Model Selection
Embedding models map text, code, or multimodal inputs into dense (or sparse) vectors where geometric distance captures semantic similarity for RAG, search, and clustering.
Context Compression for RAG
Techniques that prune, rerank, or summarize retrieved RAG chunks before LLM generation to slash token cost and TTFT while beating 'lost-in-the-middle' attention decay.
Backpressure & Flow Control
Backpressure lets a slow consumer signal an upstream producer to slow down or pause, preventing unbounded memory growth and out-of-memory crashes.
Full walkthrough · 7 stages
01
L4 · FUNDAMENTALS
.
02
L4 · FUNDAMENTALS
.
03
L5 · APPLIED DESIGN
.
04
L5 · APPLIED DESIGN
.
05
L6 · SCALE & TRADE-OFFS
.
06
L6 · SCALE & TRADE-OFFS
.
07
L7 · STAFF / PRINCIPAL
.
Practice · Explain the consequences
Practice: Make the trade-off yourself.
Question 1 of 3
Score: 0/3Why is partitioning a 12M-vector HNSW index into 1.5M-vector segments better than rebuilding one monolithic 12M-node graph?
Recommended Learning Flow