fix(memory): use per-keyword FTS search in hybrid mode #39484#120
Open
BingqingLyu wants to merge 5 commits into
Open
fix(memory): use per-keyword FTS search in hybrid mode #39484#120BingqingLyu wants to merge 5 commits into
BingqingLyu wants to merge 5 commits into
Conversation
…ord zero-hit queries openclaw#39484)
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.
Summary
memory_searchreturns 0 hits for multi-word queries (e.g.Rocky Point bagging,retail garden products) in hybrid mode, even when the terms appear 17+ times across indexed files.buildFtsQuery,searchKeyword, the FTS-only code path, vector search, scoring weights, and all other memory subsystems are untouched.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Multi-word
memory_searchqueries in hybrid mode now return results when the query terms span separate chunks. Previously these returned 0 hits. Single-word queries and FTS-only mode behavior are unchanged.Security Impact (required)
Repro + Verification
Environment
memorySearch.query.hybrid.enabled: true(default)Steps
memory_searchwith queryRocky Point bagging.Expected
Actual
Evidence
src/memory/manager.hybrid-keyword-multi.test.ts— 2 tests fail against the revertedmanager.ts(0 results asserted > 0), both pass with the fix applied.Human Verification (required)
Rocky Point bagging); two-word queries (bagging operations,retail garden products); single-word queries unaffected; FTS-only mode unaffected.manager.tsconfirms tests correctly catch the regression; restored fix confirms green.Compatibility / Migration
Failure Recovery (if this breaks)
src/memory/manager.tsto parent commit (3eec79bd6).src/memory/manager.tsonly.Risks and Mitigations
extractKeywordsalready strips stop words and short tokens, keeping N small for typical queries (2–5 terms). Thecandidatesmultiplier already caps each individual lookup at 200 rows. No change for single-word queries.