nmslib
Non-Metric Space Library (NMSLIB)
Decision gist · record as of 2026-08-14
Yes, if you need efficient approximate similarity search and can tolerate medium install friction from compiled bindings. The library is actively maintained with no known vulnerabilities and offers broad platform support. Verify the license terms and Python version compatibility in the repository before adopting in production.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a C++ compiler and build tools at install time; pybind11 is a build dependency.
- Python version support is unspecified in package metadata.
- Medium install friction due to compiled C++ bindings via pybind11.
License · maintenance · safety
(unclear) — License treatment is unclear—no SPDX identifier or raw license text is recorded in the package metadata. Verify the actual license in the GitHub repository before adopting in proprietary or restricted-license projects.
last release 2025-10-23 (295 days) · last repo commit 2026-04-13 · 3,590 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 154,328 downloads/mo, #10,854 on PyPI
Alternatives
Verify before relying
pip install nmslib
import nmslib
index = nmslib.init(space='l2', method='hnsw')
index.addDataPointsFromMatrix(data)
index.createIndex()
labels, distances = index.knnQuery(query_vector, k=10)- Exact Python version range supported (requires_python is unspecified in metadata)
- Whether the library is suitable for production use at scale (no documented SLA or performance benchmarks in fact sheet)
- Specific license terms and any commercial use restrictions
- Download volume trend and active user base size
What it is and what it does
nmslib is a cross-platform C++ library with Python bindings for searching in metric and non-metric spaces. It specializes in approximate nearest-neighbor methods and provides tools to evaluate similarity search algorithms. The library is built on pybind11 and depends on scipy and numpy, making it suitable for scientific and machine-learning workflows where fast approximate similarity matching is needed.
Unlike metric-space libraries that assume triangle inequality, nmslib handles generic and non-metric spaces, which is useful for custom distance functions or domain-specific similarity measures. It offers multiple indexing methods and is actively maintained with wheels for modern Python versions and common platforms.
Use it for
- Build a fast approximate nearest-neighbor index for large-scale vector search in recommendation systems or semantic search applications.
- Evaluate and benchmark different similarity search algorithms on custom datasets or non-metric distance functions.
- Implement similarity matching for embeddings in NLP or computer vision pipelines where exact nearest-neighbor search is too slow.
- Search in non-Euclidean or custom metric spaces where standard libraries assume L2 or cosine distance.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need efficient approximate similarity search and can tolerate medium install friction from compiled bindings.
The library is actively maintained with no known vulnerabilities and offers broad platform support. Verify the license terms and Python version compatibility in the repository before adopting in production.
Install
nmslib on PyPI
Before you install
Medium install friction due to compiled C++ bindings via pybind11. Wheels are available for Python 3.10–3.13 across macOS (Intel and ARM), Linux (x86_64 and aarch64), and Windows. Active maintenance with recent commits suggest reliable upkeep.
Requires a C++ compiler and build tools at install time; pybind11 is a build dependency. Python version support is unspecified in package metadata.
License in practice
License treatment is unclear—no SPDX identifier or raw license text is recorded in the package metadata. Verify the actual license in the GitHub repository before adopting in proprietary or restricted-license projects.
Quickstart
pip install nmslib
import nmslib
index = nmslib.init(space='l2', method='hnsw')
index.addDataPointsFromMatrix(data)
index.createIndex()
labels, distances = index.knnQuery(query_vector, k=10)
Verify before relying
- Exact Python version range supported (requires_python is unspecified in metadata)
- Whether the library is suitable for production use at scale (no documented SLA or performance benchmarks in fact sheet)
- Specific license terms and any commercial use restrictions
- Download volume trend and active user base size
Package facts
| License | Not declared unclear |
| Python support | Not specified |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 3 packagespybind11scipynumpy |
| Maintenance | Actively maintained 295 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 154,328 / month, #10,854 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: nmslib-2.1.2-cp310-cp310-macosx_10_13_x86_64.whl; nmslib-2.1.2-cp310-cp310-macosx_11_0_arm64.whl; nmslib-2.1.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; nmslib-2.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; nmslib-2.1.2-cp310-cp310-win_amd64.whl; nmslib-2.1.2-cp311-cp311-macosx_10_13_x86_64.whl; nmslib-2.1.2-cp311-cp311-macosx_11_0_arm64.whl; nmslib-2.1.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; nmslib-2.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; nmslib-2.1.2-cp311-cp311-win_amd64.whl; nmslib-2.1.2-cp311-cp311-win_arm64.whl; nmslib-2.1.2-cp312-cp312-macosx_10_13_x86_64.whl; nmslib-2.1.2-cp312-cp312-macosx_11_0_arm64.whl; nmslib-2.1.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; nmslib-2.1.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; nmslib-2.1.2-cp312-cp312-win_amd64.whl; nmslib-2.1.2-cp312-cp312-win_arm64.whl; nmslib-2.1.2-cp313-cp313-macosx_10_13_x86_64.whl; nmslib-2.1.2-cp313-cp313-macosx_11_0_arm64.whl; nmslib-2.1.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “similarity search non-metric spaces”
- nmslibnmslib provides efficient similarity search in metric and non-metric…
- annoyAnnoy searches for approximate nearest neighbors in high-dimensional…
- faiss-gpuFaiss provides GPU-accelerated similarity search and clustering for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also scann · voyager · annoy · libcuvs-cu12 · usearch · pynndescent · hnswlib · pyspark-hnsw · mhfp · kdtree