Source: hnswlib¶
hms-import hnswlib --index FILE --dim D --space {l2,ip,cosine} [--id-map F] [--texts F] [--metadata F] [--namespace NS]
Reads an hnswlib index saved with Index.save_index. Verified against real hnswlib 0.8; no mocks.
- Ids: the integer labels, sorted ascending (stable order);
str(label)unless an id map is given. The sorted label list is held in memory (N Python ints); vectors are fetched 1024 at a time withget_items. - Sidecars (
--id-map,--texts,--metadata,--namespace,--created-at-key,--updated-at-key): same format and semantics as faiss, aligned to the ascending-label order. A.jsonobject id map renames labels. --dimand--spacecannot be read back from the file reliably. The file header records the element size, so a wrong--dimis detected and reported with the dimension the index was built with; a wrong--spacecannot be detected and does not change the carried vectors.cosineindexes store L2-normalized vectors (hnswlib normalizes on insert); the normalized vectors are what is imported. Cosine ranking is unchanged.- Deleted labels (
mark_deleted) stay inget_ids_listbut their vectors are unreadable. They are yielded without a vector, so the run reports them underskipped: emptywith their ids rather than dropping them unseen. - Seekable by row position.
Credentials: none.