Skip to content

node:sqlite missing FTS5 module — memory search keyword fallback broken #62328

Description

@TimeAground

Problem

OpenClaw's memory search uses node:sqlite (Node.js built-in SQLite). On Node.js v23.11.0, the built-in SQLite (v3.49.1) is not compiled with ENABLE_FTS5, causing FTS5-based keyword search to fail silently:

[memory] fts unavailable: no such module: fts5

This means the keyword/BM25 fallback in hybrid memory search is completely non-functional. Only vector search works (when an embedding provider is configured).

Environment

  • OS: macOS (arm64, Darwin 25.3.0)
  • Node.js: v23.11.0 (Homebrew)
  • SQLite version: 3.49.1 (via node:sqlite)
  • SQLite compile options: Missing ENABLE_FTS5 (verified via pragma compile_options)

Steps to Reproduce

  1. Configure memorySearch.provider: "local" (or any provider)
  2. Start gateway
  3. Check logs: [memory] fts unavailable: no such module: fts5
  4. memory_search returns mode: "hybrid" but FTS results are always empty

Suggestion

A few possible approaches:

  1. Support better-sqlite3 as a fallback — it ships with a fully-compiled SQLite that includes FTS5 by default
  2. Document the requirement — note that node:sqlite on some Node.js builds may lack FTS5, and suggest users compile Node.js with --sqlite-enable-fts5 (available since Node 23.x configure options)
  3. Detect and warn more visibly — currently it logs a warning but the user may not notice; consider surfacing it in openclaw doctor

Workaround

Vector search (provider: "local" with embeddinggemma GGUF) works fine as the primary search mode. FTS5 is only needed for pure keyword matching fallback.

Metadata

Metadata

Assignees

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:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper 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: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

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions