Skip to content

fix: prioritize exact numeric knowledge retrieval - #3621

Open
EDDIWARD wants to merge 3 commits into
developfrom
edward/bugfix-hybrid-retrieval-numeric
Open

fix: prioritize exact numeric knowledge retrieval#3621
EDDIWARD wants to merge 3 commits into
developfrom
edward/bugfix-hybrid-retrieval-numeric

Conversation

@EDDIWARD

@EDDIWARD EDDIWARD commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Prioritize exact numeric identifiers in knowledge-base retrieval. Numeric queries now include an exact phrase score and use a higher accurate-search weight only when the caller has not set one.

Root cause

The semantic score can make nearby numeric identifiers look similar. In the original implementation, a full-width identifier such as 10.128.0.42 was not kept as one numeric token; the record with 10.128.0.52 could therefore rank first.

Before

Querying 10.128.0.42 ranked the near-but-wrong record containing 10.128.0.52 first.
codex-clipboard-d650833a-ca73-461b-80f1-8b8a0a90c72a

After

The same query ranks the exact 10.128.0.42 at 100.0% relevance.
wrong record containing 10.128.0.52 at 0.9% relevance
image
image

Validation

  • Focused backend and SDK tests: 378 passed.
  • Manual local reproduction with the same full-width numeric query: the exact record is ranked first.
  • No migrations, configuration changes, or deployment files are included.

Screenshots

The first image is the reproduction before the fix; the second image is the fixed result.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@EDDIWARD
EDDIWARD marked this pull request as ready for review August 10, 2026 03:03
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.

1 participant