Skip to content

Bug: memory_search hybrid mode not returning FTS matches #48300

@sabo961

Description

@sabo961

Summary

When using memory_search with hybrid mode enabled, FTS (full-text search) matches are not being returned in results, even when they exist in the SQLite FTS index.

Steps to Reproduce

  1. Have a memory file containing specific keyword (e.g., memory/persona.md containing "Clyde")
  2. Run openclaw memory index --force to ensure index is fresh
  3. Call memory_search with the keyword query

Expected Behavior

memory_search("Clyde") should return the chunk from persona.md that contains "Clyde"

Actual Behavior

memory_search("Clyde") returns empty results []

Proof that FTS index is correct

Direct SQLite query works:

SELECT * FROM chunks_fts WHERE chunks_fts MATCH 'Clyde' LIMIT 5;

This returns the correct chunk from persona.md.

Configuration

"memorySearch": {
  "provider": "ollama",
  "model": "bge-m3",
  "query": {
    "minScore": 0.3,
    "hybrid": {
      "enabled": true,
      "textWeight": 0.6,
      "vectorWeight": 0.4,
      "candidateMultiplier": 6
    }
  }
}

Environment

  • OpenClaw version: 2026.3.12
  • OS: macOS (Darwin arm64)
  • Memory provider: ollama (bge-m3)
  • SQLite vec extension: sqlite-vec-darwin-arm64

Analysis

The FTS index (chunks_fts) contains the data and responds correctly to MATCH queries. The vector embeddings also exist. The bug appears to be in the hybrid merge layer that combines FTS and vector results before returning to the caller.

Semantic queries work (e.g., memory_search("persona voice") returns persona.md), but exact keyword queries fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, 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.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions