Found this while testing a Go2 recording. Vector search returned matches, but SemanticSearch.search() still raised LookupError: No matching observation.
search() sorts by similarity, but peaks() expects time order. Descending scores have no interior peaks, so it returns nothing. Separately, .last() chooses the latest peak instead of the strongest one.
I reproduced it on main at 1875e3e5a with a small SQLite test. Sorting by timestamp before finding peaks, then choosing the strongest peak, makes the regression tests pass.
I have the fix and regression tests locally. Happy to open a PR.
Found this while testing a Go2 recording. Vector search returned matches, but
SemanticSearch.search()still raisedLookupError: No matching observation.search()sorts by similarity, butpeaks()expects time order. Descending scores have no interior peaks, so it returns nothing. Separately,.last()chooses the latest peak instead of the strongest one.I reproduced it on
mainat1875e3e5awith a small SQLite test. Sorting by timestamp before finding peaks, then choosing the strongest peak, makes the regression tests pass.I have the fix and regression tests locally. Happy to open a PR.