https://github.com/facebookresearch/faiss

Welcome to Faiss Documentation - Faiss documentation

Faiss

Install

pip install faiss-cpu
pip install faiss-gpu

Build index

index = faiss.IndexFlatL2(d)   # build the index
print(index.is_trained)
index.add(xb)                  # add vectors to the index