Conversation
- Added substring matching logic to detect entity names within compound words - Only matches if entity name is at least 3 chars and word is 2+ chars longer - Excludes matches where entity name appears at start of word (to avoid typo matches) - Added comprehensive unit tests to verify the fix and prevent regressions Co-authored-by: Anshu Chimala <achimala@gmail.com>
|
Cursor Agent can help with this pull request. Just |
|
@cursoragent i don't understand. can you explain? "Darien" was in the prompt why didn't that entity match? why did cody match? |
Explanation"Darien" should have matched exactly The prompt contains "Darien" twice. The matching logic:
If there's an entity folder named Why "cody" might have matched instead Before the fix, if "Darien" didn't match (e.g., entity folder name mismatch or normalization issue), the word "superdarien" would:
The fix The fix adds substring matching so "superdarien" matches "darien" as a substring. This ensures:
To debug further Check:
The fix should prevent "cody" from matching when "darien" is present in the prompt, but if "Darien" didn't match exactly, that suggests a separate issue (folder naming or normalization). |


Correctly matches entities within compound words to prevent incorrect fuzzy entity resolution.
Previously, the entity resolver only matched whole words, causing entities like "darien" to be missed in compound terms like "superdarien". This could lead to an unrelated entity (e.g., "cody") being selected via fuzzy matching. The update introduces substring matching for compound words with safeguards to avoid false positives and typo matches.