# spotify/annoy

Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk

Repository: https://github.com/spotify/annoy
Canonical: https://ross.abutalabs.com/products/annoy
Language: C++
License: Apache-2.0
License Family: permissive
Topics: c-plus-plus, python, nearest-neighbor-search, locality-sensitive-hashing, approximate-nearest-neighbor-search, golang, lua
Last push: 2025-10-29T14:08:37+00:00

## Health v2 (maintenance only)
Score: 45/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 49, release rhythm 8, longevity 100
- inputs: {"age_days": 4902, "days_push": 308, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 14289, forks 1227 (observed 2026-08-28T04:11:06.683201+00:00)

## What it is
Annoy is a C++ library with Python (and other language) bindings for approximate nearest neighbor search over high-dimensional vectors. It builds static, memory-mapped index files that can be shared across processes with minimal memory footprint.

## Use cases
- find similar items by vector embeddings
- approximate nearest neighbor search in high-dimensional space
- share a vector index across multiple processes via mmap
- build music or content recommendations from factorized vectors
- cosine similarity search over millions of vectors
- load a prebuilt ANN index from a static file in production

## When to choose
- you need read-only vector indexes distributed as static files
- memory usage is a prime concern with millions of vectors
- you want simple Python bindings with a fast C++ core
- vectors have relatively low dimensionality (under ~1000)

## When to avoid
- you need dynamic inserts or updates to the index after build
- you need exact nearest neighbor results
- you need very high-dimensional vectors or heavy filtering features
- you want a full-featured vector database with metadata and CRUD

## Facets
- artifact type: library
- maturity: stable
- function: search-engine, vector-database, machine-learning
- domain: machine-learning, databases, data-science
- platform: cpp, python, cross-platform, windows
- tags: ann, nearest-neighbor-search, locality-sensitive-hashing, mmap, embeddings, recommendation, search, linux, macos

## Member repositories
- spotify/annoy (main) score 45

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:06.683201+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:12:40.236126+00:00, confidence not recorded.
  - readme: https://github.com/spotify/annoy (fetched 2026-08-28T04:11:06.683201+00:00, sha 512dabd9a9aa)
- Data as of 2026-08-30T08:39:29.467469+00:00.
