Milvus.Client.V2
2.6.0
Prefix Reserved
dotnet add package Milvus.Client.V2 --version 2.6.0
NuGet\Install-Package Milvus.Client.V2 -Version 2.6.0
<PackageReference Include="Milvus.Client.V2" Version="2.6.0" />
<PackageVersion Include="Milvus.Client.V2" Version="2.6.0" />
<PackageReference Include="Milvus.Client.V2" />
paket add Milvus.Client.V2 --version 2.6.0
#r "nuget: Milvus.Client.V2, 2.6.0"
#:package Milvus.Client.V2@2.6.0
#addin nuget:?package=Milvus.Client.V2&version=2.6.0
#tool nuget:?package=Milvus.Client.V2&version=2.6.0
Milvus C# SDK (V2) — Milvus.Client.V2
The second-generation .NET SDK for Milvus, the open-source vector database.
It implements the request/response DTO API (mirroring the Java/C++/Rust V2 SDKs) over gRPC and
targets net8.0, netstandard2.0 and net462.
Install
dotnet add package Milvus.Client.V2
Quickstart
using Milvus.Client.V2;
using Milvus.Client.V2.Requests.Collection;
using Milvus.Client.V2.Requests.Dml;
using Milvus.Client.V2.Requests.Dql;
using Milvus.Client.V2.Requests.Index;
using Milvus.Client.V2.Responses.Dql;
using Milvus.Client.V2.Types;
// Connect (see below for a token when authentication is enabled).
using var client = new MilvusClientV2(new ConnectConfig { Uri = "localhost:19530" });
// Build the collection schema with its fields.
var schema = new CollectionSchema { Name = "book" };
schema.Fields.Add(new FieldSchema("id", DataType.Int64, isPrimaryKey: true, autoId: true));
schema.Fields.Add(FieldSchema.CreateVarchar("title", maxLength: 256));
schema.Fields.Add(FieldSchema.CreateFloatVector("embedding", dimension: 128));
// Create the collection.
await client.CreateCollectionAsync(new CreateCollectionReq
{
CollectionName = "book",
Schema = schema
});
// Insert rows (row-based or column-based; here row-based).
await client.InsertAsync(new InsertReq
{
CollectionName = "book",
RowsData =
[
new Dictionary<string, object?>
{
["title"] = "The Time Machine",
["embedding"] = Enumerable.Repeat(0.1f, 128).ToArray()
}
]
});
// Build an index and load before searching.
await client.CreateIndexAsync(new CreateIndexReq
{
CollectionName = "book",
Indexes = [new IndexParam("embedding", indexType: IndexType.AutoIndex, metricType: SimilarityMetricType.Cosine)]
});
await client.LoadCollectionAsync(new LoadCollectionReq { CollectionName = "book" });
// Search.
SearchResp results = await client.SearchAsync(new SearchReq
{
CollectionName = "book",
VectorFieldName = "embedding",
Vectors = [Enumerable.Repeat(0.1f, 128).ToArray()],
MetricType = SimilarityMetricType.Cosine,
Limit = 10
});
See docs/design/v2_design.md for the full design and the request/response DTO conventions, and the
examples/v2/ project for runnable, per-feature sample programs (each one is a small console app that
connects to a server, exercises one feature area, and cleans up after itself).
Connection
// Default port 19530, plaintext.
using var client = new MilvusClientV2(new ConnectConfig { Uri = "localhost:19530" });
// With authentication (username/password) and TLS (https:// scheme).
using var client = new MilvusClientV2(new ConnectConfig
{
Uri = "https://host:19530",
Username = "root",
Password = "Milvus"
});
// With an API key instead.
using var client = new MilvusClientV2(new ConnectConfig { Uri = "https://host:19530", ApiKey = "..." });
// Connect to a specific database.
using var client = new MilvusClientV2(new ConnectConfig { Uri = "localhost:19530", Database = "my_db" });
The examples honor the MILVUS_URI and MILVUS_TOKEN environment variables
(default localhost:19530 / none).
Documentation layout
| Path | Contents |
|---|---|
docs/v2/ |
V2 API reference and docs (this readme is packed into the NuGet package). |
docs/v1/ |
Legacy first-generation SDK (Milvus.Client) docs. |
docs/design/v2_design.md |
V2 design document. |
examples/v2/ |
Runnable V2 example programs. |
| 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 was computed. 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
- Google.Protobuf (>= 3.36.0)
- Grpc.Net.Client (>= 2.83.0)
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- Microsoft.Bcl.HashCode (>= 6.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- System.Text.Json (>= 8.0.6)
-
.NETStandard 2.0
- Google.Protobuf (>= 3.36.0)
- Grpc.Net.Client (>= 2.83.0)
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- Microsoft.Bcl.HashCode (>= 6.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- System.Text.Json (>= 8.0.6)
-
net8.0
- Google.Protobuf (>= 3.36.0)
- Grpc.Net.Client (>= 2.83.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
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 |
|---|---|---|
| 2.6.0 | 45 | 10/16/2026 |