Skip to content

fix(search): make FalkorDB tie-breaking deterministic#1644

Open
jaimehgb wants to merge 2 commits into
getzep:mainfrom
intelia-technologies:contrib/deterministic-falkor-ties
Open

fix(search): make FalkorDB tie-breaking deterministic#1644
jaimehgb wants to merge 2 commits into
getzep:mainfrom
intelia-technologies:contrib/deterministic-falkor-ties

Conversation

@jaimehgb

@jaimehgb jaimehgb commented Jul 11, 2026

Copy link
Copy Markdown

Summary

  • add UUID ascending as the secondary order for all seven score-ranked FalkorDB search primitives
  • make reciprocal rank fusion break equal scores by UUID
  • mirror query ordering in the FalkorDB SearchOperations implementation

This prevents database iteration order and input insertion order from changing capped search results when scores tie.

Tests

  • added focused query-rendering coverage for the legacy and SearchOperations paths
  • added an equal-score RRF regression test
  • pytest --confcutdir tests/utils/search tests/utils/search/deterministic_tie_breaks_test.py tests/utils/search/search_utils_test.py -q (20 passed)

@zep-cla-assistant

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. For privacy information, see our Privacy Notice. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: example@example.com

or

I have read the CLA Document and I hereby sign the CLA behalf of my company, e-mail: example@example.com

Signature is valid for 6 months.


This bot will be retriggered when the Contributor License Agreement comment has been provided. Posted by the CLA Assistant Lite bot.

@Naseem77

Copy link
Copy Markdown
Contributor

@jaimehgb Reproduced the nondeterminism: the same 6 tied-score nodes inserted in different orders came back in different orders, and with your patch both come back in identical UUID order. 15 tests pass. Only thing left is a ruff format run on the test file (that's the failing check) and the CLA.

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