CommunityToolkit.VectorData.Milvus
1.0.0-preview
Prefix Reserved
dotnet add package CommunityToolkit.VectorData.Milvus --version 1.0.0-preview
NuGet\Install-Package CommunityToolkit.VectorData.Milvus -Version 1.0.0-preview
<PackageReference Include="CommunityToolkit.VectorData.Milvus" Version="1.0.0-preview" />
<PackageVersion Include="CommunityToolkit.VectorData.Milvus" Version="1.0.0-preview" />
<PackageReference Include="CommunityToolkit.VectorData.Milvus" />
paket add CommunityToolkit.VectorData.Milvus --version 1.0.0-preview
#r "nuget: CommunityToolkit.VectorData.Milvus, 1.0.0-preview"
#:package CommunityToolkit.VectorData.Milvus@1.0.0-preview
#addin nuget:?package=CommunityToolkit.VectorData.Milvus&version=1.0.0-preview&prerelease
#tool nuget:?package=CommunityToolkit.VectorData.Milvus&version=1.0.0-preview&prerelease
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
- 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.
- 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, orGuid. 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
ContainsandAnyis supported.IsFullTextIndexedis 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+Skipwhen more. Scores are RRF scores: a higher score ranks higher, and a score threshold is a lower bound.GetServicereturnsIKeywordHybridSearchable<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.
IsIndexeddoes 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
IL2104andIL3053of the dependencyMilvus.Client.On .NET Framework,
Milvus.Clientcalls Milvus over WinHTTP (WinHttpHandler, whichGrpc.Net.Clientbrings in). This needs:- A TLS endpoint:
https: true(the default) on the host-based registrations, orssl: trueonMilvusClient. A plaintext endpoint fails withResponse protocol downgraded to HTTP/1.1. - A server certificate that Windows trusts. To validate it another way, create the
MilvusClienton aGrpcChannelwith aWinHttpHandlerand 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.
- A TLS endpoint:
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 | Versions 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. |
-
.NETFramework 4.6.2
- Microsoft.Extensions.AI.Abstractions (>= 10.8.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.VectorData.Abstractions (>= 10.8.2)
- Milvus.Client (>= 2.6.0)
- System.Linq.AsyncEnumerable (>= 10.0.10)
- System.Text.Json (>= 10.0.10)
-
.NETStandard 2.0
- Microsoft.Extensions.AI.Abstractions (>= 10.8.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.VectorData.Abstractions (>= 10.8.2)
- Milvus.Client (>= 2.6.0)
- System.Linq.AsyncEnumerable (>= 10.0.10)
- System.Text.Json (>= 10.0.10)
-
net10.0
- Microsoft.Extensions.AI.Abstractions (>= 10.8.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.VectorData.Abstractions (>= 10.8.2)
- Milvus.Client (>= 2.6.0)
-
net8.0
- Microsoft.Extensions.AI.Abstractions (>= 10.8.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.VectorData.Abstractions (>= 10.8.2)
- Milvus.Client (>= 2.6.0)
- System.Linq.AsyncEnumerable (>= 10.0.10)
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 | 44 | 10/29/2026 |