fix(memory): use per-keyword FTS search in hybrid mode #39484#39555
fix(memory): use per-keyword FTS search in hybrid mode #39484#39555yangzi33 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47aad9c6ad
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Greptile SummaryThis PR fixes a bug in hybrid memory search mode where multi-word queries (e.g. Key changes:
Implementation quality: The refactoring maintains consistency with the FTS-only search path: individual Confidence Score: 5/5
Last reviewed commit: 47aad9c |
9186827 to
47aad9c
Compare
💡 Codex Reviewhttps://github.com/openclaw/openclaw/blob/9186827477d361f6ccda5042c864b450d6a1290b/.secrets.baseline#L121-L124 This baseline dropped the ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Keep this PR open. Current main still does not implement the intended provider-backed hybrid memory-search behavior: it only fans out per keyword in the no-provider FTS-only branch, while provider-backed hybrid search still performs one full-query FTS lookup. The live PR remains open, now has a bounded fan-out repair at head 8ad671b, and maintainer context keeps it as the canonical contributor path after #57711 was closed unmerged. Best possible solution: Keep this PR open for maintainer review and landing. The best path is to rebase or port the bounded searchKeywordsMulti implementation into extensions/memory-core/src/memory/manager.ts, keep provider-backed split multi-word regression coverage in extensions/memory-core/src/memory/index.test.ts, preserve the changelog credit, and run the changed gate before merge. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against a820a307dfeb. |
|
ProjectClownfish pushed a narrow repair to this branch so the original contributor path can stay canonical. Source PR: #39555 |
79fceef to
8ad671b
Compare
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.