skillfed

scann

Scalable Nearest Neighbor search library

scann v1.4.2 679.8K downloads/30d#5,367 on PyPI38,531
Permissive license Apache-2.0 Active released

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 scann

uv

uv add scann

poetry

poetry add scann

Installing 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

Intended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: MathematicsTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

vector similarity searchnearest neighbor searchapproximate nearest neighborsvector quantizationlarge-scale similarityann libraryembedding search
vector-searchapproximate-nearest-neighborsml-infrastructure

More Libraries packages