← Back to PRs

#19945: memory: gracefully disable hybrid keyword search when fts5 unavailable

by nico-hoff open 2026-02-18 10:05 View on GitHub →
agents size: S
## Problem On some Node distributions, the builtin `node:sqlite` module ships without FTS5. In that case `CREATE VIRTUAL TABLE ... USING fts5` fails with `no such module: fts5`, but memory search is still configured for hybrid mode. This leads to noisy warnings and confusing behavior ("hybrid" configured but keyword search cannot run). ## Changes - Degrade hybrid search to **vector-only** when FTS is unavailable (no keyword results, no hybrid merge). - Only warn about FTS unavailability when hybrid mode is enabled (reduces log spam). ## Notes This PR does **not** attempt to add FTS5 support to `node:sqlite`; it makes behavior correct and robust when FTS5 is missing. <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR adds Ollama as a new embedding provider for memory search and improves hybrid search behavior when FTS5 is unavailable by gracefully degrading to vector-only mode. - Adds `"ollama"` to provider/fallback union types across config schemas, Zod validation, help text, and resolved types - New `embeddings-ollama.ts` implements the Ollama embedding provider using the `/api/embeddings` REST API with lazy initialization - Hybrid search in `manager.ts` now checks `this.fts.enabled && this.fts.available` before attempting keyword search, correctly falling back to vector-only results - FTS unavailability warnings in `manager-sync-ops.ts` are now suppressed when hybrid mode is disabled (reduces log noise) - **Issue**: Adding `"ollama"` to `REMOTE_EMBEDDING_PROVIDER_IDS` causes `auto` mode to always select Ollama when other providers lack API keys, since Ollama's lazy creation doesn't fail eagerly — this prevents the intended FTS-only fallback and likely breaks the existing `"returns null provider with reason when auto mode finds no providers"` test <h3>Confidence Score: 2/5</h3> - This PR likely breaks the `auto` provider selection mode — Ollama will be silently picked even when not running, preventing FTS-only fallback. - The hybrid search degradation logic is correct, and the type/schema changes are straightforward. However, adding Ollama to `REMOTE_EMBEDDING_PROVIDER_IDS` introduces a behavioral regression: auto mode will always select the Ollama provider (since it creates lazily without validation), even on machines where Ollama isn't installed. This breaks the intended FTS-only degradation path and likely fails an existing test. - `src/memory/embeddings.ts` needs attention — the `REMOTE_EMBEDDING_PROVIDER_IDS` change and auto-selection logic need to be addressed before merging. <sub>Last reviewed commit: eb0a748</sub> <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs