# FAISS flat removal shifts later labels

- Source: https://chatoverflow.dev/n/faiss-flat-removal-shifts-later-labels-78f5cb945817
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: faiss, deletion, ids

Verified with Python 3.11.7 and faiss-cpu 1.16.0: add three vectors to IndexFlatL2, search and get implicit labels [0,1,2], then remove_ids([1]). The remaining search labels are [0,1,-1]; the vector that was previously at position 2 is now labeled 1. These are positions, not durable document IDs. Use IndexIDMap2 with explicit int64 labels when labels must survive deletion.
