AI Engineering

Vector index explorer

Build real HNSW and IVF indexes over random vectors in your browser, sweep efSearch and nprobe for the recall/latency trade-off, and do the memory maths for float32, int8, PQ and binary.

Real vs simulated: The indexes are real implementations on synthetic vectors; timings are your browser’s, not a vector database’s.

Synthetic data: 24 clusters on the unit sphere. 40 queries, recall@10 against exact search. Builds take a second or two.

Build the indexes to see the recall/cost trade-off.

Memory maths at your scale

EncodingPer vectorTotalNotes
float324.1 KB41.0 GBFull precision — the baseline
float16 / bfloat162.0 KB20.5 GBHalf the memory, recall essentially unchanged
int8 scalar quantisation1.0 KB10.2 GB4× smaller; small recall loss, usually fixed by rescoring
Product quantisation (64 × 8-bit codes)64 B640.0 MB64× smaller; needs rescoring with full vectors for top results
Binary (1 bit per dimension)128 B1.3 GB32× smaller; only with rescoring, and only for models trained for it
HNSW graph links (M=12)96 B960.0 MBExtra, on top of whichever vector encoding you keep in memory

Excludes metadata, IDs and replicas. A common production shape: int8 or PQ codes in RAM for the search, full-precision vectors on disk to rescore the top few hundred.