Migrate VectorStoreRAG and Concepts samples to CommunityToolkit.VectorData packages - #14170
Conversation
Adam Sitnik (adamsitnik)
left a comment
There was a problem hiding this comment.
Copilot please address my feedback
…press/Snappier pins
Adam Sitnik (adamsitnik)
left a comment
There was a problem hiding this comment.
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.*
Fixed in the latest commit. All 6 failing projects have been migrated:
|
…ry package reference
There was a problem hiding this comment.
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 toCommunityToolkit.VectorData.*. - Update central package versions (including
MongoDB.DriverandMicrosoft.Extensions.VectorData.Abstractions) and remove explicitSharpCompress/Snappierpinning in connector projects. - Apply compatibility fixes: add
where TRecord : classconstraints 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.

Motivation and Context
Microsoft.SemanticKernel.Connectors.*vector store packages are moving toCommunityToolkit.VectorData.*. This updates theVectorStoreRAGandConceptssample projects to reference the new package IDs and namespaces.Description
Package reference updates (
Directory.Packages.props,VectorStoreRAG.csproj,Concepts.csproj):Microsoft.SemanticKernel.Connectors.AzureAISearchCommunityToolkit.VectorData.AzureAISearchMicrosoft.SemanticKernel.Connectors.CosmosMongoDBCommunityToolkit.VectorData.CosmosMongoDBMicrosoft.SemanticKernel.Connectors.CosmosNoSqlCommunityToolkit.VectorData.CosmosNoSqlMicrosoft.SemanticKernel.Connectors.InMemoryCommunityToolkit.VectorData.InMemoryMicrosoft.SemanticKernel.Connectors.PgVectorCommunityToolkit.VectorData.PgVectorMicrosoft.SemanticKernel.Connectors.QdrantCommunityToolkit.VectorData.QdrantMicrosoft.SemanticKernel.Connectors.RedisCommunityToolkit.VectorData.RedisMicrosoft.SemanticKernel.Connectors.WeaviateCommunityToolkit.VectorData.WeaviateNamespace updates :
DI extension methods (
AddInMemoryVectorStore,AddQdrantCollection, etc.) moved toMicrosoft.Extensions.DependencyInjectionin the CT packages — all affected files already had thatusing, so no additional changes needed there.API compatibility fixes:
[VectorStoreVector(Dimensions: N)]→[VectorStoreVector(N)]in two files — the newMicrosoft.Extensions.VectorData.Abstractionsconstructor uses a positional parameter nameddimensions(lowercase), so the old named-argument form no longer compiles.SharpCompresspin bumped0.48.0→0.48.1inDirectory.Packages.props—CommunityToolkit.VectorData.CosmosMongoDBpullsMongoDB.Driver 3.10.0which requires>= 0.48.1.<AzureCosmosDisableNewtonsoftJsonCheck>true</AzureCosmosDisableNewtonsoftJsonCheck>to both sample csproj files —CommunityToolkit.VectorData.CosmosNoSqlpullsMicrosoft.Azure.Cosmos 3.61.0which added a mandatory Newtonsoft.Json explicit-reference check not present in the prior version.Contribution Checklist