Skip to content

Commit 556a777

Browse files
davidhooclaude
andauthored
fix: increase ANN search K from 50 to 200 for 72K+ person pool (#7)
With 72K+ stranger persons (~364K face nodes in the HNSW index), K=50 per prototype query was too small: high-similarity candidates (e.g. 77%) were being missed because 50+ other stranger face nodes ranked above them for prominent persons like 胡波 (3505 faces). Increase annSearchK 50→200 and annHNSWEfSearch 100→200 (must be >= K per HNSW guidelines) so each of the ~210 per-patrol queries covers a wider neighborhood, ensuring borderline pairs above the merge-suggestion threshold (55%) are not silently dropped. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2a772b4 commit 556a777

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/internal/service/person_merge_suggestion_ann.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
)
99

1010
const (
11-
annSearchK = 50 // neighbors per prototype query
11+
annSearchK = 200 // neighbors per prototype query; 72K+ person pool needs wider net than 50
1212
annHNSWM = 16 // max neighbors per node; 16 gives better recall at 60K+ scale vs 8
13-
annHNSWEfSearch = 100 // search beam width; high value ensures recall near threshold boundary
13+
annHNSWEfSearch = 200 // search beam width; must be >= annSearchK
1414
)
1515

1616
// annIndex is a cached HNSW nearest-neighbor index over all person prototype embeddings.

0 commit comments

Comments
 (0)