scann
Scalable Nearest Neighbor search library
What it is and what it does
ScaNN is a research-grade library for fast approximate nearest neighbor search on large vector datasets. It implements techniques for search space pruning and vector quantization to accelerate similarity lookups while trading off recall for speed. The library is optimized for x86 processors with AVX support and provides both Python and TensorFlow APIs, with the core Python bindings available by default and TensorFlow ops available as an optional extra.
The package depends on numpy for array handling and protobuf for serialization. It is designed for machine learning workflows where you need to find similar embeddings or vectors quickly—typical use cases include semantic search, recommendation systems, and clustering. Installation requires Linux with glibc 2.27 or later and Python 3.9–3.13; the compiled wheels are pre-built for common architectures, avoiding the need to compile from source in most cases.
Use it for:
- Semantic search over document embeddings or text representations to find similar content quickly
- Recommendation systems that retrieve similar items based on learned vector representations
- Large-scale clustering or nearest-neighbor analysis on high-dimensional datasets
- Real-time similarity lookup in machine learning inference pipelines
- Embedding-based retrieval for information retrieval or question-answering systems
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
ScaNN performs efficient vector similarity search at scale using search space pruning and quantization, supporting multiple distance functions including inner product and Euclidean distance.
Yes, if you need fast approximate nearest neighbor search on Linux with Python 3.9–3.13 and have x86 or ARM hardware with the required instruction sets. The library is actively maintained, has no known vulnerabilities, and is well-suited for production recommendation and search workloads. Install friction is moderate due to compiled dependencies, but pre-built wheels mitigate build complexity. Not suitable for Windows or macOS without additional setup.
Install
scann on PyPI
pip
pip install scannuv
uv add scannpoetry
poetry add scannInstalling scann
Before you install
Medium friction due to compiled wheels requiring specific CPU instruction sets (AVX and FMA for x86, NEON for ARM) and glibc version 2.27 or later. Actively maintained with recent releases; supports Python 3.9–3.13 on Linux.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; attribution required.
Quickstart
pip install scann
import scann
# Build index from numpy array of vectors
builder = scann.scann_ops_pybind.builder(data, num_leaves=100, leaves_to_search=10)
index = builder.build()
# Search for nearest neighbors
neighbors, distances = index.search(query_vector, k=10)
Requires x86 processors with AVX and FMA support (or ARM with NEON); libstdc++ version 3.4.23 or above must be installed on the system.
Verify before relying
- Exact performance metrics on ann-benchmarks.com for glove-100-angular dataset mentioned in description
- Whether TensorFlow integration (scann[tf]) is necessary for typical use cases or only for SavedModel embedding
- Memory overhead and scaling characteristics for datasets larger than those in published benchmarks
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<3.14,>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — numpy, protobuf |
| Maintenance | actively maintained — 350 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 679,845/month — #5,367 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: scann-1.4.2-cp310-cp310-manylinux_2_27_aarch64.whl; scann-1.4.2-cp310-cp310-manylinux_2_27_x86_64.whl; scann-1.4.2-cp311-cp311-manylinux_2_27_aarch64.whl; scann-1.4.2-cp311-cp311-manylinux_2_27_x86_64.whl; scann-1.4.2-cp312-cp312-manylinux_2_27_aarch64.whl; scann-1.4.2-cp312-cp312-manylinux_2_27_x86_64.whl; scann-1.4.2-cp313-cp313-manylinux_2_27_aarch64.whl; scann-1.4.2-cp313-cp313-manylinux_2_27_x86_64.whl; scann-1.4.2-cp39-cp39-manylinux_2_27_aarch64.whl; scann-1.4.2-cp39-cp39-manylinux_2_27_x86_64.whl
Keywords: machine, learning
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
nmslibnmslib provides efficient similarity search in…
unclear · top 15,000 on PyPI
annoyAnnoy searches for approximate nearest…
permissive · top 5,000 on PyPI
libcuvs-cu12GPU-accelerated vector search and clustering…
permissive · top 15,000 on PyPI
cuvs-cu12Provides GPU-accelerated approximate nearest…
permissive · top 15,000 on PyPI
pynndescentPyNNDescent builds approximate nearest neighbor…
permissive · top 5,000 on PyPI
voyagerVoyager performs fast approximate…
permissive · top 15,000 on PyPI
simsimdSimSIMD provides SIMD-optimized kernels for…
permissive · top 5,000 on PyPI
edtComputes Euclidean distance transforms for 1D,…
copyleft · top 15,000 on PyPI
pyspark-hnswProvides a PySpark-compatible implementation of…
unclear · top 15,000 on PyPI
usearchUSearch provides approximate nearest-neighbor…
permissive · top 15,000 on PyPI