Comparison
annoy vs faiss-cpu vs hnswlib vs nmslib
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk.
Slowing down. Last release over 3 years ago, little activity since. Fine for existing code; think twice for a new project.
pip install annoyA library for efficient similarity search and clustering of dense vectors.
Actively maintained. Last release 3 weeks ago, commits in 26 of the last 26 weeks. A safe choice.
pip install faiss-cpuhnswlib
Low maintenance activity. Last release over 3 years ago, commits in 1 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install hnswlibNon-Metric Space Library (NMSLIB)
Low maintenance activity. Last release 13 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install nmslibIn short
- annoy is slowing down (last release over 3 years ago): fine for existing code, risky for a new project.
- faiss-cpu is the most used: 12.9M downloads a month, 13× more than annoy.
- faiss-cpu also has the best Pythie’s Index (86).
- Safe default for a new project: faiss-cpu.
Side by side
| Metric | annoy | faiss-cpu | hnswlib | nmslib |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 19 | Pythie’s Index: 86 | Pythie’s Index: 22 | Pythie’s Index: 26 |
| Verdict | Slowing down | Actively maintained | Low maintenance activity | Low maintenance activity |
| Downloads / month | 980.4K | 12.9M | 676.1K | 121.3K |
| Downloads, month over month | +1% | +4% | -2% | -8% |
| GitHub stars | 14.3K | 42K | 5.4K | 3.6K |
| Stars, last 7 days | – | – | – | – |
| Direct dependents | 123 | 1.1K | 133 | 24 |
| Last release | Jun 14, 2023 | Nov 10, 2026 | Dec 3, 2023 | Oct 23, 2025 |
| Releases, 12 months | 0 | 7 | 0 | 0 |
| Weeks with commits | 0 / 26 | 26 / 26 | 1 / 26 | 0 / 26 |
| Recent contributors | 21 | 36 | 20 | 8 |
| First release | Mar 2014 | Jul 2019 | Aug 2019 | Jun 2017 |
| Python versions | 3.3 – 3.9 | 3.10 – 3.14 | – | – |
| License | Apache-2.0 | MIT | Apache-2.0 | Apache-2.0 |
| Known vulnerabilities | None | None | None | None |
Bold marks the best value in each row. Pythie’s Index rates maintenance out of 100: how it works.