HNSW Index RAM Calculator
Work out what a vector index costs in memory before you build it: embedding storage, the HNSW graph on top of it, what quantization saves, and the multiplier from replicas.
GB means 10^9 bytes, the unit cloud providers bill in. Graph cost is estimated as 2 x M links of 4 bytes per element, which is the layer-0 term that dominates HNSW; higher layers and per-element bookkeeping add a small amount on top. Payload and metadata indexes, build-time headroom and operating margin are not included, and neither is query latency, which depends on the search-effort parameter and the hardware rather than on corpus size.
Working through the arithmetic by hand, including what the tool leaves out: vector database memory sizing.
If the number here rules out keeping everything resident, the index choice changes too: HNSW vs IVF tradeoffs compared.
Cutting memory with quantization has a recall cost that rescoring is meant to absorb: low vector search recall: causes and fixes.