Skip to content

Implement exact KNN query mode#32

Merged
hev merged 1 commit into
mainfrom
feat/exact-knn-mode
Jul 8, 2026
Merged

Implement exact KNN query mode#32
hev merged 1 commit into
mainfrom
feat/exact-knn-mode

Conversation

@hevbot

@hevbot hevbot commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds exact: true to /query and routes vector/hybrid vector legs through LanceDB VectorQuery::bypass_vector_index().
  • Rejects exact+nprobes, FTS-only exact, and enabled semantic cache with exact mode.
  • Keys the exact result cache distinctly for exact vs indexed requests.
  • Adds MinIO-gated RFC 0014 integration coverage for indexed-vs-exact recall, selective filters, validation, and hybrid fuzzy FTS composition.

Closes #29.

Bench integration follows as #30.

Evidence

  • ./scripts/cargo fmt --all -- --check
  • ./scripts/cargo clippy --workspace --tests --benches -- -D warnings
  • HEVSEARCH_S3_ENDPOINT=http://127.0.0.1:19000 ./scripts/cargo test -p hevsearch-api --test api_exact_knn -- --ignored --nocapture

Exact vs indexed seeded PQ namespace (k=20, IVF_PQ num_partitions=16, num_sub_vectors=4, num_bits=4, indexed nprobes=1):

query_id indexed recall@20
3 0.750
19 0.700
41 0.450
73 0.550
127 0.850
211 0.850
307 0.350
401 0.700

Full ignored workspace attempt:

  • HEVSEARCH_S3_ENDPOINT=http://127.0.0.1:19000 ./scripts/cargo test --workspace -- --ignored --skip _aws --skip _100_runs_ --nocapture did not complete in this local container because linking was killed by the OS (collect2: fatal error: ld terminated with signal 9 [Killed]) while building object_cache_s3_smoke / hevsearch-core test binaries.
  • Retried with -j 1; same linker OOM class, so targeted MinIO coverage above is the passing evidence for this change.

@hevbot hevbot added the gate:impl Implementation PR awaiting CI + spec-review + merge (agentic-gates §2) label Jul 8, 2026
@hevbot

hevbot commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

Factory verified: RFC 0014 implemented per accepted spec — exact/hybrid routing through bypass_vector_index, exact+nprobes rejected, shared prefilter path covered, exact-vs-indexed recall evidence in body. Required check green in 3m57s (the #28 fix paying for itself). Merge-ready — merging also flips #30 (bench ground-truth tie-in) to ready.

@hev hev merged commit fb598f5 into main Jul 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gate:impl Implementation PR awaiting CI + spec-review + merge (agentic-gates §2)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement exact KNN query mode (exact: true) per accepted RFC 0014

2 participants