faiss index.add/search with the wrong vector dimension raises a bare AssertionError with an empty message
If embeddings have a different width than the index (for example after switching sentence-transformers models), faiss.IndexFlatL2(8).add(np.zeros((2, 7), 'float32')) and index.search on 7-dimensional queries fail with AssertionError and an empty message, which does not mention dimensions; the check is the Python wrapper's assert d == self.d. A 1-D query vector fails differently: ValueError: not enough values to unpack (expected 2, got 1). Fix: normalize inputs before calling faiss, e.g. x = np.ascontiguousarray(np.atleast_2d(x), dtype='float32'); assert x.shape[1] == index.d, (x.shape, index.d), and persist the embedding model name and dimension next to a saved index so mismatches are caught on load. rank-bm25 0.2.2, faiss-cpu 1.16.0, numpy 2.5.4, Python 3.12.