# NGT-labs/NGT

Nearest Neighbor Search with Neighborhood Graph and Tree for High-dimensional Data

Repository: https://github.com/NGT-labs/NGT
Canonical: https://ross.abutalabs.com/products/ngt
Language: C++
License: Apache-2.0
License Family: permissive
Topics: approximate-nearest-neighbor-search, k-nearest-neighbors, knn-search, nearest-neighbors, nearest-neighbor-search, vector-database, vector-search
Last push: 2026-07-27T23:11:15+00:00

## Health v2 (maintenance only)
Score: 90/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 94, release rhythm 80, longevity 100
- inputs: {"age_days": 3653, "days_push": 37, "days_rel": 135, "gap_med": 12.5, "n_releases_24m": 29}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1370, forks 130 (observed 2026-08-28T04:04:31.844292+00:00)

## What it is
NGT is a C++ library and command-line tool from Yahoo Japan for high-speed approximate nearest neighbor search on high-dimensional vector data, using neighborhood graph and tree-based indexing with quantized variants (QG, QBG). It offers a Python package via PyPI and supports distance metrics like L2, cosine, Jaccard, and inner product.

## Use cases
- find similar vectors in a high-dimensional dataset
- build an approximate nearest neighbor index for embeddings
- search k-nearest neighbors for image or text embeddings
- speed up similarity search over millions of vectors
- use quantized graph indexes to reduce memory for vector search
- integrate ANN search into a Python application

## When to choose
- you need fast approximate nearest neighbor search on tens to thousands of dimensions
- you want a mature C++ core with Python bindings
- memory-efficient quantized indexes (QG/QBG) are needed for large datasets

## When to avoid
- you need a full managed vector database with filtering and replication
- your data is small enough that brute-force search suffices
- you need first-class Windows support or non-Linux/macOS deployment

## Facets
- artifact type: library
- maturity: active
- function: vector-database, search-engine
- domain: machine-learning
- platform: cpp, python, cli
- tags: approximate-nearest-neighbor-search, ann, vector-search, graph-index, quantization, high-dimensional-data, search, algorithms, linux, macos

## Member repositories
- NGT-labs/NGT (main) score 90

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:31.844292+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-30T04:40:52.825139+00:00, confidence not recorded.
  - readme: https://github.com/NGT-labs/NGT (fetched 2026-08-28T04:04:31.844292+00:00, sha 763707ce4faf)
- Data as of 2026-08-30T08:39:29.467469+00:00.
