https://github.com/facebookresearch/faiss
Welcome to Faiss Documentation - Faiss documentation
pip install faiss-cpu
pip install faiss-gpu
index = faiss.IndexFlatL2(d) # build the index
print(index.is_trained)
index.add(xb) # add vectors to the index
IndexFlatL2
: Exact Search for L2IndexFlatIP
: Exact Search for Inner Product