-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
memory-core: CJK LIKE fallback returns wrong results for multi-character queries #92728
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
The LIKE fallback in
searchKeywordreturns results from unrelated files when querying with multi-character CJK strings (e.g. "飞书插件配置"). The LIKE query uses the full token as a single substring pattern, which matches files that discuss the search issue itself rather than files with relevant content.Environment
trigramRoot Cause
In
planKeywordSearch, CJK tokens are routed tosubstringTermsas-is:This generates:
WHERE text LIKE '%飞书插件配置%'Problem: The exact substring "飞书插件配置" rarely appears in actual content. The relevant text is "飞书配置", "飞书插件", "插件配置" etc. spread across different positions. The LIKE query only matches files that literally contain the exact phrase — typically files that discuss the CJK search issue itself (e.g.
memory/2026-06-12-cjk-pr-draft.md).Reproduction
agents.defaults.memorySearch.store.fts.tokenizer: "trigram"memory_searchwith query "飞书插件配置"memory/2026-06-12-cjk-*.md(issue discussion files), not from files with actual 飞书配置 contentExpected Behavior
The LIKE fallback should find results from files that contain the query terms, not just files that contain the exact phrase. Possible approaches:
LIKE '%飞%' AND LIKE '%书%' AND LIKE '%插%' AND ...*) — tested but too broadLIKE '%飞书%' AND LIKE '%书插%' AND LIKE '%插件%' AND ...) — likely best balanceImpact
Related