Skip to content

Migrate VectorStoreRAG and Concepts samples to CommunityToolkit.VectorData packages - #14170

Merged
Adam Sitnik (adamsitnik) merged 13 commits into
mainfrom
copilot/update-package-names
Jul 24, 2026
Merged

Migrate VectorStoreRAG and Concepts samples to CommunityToolkit.VectorData packages#14170
Adam Sitnik (adamsitnik) merged 13 commits into
mainfrom
copilot/update-package-names

Conversation

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

Microsoft.SemanticKernel.Connectors.* vector store packages are moving to CommunityToolkit.VectorData.*. This updates the VectorStoreRAG and Concepts sample projects to reference the new package IDs and namespaces.

Description

Package reference updates (Directory.Packages.props, VectorStoreRAG.csproj, Concepts.csproj):

Old New Version
Microsoft.SemanticKernel.Connectors.AzureAISearch CommunityToolkit.VectorData.AzureAISearch 1.0.0
Microsoft.SemanticKernel.Connectors.CosmosMongoDB CommunityToolkit.VectorData.CosmosMongoDB 1.0.0
Microsoft.SemanticKernel.Connectors.CosmosNoSql CommunityToolkit.VectorData.CosmosNoSql 1.0.0
Microsoft.SemanticKernel.Connectors.InMemory CommunityToolkit.VectorData.InMemory 1.0.0
Microsoft.SemanticKernel.Connectors.PgVector CommunityToolkit.VectorData.PgVector 1.0.0
Microsoft.SemanticKernel.Connectors.Qdrant CommunityToolkit.VectorData.Qdrant 1.0.0
Microsoft.SemanticKernel.Connectors.Redis CommunityToolkit.VectorData.Redis 1.0.0
Microsoft.SemanticKernel.Connectors.Weaviate CommunityToolkit.VectorData.Weaviate 1.0.0

Namespace updates :

// Before
using Microsoft.SemanticKernel.Connectors.InMemory;
// After
using CommunityToolkit.VectorData.InMemory;

DI extension methods (AddInMemoryVectorStore, AddQdrantCollection, etc.) moved to Microsoft.Extensions.DependencyInjection in the CT packages — all affected files already had that using, so no additional changes needed there.

API compatibility fixes:

  • [VectorStoreVector(Dimensions: N)][VectorStoreVector(N)] in two files — the new Microsoft.Extensions.VectorData.Abstractions constructor uses a positional parameter named dimensions (lowercase), so the old named-argument form no longer compiles.
  • SharpCompress pin bumped 0.48.00.48.1 in Directory.Packages.propsCommunityToolkit.VectorData.CosmosMongoDB pulls MongoDB.Driver 3.10.0 which requires >= 0.48.1.
  • Added <AzureCosmosDisableNewtonsoftJsonCheck>true</AzureCosmosDisableNewtonsoftJsonCheck> to both sample csproj files — CommunityToolkit.VectorData.CosmosNoSql pulls Microsoft.Azure.Cosmos 3.61.0 which added a mandatory Newtonsoft.Json explicit-reference check not present in the prior version.

Contribution Checklist

Copilot AI changed the title Migrate SK connector packages to CommunityToolkit.VectorData in samples Migrate VectorStoreRAG and Concepts samples to CommunityToolkit.VectorData packages Jul 20, 2026

@adamsitnik Adam Sitnik (adamsitnik) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copilot please address my feedback

Comment thread dotnet/samples/Concepts/Concepts.csproj
Comment thread dotnet/samples/Concepts/Concepts.csproj Outdated
Comment thread dotnet/samples/Demos/VectorStoreRAG/VectorStoreRAG.csproj Outdated
Comment thread dotnet/Directory.Packages.props Outdated
Comment thread dotnet/Directory.Packages.props Outdated

@adamsitnik Adam Sitnik (adamsitnik) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copilot fix following build failure:

/home/runner/work/semantic-kernel/semantic-kernel/dotnet/samples/GettingStartedWithVectorStores/GettingStartedWithVectorStores.csproj : error NU1010: The following PackageReference items do not define a corresponding PackageVersion item: Microsoft.SemanticKernel.Connectors.AzureAISearch, Microsoft.SemanticKernel.Connectors.InMemory, Microsoft.SemanticKernel.Connectors.Redis. Projects using Central Package Management must declare PackageReference and PackageVersion items with matching names. For more information, visit https://aka.ms/nuget/cpm/gettingstarted [/home/runner/work/semantic-kernel/semantic-kernel/dotnet/SK-dotnet.slnx]
/home/runner/work/semantic-kernel/semantic-kernel/dotnet/samples/GettingStartedWithTextSearch/GettingStartedWithTextSearch.csproj : error NU1010: The following PackageReference items do not define a corresponding PackageVersion item: Microsoft.SemanticKernel.Connectors.InMemory. Projects using Central Package Management must declare PackageReference and PackageVersion items with matching names. For more information, visit https://aka.ms/nuget/cpm/gettingstarted [/home/runner/work/semantic-kernel/semantic-kernel/dotnet/SK-dotnet.slnx]
/home/runner/work/semantic-kernel/semantic-kernel/dotnet/samples/Demos/OnnxSimpleRAG/OnnxSimpleRAG.csproj : error NU1010: The following PackageReference items do not define a corresponding PackageVersion item: Microsoft.SemanticKernel.Connectors.InMemory. Projects using Central Package Management must declare PackageReference and PackageVersion items with matching names. For more information, visit https://aka.ms/nuget/cpm/gettingstarted [/home/runner/work/semantic-kernel/semantic-kernel/dotnet/SK-dotnet.slnx]
/home/runner/work/semantic-kernel/semantic-kernel/dotnet/samples/Demos/ModelContextProtocolClientServer/MCPServer/MCPServer.csproj : error NU1010: The following PackageReference items do not define a corresponding PackageVersion item: Microsoft.SemanticKernel.Connectors.InMemory. Projects using Central Package Management must declare PackageReference and PackageVersion items with matching names. For more information, visit https://aka.ms/nuget/cpm/gettingstarted [/home/runner/work/semantic-kernel/semantic-kernel/dotnet/SK-dotnet.slnx]
/home/runner/work/semantic-kernel/semantic-kernel/dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/ChatWithAgent.ApiService.csproj : error NU1010: The following PackageReference items do not define a corresponding PackageVersion item: Microsoft.SemanticKernel.Connectors.AzureAISearch. Projects using Central Package Management must declare PackageReference and PackageVersion items with matching names. For more information, visit https://aka.ms/nuget/cpm/gettingstarted [/home/runner/work/semantic-kernel/semantic-kernel/dotnet/SK-dotnet.slnx]
/home/runner/work/semantic-kernel/semantic-kernel/dotnet/src/SemanticKernel.UnitTests/SemanticKernel.UnitTests.csproj : error NU1010: The following PackageReference items do not define a corresponding PackageVersion item: Microsoft.SemanticKernel.Connectors.InMemory. Projects using Central Package Management must declare PackageReference and PackageVersion items with matching names. For more information, visit https://aka.ms/nuget/cpm/gettingstarted [/home/runner/work/semantic-kernel/semantic-kernel/dotnet/SK-dotnet.slnx]

make sure that none of the projects in this repo keeps using Microsoft.SemanticKernel.Connectors.* packages, just migrate all of them to CommunityToolkit.VectorData.*

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Copilot fix following build failure:

Fixed in the latest commit. All 6 failing projects have been migrated:

  • GettingStartedWithVectorStores, GettingStartedWithTextSearch, OnnxSimpleRAG, MCPServer, ChatWithAgent.ApiService — PackageReferences updated to CommunityToolkit.VectorData.* and using statements updated in the corresponding .cs files.
  • SemanticKernel.UnitTests — converted from a PackageReference to a ProjectReference to the local src/VectorData/InMemory project (which keeps the Microsoft.SemanticKernel.Connectors.InMemory namespace, so no using changes were needed in the test files).

Comment thread dotnet/src/SemanticKernel.UnitTests/SemanticKernel.UnitTests.csproj Outdated
@adamsitnik
Adam Sitnik (adamsitnik) marked this pull request as ready for review July 22, 2026 12:35
@adamsitnik
Adam Sitnik (adamsitnik) requested a review from a team as a code owner July 22, 2026 12:35

@adamsitnik Adam Sitnik (adamsitnik) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The CI is green, it's ready for review:

Image

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.

Pull request overview

Updates the .NET VectorStore/RAG and text search ecosystem to use the new CommunityToolkit.VectorData.* connector packages (instead of Microsoft.SemanticKernel.Connectors.*) across samples and tests, alongside dependency/version alignment and minor API-compat fixes in SemanticKernel.Core.

Changes:

  • Switch multiple samples/tests from Microsoft.SemanticKernel.Connectors.* packages/namespaces to CommunityToolkit.VectorData.*.
  • Update central package versions (including MongoDB.Driver and Microsoft.Extensions.VectorData.Abstractions) and remove explicit SharpCompress/Snappier pinning in connector projects.
  • Apply compatibility fixes: add where TRecord : class constraints and add package-validation suppressions; update [VectorStoreVector(...)] usage in samples.

Reviewed changes

Copilot reviewed 56 out of 56 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
dotnet/src/VectorData/MongoDB/MongoDB.csproj Removes explicit SharpCompress/Snappier package pins.
dotnet/src/VectorData/CosmosMongoDB/CosmosMongoDB.csproj Removes explicit SharpCompress/Snappier package pins.
dotnet/src/SemanticKernel.UnitTests/SemanticKernel.UnitTests.csproj Swaps InMemory connector package dependency to CommunityToolkit.VectorData.InMemory.
dotnet/src/SemanticKernel.UnitTests/Data/VectorStoreTextSearchTests.cs Updates InMemory connector namespace usage for tests.
dotnet/src/SemanticKernel.UnitTests/Data/VectorStoreTextSearchTestBase.cs Updates InMemory connector namespace usage for tests.
dotnet/src/SemanticKernel.UnitTests/Data/TextSearchServiceCollectionExtensionsTests.cs Updates InMemory connector namespace usage for DI-related tests.
dotnet/src/SemanticKernel.Core/Data/TextSearch/VectorStoreTextSearch.cs Adds where TRecord : class constraint for vector-text-search implementation.
dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchServiceCollectionExtensions.cs Adds where TRecord : class constraint for DI registration extension.
dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchKernelBuilderExtensions.cs Adds where TRecord : class constraint for kernel builder registration extension.
dotnet/src/SemanticKernel.Core/CompatibilitySuppressions.xml Adds package-validation suppressions for the new generic constraints.
dotnet/src/SemanticKernel.AotTests/UnitTests/Search/MockVectorizableTextSearch.cs Adds where TRecord : class to satisfy updated vector search constraints.
dotnet/src/InternalUtilities/src/RestrictedInternalUtilities.props Excludes PathUtilities.cs from restricted shared utilities used by VectorData connectors.
dotnet/src/IntegrationTests/Plugins/ContextualFunctionProviderTests.cs Updates InMemory connector namespace for integration tests.
dotnet/src/IntegrationTests/IntegrationTests.csproj Adds CommunityToolkit.VectorData.InMemory package reference for integration tests.
dotnet/samples/GettingStartedWithVectorStores/Step4_Use_DynamicDataModel.cs Migrates Redis connector usage to CommunityToolkit.VectorData.Redis.
dotnet/samples/GettingStartedWithVectorStores/Step3_Switch_VectorStore.cs Migrates Azure AI Search + Redis connector usage to CommunityToolkit packages.
dotnet/samples/GettingStartedWithVectorStores/Step2_Vector_Search.cs Migrates InMemory connector usage to CommunityToolkit.VectorData.InMemory.
dotnet/samples/GettingStartedWithVectorStores/Step1_Ingest_Data.cs Migrates InMemory connector usage to CommunityToolkit.VectorData.InMemory.
dotnet/samples/GettingStartedWithVectorStores/Glossary.cs Updates [VectorStoreVector] attribute usage to new constructor form.
dotnet/samples/GettingStartedWithVectorStores/GettingStartedWithVectorStores.csproj Swaps vector connector package references to CommunityToolkit equivalents.
dotnet/samples/GettingStartedWithTextSearch/InMemoryVectorStoreFixture.cs Migrates InMemory connector usage to CommunityToolkit.VectorData.InMemory.
dotnet/samples/GettingStartedWithTextSearch/GettingStartedWithTextSearch.csproj Swaps InMemory connector package reference to CommunityToolkit.
dotnet/samples/Demos/VectorStoreRAG/VectorStoreRAG.csproj Migrates VectorStoreRAG demo to CommunityToolkit connector packages + adds Cosmos JSON-check disable property.
dotnet/samples/Demos/OnnxSimpleRAG/Program.cs Migrates InMemory connector usage + updates [VectorStoreVector] attribute usage.
dotnet/samples/Demos/OnnxSimpleRAG/OnnxSimpleRAG.csproj Swaps InMemory connector package reference to CommunityToolkit.
dotnet/samples/Demos/ModelContextProtocolClientServer/MCPServer/Program.cs Migrates InMemory connector usage to CommunityToolkit.
dotnet/samples/Demos/ModelContextProtocolClientServer/MCPServer/MCPServer.csproj Swaps InMemory connector package reference to CommunityToolkit.
dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/ChatWithAgent.ApiService.csproj Migrates Azure AI Search connector package reference to CommunityToolkit.
dotnet/samples/Concepts/Search/VectorStore_TextSearch.cs Migrates InMemory connector usage to CommunityToolkit.
dotnet/samples/Concepts/RAG/WithPlugins.cs Migrates InMemory connector usage to CommunityToolkit.
dotnet/samples/Concepts/Optimization/FrugalGPTWithFilters.cs Migrates InMemory connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VolatileVectorStore_LoadData.cs Migrates InMemory connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStoreLangchainInterop/RedisFactory.cs Migrates Redis connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStoreLangchainInterop/PineconeFactory.cs Removes Pinecone Langchain interop factory implementation.
dotnet/samples/Concepts/Memory/VectorStore_VectorSearch_Simple.cs Migrates InMemory connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_VectorSearch_Paging.cs Migrates InMemory connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_VectorSearch_MultiVector.cs Migrates InMemory connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_VectorSearch_MultiStore_Redis.cs Migrates Redis connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_VectorSearch_MultiStore_Qdrant.cs Migrates Qdrant connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_VectorSearch_MultiStore_Postgres.cs Migrates PgVector connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_VectorSearch_MultiStore_InMemory.cs Migrates InMemory connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_VectorSearch_MultiStore_AzureAISearch.cs Migrates Azure AI Search connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_Langchain_Interop.cs Removes Pinecone Langchain interop test scenario (keeps Redis scenario).
dotnet/samples/Concepts/Memory/VectorStore_HybridSearch_Simple_AzureAISearch.cs Migrates Azure AI Search connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_DynamicDataModel_Interop.cs Migrates Qdrant connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_DataIngestion_Simple.cs Migrates Qdrant connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_DataIngestion_MultiStore.cs Migrates InMemory/Qdrant/Redis connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_ConsumeFromMemoryStore_Redis.cs Migrates Redis connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_ConsumeFromMemoryStore_Qdrant.cs Migrates Qdrant connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/VectorStore_ConsumeFromMemoryStore_AzureAISearch.cs Migrates Azure AI Search connector usage to CommunityToolkit.
dotnet/samples/Concepts/Memory/HuggingFace_TextEmbeddingCustomHttpHandler.cs Migrates InMemory connector usage + updates [VectorStoreVector] attribute usage.
dotnet/samples/Concepts/Concepts.csproj Migrates Concepts sample project package references to CommunityToolkit + adds Cosmos JSON-check disable property.
dotnet/samples/Concepts/Caching/SemanticCachingWithFilters.cs Updates [VectorStoreVector] attribute usage to new constructor form.
dotnet/samples/Concepts/Agents/ChatCompletion_Rag.cs Migrates InMemory connector usage to CommunityToolkit.
dotnet/samples/Concepts/Agents/ChatCompletion_ContextualFunctionSelection.cs Migrates InMemory connector usage to CommunityToolkit.
dotnet/Directory.Packages.props Updates central dependency versions and adds CommunityToolkit.VectorData package versions.
Comments suppressed due to low confidence (1)

dotnet/samples/Concepts/Memory/VectorStore_Langchain_Interop.cs:31

  • The Pinecone Langchain interop scenario appears to have been removed (along with the PineconeFactory), but the PR description indicates Pinecone should be migrated to CommunityToolkit.VectorData.Pinecone. If Pinecone interop is still in scope, consider reintroducing this example using the new CT package; otherwise, update the PR description / sample narrative to reflect the dropped Pinecone scenario.
public class VectorStore_Langchain_Interop(ITestOutputHelper output) : BaseTest(output)
{
    /// <summary>
    /// Shows how to read data from a Redis collection that was created and ingested using Langchain.
    /// </summary>
    [Fact]
    public async Task ReadDataFromLangchainRedisAsync()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dotnet/Directory.Packages.props
Comment thread dotnet/samples/Concepts/Concepts.csproj
@adamsitnik Adam Sitnik (adamsitnik) added the msft.ext.vectordata Related to Microsoft.Extensions.VectorData label Jul 22, 2026
Comment thread dotnet/src/SemanticKernel.Core/CompatibilitySuppressions.xml
@adamsitnik
Adam Sitnik (adamsitnik) added this pull request to the merge queue Jul 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 24, 2026
@adamsitnik
Adam Sitnik (adamsitnik) added this pull request to the merge queue Jul 24, 2026
Merged via the queue into main with commit 61a6b0c Jul 24, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

msft.ext.vectordata Related to Microsoft.Extensions.VectorData

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants