NGT-labs/NGT

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

What it solves

NGT addresses the challenge of finding similar items within massive datasets of high-dimensional vectors. It enables high-speed approximate nearest neighbor searches, which are essential for tasks like recommendation systems, image retrieval, and machine learning applications where comparing every item individually would be too slow.

How it works

NGT organizes data using graph and tree-based structures to navigate high-dimensional spaces efficiently. It offers three primary methods: standard graph-based indexing (NGT), quantized graph-based indexing (QG) for higher performance, and quantized blob graph-based indexing (QBG) for handling datasets containing billions of objects. The system supports various distance metrics—such as Cosine similarity, L2, and Jaccard—and allows for memory-efficient operation through memory-mapped files and quantization techniques.

Who it’s for

NGT is designed for developers and data engineers building high-performance search systems, vector stores, or machine learning pipelines. It is suitable for those working with large-scale data that may exceed available RAM, as well as those needing cross-language support, including Python, C++, Go, Rust, and others.

Highlights

  • High-speed approximate nearest neighbor search for high-dimensional data.
  • Supports massive datasets, including billions of objects via the QBG method.
  • Flexible memory management using shared memory and memory-mapped files.
  • Extensive language support including Python, C++, Go, Rust, Ruby, PHP, and JavaScript.
  • Compatible with LlamaIndex as a vector store.

Related

  • Project
  • Project
  • Project
  • Project
  • Project