▶ Interactive Lab

pgvector ANN Search

2D vector search with adjustable recall threshold.

Advertisement
click anywhere to query
Click in the plot to query. Top-K nearest vectors highlighted.

What you're seeing

Vector databases store high-dim embeddings + index them for fast nearest-neighbor search. pgvector uses HNSW (Hierarchical Navigable Small World) by default in 2026.

Real embeddings are 768-1536 dim; we use 2D for visualization. ANN doesn't always return exact top-K — it's a recall/speed tradeoff.

★ KEY TAKEAWAY
Vector search returns top-K nearest by cosine/L2 distance. pgvector uses HNSW for log-N query time.
▶ WHAT TO TRY
  • Click anywhere to query.
  • Top-K neighbors highlight in green.
  • Real embeddings are 768-1536 dim; we use 2D for visualization.