Summary
TurboQuantVectorDb._load_from reconstructs its in-memory maps from docstore.json
without calling check_persisted_handles(...). The other three integrations
(langchain, haystack, llama_index) all run that check after loading. As a result,
if index.tvim and docstore.json get out of sync (partial copy, stale backup, manual
edit), agno surfaces an opaque KeyError deep inside search instead of the clean
ValueError at load time that _persist.py was written to provide.
Where
turbovec-python/python/turbovec/agno.py::_load_from — rebuilds _u64_to_doc,
_str_to_u64, _content_hashes, _name_to_ids, but never validates the loaded handle
set against the index.
- Compare with
langchain.py::load, haystack.py::load_from_disk,
llama_index.py::from_persist_path, which all call
check_persisted_handles(index, ..., what=...).
Impact
Low severity but a real robustness/consistency gap: a desynced agno store fails late and
unclearly (KeyError during query) instead of early and explicitly (ValueError on load),
which is the exact failure mode _persist.py exists to prevent.
Suggested fix
Add check_persisted_handles(self._index, self._u64_to_doc.keys(), what="document") at the
end of _load_from, matching the other integrations.
Environment
- turbovec 0.8.0 (Python), x86_64 Linux, built from source.
Summary
TurboQuantVectorDb._load_fromreconstructs its in-memory maps fromdocstore.jsonwithout calling
check_persisted_handles(...). The other three integrations(
langchain,haystack,llama_index) all run that check after loading. As a result,if
index.tvimanddocstore.jsonget out of sync (partial copy, stale backup, manualedit), agno surfaces an opaque
KeyErrordeep insidesearchinstead of the cleanValueErrorat load time that_persist.pywas written to provide.Where
turbovec-python/python/turbovec/agno.py::_load_from— rebuilds_u64_to_doc,_str_to_u64,_content_hashes,_name_to_ids, but never validates the loaded handleset against the index.
langchain.py::load,haystack.py::load_from_disk,llama_index.py::from_persist_path, which all callcheck_persisted_handles(index, ..., what=...).Impact
Low severity but a real robustness/consistency gap: a desynced agno store fails late and
unclearly (KeyError during query) instead of early and explicitly (ValueError on load),
which is the exact failure mode
_persist.pyexists to prevent.Suggested fix
Add
check_persisted_handles(self._index, self._u64_to_doc.keys(), what="document")at theend of
_load_from, matching the other integrations.Environment