BuildBot

Retrieval Engineering

kNN & approximate nearest neighbors

Lesson 3 of 5

Brute-force kNN is exact but slow; ANN indexes like HNSW trade a little recall for orders-of-magnitude speed.

What you'll learn

  • Implement exact top-k nearest-neighbor search
  • Understand why brute force doesn't scale
  • Grasp the recall/speed trade-off behind ANN and HNSW
Members only

A free account unlocks this lesson and every other one.

Runnable challenges, knowledge checks, and progress that syncs across your devices. No card needed.

Not sure yet? Try the free lesson first: Embeddings & cosine similarity