Skip to content

Conversation

@cbcoutinho
Copy link

@cbcoutinho cbcoutinho commented Dec 13, 2025

Summary

  • Fixed score_threshold not being applied after RRF and DBSF fusion operations in local/memory mode
  • Added local-only tests to verify fusion score_threshold filtering works correctly
  • Added congruence tests for RRF and DBSF with score_threshold

Test plan

  • test_fusion_rrf_score_threshold - verifies RRF fusion respects score_threshold
  • test_fusion_dbsf_score_threshold - verifies DBSF fusion respects score_threshold
  • Tests fail without the fix, pass with the fix
  • Run congruence tests against remote Qdrant server

Fixes:


This PR was generated with the help of AI, and reviewed by a Human

The local/memory client was not applying score_threshold filtering after
RRF and DBSF fusion operations. This caused query_points with prefetch
and fusion queries to return results below the specified score_threshold.

This fix adds score_threshold filtering after fusion results are computed,
matching the behavior of the remote Qdrant server.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@netlify
Copy link

netlify bot commented Dec 13, 2025

Deploy Preview for poetic-froyo-8baba7 ready!

Name Link
🔨 Latest commit 69eadfb
🔍 Latest deploy log https://app.netlify.com/projects/poetic-froyo-8baba7/deploys/694118545e492800088dada0
😎 Deploy Preview https://deploy-preview-1137--poetic-froyo-8baba7.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link

coderabbitai bot commented Dec 13, 2025

📝 Walkthrough

Walkthrough

Adds post-fusion score threshold filtering in qdrant_client/local/local_collection.py: after fusion (RRF/DBSF) produces fused scored points, if score_threshold is provided the code filters out points with score < score_threshold before retrieving payloads/vectors and applying offset/limit. No public signatures changed. Tests were added/updated to cover RRF and DBSF fusion behavior with thresholds.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Changes are localized: one functional edit in local_collection.py plus new tests.
  • Review focus: correctness of the threshold comparison, interaction with subsequent payload/vector fetch and offset/limit handling, and that tests exercise both fusion methods.
  • Files to pay attention to:
    • qdrant_client/local/local_collection.py
    • tests/test_in_memory.py
    • tests/congruence_tests/test_query.py

Possibly related issues

Possibly related PRs

  • new: queryless score 1 #1088 — Modifies scoring behavior in the same local_collection scoring/fusion area; conceptually related to how fused scores are produced and subsequently filtered.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: applying score_threshold filtering after fusion queries in local mode.
Description check ✅ Passed The description is directly related to the changeset, detailing the fix for score_threshold filtering in fusion operations, the tests added, and the issue addressed.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a62ec30 and 69eadfb.

📒 Files selected for processing (1)
  • tests/congruence_tests/test_query.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/congruence_tests/test_query.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Redirect rules - poetic-froyo-8baba7
  • GitHub Check: Header rules - poetic-froyo-8baba7
  • GitHub Check: Pages changed - poetic-froyo-8baba7

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@generall generall requested a review from joein December 13, 2025 22:32
@joein
Copy link
Member

joein commented Dec 16, 2025

Hey @cbcoutinho

Thanks for pointing this out and contributing a fix!
I've adjusted PR a bit to simplify some of the tests.

P.S. Base branch for new pull requests should be dev, not master. I think it'll be easier to recreate the PR from the proper branch. Would you like to do that or should I?

@joein joein changed the base branch from master to dev December 16, 2025 08:31
@joein joein changed the base branch from dev to master December 16, 2025 08:32
@cbcoutinho
Copy link
Author

cbcoutinho commented Dec 16, 2025

Hi @joein, thanks for the review - closing in favor of #1138 which targets the dev branch instead of main

@cbcoutinho cbcoutinho closed this Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants