Commit 8a1f322
committed
fix(consolidation): interleave fusion for dedup recall so the twin is always shown
The residual near-duplicate observations were recall misses, not LLM errors:
the existing near-identical observation (the merge 'twin') is semantic rank #1
for the new fact, but shares no source-fact graph link and little lexical
overlap, so RRF averaged it below the per-fact recall budget (512 tokens, ~8
observations) and the LLM never saw it -> created a duplicate. The cross-encoder
demoted it the same way (semantic #1 -> reranked #37).
Add round-robin interleave fusion: take each retrieval arm's #1, then each #2,
... (semantic, bm25, graph, temporal), de-duplicating, until the budget fills.
This guarantees every arm's top hit a slot, so the semantic-#1 twin is always
shown and the LLM UPDATEs instead of creating a duplicate.
Replace the recall 'rerank: bool' / ad-hoc passthrough with a single named
'reranking' strategy: 'cross_encoder' (default), 'rrf', 'interleave'.
Consolidation dedup recall uses 'interleave'. For interleave the fusion order is
authoritative — combined scoring's recency/temporal re-sort is skipped (that
re-sort is what buried the twin).
Measured on an English translation of the hermes transcript (removes the
cross-lingual embedding confound): near-dup observations 4% (@0.97) -> 0% at both
1/10 and 1/4 cuts, coverage 89% -> 94%, no false merges (heavy observations are
coherent single themes; distinct facets stay separate).1 parent 11d2d5c commit 8a1f322
4 files changed
Lines changed: 170 additions & 28 deletions
File tree
- hindsight-api-slim
- hindsight_api/engine
- consolidation
- search
- tests
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1501 | 1501 | | |
1502 | 1502 | | |
1503 | 1503 | | |
1504 | | - | |
1505 | | - | |
1506 | | - | |
1507 | | - | |
1508 | | - | |
1509 | | - | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
1510 | 1511 | | |
1511 | 1512 | | |
1512 | 1513 | | |
| |||
Lines changed: 42 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
258 | 267 | | |
259 | 268 | | |
260 | 269 | | |
| |||
3186 | 3195 | | |
3187 | 3196 | | |
3188 | 3197 | | |
3189 | | - | |
| 3198 | + | |
3190 | 3199 | | |
3191 | 3200 | | |
3192 | 3201 | | |
| |||
3343 | 3352 | | |
3344 | 3353 | | |
3345 | 3354 | | |
3346 | | - | |
| 3355 | + | |
3347 | 3356 | | |
3348 | 3357 | | |
3349 | 3358 | | |
| |||
3475 | 3484 | | |
3476 | 3485 | | |
3477 | 3486 | | |
3478 | | - | |
| 3487 | + | |
3479 | 3488 | | |
3480 | 3489 | | |
3481 | 3490 | | |
| |||
3792 | 3801 | | |
3793 | 3802 | | |
3794 | 3803 | | |
3795 | | - | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
| 3808 | + | |
3796 | 3809 | | |
3797 | | - | |
| 3810 | + | |
3798 | 3811 | | |
3799 | 3812 | | |
3800 | 3813 | | |
| |||
3805 | 3818 | | |
3806 | 3819 | | |
3807 | 3820 | | |
| 3821 | + | |
3808 | 3822 | | |
3809 | | - | |
3810 | | - | |
3811 | | - | |
3812 | | - | |
3813 | | - | |
| 3823 | + | |
| 3824 | + | |
| 3825 | + | |
3814 | 3826 | | |
3815 | 3827 | | |
3816 | 3828 | | |
3817 | | - | |
| 3829 | + | |
| 3830 | + | |
3818 | 3831 | | |
3819 | 3832 | | |
3820 | 3833 | | |
| |||
3849 | 3862 | | |
3850 | 3863 | | |
3851 | 3864 | | |
3852 | | - | |
| 3865 | + | |
3853 | 3866 | | |
3854 | 3867 | | |
3855 | 3868 | | |
3856 | 3869 | | |
3857 | | - | |
3858 | | - | |
3859 | | - | |
3860 | | - | |
3861 | | - | |
3862 | | - | |
3863 | | - | |
| 3870 | + | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
3864 | 3876 | | |
3865 | 3877 | | |
3866 | 3878 | | |
| |||
3888 | 3900 | | |
3889 | 3901 | | |
3890 | 3902 | | |
3891 | | - | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
3892 | 3912 | | |
3893 | | - | |
3894 | | - | |
| 3913 | + | |
| 3914 | + | |
3895 | 3915 | | |
3896 | 3916 | | |
3897 | 3917 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
80 | 140 | | |
81 | 141 | | |
82 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
0 commit comments