KNN prefiltering in Manticore Search (available from v19.0.1) integrates attribute filters directly into HNSW graph traversal rather than applying them after the fact. Postfiltering can return fewer results than requested when filters are selective, while prefiltering guarantees k results. Manticore uses three strategies automatically: standard filtered HNSW when most documents match, ACORN-1 (from SIGMOD 2024) when fewer than 60% of documents pass the filter (skipping distance computations for non-matching nodes and expanding through them adaptively), and brute-force linear scan when the filtered subset is tiny enough that scanning is cheaper than graph traversal. The query planner estimates selectivity per-query and per-segment with no manual tuning required. Postfiltering can still be explicitly requested via prefilter=0 when globally closest vectors are needed regardless of result count, and brute-force can be forced with fullscan=1.
Table of contents
The problem with postfilteringWhat prefiltering does differentlyNaive prefiltering and where it falls shortHow Manticore solves it: ACORN-1Automatic brute-force fallbackWhen to use postfiltering insteadForcing brute-forceSummarySort: