What's Changed
Bug Fixes
-
[#551] Fix external embedding API silent fallback (PR #554): When an external embedding provider (vLLM, Ollama, TEI, OpenAI-compatible) returned an error during startup or embedding generation,
sqlite_vec.pysilently fell back to the local ONNX model. This mixed two incompatible vector spaces in the same database, causing all subsequent semantic searches to return incorrect or irrelevant results — with no warning to the user that anything was wrong.The fix:
- Replaced the silent
logger.warning + fallbackpath with a hardraise RuntimeError(...)that clearly reports the API failure reason - Added
_get_existing_db_embedding_dimension()helper that reads theFLOAT[N]column definition fromsqlite_masterto detect the dimension already stored in the database - Used
asyncio.to_thread()for the synchronous DB read inside the async method - DRY error message includes the detected existing DB dimension when available, making mismatch diagnosis straightforward
- Corrected a stale integration test that asserted a
versionfield on/api/health(removed in the GHSA-73hc-m4hx-79pj security hardening in v10.21.0)
- Replaced the silent
Tests
- 10 new regression tests in
tests/storage/test_issue_551_external_embedding_fallback.pycovering: hard failure on API error, dimension mismatch detection, DRY error message format,asyncio.to_threadintegration, and interaction with the existing DB dimension helper - 1,397 total tests
Upgrade Notes
This is a PATCH release. No breaking changes. No migration required.
If you were relying on the silent fallback to local ONNX when your external embedding API was unavailable, you will now receive a RuntimeError at startup instead. This is intentional — the previous behaviour silently corrupted your vector database.
Full Changelog: https://github.com/doobidoo/mcp-memory-service/blob/main/CHANGELOG.md#10240---2026-03-05