Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
78e5b1f
Add Milvus vector data provider
Overvolted Oct 23, 2026
943a871
style: standardize member ordering across Milvus classes
Overvolted Oct 27, 2026
f5961ca
style: remove redundant Milvus constructor comments
Overvolted Oct 27, 2026
cb9ba98
docs: explain Milvus HNSW index parameters
Overvolted Oct 27, 2026
097bab1
refactor: align Milvus client wrapper naming with provider conventions
Overvolted Oct 27, 2026
8336736
perf: avoid list allocation for single-record Milvus lookups
Overvolted Oct 27, 2026
e749425
refactor: centralize Milvus key type validation
Overvolted Oct 27, 2026
56a3b1d
refactor: centralize Milvus limits and default values
Overvolted Oct 27, 2026
bbf4f47
style: normalize namespace spacing in Milvus files
Overvolted Oct 27, 2026
2c6223a
test: cover idempotent disposal of shared Milvus clients
Overvolted Oct 28, 2026
e76300a
feat: expose Milvus collection load timeout in options
Overvolted Oct 28, 2026
b63a8a9
feat: make Milvus HNSW index parameters configurable
Overvolted Oct 28, 2026
265b2bf
docs: link Milvus empty-search workaround to upstream issue
Overvolted Oct 28, 2026
1c7a722
style: Add newlines between methods
Overvolted Oct 28, 2026
0ed6811
style: Add newline after class
Overvolted Oct 28, 2026
3a954d3
refactor: separate Milvus authentication registration overloads
Overvolted Oct 28, 2026
a2afcca
fix: default Milvus host registrations to HTTPS
Overvolted Oct 28, 2026
3d22cd0
style: break long line
Overvolted Oct 28, 2026
58fe415
docs: avoid root username in Milvus example
Overvolted Oct 28, 2026
37b5943
Merge branch 'feature/milvus-vector-data' of https://github.com/Overv…
Overvolted Oct 28, 2026
5c30e71
style: normalize member spacing in Milvus classes
Overvolted Oct 28, 2026
aeab801
style: remove trailing blank line in Milvus string escaping tests
Overvolted Oct 28, 2026
ccf84f0
fix: reject minimum_should_match as a Milvus field name
Overvolted Oct 28, 2026
f55166c
fix: preserve reusable Milvus test container between fixtures
Overvolted Oct 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CommunityToolkit.AI.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<Project Path="MEVD/src/AzureDocumentDB/AzureDocumentDB.csproj" />
<Project Path="MEVD/src/Chroma/Chroma.csproj" />
<Project Path="MEVD/src/InMemory/InMemory.csproj" />
<Project Path="MEVD/src/Milvus/Milvus.csproj" />
<Project Path="MEVD/src/PgVector/PgVector.csproj" />
<Project Path="MEVD/src/Qdrant/Qdrant.csproj" />
<Project Path="MEVD/src/Redis/Redis.csproj" />
Expand All @@ -32,6 +33,8 @@
<Project Path="MEVD/test/Chroma.ConformanceTests/Chroma.ConformanceTests.csproj" />
<Project Path="MEVD/test/InMemory.UnitTests/InMemory.UnitTests.csproj" />
<Project Path="MEVD/test/InMemory.ConformanceTests/InMemory.ConformanceTests.csproj" />
<Project Path="MEVD/test/Milvus.UnitTests/Milvus.UnitTests.csproj" />
<Project Path="MEVD/test/Milvus.ConformanceTests/Milvus.ConformanceTests.csproj" />
<Project Path="MEVD/test/PgVector.UnitTests/PgVector.UnitTests.csproj" />
<Project Path="MEVD/test/PgVector.ConformanceTests/PgVector.ConformanceTests.csproj" />
<Project Path="MEVD/test/Qdrant.UnitTests/Qdrant.UnitTests.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<PackageVersion Include="Microsoft.Data.SqlClient" Version="6.1.6" />
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="10.0.13" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="10.0.10" />
<PackageVersion Include="Milvus.Client" Version="2.6.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.10.0" />
<PackageVersion Include="Npgsql" Version="10.0.3" />
<PackageVersion Include="NRedisStack" Version="1.6.0" />
Expand Down Expand Up @@ -46,6 +47,7 @@
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="Testcontainers" Version="4.14.0" />
<PackageVersion Include="Testcontainers.CosmosDb" Version="4.14.0" />
<PackageVersion Include="Testcontainers.Milvus" Version="4.14.0" />
<PackageVersion Include="Testcontainers.MsSql" Version="4.14.0" />
<PackageVersion Include="Testcontainers.PostgreSql" Version="4.14.0" />
<PackageVersion Include="Testcontainers.Qdrant" Version="4.14.0" />
Expand Down
3 changes: 3 additions & 0 deletions MEVD/MEVD.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"MEVD/src/AzureDocumentDB/AzureDocumentDB.csproj",
"MEVD/src/Chroma/Chroma.csproj",
"MEVD/src/InMemory/InMemory.csproj",
"MEVD/src/Milvus/Milvus.csproj",
"MEVD/src/PgVector/PgVector.csproj",
"MEVD/src/Qdrant/Qdrant.csproj",
"MEVD/src/Redis/Redis.csproj",
Expand All @@ -25,6 +26,8 @@
"MEVD/test/Chroma.ConformanceTests/Chroma.ConformanceTests.csproj",
"MEVD/test/InMemory.UnitTests/InMemory.UnitTests.csproj",
"MEVD/test/InMemory.ConformanceTests/InMemory.ConformanceTests.csproj",
"MEVD/test/Milvus.UnitTests/Milvus.UnitTests.csproj",
"MEVD/test/Milvus.ConformanceTests/Milvus.ConformanceTests.csproj",
"MEVD/test/PgVector.UnitTests/PgVector.UnitTests.csproj",
"MEVD/test/PgVector.ConformanceTests/PgVector.ConformanceTests.csproj",
"MEVD/test/Qdrant.UnitTests/Qdrant.UnitTests.csproj",
Expand Down
2 changes: 2 additions & 0 deletions MEVD/src/Milvus/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
68 changes: 68 additions & 0 deletions MEVD/src/Milvus/ClientWrapper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Milvus.Client;
using Microsoft.Shared.Diagnostics;

