fix(agentic_rag): honor similarity_threshold in deduplicate_chunks - #829
fix(agentic_rag): honor similarity_threshold in deduplicate_chunks#829andrewwhitecdw wants to merge 2 commits into
Conversation
The deduplicate_chunks helper accepted a similarity_threshold parameter but only performed exact-match deduplication. Use Jaccard similarity over normalized token sets so the threshold is actually honored. Signed-off-by: Andrew White <andrew.white@cdw.com> Signed-off-by: Andrew White <andrewh@cdw.com>
|
|
|
@andrewwhitecdw thanks for the fix — the threshold behavior in If it's still unsigned in a few days we'll close this to keep the review queue tidy — it can be reopened any time once you've signed. |
|
Thanks for catching this — you were right that We can't merge patches from contributors who haven't signed the CLA, so rather than leave the bug sitting here we reimplemented the fix independently in #832. Full credit to you for the report — it's a real bug and it would have kept biting the multi-pass retrieval loop in If you'd like to sign the CLA, we'd be glad to take contributions from you directly next time. Closing this in favor of #832. |
Bug:
deduplicate_chunksaccepted asimilarity_thresholdargument but only performed exact-match deduplication, so the threshold was silently ignored.Fix: Compare chunks using Jaccard similarity over normalized token sets and only keep a chunk when it is below the threshold relative to every chunk already kept.
Test: Added regression tests covering exact duplicates, near-duplicates at the default threshold, threshold sensitivity, and empty input.