nmslib/hnswlib

Header-only C++/python library for fast approximate nearest neighbors

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 34 minutes ago
Added to GitGenius on September 12th, 2026
Created on July 6th, 2017
Open Issues & Pull Requests: 292 (+0)
GitHub issues: Enabled
Number of forks: 841
Total Stargazers: 5,327 (+0)
Total Subscribers: 68 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 3.6 days
Mean response time: 49.7 days
90th percentile: 198.4 days
Tracked items: 34

Most active contributors

Sign in to see contributor activity.

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 98% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Only 3% of issues opened in the past year have been closed.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 44
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 640 days
Stale 30+ days: 44
Stale 90+ days: 43

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • enhancement (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Hnswlib is a header-only C++ library with Python bindings that implements the Hierarchical Navigable Small World algorithm for fast approximate nearest neighbor search.

The library addresses the need for efficient similarity search in high-dimensional spaces by implementing HNSW, a graph-based approach that provides logarithmic complexity for both insertion and search operations. The algorithm constructs a hierarchical structure of proximity graphs that enables rapid approximate nearest neighbor queries without requiring exhaustive distance calculations across the entire dataset.

Developers should choose this tool when building systems that require fast approximate nearest neighbor retrieval at scale, such as recommendation engines, semantic search, or similarity-based retrieval systems. The header-only design means no separate compilation step is needed for C++ integration, and Python bindings make it accessible for data science workflows. The library supports filtering during search, multi-vector document search, epsilon-based search, and index persistence through streaming. It handles dynamic operations including insertions, updates, and element replacement without requiring index rebuilds.

The project maintains active development with recent releases addressing production concerns. The codebase has been hardened through comprehensive testing across multiple compilers and configurations, including exception handling modes and sanitizer coverage. The library now offers a no-exceptions C++ API alongside its traditional throwing interface, enabling use in environments with `-fno-exceptions` compilation flags. Recent work has focused on correctness fixes in brute-force search with filters, proper error reporting through Status return types, and support for streaming index serialization. The project demonstrates attention to both performance optimization and robustness, with fixes for data races in multithreaded operations and undefined behavior issues.