Skip to content

agno load path skips the index/side-car consistency check used by the other integrations #115

Description

@Aravindargutus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions