Repository navigation
fix(#900): honour recall strategy flag in unified search path - #909
Merged
Merged
Conversation
recall_unified_memories() called self.recall() (vector-only) instead of self.recall_hybrid(), silently ignoring the user-selected strategy. This meant --strategy fts5/hybrid had zero effect when using the unified search path (the default for CLI/HTTP/MCP). Root cause: recall_unified() did not accept a strategy parameter, so it could not propagate it to the memory recall sub-path. Fix: - Add strategy: RecallStrategy param to recall_unified(), recall_unified_memories(), and recall_unified_all() - recall_unified_memories() now calls recall_hybrid() (which dispatches to vector/fts5/hbrid based on strategy) instead of recall() (vector-only) - CLI recall.rs: pass resolved strategy to recall_unified() - Server types.rs: add optional strategy field to RecallRequest - Server handlers.rs: parse strategy string and propagate to recall_unified() - MCP lib.rs: pass RecallStrategy::Vector as default (no MCP UI for strategy) - Update all 6 test call sites with explicit strategy argument - Add regression test: recall_unified_honours_fts5_strategy
🔍 Cora AI Code ReviewReview powered by cora-code · BYOK · MIT |
Cora review caught that entity_filter and category_filter were silently discarded (let _ = ...) instead of applied. Server handler passes them to recall_unified but had no post-filter logic, causing unfiltered results. Now post-filters entity/category metadata inside recall_unified_memories() itself, so ALL callers (CLI, HTTP, MCP) get correct filtering.
| // entity_filter and category_filter are not natively supported by | ||
| // recall_hybrid, so we apply them as post-filters here (#900 cora review). | ||
| let results = | ||
| self.recall_hybrid(query, limit, tags_filter, namespace, strategy, min_score)?; |
CodeCora caught that post-filtering after fetching exactly 'limit' rows can return fewer results than requested. Now over-fetches 3x (min limit+10) when entity_filter or category_filter is active, then truncates to limit after filtering.
ajianaz
added a commit
that referenced
this pull request
Aug 13, 2026
* fix(#900): honour recall strategy flag in unified search path recall_unified_memories() called self.recall() (vector-only) instead of self.recall_hybrid(), silently ignoring the user-selected strategy. This meant --strategy fts5/hybrid had zero effect when using the unified search path (the default for CLI/HTTP/MCP). Root cause: recall_unified() did not accept a strategy parameter, so it could not propagate it to the memory recall sub-path. Fix: - Add strategy: RecallStrategy param to recall_unified(), recall_unified_memories(), and recall_unified_all() - recall_unified_memories() now calls recall_hybrid() (which dispatches to vector/fts5/hbrid based on strategy) instead of recall() (vector-only) - CLI recall.rs: pass resolved strategy to recall_unified() - Server types.rs: add optional strategy field to RecallRequest - Server handlers.rs: parse strategy string and propagate to recall_unified() - MCP lib.rs: pass RecallStrategy::Vector as default (no MCP UI for strategy) - Update all 6 test call sites with explicit strategy argument - Add regression test: recall_unified_honours_fts5_strategy * style: cargo fmt * docs: regenerate api-reference for recall_unified signature change * fix(#900): post-filter entity/category in recall_unified_memories Cora review caught that entity_filter and category_filter were silently discarded (let _ = ...) instead of applied. Server handler passes them to recall_unified but had no post-filter logic, causing unfiltered results. Now post-filters entity/category metadata inside recall_unified_memories() itself, so ALL callers (CLI, HTTP, MCP) get correct filtering. * fix(#900): over-fetch to fill limit after entity/category post-filter CodeCora caught that post-filtering after fetching exactly 'limit' rows can return fewer results than requested. Now over-fetches 3x (min limit+10) when entity_filter or category_filter is active, then truncates to limit after filtering. --------- Co-authored-by: ajianaz <[email protected]>
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
Fixes the strategy flag (
--strategy fts5/hybrid/graph) being silently ignored when using the unified search path — the default code path for CLIrecall, HTTP/api/recall, and MCPuteke_recall.Root cause
recall_unified_memories()calledself.recall()(vector-only) instead ofself.recall_hybrid(). Sincerecall_unified()did not accept astrategyparameter, it had no way to propagate the user's choice to the memory sub-path.This meant
uteke recall "query" --strategy fts5silently fell back to pure vector search — the FTS5 index (5,912 entries, verified working via direct SQL) was never queried.Changes (5 files, +107/-7)
uteke-core/src/lib.rsstrategy: RecallStrategyparam torecall_unified(),recall_unified_memories(),recall_unified_all(). Memory sub-path now callsrecall_hybrid()(dispatches by strategy) instead ofrecall()(vector-only). +6 test call sites updated +1 new regression test.uteke-cli/src/commands/recall.rsrecall_unified().uteke-server/src/types.rsstrategy: Option<String>toRecallRequeststruct.uteke-server/src/handlers.rsRecallStrategy, propagate torecall_unified().uteke-mcp/src/lib.rsRecallStrategy::Vectoras default (no MCP UI for strategy yet).Regression test
Why
--strategy fts5appeared to work (no error) but returned vector results. Silent functional regression.Testing
cargo check --workspace— zero errorscargo clippy --workspace --all-targets -- -D warnings— zero warningscargo test --workspace— 454 passed, 0 failed, 26 ignored (ONNX-dependent)recall_unified_honours_fts5_strategy— verifies FTS5 path is taken when strategy=fts5Closes #900.