Skip to main content

DiskANN Python extension module

Project description


DiskANN Pull Request Build and Test

DiskANN is a suite of scalable, accurate and cost-effective approximate nearest neighbor search algorithms for large-scale vector search that support real-time changes and simple filters. This code is based on ideas from the DiskANN, Fresh-DiskANN and the Filtered-DiskANN papers with further improvements. This code forked off from code for NSG algorithm.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.

See guidelines for contributing to this project.

Linux build:

Install the following packages through apt-get

sudo apt install make cmake g++ libaio-dev libgoogle-perftools-dev clang-format libboost-all-dev

Install Intel MKL

Ubuntu 20.04 or newer

sudo apt install libmkl-full-dev

Earlier versions of Ubuntu

Install Intel MKL either by downloading the oneAPI MKL installer or using apt (we tested with build 2019.4-070 and 2022.1.2.146).

# OneAPI MKL Installer
sudo sh -a --components intel.oneapi.lin.mkl.devel --action install --eula accept -s


mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j 

Windows build:

The Windows version has been tested with Enterprise editions of Visual Studio 2022, 2019 and 2017. It should work with the Community and Professional editions as well without any changes.


  • CMake 3.15+ (available in VisualStudio 2019+ or from
  • NuGet.exe (install from
    • The build script will use NuGet to get MKL, OpenMP and Boost packages.
  • DiskANN git repository checked out together with submodules. To check out submodules after git clone:
git submodule init
git submodule update
  • Environment variables:
    • [optional] If you would like to override the Boost library listed in windows/, set BOOST_ROOT to your Boost folder.

Build steps:

  • Open the "x64 Native Tools Command Prompt for VS 2019" (or corresponding version) and change to DiskANN folder
  • Create a "build" directory inside it
  • Change to the "build" directory and run
cmake ..

OR for Visual Studio 2017 and earlier:

<full-path-to-installed-cmake>\cmake ..
  • This will create a diskann.sln solution. Open it from VisualStudio and build either Release or Debug configuration.
    • Alternatively, use MSBuild:
msbuild.exe diskann.sln /m /nologo /t:Build /p:Configuration="Release" /property:Platform="x64"
* This will also build gperftools submodule for libtcmalloc_minimal dependency.
  • Generated binaries are stored in the x64/Release or x64/Debug directories.


Please see the following pages on using the compiled code:

Please cite this software in your work as:

   author = {Simhadri, Harsha Vardhan and Krishnaswamy, Ravishankar and Srinivasa, Gopal and Subramanya, Suhas Jayaram and Antonijevic, Andrija and Pryce, Dax and Kaczynski, David and Williams, Shane and Gollapudi, Siddarth and Sivashankar, Varun and Karia, Neel and Singh, Aditi and Jaiswal, Shikhar and Mahapatro, Neelam and Adams, Philip and Tower, Bryan}},
   title = {{DiskANN: Graph-structured Indices for Scalable, Fast, Fresh and Filtered Approximate Nearest Neighbor Search}},
   url = {},
   version = {0.5},
   year = {2023}

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

diskannpy-0.5.0rc4-cp311-cp311-win_amd64.whl (4.5 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

diskannpy-0.5.0rc4-cp311-cp311-manylinux_2_28_x86_64.whl (91.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

diskannpy-0.5.0rc4-cp310-cp310-win_amd64.whl (4.5 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

diskannpy-0.5.0rc4-cp310-cp310-manylinux_2_28_x86_64.whl (91.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

diskannpy-0.5.0rc4-cp39-cp39-win_amd64.whl (4.5 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

diskannpy-0.5.0rc4-cp39-cp39-manylinux_2_28_x86_64.whl (91.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page