k-nearest-neighbor search returns the k stored vectors closest to a query under a chosen distance metric. Exact search compares the query with every eligible vector and guarantees the true nearest results.
Approximate nearest neighbor (ANN) search uses an index to examine only promising parts of the collection. It can be much faster and use less computation, but may miss some true neighbors.
Use exact search for small datasets, offline evaluation, or filtered sets that are already tiny. Use ANN for large, interactive systems. Tune it by measuring recall against exact results together with latency and memory. The best k for retrieval is separate from the number of index candidates examined.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.