CommunityToolkit.VectorData.Milvus 1.0.0-preview

Prefix Reserved
This is a prerelease version of CommunityToolkit.VectorData.Milvus.
dotnet add package CommunityToolkit.VectorData.Milvus --version 1.0.0-preview
                    
NuGet\Install-Package CommunityToolkit.VectorData.Milvus -Version 1.0.0-preview
                    
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="CommunityToolkit.VectorData.Milvus" Version="1.0.0-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommunityToolkit.VectorData.Milvus" Version="1.0.0-preview" />
                    
Directory.Packages.props
<PackageReference Include="CommunityToolkit.VectorData.Milvus" />
                    
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 CommunityToolkit.VectorData.Milvus --version 1.0.0-preview
                    
#r "nuget: CommunityToolkit.VectorData.Milvus, 1.0.0-preview"
                    
#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 CommunityToolkit.VectorData.Milvus@1.0.0-preview
                    
#: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=CommunityToolkit.VectorData.Milvus&version=1.0.0-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CommunityToolkit.VectorData.Milvus&version=1.0.0-preview&prerelease
                    
Install as a Cake Tool

CommunityToolkit.VectorData.Milvus

Milvus provider for Microsoft.Extensions.VectorData, by the .NET Community Toolkit.

Milvus is an open-source vector database for AI applications.

The provider is built on Milvus.Client, the Milvus C# SDK.

Requires Milvus 2.6 or later.

Quick start

  1. Run Milvus with Docker, as a single container with embedded etcd and local storage:
docker run -d --name milvus -p 19530:19530 -e DEPLOY_MODE=STANDALONE -e ETCD_USE_EMBED=true -e COMMON_STORAGETYPE=local milvusdb/milvus:v2.6.25 milvus run standalone

For other setups, see the standalone installation instructions.

Host-based dependency injection registrations use HTTPS by default. For the local plaintext container above, explicitly pass https: false.

  1. Install the NuGet package:
dotnet add package CommunityToolkit.VectorData.Milvus

For more information, see the Microsoft.Extensions.VectorData documentation.

Limitations

  • Milvus 2.5 is not supported: on Milvus 2.5.27, an upsert of a record with a string property fails with the length of valid_data of field(...) is wrong.

  • Keys can be long, string, or Guid. Auto-generation is supported only for Guid keys and happens in the provider before upsert.

  • Whole-array equality filters, date/time data, and ordered retrieval are not supported. Array membership via Contains and Any is supported.

  • IsFullTextIndexed is supported on string properties. Milvus analyzes the text with its default analyzer, and a BM25 function stores the result in a hidden sparse field: the storage name of the property with _bm25. No other property can use that name, so the storage name of a full-text indexed property can have at most 250 characters. Records read back do not include the hidden field.

  • Keyword hybrid search fuses a vector search and a BM25 search of the keywords on a full-text indexed property, both filtered, with Reciprocal Rank Fusion (k = 60). The keywords are searched as one text, analyzed like the property. Each of the two searches ranks at least 10 records, or top + Skip when more. Scores are RRF scores: a higher score ranks higher, and a score threshold is a lower bound. GetService returns IKeywordHybridSearchable<TRecord> only for a collection with a full-text indexed property.

  • An array or list property can be null or empty, but its individual elements cannot be null. The provider rejects null elements before calling the SDK and identifies the record, property and element index.

  • Supported metrics are cosine similarity (default), dot product similarity, Euclidean distance, and squared Euclidean distance. Scores are native Milvus scores, except Euclidean distance: the square root of the squared distance that Milvus returns. Distance thresholds are upper bounds, similarity thresholds are lower bounds.

  • IsIndexed does not create scalar indexes; Milvus can filter scalar fields without them. Supported vector indexes are automatic (default), Flat, and HNSW.

  • Field storage names must use ASCII letters, digits and underscores, starting with a letter or underscore. Reserved Milvus keywords are rejected during model construction. Varchar fields allow up to 65535 bytes. Schema changes on an existing collection require explicit management through the SDK.

  • Collection names must use ASCII letters, digits and underscores, start with a letter or underscore, and have at most 255 characters: Milvus rejects other names, such as chathistory-local.

  • For NativeAOT, use dynamic dictionary collections with explicit definitions: the typed collection APIs use reflection. Publishing with trimming or NativeAOT shows the warnings IL2104 and IL3053 of the dependency Milvus.Client.

  • On .NET Framework, Milvus.Client calls Milvus over WinHTTP (WinHttpHandler, which Grpc.Net.Client brings in). This needs:

    • A TLS endpoint: https: true (the default) on the host-based registrations, or ssl: true on MilvusClient. A plaintext endpoint fails with Response protocol downgraded to HTTP/1.1.
    • A server certificate that Windows trusts. To validate it another way, create the MilvusClient on a GrpcChannel with a WinHttpHandler and pass that client to the provider.
    • Windows 11 or later. Windows Server 2019 and 2022 support gRPC over WinHTTP only partially. See Microsoft's gRPC requirements for .NET Framework.

    Verified on Windows 11 with .NET Framework 4.7.2 against Milvus 2.6.25 over TLS.

Host-based registrations accept database, username/password, or apiKey. The two authentication modes are mutually exclusive. Keyed variants are also available:

builder.Services.AddMilvusVectorStore("milvus.example.com", https: true,
    database: "catalog", username: "some", password: password);

Host-based registrations report the selected database as VectorStoreName in the metadata of the store and of its collections, or default when none is selected. An existing MilvusClient does not expose the database it uses, so with a supplied client VectorStoreName is null. Host-based registrations own their SDK client; supplied clients remain caller-owned:

var client = new MilvusClient("milvus.example.com", port: 19530, ssl: true,
    database: "catalog");

builder.Services.AddMilvusVectorStore(_ => client);
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview 41 10/29/2026