Repository navigation
feat(core,cli,server,mcp): recall similarity field, strict on similarity (#1650) - #1659
Merged
Merged
Conversation
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
| let mut all_results: Vec<SearchResult> = results | ||
| .into_iter() | ||
| .map(|(_, (memory, score))| SearchResult { memory, score }) | ||
| .map(|(_, (memory, score))| SearchResult::new(memory, score)) |
…ity (#1650) Every memory result carries `similarity`, the unboosted cosine of the vector leg (null for a hit only full-text search found). `strict` and `[recall] min_score_strict` compare against it and drop null-similarity hits, so `recall --strict` works under the default fusion strategy. `score`, `--min` and the ranking are unchanged for every strategy. The filter runs before the limit through a shared window-widening fetch used by run_recall (HTTP, MCP) and the CLI local path. Pack and unified results carry `similarity` too. Benchmark note on the 0.5 floor with EmbeddingGemma: benchmarks/internal/STRICT_FLOOR.md.
The widened passes of the strict filter fetched discarded candidates and counted them as recalled. They now run with the touch held, and the rows finally returned are touched once.
ajianaz
force-pushed
the
feat/recall-similarity-1650
branch
from
November 4, 2026 03:12
695b76f to
088d20b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
--json,POST /recall, MCPuteke_recallincl. explain/pack/unified) carriessimilarity: the unboosted cosine of the vector leg,nullfor a hit only full-text search found (and for documents). MCP text lines show it assim.strict/[recall] min_score_strictcompare againstsimilarity, and hits withnullsimilarity are dropped.score,--min/min_scoreand the ranking are unchanged for every strategy. With--strict --min,--minstill filtersscoreand the strict floor filterssimilarity.ResultFilter::fetch) used byrun_recall(HTTP + MCP) and the CLI local path, so up to N rows come back when N qualify.benchmarks/internal/STRICT_FLOOR.mdplus the reproducible script.Why
Under the default fusion strategy the score is at most about 0.25, so
recall --strict(floor 0.5 onscore) returned nothing. Closes #1650. Wire names agreed in uteke-cloud#459 (Amendment 3).The floor: off-topic queries top out at cosine 0.37; relevant hits keep 38% (sentences) / 27% (paragraphs) at 0.5 while 95-98% of irrelevant hits are dropped. It is a precision floor; 0.4 is the recall-leaning alternative. Details and caveats in the note.
Testing
--minstill on score;similaritynull/number in JSON; unified and pack under strict; filter window logic.POST /recall: similarity present, null for FTS-only, strict, pack) and an MCP test (sim, strict, FTS-only).cargo fmt --check,cargo clippy --workspace --all-targets -D warnings,cargo test --workspaceall pass locally;cargo run -p docgenoutput committed.