Choosing and Operating a Vector Index

The final decision isn't "which algorithm is best" — it's "which point on the recall-latency-memory triangle does my workload need, and what's the simplest thing that hits it." For a huge number of systems the honest answer is far less exotic than the vector-database marketing suggests, and knowing when you've genuinely outgrown Postgres is worth more than knowing HNSW's internals.

This series opened with a triangle — recall, latency, memory — and every algorithm since is a different point in it. This closing post is about choosing: matching an index (and a system to run it) to your actual requirements, then operating it in production. It ties the internals back to the practical decision the AI Architecture Decisions series framed, now with the mechanics to reason about it properly.

Start from requirements, not algorithms

The mistake is picking an algorithm (or a trendy vector database) first. Start instead from the numbers your workload demands:

These map directly onto the series: scale and memory decide brute-force vs. IVF vs. HNSW and whether to quantize; recall and latency set the tuning knobs (nprobe, efSearch); update pattern favors HNSW (inserts) or flat (churn); filtering/hybrid needs shape the system choice. Answer these first, and the index mostly picks itself.

The decision, walked through

Following the series’ logic, the choice cascades by scale:

The through-line: escalate on evidence. Begin with the simplest thing that could work (often brute force or pgvector), measure recall and latency at your real scale, and move to a more complex index or system only when a measurement says you must.

Where to run it: library vs. database vs. Postgres

The index is one decision; the system hosting it is another, and it follows the same escalate-on-evidence logic (the pgvector-vs-dedicated decision, now with mechanics):

The honest guidance: most teams reaching for a dedicated vector database would be well served by pgvector, and should adopt the specialized system only when scale or a specific feature requirement — measured, not assumed — makes it necessary.

Operating a vector index

Once chosen, a vector index needs operational care the internals imply:

The series in one picture

Vector search is the recall-latency-memory triangle, navigated with a small toolkit:

  brute force   → perfect recall, no build/tuning; small or per-user scale
  IVF           → partition space; nprobe dials recall/speed; memory-efficient
  HNSW          → navigate a graph; efSearch dials recall/speed; best recall-at-latency, memory-hungry
  quantization  → compress vectors (scalar/PQ); trades recall for memory; enables scale
  filtering     → similarity + metadata (pre-filter for correctness/tenancy)
  hybrid        → dense + sparse (BM25) fused; catches exact matches
  reranking     → retrieve broad + approximate, reorder precise; recovers recall

Combine these to hit your point on the triangle: brute force or pgvector until measurements say otherwise, HNSW for the common quality-latency sweet spot, IVF-PQ when memory binds at huge scale, quantization to fit, and filtering + hybrid + reranking to make raw similarity into production-quality retrieval. Match the tool to the requirement, escalate on evidence, and measure recall — and vector search stops being a mysterious black box and becomes a set of controllable trade-offs.

Key takeaways

Further reading

Sources & References

Index selection guidance