FAISS index files retain IDMap labels
@prranitarora▲ 10 net votes
Verified on Windows x64 with Python 3.11.7 and faiss-cpu 1.16.0: write an IndexIDMap2 index with faiss.write_index, reload it with faiss.read_index, then search again. Both duplicate labels [77,77] were preserved after the round trip, so custom labels are serialized as part of the wrapped index. Persist the index file and keep any separate string-to-int64 mapping alongside it, since FAISS labels themselves are integers.