Annoy
maintenanceby Spotify · since 2013 · also known as Approximate Nearest Neighbors Oh Yeah
Spotify's memory-mapped random-projection-tree ANN library; stable but no longer evolving.
maintenance. No release since 1.17.3 (June 2023) and only sporadic commits; Spotify's HNSW-based Voyager library is the modern successor.
Overview
Annoy is a C++ library with Python bindings that Spotify built for music recommendations. It builds forests of random projection trees into static, read-only files that are memory-mapped, so many processes can share one index with almost no load time. It supports Euclidean, Manhattan, cosine, Hamming and dot-product distances and can build on disk for data larger than RAM. The last release was 1.17.3 in June 2023 and Spotify's newer Voyager (HNSW) library is its practical successor, so Annoy is best treated as stable legacy.
Strengths & trade-offs
Strengths
- +Memory-mapped index files share across processes with instant load
- +Very simple API with two tuning knobs
- +Can build indexes larger than RAM on disk
Trade-offs
- −Indexes are immutable; any change needs a rebuild
- −Lower recall/speed than HNSW-based libraries
- −No active feature development
Great for
- +Read-only similarity indexes shipped to many workers
- +Legacy recommendation pipelines
Think twice for
- −Frequently updated data
- −New projects (prefer HNSW libraries)
Capabilities
Native or official first-party support · 2 of 25 tracked
Scale & consistency
- Comfortable data size
- Medium · ≤ 10 TB
- Horizontal scaling
- Manual
- Multi-region
- No
- Transactions
- None
- Consistency
- Strong
- Schema
- Schemaless
- Architecture
- Embedded
- Query languages
- Library API
Static index files memory-mapped per process; rebuild to add data.
Deployment
Ecosystem
Alternatives to Annoy
Header-only C++ HNSW library with Python bindings, from the authors of the HNSW algorithm.
annoy vs hnswlib →Meta's C++/Python library for fast dense-vector similarity search and clustering, CPU and GPU.
annoy vs faiss →Single-header C++ HNSW library with SIMD distance kernels and bindings for a dozen languages.
annoy vs usearch →Google Research's ANN library using anisotropic quantization; the tech behind Vertex AI and AlloyDB vectors.
annoy vs scann →Kubernetes-native distributed vector search engine built on Yahoo Japan's NGT.
annoy vs vald →Google Cloud's managed ANN service built on ScaNN, now part of Gemini Enterprise Agent Platform.
annoy vs vertex-ai-vector-search →Annoy FAQ
What is Annoy?
Annoy is a vector database by Spotify, first released in 2013. Annoy is a C++ library with Python bindings that Spotify built for music recommendations. It builds forests of random projection trees into static, read-only files that are memory-mapped, so many processes can share one index with almost no load time. It supports Euclidean, Manhattan, cosine, Hamming and dot-product distances and can build on disk for data larger than RAM. The last release was 1.17.3 in June 2023 and Spotify's newer Voyager (HNSW) library is its practical successor, so Annoy is best treated as stable legacy.
Is Annoy open source?
Yes. Annoy is open source. License: Apache License 2.0.
Does Annoy support ACID transactions?
No. Annoy does not provide ACID transactions; its consistency model is strong.
Does Annoy scale horizontally?
Annoy has no built-in sharding; scaling out means partitioning data in your application. It is comfortable at medium scale (≤ 10 TB).
How can I run Annoy?
You can self-host it and embed it in your application.
What is Annoy best for?
Annoy is a strong fit for read-only similarity indexes shipped to many workers and legacy recommendation pipelines. Think twice for frequently updated data.
What are the best alternatives to Annoy?
Common alternatives to Annoy include hnswlib, Faiss, USearch, ScaNN and Vald. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.
Is Annoy still maintained?
Annoy is in maintenance mode. No release since 1.17.3 (June 2023) and only sporadic commits; Spotify's HNSW-based Voyager library is the modern successor.
How popular is Annoy?
Annoy ranks #217 of 844 databases on the WhichDB Score (15.3/100), and #14 among vector databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.