You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: Bug: Python FAISS flat index retains vectors after deleting records #14695
Deleting multiple records from the default FAISS flat index can leave vectors behind after their records and key mappings have been removed. Later inserts or searches can then operate on an index that is out of sync with the records.
To Reproduce
Run the following against the Python source at the commit below:
After deleting all three records, the index should contain zero vectors and the key map should be empty.
Platform
Language: Python 3.12.2
Source: main at 96c9e860db4d7c6da40652d9b421a31b05e98692 (package version 1.46.0)
FAISS: 1.13.2
OS: Windows, x64
AI model / IDE: not applicable
Additional context
IndexFlat.remove_ids shifts the positions of surviving vectors. The collection retains the original offsets for the remaining keys, so a subsequent delete can target a stale position.
This issue is also noted as an existing limitation in #14690, which addresses a separate upsert issue. I would like to work on this deletion bug after discussing a compatible approach, including custom FAISS indexes.
changed the title [-]Bug: Python FAISS flat index retains vectors after deleting records[/-][+]Python: Bug: Python FAISS flat index retains vectors after deleting records[/+]on Oct 31, 2026
Activity
[-]Bug: Python FAISS flat index retains vectors after deleting records[/-][+]Python: Bug: Python FAISS flat index retains vectors after deleting records[/+]