#19945: memory: gracefully disable hybrid keyword search when fts5 unavailable
agents
size: S
Cluster:
Memory Management Enhancements
## 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
#19920: fix(memory): populate FTS index in FTS-only mode so search returns ...
by forketyfork · 2026-02-18
81.4%
#8706: fix(memory): fall back to better-sqlite3 when node:sqlite lacks FTS5
by ElmerProject · 2026-02-04
76.7%
#19865: memory: add Ollama embedding provider
by nico-hoff · 2026-02-18
76.6%
#15339: fix: BM25 score normalization and FTS5 query join operator
by echoVic · 2026-02-13
74.7%
#11179: fix(memory): replace confusing "No API key" errors in memory tools ...
by liuxiaopai-ai · 2026-02-07
74.0%
#7278: feat(ollama): optimize local LLM support with auto-discovery and ti...
by alltomatos · 2026-02-02
72.9%
#22732: feat(plugin): add embedding-fts extension
by cintia09 · 2026-02-21
72.7%
#9149: Fix: Allow QMD backend to work without OpenAI auth
by vishaltandale00 · 2026-02-04
72.7%
#19591: fix(memory): probe FTS5 availability instead of relying on IF NOT E...
by ylecoyote · 2026-02-18
72.6%
#17030: feat(memory-lancedb): support Ollama and OpenAI-compatible embeddin...
by nightfullstar · 2026-02-15
72.4%