diskann-garnet 2.0.3

dotnet add package diskann-garnet --version 2.0.3
                    
NuGet\Install-Package diskann-garnet -Version 2.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="diskann-garnet" Version="2.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="diskann-garnet" Version="2.0.3" />
                    
Directory.Packages.props
<PackageReference Include="diskann-garnet" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add diskann-garnet --version 2.0.3
                    
#r "nuget: diskann-garnet, 2.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package diskann-garnet@2.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=diskann-garnet&version=2.0.3
                    
Install as a Cake Addin
#tool nuget:?package=diskann-garnet&version=2.0.3
                    
Install as a Cake Tool

diskann-garnet

This crate providers an implementation of DataProvider for Garnet as well as FFI endpoints for Garnet to access DiskANN functionality. Garnet is a remote cache service developed by Microsoft Research, offers Redis compatibility, and has better performance, throughput, and lower latency than competitors. With this crate, it also supports vector sets, allowing clients to use vector sets for ANN indexing and search.

Supported Features

diskann-garnet currently supports full precision vectors only with cosine distance metrics.

In addition to the normal vector set operations, the following extensions are added:

  • XB8: When specifying vector input type, you can use XB8 instead of FP32 to specify binary data in uint8 format, one byte per dimension.
  • XPREQ8: This is a pseudo-quantizer that specifies the vector data will be stored as full precision data in uint8 format.

Generally you will use XB8 with XPREQ8 to input and store uint8 vectors and FP32 with NOQUANT to input and store f32 vectors.

Support for binary and scalar quantization is coming, along with support for customizing the distance metric.

Currently there is limit of 2^32 - 1 vectors in a single instance due to internal IDs being u32. This will probably restriction will be lifted in the future.

Installing

Garnet depends on diskann-garnet as a NuGet package, which means you can simply check out the Garnet repo on Windows or Linux, and if you have a dotnet toolchain installed you can just run:

dotnet dotnet run -c Release -f net8.0 --project main/GarnetServer --enable-vector-set-preview

and it will build and launch Garnet with vector sets enabled.

Local Installs

If you want to install a specific version of diskann-garnet to use with Garnet, it is a little more complicated. Aside from compiling diskann-garnet, you will need to create a NuGet package. For example:

cd diskann-garnet
cargo build --release
mkdir ../target/pkg
mkdir ../target/pkg/linux
mkdir ../target/pkg/windows
mkdir ../target/pkg/docs
cp README.md ../target/pkg/linux/libdiskann_garnet.so # dummy file
cp ../target/release/*.dll ../target/pkg/windows
cp ../target/release/*.pdb ../target/pkg/windows
cp README.md ../target/pkg/docs
nuget pack -BasePath ../target/pkg -OutputDirectory LOCAL_NUGET_PATH
nuget locals -clear all

You will need to set up a local path to host NuGets and setup %APPDATA%/NuGet/NuGet.config appropriately. For example:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="local" value="LOCAL_NUGET_PATH" />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
  <packageSourceMapping>
    <packageSource key="nuget.org">
        <package pattern="*"/>
    </packageSource>
    <packageSource key="local">
        <package pattern="diskann-garnet"/>
    </packageSource> 
  </packageSourceMapping>
</configuration>

Replace LOCAL_NUGET_PATH with whatever path you like.

Linux instructions are a bit more difficult as nuget pack does not exist in Linux. You will need to grab an existing NuGet from NuGet.org, unzip it, and then replace the files, and rezip.

mkdir target/nupkg
cd target/nupkg
unzip PATH_TO/diskann-garnet.x.y.z.nupkg
cd ../../diskann-garnet
cargo build --release
cp diskann-garnet.nuspec ../target/nupkg/
cp ../target/release/libdiskann_garnet.so ../target/nupkg/runtimes/linux-x64/native/
cd ../target/nupkg
zip -r LOCAL_NUGET_PATH/diskann-garnet.X.Y.Z.nupkg *
dotnet nuget locals all --clear

Replace LOCAL_NUGET_PATH with the path you like and X.Y.Z with the version number from diskann-garnet.nuspec.

If you aren't replacing the same version of diskann-garnet as Garnet is using, you can modify Garnet's Directory.Packages.props file to set the version to the one you want.

Testing

Unit tests are run in the usual way with cargo test, but many are end-to-end and run from the Garnet side. These two invocations will the relevant tests:

dotnet test test/Garnet.test -f net8.0 -c Debug --filter RespVectorSetTests
dotnet test test/Garnet.test -f net8.0 -c Debug --filter DiskANNServiceTests

Client Examples

To benchmark or see an example of usage, see the vectorset crate, which uses the official Redis Rust client to run vector workloads on Garnet.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on diskann-garnet:

Package Downloads
Microsoft.Garnet

Garnet is a remote cache-store from Microsoft Research, that offers strong performance (throughput and latency), scalability, storage, recovery, cluster sharding, key migration, and replication features. Garnet uses the Redis RESP wire protocol and can work with existing Redis clients.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on diskann-garnet:

Repository Stars
microsoft/garnet
Garnet is a remote cache-store from Microsoft Research that offers strong performance (throughput and latency), scalability, storage, recovery, cluster sharding, key migration, and replication features. Garnet can work with existing Redis clients.
Version Downloads Last Updated
2.0.3 0 6/12/2026
2.0.2 153 6/9/2026
2.0.1 136 6/5/2026
2.0.0 154 6/2/2026
1.0.27 45,148 5/19/2026
1.0.26 73,723 4/9/2026
1.0.25 358 2/25/2026
1.0.23 54,628 2/17/2026
1.0.22 128 2/14/2026
1.0.21 145 1/30/2026
1.0.20 25,291 1/27/2026
1.0.19 306 1/20/2026
1.0.18 179 1/17/2026
1.0.17 137 1/15/2026
1.0.16 1,606 11/26/2025
1.0.15 551 11/19/2025