namespace CommunityToolkit.VectorData.Milvus;

/// <summary>
/// The <see cref="MilvusClient"/> of a vector store or of a collection. A vector store shares it with the collections it returns,
/// and the <see cref="MilvusClient"/> it owns is disposed when the last of them is disposed.
/// </summary>
internal sealed class ClientWrapper : IDisposable
{
private readonly MilvusClient? _ownedClient;

private int _referenceCount = 1;

/// <summary>
/// Gets the client.
/// </summary>
public MilvusClient Client { get; }

/// <summary>
/// Gets the database name for telemetry, or <see langword="null"/> for a client created by the caller: the SDK does not
/// expose the configured database.
/// </summary>
public string? DatabaseName { get; }

/// <summary>
/// Initializes a new instance of the <see cref="ClientWrapper"/> class.
/// </summary>
/// <param name="milvusClient">Milvus client that can be used to manage the collections and records in a Milvus store.</param>
/// <param name="ownsClient">A value indicating whether <paramref name="milvusClient"/> is disposed with the last of the vector store and its collections.</param>
/// <param name="databaseName">
/// The database the SDK client connects to, for telemetry: known to the host-based registrations, which create the client.
/// </param>
public ClientWrapper(MilvusClient milvusClient, bool ownsClient, string? databaseName = null)
{
Throw.IfNull(milvusClient);

Client = milvusClient;
DatabaseName = databaseName;
_ownedClient = ownsClient ? milvusClient : null;
}

/// <summary>
/// Gets this client for one more user, a collection of the vector store, which disposes it too.
/// </summary>
public ClientWrapper Share()
{
if (_ownedClient is not null)
{
Interlocked.Increment(ref _referenceCount);
}

return this;
}

/// <inheritdoc />
public void Dispose()
{
if (_ownedClient is not null && Interlocked.Decrement(ref _referenceCount) == 0)
{
_ownedClient.Dispose();
}
}
}
31 changes: 31 additions & 0 deletions MEVD/src/Milvus/Milvus.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.0.0-preview</Version>
<AssemblyName>CommunityToolkit.VectorData.Milvus</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<TargetFrameworks>net10.0;net8.0;netstandard2.0;net462</TargetFrameworks>

<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>

<Title>Milvus provider for Microsoft.Extensions.VectorData</Title>
<Description>Milvus provider for Microsoft.Extensions.VectorData by the .NET Community Toolkit</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Linq.AsyncEnumerable" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" />
<PackageReference Include="Milvus.Client" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'net462' ">
<PackageReference Include="System.Text.Json" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="CommunityToolkit.VectorData.Milvus.UnitTests" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" />
</ItemGroup>

</Project>
Loading
Loading