Skip to content

fix: consistent score calculation in FAISSRetriever#2434

Open
0xbyt4 wants to merge 1 commit intoOpenMind:mainfrom
0xbyt4:fix/faiss-score-inconsistency
Open

fix: consistent score calculation in FAISSRetriever#2434
0xbyt4 wants to merge 1 commit intoOpenMind:mainfrom
0xbyt4:fix/faiss-score-inconsistency

Conversation

@0xbyt4
Copy link
Collaborator

@0xbyt4 0xbyt4 commented Feb 28, 2026

Summary

  • search() returned raw FAISS distance as score while batch_search() used 1/(1+dist) normalization
  • Same distance value produced different scores: e.g., dist=0.1 gave score 0.1 via query() but 0.909 via query_batch()
  • Aligned search() to use the same 1/(1+dist) formula as batch_search()

search() used raw FAISS distance as score while batch_search() used
1/(1+dist) normalization. Same distance value produced different scores
depending on which method was called (e.g., 0.1 vs 0.909 for dist=0.1).
Align search() to use the same normalization formula as batch_search().
@0xbyt4 0xbyt4 requested review from a team as code owners February 28, 2026 14:21
@github-actions github-actions bot added robotics Robotics code changes python Python code tests Test files labels Feb 28, 2026
@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Python code robotics Robotics code changes tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant