Skip to content

.Net: Add Milvus vector store examples - #14717

Open
Luca Schiavone (Overvolted) wants to merge 4 commits into
microsoft:mainfrom
Overvolted:samples/add-milvus-vector-store
Open

Luca Schiavone (Overvolted) wants to merge 4 commits into
microsoft:mainfrom
Overvolted:samples/add-milvus-vector-store

Conversation

@Overvolted

Copy link
Copy Markdown

Motivation and Context

#14682 removed the .NET Milvus connector and points to the provider in CommunityToolkit/AI.

This PR adds Milvus to the multi-store vector search sample and the VectorStoreRAG demo, using CommunityToolkit.VectorData.Milvus. It follows the Chroma sample additions in #14602.

Description

  • Add VectorStore_VectorSearch_MultiStore_Milvus, with examples using and without dependency injection.
  • Add a Docker fixture running Milvus 2.6.25 with embedded etcd and local storage, including a readiness check and container cleanup.
  • Link the Milvus example from the common class and the other vector store examples.
  • Add Milvus as a Rag:VectorStoreType option in VectorStoreRAG, with host, port, TLS, API key, and database configuration.
  • Document how to start Milvus locally and configure a remote endpoint.
  • Reference CommunityToolkit.VectorData.Milvus 1.0.0-preview from both sample projects.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • Formatting checks pass for the changed implementation files
  • All unit tests pass, and I have added new tests where possible
  • I didn't break anyone 😄

@semantic-kernel-automation semantic-kernel-automation Bot added .NET Issue or Pull requests regarding .NET code documentation labels Nov 3, 2026
@Overvolted

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@Overvolted
Luca Schiavone (Overvolted) marked this pull request as ready for review November 16, 2026 17:07
@Overvolted
Luca Schiavone (Overvolted) requested a review from a team as a code owner November 16, 2026 17:07
Copilot AI balanced review requested due to automatic review settings November 16, 2026 17:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The fixture and documented command expose unauthenticated Milvus on all host interfaces, and failed fixture startup leaves orphaned containers.

3 open issues
What changed in this PR

Adds Milvus support to the .NET vector search samples and VectorStoreRAG demo through the CommunityToolkit provider, following the removal of the legacy connector.

Changes:

  • Adds Milvus examples with and without dependency injection, plus a Docker fixture with readiness checks and cleanup.
  • Adds Milvus connection settings and registration to VectorStoreRAG, with local and remote setup documentation.
  • References the provider package and links the new example from existing sample documentation.
File Description
dotnet/​samples/​Demos/​VectorStoreRAG/​VectorStoreRAG.csproj References the Milvus provider.
dotnet/​samples/​Demos/​VectorStoreRAG/​README.md Documents Milvus setup and configuration.
dotnet/​samples/​Demos/​VectorStoreRAG/​Program.cs Registers Milvus collections and RAG services.
dotnet/​samples/​Demos/​VectorStoreRAG/​Options/​MilvusConfig.cs Defines Milvus connection settings.
dotnet/​samples/​Demos/​VectorStoreRAG/​Options/​ApplicationConfig.cs Binds and exposes Milvus settings.
dotnet/​samples/​Demos/​VectorStoreRAG/​appsettings.json Supplies local Milvus defaults.
dotnet/​samples/​Concepts/​Memory/​VectorStoreFixtures/​VectorStoreMilvusContainerFixture.cs Manages container readiness and cleanup.
dotnet/​samples/​Concepts/​Memory/​VectorStoreFixtures/​VectorStoreInfra.cs Adds standalone Milvus container creation.
dotnet/​samples/​Concepts/​Memory/​VectorStore_VectorSearch_MultiStore_Redis.cs Adds a documentation link to Milvus.
dotnet/​samples/​Concepts/​Memory/​VectorStore_VectorSearch_MultiStore_Qdrant.cs Adds a documentation link to Milvus.
dotnet/​samples/​Concepts/​Memory/​VectorStore_VectorSearch_MultiStore_Postgres.cs Adds a documentation link to Milvus.
dotnet/​samples/​Concepts/​Memory/​VectorStore_VectorSearch_MultiStore_Milvus.cs Adds examples with and without dependency injection.
dotnet/​samples/​Concepts/​Memory/​VectorStore_VectorSearch_MultiStore_InMemory.cs Adds a documentation link to Milvus.
dotnet/​samples/​Concepts/​Memory/​VectorStore_VectorSearch_MultiStore_Common.cs Lists Milvus in the shared sample documentation.
dotnet/​samples/​Concepts/​Memory/​VectorStore_VectorSearch_MultiStore_AzureAISearch.cs Adds a documentation link to Milvus.
dotnet/​samples/​Concepts/​Concepts.csproj References the Milvus provider.
dotnet/​Directory.Packages.props Pins the provider to 1.0.0-preview.

Review effort: Balanced

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Overvolted

Copy link
Copy Markdown
Author

I ran the new sample and the Qdrant one with Azure OpenAI embeddings: both print the same results, with the same scores.

This branch was previously deployed

1 inactive (outdated) deployment
github-app-auth — 4ecfe62f Deployed Nov 3, 2026 by Overvolted via add_label #29580
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation .NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants