flat index
**Flat index** is the **exact vector-search index that compares each query against every stored vector without approximation** - it provides perfect nearest-neighbor recall at the cost of high computational expense.
**What Is Flat index?**
- **Definition**: Brute-force nearest-neighbor search over the full vector corpus.
- **Accuracy Property**: Returns true exact top-k results given the selected similarity metric.
- **Complexity Profile**: Query cost scales linearly with corpus size.
- **Benchmark Role**: Serves as ground-truth reference for evaluating ANN recall.
**Why Flat index Matters**
- **Gold Standard Accuracy**: Needed when maximum retrieval correctness is required.
- **Evaluation Baseline**: Essential for measuring approximation error of ANN methods.
- **Small-Corpus Fit**: Practical for low-volume datasets or offline analytics workloads.
- **Debug Utility**: Simplifies retrieval diagnostics by removing ANN approximation effects.
- **Calibration Anchor**: Helps tune ANN parameters against exact search outcomes.
**How It Is Used in Practice**
- **Ground-Truth Runs**: Generate exact recall benchmarks for candidate ANN configurations.
- **Hybrid Deployment**: Use flat search for high-value subsets and ANN for large tails.
- **Capacity Planning**: Estimate compute requirements before scaling to larger corpora.
Flat index is **the exact-reference method for vector retrieval** - although computationally expensive, it is indispensable for benchmarking, validation, and small-scale high-precision search workloads.