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
                    
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="Milvus.Client.V2" Version="2.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Milvus.Client.V2" Version="2.6.0" />
                    
Directory.Packages.props
<PackageReference Include="Milvus.Client.V2" />
                    
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 Milvus.Client.V2 --version 2.6.0
                    
#r "nuget: Milvus.Client.V2, 2.6.0"
                    
#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 Milvus.Client.V2@2.6.0
                    
#: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=Milvus.Client.V2&version=2.6.0
                    
Install as a Cake Addin
#tool nuget:?package=Milvus.Client.V2&version=2.6.0
                    
Install as a Cake Tool

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 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. 
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
2.6.0 45 10/16/2026