@lhoestq I decreased the m from 512 to 128 and I am now using inner product metric (faiss.METRIC_INNER_PRODUCT). The time to index almost doubled (from 50 hours to 100 hours), is it expected?
import faiss

store_n = 128 # neighbors to stode per node - Quentin said it was enough based on RAG
ef_search = 128 # search depth
ef_construction = 200 # construction time search depth
vector_sz = 768 # vector dimension

hnsw_index = faiss.IndexHNSWFlat(vector_sz, store_n, faiss.METRIC_INNER_PRODUCT)
hnsw_index.hnsw.efSearch = ef_search
hnsw_index.hnsw.efConstruction = ef_construction

docs = dpr_doc_sys.get_documents()['train']
docs.add_faiss_index(column='embeddings', custom_index=hnsw_index)