Summary
Non-blocking polish items from the local review of the optional derived vector index (PR #85, issue #49). All are small; none affect correctness of the shipped contract.
Items
- Chunk
search_by_ids SQLite binds — id IN (…) binds up to oversample + FTS hits parameters. Fine at the default oversample (1000) on modern SQLite (limit 32766), but oversample is user-configurable and older SQLite builds cap at 999 — chunk the id list or clamp oversample.
- Single FTS pass on the accelerated path —
_fetch_candidates runs db.fts_search to union text-match ids, then search_memories runs it again for BM25 scores. Pass the rows through instead of re-querying.
- Reuse
embed.unpack_embedding — vector_index._unpack_blob reimplements it; sharing keeps the blob format (endianness) defined in one place.
- Cosmetics — docstring artifact in the
/v1/vector-index/rebuild endpoint ("backing file. Returns 400"); _suppress_exception(Exception) around Chroma delete/clear is broad — consider logging swallowed errors at warn level.
Context
Summary
Non-blocking polish items from the local review of the optional derived vector index (PR #85, issue #49). All are small; none affect correctness of the shipped contract.
Items
search_by_idsSQLite binds —id IN (…)binds up tooversample + FTS hitsparameters. Fine at the default oversample (1000) on modern SQLite (limit 32766), butoversampleis user-configurable and older SQLite builds cap at 999 — chunk the id list or clampoversample._fetch_candidatesrunsdb.fts_searchto union text-match ids, thensearch_memoriesruns it again for BM25 scores. Pass the rows through instead of re-querying.embed.unpack_embedding—vector_index._unpack_blobreimplements it; sharing keeps the blob format (endianness) defined in one place./v1/vector-index/rebuildendpoint ("backing file. Returns 400");_suppress_exception(Exception)around Chroma delete/clear is broad — consider logging swallowed errors at warn level.Context