Skip to main content
ScaNN (Scalable Nearest Neighbors) is a method for efficient vector similarity search at scale. ScaNN includes search space pruning and quantization for Maximum Inner Product Search and also supports other distance functions such as Euclidean distance. The implementation is optimized for x86 processors with AVX2 support. See its Google Research github for more details. You’ll need to install langchain-community with pip install -qU langchain-community to use this integration

Installation

Install ScaNN through pip. Alternatively, you can follow instructions on the ScaNN Website to install from source.

Retrieval Demo

Below we show how to use ScaNN in conjunction with Huggingface Embeddings.

RetrievalQA Demo

Next, we demonstrate using ScaNN in conjunction with Google PaLM API. You can obtain an API key from developers.generativeai.google/tutorials/setup

Save and loading local retrieval index