diff --git a/semantic-kernel/concepts/vector-store-connectors/embedding-generation.md b/semantic-kernel/concepts/vector-store-connectors/embedding-generation.md index e39074e16..69d48e1ca 100644 --- a/semantic-kernel/concepts/vector-store-connectors/embedding-generation.md +++ b/semantic-kernel/concepts/vector-store-connectors/embedding-generation.md @@ -56,7 +56,7 @@ Embedding generators implementing the `Microsoft.Extensions.AI` abstractions are ```csharp using Microsoft.Extensions.AI; - using Microsoft.SemanticKernel.Connectors.Qdrant; + using CommunityToolkit.VectorData.Qdrant; using OpenAI; using Qdrant.Client; @@ -78,7 +78,7 @@ Embedding generators implementing the `Microsoft.Extensions.AI` abstractions are ```csharp using Microsoft.Extensions.AI; - using Microsoft.SemanticKernel.Connectors.Qdrant; + using CommunityToolkit.VectorData.Qdrant; using OpenAI; using Qdrant.Client; @@ -103,7 +103,7 @@ Embedding generators implementing the `Microsoft.Extensions.AI` abstractions are ```csharp using Microsoft.Extensions.AI; using Microsoft.Extensions.VectorData; - using Microsoft.SemanticKernel.Connectors.Qdrant; + using CommunityToolkit.VectorData.Qdrant; using OpenAI; using Qdrant.Client; @@ -155,7 +155,6 @@ Embedding generators implementing the `Microsoft.Extensions.AI` abstractions are The following example demonstrates how to use the embedding generator to automatically generate vectors during both upsert and search operations. This approach simplifies workflows by eliminating the need to precompute embeddings manually. ```csharp - // The data model internal class FinanceInfo { diff --git a/semantic-kernel/concepts/vector-store-connectors/how-to/vector-store-data-ingestion.md b/semantic-kernel/concepts/vector-store-connectors/how-to/vector-store-data-ingestion.md index b95f203a5..36e1f9dba 100644 --- a/semantic-kernel/concepts/vector-store-connectors/how-to/vector-store-data-ingestion.md +++ b/semantic-kernel/concepts/vector-store-connectors/how-to/vector-store-data-ingestion.md @@ -57,14 +57,14 @@ The rest of these instructions will assume that you are using this container usi ## Create your project -Create a new project and add nuget package references for the Redis connector from Semantic Kernel, the open xml package to read the word +Create a new project and add NuGet package references for the Redis connector, the open xml package to read the word document with and the OpenAI connector from Semantic Kernel for generating embeddings. ```dotnetcli dotnet new console --framework net8.0 --name SKVectorIngest cd SKVectorIngest dotnet add package Microsoft.SemanticKernel.Connectors.AzureOpenAI -dotnet add package Microsoft.SemanticKernel.Connectors.Redis --prerelease +dotnet add package CommunityToolkit.VectorData.Redis dotnet add package DocumentFormat.OpenXml ``` diff --git a/semantic-kernel/concepts/vector-store-connectors/hybrid-search.md b/semantic-kernel/concepts/vector-store-connectors/hybrid-search.md index 0c771aca8..838a9b52a 100644 --- a/semantic-kernel/concepts/vector-store-connectors/hybrid-search.md +++ b/semantic-kernel/concepts/vector-store-connectors/hybrid-search.md @@ -93,7 +93,7 @@ Only connectors for databases that currently support vector plus keyword hybrid Assuming you have a collection that already contains data, you can easily do a hybrid search on it. Here is an example using Qdrant. ```csharp -using Microsoft.SemanticKernel.Connectors.Qdrant; +using CommunityToolkit.VectorData.Qdrant; using Microsoft.Extensions.VectorData; using Qdrant.Client; @@ -150,7 +150,7 @@ If no `AdditionalProperty` is provided and the data model contains only one full If the data model contains no full text search property or multiple full text search properties and `AdditionalProperty` is not provided, the search method will throw. ```csharp -using Microsoft.SemanticKernel.Connectors.Qdrant; +using CommunityToolkit.VectorData.Qdrant; using Microsoft.Extensions.VectorData; using Qdrant.Client; diff --git a/semantic-kernel/concepts/vector-store-connectors/index.md b/semantic-kernel/concepts/vector-store-connectors/index.md index 4da14b746..7f12e9655 100644 --- a/semantic-kernel/concepts/vector-store-connectors/index.md +++ b/semantic-kernel/concepts/vector-store-connectors/index.md @@ -258,7 +258,7 @@ Once you have defined your data model, the next step is to create a VectorStore In this example, we'll use Qdrant. You will therefore need to import the Qdrant nuget package. ```dotnetcli -dotnet add package Microsoft.SemanticKernel.Connectors.Qdrant --prerelease +dotnet add package CommunityToolkit.VectorData.Qdrant ``` If you want to run Qdrant locally using Docker, use the following command to start the Qdrant container @@ -275,7 +275,7 @@ Since databases support many different types of keys and records, we allow you t In our case, the type of record will be the `Hotel` class we already defined, and the type of key will be `ulong`, since the `HotelId` property is a `ulong` and Qdrant only supports `Guid` or `ulong` keys. ```csharp -using Microsoft.SemanticKernel.Connectors.Qdrant; +using CommunityToolkit.VectorData.Qdrant; using Qdrant.Client; // Create a Qdrant VectorStore object diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/azure-ai-search-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/azure-ai-search-connector.md index 4d31d2092..0c7da20e1 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/azure-ai-search-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/azure-ai-search-connector.md @@ -100,10 +100,10 @@ Notable Azure AI Search connector functionality limitations. Add the Azure AI Search Vector Store connector NuGet package to your project. ```dotnetcli -dotnet add package Microsoft.SemanticKernel.Connectors.AzureAISearch --prerelease +dotnet add package CommunityToolkit.VectorData.AzureAISearch ``` -You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. +You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by the connector package. ```csharp using Azure; @@ -120,7 +120,6 @@ kernelBuilder.Services ```csharp using Azure; using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; // Using IServiceCollection with ASP.NET Core. var builder = WebApplication.CreateBuilder(args); @@ -148,7 +147,6 @@ kernelBuilder.Services.AddAzureAISearchVectorStore(); using Azure; using Azure.Search.Documents.Indexes; using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; // Using IServiceCollection with ASP.NET Core. var builder = WebApplication.CreateBuilder(args); @@ -164,7 +162,7 @@ You can construct an Azure AI Search Vector Store instance directly. ```csharp using Azure; using Azure.Search.Documents.Indexes; -using Microsoft.SemanticKernel.Connectors.AzureAISearch; +using CommunityToolkit.VectorData.AzureAISearch; var vectorStore = new AzureAISearchVectorStore( new SearchIndexClient( @@ -177,7 +175,7 @@ It is possible to construct a direct reference to a named collection. ```csharp using Azure; using Azure.Search.Documents.Indexes; -using Microsoft.SemanticKernel.Connectors.AzureAISearch; +using CommunityToolkit.VectorData.AzureAISearch; var collection = new AzureAISearchCollection( new SearchIndexClient(new Uri(azureAISearchUri), new AzureKeyCredential(secret)), diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/azure-cosmosdb-mongodb-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/azure-cosmosdb-mongodb-connector.md index 749d4290b..685d2d95d 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/azure-cosmosdb-mongodb-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/azure-cosmosdb-mongodb-connector.md @@ -82,10 +82,10 @@ This connector is compatible with Azure Cosmos DB MongoDB (vCore) and is *not* d Add the Azure CosmosDB MongoDB Vector Store connector NuGet package to your project. ```dotnetcli -dotnet add package Microsoft.SemanticKernel.Connectors.CosmosMongoDB --prerelease +dotnet add package CommunityToolkit.VectorData.CosmosMongoDB ``` -You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. +You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by the connector package. ```csharp using Microsoft.Extensions.DependencyInjection; @@ -100,7 +100,6 @@ kernelBuilder.Services ```csharp using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; // Using IServiceCollection with ASP.NET Core. var builder = WebApplication.CreateBuilder(args); @@ -127,7 +126,6 @@ kernelBuilder.Services.AddCosmosMongoVectorStore(); ```csharp using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; using MongoDB.Driver; // Using IServiceCollection with ASP.NET Core. @@ -144,7 +142,7 @@ builder.Services.AddCosmosMongoVectorStore(); You can construct an Azure CosmosDB MongoDB Vector Store instance directly. ```csharp -using Microsoft.SemanticKernel.Connectors.CosmosMongoDB; +using CommunityToolkit.VectorData.CosmosMongoDB; using MongoDB.Driver; var mongoClient = new MongoClient(connectionString); @@ -155,7 +153,7 @@ var vectorStore = new CosmosMongoVectorStore(database); It is possible to construct a direct reference to a named collection. ```csharp -using Microsoft.SemanticKernel.Connectors.CosmosMongoDB; +using CommunityToolkit.VectorData.CosmosMongoDB; using MongoDB.Driver; var mongoClient = new MongoClient(connectionString); diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/azure-cosmosdb-nosql-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/azure-cosmosdb-nosql-connector.md index f803e6cd1..983a567dc 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/azure-cosmosdb-nosql-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/azure-cosmosdb-nosql-connector.md @@ -66,10 +66,10 @@ var cosmosClient = new CosmosClient(connectionString, new CosmosClientOptions() Add the Azure CosmosDB NoSQL Vector Store connector NuGet package to your project. ```dotnetcli -dotnet add package Microsoft.SemanticKernel.Connectors.CosmosNoSql --prerelease +dotnet add package CommunityToolkit.VectorData.CosmosNoSql ``` -You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. +You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by the connector package. ```csharp using Microsoft.Extensions.DependencyInjection; @@ -84,7 +84,6 @@ kernelBuilder.Services ```csharp using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; // Using IServiceCollection with ASP.NET Core. var builder = WebApplication.CreateBuilder(args); @@ -120,7 +119,6 @@ kernelBuilder.Services.AddCosmosNoSqlVectorStore(); using System.Text.Json; using Microsoft.Azure.Cosmos; using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; // Using IServiceCollection with ASP.NET Core. var builder = WebApplication.CreateBuilder(args); @@ -144,7 +142,7 @@ You can construct an Azure CosmosDB NoSQL Vector Store instance directly. ```csharp using System.Text.Json; using Microsoft.Azure.Cosmos; -using Microsoft.SemanticKernel.Connectors.CosmosNoSql; +using CommunityToolkit.VectorData.CosmosNoSql; var cosmosClient = new CosmosClient(connectionString, new CosmosClientOptions() { @@ -162,7 +160,7 @@ It is possible to construct a direct reference to a named collection. ```csharp using System.Text.Json; using Microsoft.Azure.Cosmos; -using Microsoft.SemanticKernel.Connectors.CosmosNoSql; +using CommunityToolkit.VectorData.CosmosNoSql; var cosmosClient = new CosmosClient(connectionString, new CosmosClientOptions() { @@ -192,7 +190,7 @@ must be passed to the `CosmosNoSqlCollection` on construction. ```csharp using System.Text.Json; using Microsoft.Azure.Cosmos; -using Microsoft.SemanticKernel.Connectors.CosmosNoSql; +using CommunityToolkit.VectorData.CosmosNoSql; var jsonSerializerOptions = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseUpper }; diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/couchbase-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/couchbase-connector.md index 33f0c4f51..fb4862298 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/couchbase-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/couchbase-connector.md @@ -43,7 +43,7 @@ Add the Couchbase Vector Store connector NuGet package to your project. dotnet add package CouchbaseConnector.SemanticKernel --prerelease ``` -You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. +You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by the connector package. ```csharp using Microsoft.SemanticKernel; diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/elasticsearch-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/elasticsearch-connector.md index 77ca5d74c..2e1db8552 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/elasticsearch-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/elasticsearch-connector.md @@ -48,7 +48,7 @@ Add the Elasticsearch Vector Store connector NuGet package to your project. dotnet add package Elastic.SemanticKernel.Connectors.Elasticsearch --prerelease ``` -You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. +You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by the connector package. ```csharp using Microsoft.SemanticKernel; diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/inmemory-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/inmemory-connector.md index b175ce213..742e75b6e 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/inmemory-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/inmemory-connector.md @@ -58,10 +58,10 @@ The connector has the following characteristics. Add the Semantic Kernel Core nuget package to your project. ```dotnetcli -dotnet add package Microsoft.SemanticKernel.Connectors.InMemory --prerelease +dotnet add package CommunityToolkit.VectorData.InMemory ``` -You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. +You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by the connector package. ```csharp using Microsoft.Extensions.DependencyInjection; @@ -76,7 +76,6 @@ kernelBuilder.Services ```csharp using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; // Using IServiceCollection with ASP.NET Core. var builder = WebApplication.CreateBuilder(args); @@ -86,7 +85,7 @@ builder.Services.AddInMemoryVectorStore(); You can construct an InMemory Vector Store instance directly. ```csharp -using Microsoft.SemanticKernel.Connectors.InMemory; +using CommunityToolkit.VectorData.InMemory; var vectorStore = new InMemoryVectorStore(); ``` @@ -94,7 +93,7 @@ var vectorStore = new InMemoryVectorStore(); It is possible to construct a direct reference to a named collection. ```csharp -using Microsoft.SemanticKernel.Connectors.InMemory; +using CommunityToolkit.VectorData.InMemory; var collection = new InMemoryCollection("skhotels"); ``` diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracle-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracle-connector.md index 0cefce4a0..f0cf0c81b 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracle-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracle-connector.md @@ -104,7 +104,7 @@ Add the Oracle Database Vector Store connector NuGet package to your project. dotnet add package Oracle.VectorData --prerelease ``` -You can add the vector store to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. In this case, an instance of the `Oracle.VectorData.OracleVectorStore` class also gets registered with the container. +You can add the vector store to the `IServiceCollection` dependency injection container using extension methods provided by the connector package. In this case, an instance of the `Oracle.VectorData.OracleVectorStore` class also gets registered with the container. ```csharp using Microsoft.SemanticKernel; diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/pinecone-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/pinecone-connector.md index 9bbc98c62..cf60922b2 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/pinecone-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/pinecone-connector.md @@ -13,7 +13,7 @@ ms.service: semantic-kernel ::: zone pivot="programming-language-csharp" > [!WARNING] -> The Pinecone Vector Store functionality is in preview, and improvements that require breaking changes may still occur in limited circumstances before release. +> Pinecone has dropped the .NET SDK support by archiving [their repository](https://github.com/pinecone-io/pinecone-dotnet-client). ::: zone-end ::: zone pivot="programming-language-python" @@ -27,170 +27,6 @@ ms.service: semantic-kernel > [!WARNING] > The Semantic Kernel Vector Store functionality is in preview, and improvements that require breaking changes may still occur in limited circumstances before release. -::: zone-end - -::: zone pivot="programming-language-csharp" - -## Overview - -The Pinecone Vector Store connector can be used to access and manage data in Pinecone. The connector has the following characteristics. - -| Feature Area | Support | -| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -| Collection maps to | Pinecone serverless Index | -| Supported key property types | string | -| Supported data property types | | -| Supported vector property types | | -| Supported index types | PGA (Pinecone Graph Algorithm) | -| Supported distance functions | | -| Supported filter clauses | | -| Supports multiple vectors in a record | No | -| IsIndexed supported? | Yes | -| IsFullTextIndexed supported? | No | -| StorageName supported? | Yes | -| HybridSearch supported? | No | -| Integrated Embeddings supported? | No | - -## Getting started - -Add the Pinecone Vector Store connector NuGet package to your project. - -```dotnetcli -dotnet add package Microsoft.SemanticKernel.Connectors.Pinecone --prerelease -``` - -You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. - -```csharp -using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; - -// Using Kernel Builder. -var kernelBuilder = Kernel - .CreateBuilder(); -kernelBuilder.Services - .AddPineconeVectorStore(pineconeApiKey); -``` - -```csharp -using Microsoft.Extensions.DependencyInjection; - -// Using IServiceCollection with ASP.NET Core. -var builder = WebApplication.CreateBuilder(args); -builder.Services.AddPineconeVectorStore(pineconeApiKey); -``` - -Extension methods that take no parameters are also provided. These require an instance of the `PineconeClient` to be separately registered with the dependency injection container. - -```csharp -using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; -using PineconeClient = Pinecone.PineconeClient; - -// Using Kernel Builder. -var kernelBuilder = Kernel.CreateBuilder(); -kernelBuilder.Services.AddSingleton( - sp => new PineconeClient(pineconeApiKey)); -kernelBuilder.Services.AddPineconeVectorStore(); -``` - -```csharp -using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; -using PineconeClient = Pinecone.PineconeClient; - -// Using IServiceCollection with ASP.NET Core. -var builder = WebApplication.CreateBuilder(args); -builder.Services.AddSingleton( - sp => new PineconeClient(pineconeApiKey)); -builder.Services.AddPineconeVectorStore(); -``` - -You can construct a Pinecone Vector Store instance directly. - -```csharp -using Microsoft.SemanticKernel.Connectors.Pinecone; -using PineconeClient = Pinecone.PineconeClient; - -var vectorStore = new PineconeVectorStore( - new PineconeClient(pineconeApiKey)); -``` - -It is possible to construct a direct reference to a named collection. - -```csharp -using Microsoft.SemanticKernel.Connectors.Pinecone; -using PineconeClient = Pinecone.PineconeClient; - -var collection = new PineconeCollection( - new PineconeClient(pineconeApiKey), - "skhotels"); -``` - -## Index Namespace - -The Vector Store abstraction does not support a multi tiered record grouping mechanism. Collections in the abstraction map to a Pinecone serverless index -and no second level exists in the abstraction. Pinecone does support a second level of grouping called namespaces. - -By default the Pinecone connector will pass null as the namespace for all operations. However it is possible to pass a single namespace to the -Pinecone collection when constructing it and use this instead for all operations. - -```csharp -using Microsoft.SemanticKernel.Connectors.Pinecone; -using PineconeClient = Pinecone.PineconeClient; - -var collection = new PineconeCollection( - new PineconeClient(pineconeApiKey), - "skhotels", - new() { IndexNamespace = "seasidehotels" }); -``` - -## Data mapping - -The Pinecone connector provides a default mapper when mapping data from the data model to storage. -Pinecone requires properties to be mapped into id, metadata and values groupings. -The default mapper uses the model annotations or record definition to determine the type of each property and to do this mapping. - -- The data model property annotated as a key will be mapped to the Pinecone id property. -- The data model properties annotated as data will be mapped to the Pinecone metadata object. -- The data model property annotated as a vector will be mapped to the Pinecone vector property. - -### Property name override - -For data properties, you can provide override field names to use in storage that is different to the -property names on the data model. This is not supported for keys, since a key has a fixed name in Pinecone. -It is also not supported for vectors, since the vector is stored under a fixed name `values`. -The property name override is done by setting the `StorageName` option via the data model attributes or record definition. - -Here is an example of a data model with `StorageName` set on its attributes and how that will be represented in Pinecone. - -```csharp -using Microsoft.Extensions.VectorData; - -public class Hotel -{ - [VectorStoreKey] - public string HotelId { get; set; } - - [VectorStoreData(IsIndexed = true, StorageName = "hotel_name")] - public string HotelName { get; set; } - - [VectorStoreData(IsFullTextIndexed = true, StorageName = "hotel_description")] - public string Description { get; set; } - - [VectorStoreVector(Dimensions: 4, DistanceFunction = DistanceFunction.CosineSimilarity, IndexKind = IndexKind.Hnsw)] - public ReadOnlyMemory? DescriptionEmbedding { get; set; } -} -``` - -```json -{ - "id": "h1", - "values": [0.9, 0.1, 0.1, 0.1], - "metadata": { "hotel_name": "Hotel Happy", "hotel_description": "A place where everyone can be happy." } -} -``` - ::: zone-end ::: zone pivot="programming-language-python" diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/postgres-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/postgres-connector.md index 1b5c437a2..3f14d2df5 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/postgres-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/postgres-connector.md @@ -72,10 +72,10 @@ When using the `AddPostgresVectorStore` dependency injection registration method Add the Postgres Vector Store connector NuGet package to your project. ```dotnetcli -dotnet add package Microsoft.SemanticKernel.Connectors.PgVector --prerelease +dotnet add package CommunityToolkit.VectorData.PgVector ``` -You can add the vector store to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. +You can add the vector store to the `IServiceCollection` dependency injection container using extension methods provided by the connector package. ```csharp using Microsoft.Extensions.DependencyInjection; @@ -90,7 +90,6 @@ Extension methods that take no parameters are also provided. These require an in ```csharp using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; // Using IServiceCollection with ASP.NET Core. var builder = WebApplication.CreateBuilder(args); @@ -99,7 +98,6 @@ builder.Services.AddPostgresVectorStore(""); ```csharp using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; using Npgsql; // Using IServiceCollection with ASP.NET Core. @@ -116,7 +114,7 @@ builder.Services.AddPostgresVectorStore(); You can construct a Postgres Vector Store instance directly with a custom data source or with a connection string. ```csharp -using Microsoft.SemanticKernel.Connectors.PgVector; +using CommunityToolkit.VectorData.PgVector; using Npgsql; NpgsqlDataSourceBuilder dataSourceBuilder = new(""); @@ -126,7 +124,7 @@ var vectorStore = new PostgresVectorStore(dataSource, ownsDataSource: true); ``` ```csharp -using Microsoft.SemanticKernel.Connectors.PgVector; +using CommunityToolkit.VectorData.PgVector; var connection = new PostgresVectorStore(""); ``` @@ -134,7 +132,7 @@ var connection = new PostgresVectorStore(""); It is possible to construct a direct reference to a named collection with a custom data source or with a connection string. ```csharp -using Microsoft.SemanticKernel.Connectors.PgVector; +using CommunityToolkit.VectorData.PgVector; using Npgsql; NpgsqlDataSourceBuilder dataSourceBuilder = new(""); @@ -145,7 +143,7 @@ var collection = new PostgresCollection(dataSource, "skhotels", o ``` ```csharp -using Microsoft.SemanticKernel.Connectors.PgVector; +using CommunityToolkit.VectorData.PgVector; var collection = new PostgresCollection("", "skhotels"); ``` @@ -335,7 +333,7 @@ public static class NpgsqlDataSourceBuilderExtensions Now you can use the `UseEntraAuthentication` method to set up the connection string for the Postgres connector: ```csharp -using Microsoft.SemanticKernel.Connectors.Postgres; +using CommunityToolkit.VectorData.PgVector; var connectionString = "Host=mydb.postgres.database.azure.com;Port=5432;Database=postgres;SSL Mode=Require;"; // No Username or Password var dataSourceBuilder = new NpgsqlDataSourceBuilder(connectionString); diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/qdrant-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/qdrant-connector.md index 67b75cbc8..9ceed691c 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/qdrant-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/qdrant-connector.md @@ -83,10 +83,10 @@ Not currently supported. Add the Qdrant Vector Store connector NuGet package to your project. ```dotnetcli -dotnet add package Microsoft.SemanticKernel.Connectors.Qdrant --prerelease +dotnet add package CommunityToolkit.VectorData.Qdrant ``` -You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. +You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by the connector package. ```csharp using Microsoft.Extensions.DependencyInjection; @@ -122,7 +122,6 @@ kernelBuilder.Services.AddQdrantVectorStore(); ```csharp using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; using Qdrant.Client; // Using IServiceCollection with ASP.NET Core. @@ -134,7 +133,7 @@ builder.Services.AddQdrantVectorStore(); You can construct a Qdrant Vector Store instance directly. ```csharp -using Microsoft.SemanticKernel.Connectors.Qdrant; +using CommunityToolkit.VectorData.Qdrant; using Qdrant.Client; var vectorStore = new QdrantVectorStore(new QdrantClient("localhost"), ownsClient: true); @@ -143,7 +142,7 @@ var vectorStore = new QdrantVectorStore(new QdrantClient("localhost"), ownsClien It is possible to construct a direct reference to a named collection. ```csharp -using Microsoft.SemanticKernel.Connectors.Qdrant; +using CommunityToolkit.VectorData.Qdrant; using Qdrant.Client; var collection = new QdrantCollection( @@ -387,7 +386,7 @@ To enable named vectors mode, pass this as an option when constructing a Vector The same options can also be passed to any of the provided dependency injection container extension methods. ```csharp -using Microsoft.SemanticKernel.Connectors.Qdrant; +using CommunityToolkit.VectorData.Qdrant; using Qdrant.Client; var vectorStore = new QdrantVectorStore( diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/redis-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/redis-connector.md index 5b1006191..150f34081 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/redis-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/redis-connector.md @@ -57,10 +57,10 @@ The connector has the following characteristics. Add the Redis Vector Store connector nuget package to your project. ```dotnetcli -dotnet add package Microsoft.SemanticKernel.Connectors.Redis --prerelease +dotnet add package CommunityToolkit.VectorData.Redis ``` -You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. +You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by the connector package. ```csharp using Microsoft.Extensions.DependencyInjection; @@ -74,7 +74,7 @@ kernelBuilder.Services ``` ```csharp -using Microsoft.SemanticKernel; +using Microsoft.Extensions.DependencyInjection; // Using IServiceCollection with ASP.NET Core. var builder = WebApplication.CreateBuilder(args); @@ -96,7 +96,6 @@ kernelBuilder.Services.AddRedisVectorStore(); ```csharp using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; using StackExchange.Redis; // Using IServiceCollection with ASP.NET Core. @@ -108,7 +107,7 @@ builder.Services.AddRedisVectorStore(); You can construct a Redis Vector Store instance directly. ```csharp -using Microsoft.SemanticKernel.Connectors.Redis; +using CommunityToolkit.VectorData.Redis; using StackExchange.Redis; var vectorStore = new RedisVectorStore(ConnectionMultiplexer.Connect("localhost:6379").GetDatabase()); @@ -118,7 +117,7 @@ It is possible to construct a direct reference to a named collection. When doing so, you have to choose between the JSON or Hashes instance depending on how you wish to store data in Redis. ```csharp -using Microsoft.SemanticKernel.Connectors.Redis; +using CommunityToolkit.VectorData.Redis; using StackExchange.Redis; // Using Hashes. @@ -128,7 +127,7 @@ var hashesCollection = new RedisHashSetCollection( ``` ```csharp -using Microsoft.SemanticKernel.Connectors.Redis; +using CommunityToolkit.VectorData.Redis; using StackExchange.Redis; // Using JSON. @@ -141,7 +140,7 @@ When constructing a `RedisVectorStore` or registering it with the dependency inj that configures the preferred storage type / mode used: Hashes or JSON. If not specified, the default is JSON. ```csharp -using Microsoft.SemanticKernel.Connectors.Redis; +using CommunityToolkit.VectorData.Redis; using StackExchange.Redis; var vectorStore = new RedisVectorStore( @@ -282,7 +281,7 @@ off the prefixing behavior and pass in the fully prefixed key to the record oper ::: zone pivot="programming-language-csharp" ```csharp -using Microsoft.SemanticKernel.Connectors.Redis; +using CommunityToolkit.VectorData.Redis; using StackExchange.Redis; var collection = new RedisJsonCollection( diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/sql-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/sql-connector.md index 4773bf51f..286c9c1e0 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/sql-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/sql-connector.md @@ -53,10 +53,10 @@ The SQL Server Vector Store connector can be used to access and manage data in S Add the SQL Sever Vector Store connector NuGet package to your project. ```dotnetcli -dotnet add package Microsoft.SemanticKernel.Connectors.SqlServer --prerelease +dotnet add package CommunityToolkit.VectorData.SqlServer ``` -You can add the vector store to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. +You can add the vector store to the `IServiceCollection` dependency injection container using extension methods provided by the connector package. ```csharp using Microsoft.Extensions.DependencyInjection; @@ -68,7 +68,6 @@ builder.Services.AddSqlServerVectorStore(_ => ""); ```csharp using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; // Using IServiceCollection with ASP.NET Core. var builder = WebApplication.CreateBuilder(args); @@ -78,7 +77,7 @@ builder.Services.AddSqlServerVectorStore(_ => "") You can construct a Sql Server Vector Store instance directly. ```csharp -using Microsoft.SemanticKernel.Connectors.SqlServer; +using CommunityToolkit.VectorData.SqlServer; var vectorStore = new SqlServerVectorStore(""); ``` @@ -86,7 +85,7 @@ var vectorStore = new SqlServerVectorStore(""); It is possible to construct a direct reference to a named collection. ```csharp -using Microsoft.SemanticKernel.Connectors.SqlServer; +using CommunityToolkit.VectorData.SqlServer; var collection = new SqlServerCollection("", "skhotels"); ``` diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/sqlite-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/sqlite-connector.md index b9d5f71cc..962c97c2a 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/sqlite-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/sqlite-connector.md @@ -55,10 +55,10 @@ The SQLite Vector Store connector can be used to access and manage data in SQLit Add the SQLite Vector Store connector NuGet package to your project. ```dotnetcli -dotnet add package Microsoft.SemanticKernel.Connectors.SqliteVec --prerelease +dotnet add package CommunityToolkit.VectorData.SqliteVec --prerelease ``` -You can add the vector store to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. +You can add the vector store to the `IServiceCollection` dependency injection container using extension methods provided by the connector package. ```csharp using Microsoft.Extensions.DependencyInjection; @@ -70,7 +70,6 @@ builder.Services.AddSqliteVectorStore(_ => "Data Source=:memory:"); ```csharp using Microsoft.Extensions.DependencyInjection; -using Microsoft.SemanticKernel; // Using IServiceCollection with ASP.NET Core. var builder = WebApplication.CreateBuilder(args); @@ -80,7 +79,7 @@ builder.Services.AddSqliteVectorStore(_ => "Data Source=:memory:") You can construct a SQLite Vector Store instance directly. ```csharp -using Microsoft.SemanticKernel.Connectors.SqliteVec; +using CommunityToolkit.VectorData.SqliteVec; var vectorStore = new SqliteVectorStore("Data Source=:memory:"); ``` @@ -88,7 +87,7 @@ var vectorStore = new SqliteVectorStore("Data Source=:memory:"); It is possible to construct a direct reference to a named collection. ```csharp -using Microsoft.SemanticKernel.Connectors.SqliteVec; +using CommunityToolkit.VectorData.SqliteVec; var collection = new SqliteCollection("Data Source=:memory:", "skhotels"); ``` diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/weaviate-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/weaviate-connector.md index 9c7bb1d04..67bb0596c 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/weaviate-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/weaviate-connector.md @@ -89,10 +89,10 @@ Notable Weaviate connector functionality limitations. Add the Weaviate Vector Store connector NuGet package to your project. ```dotnetcli -dotnet add package Microsoft.SemanticKernel.Connectors.Weaviate --prerelease +dotnet add package CommunityToolkit.VectorData.Weaviate ``` -You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by Semantic Kernel. +You can add the vector store to the dependency injection container available on the `KernelBuilder` or to the `IServiceCollection` dependency injection container using extension methods provided by the connector package. The Weaviate vector store uses an `HttpClient` to communicate with the Weaviate service. There are two options for providing the URL/endpoint for the Weaviate service. It can be provided via options or by setting the base address of the `HttpClient`. @@ -146,7 +146,7 @@ You can construct a Weaviate Vector Store instance directly as well. ```csharp using System.Net.Http; -using Microsoft.SemanticKernel.Connectors.Weaviate; +using CommunityToolkit.VectorData.Weaviate; var vectorStore = new WeaviateVectorStore( new HttpClient { BaseAddress = new Uri("http://localhost:8080/v1/") }); @@ -156,7 +156,7 @@ It is possible to construct a direct reference to a named collection. ```csharp using System.Net.Http; -using Microsoft.SemanticKernel.Connectors.Weaviate; +using CommunityToolkit.VectorData.Weaviate; var collection = new WeaviateCollection( new HttpClient { BaseAddress = new Uri("http://localhost:8080/v1/") }, diff --git a/semantic-kernel/concepts/vector-store-connectors/vector-search.md b/semantic-kernel/concepts/vector-store-connectors/vector-search.md index 30d633d2f..804f47412 100644 --- a/semantic-kernel/concepts/vector-store-connectors/vector-search.md +++ b/semantic-kernel/concepts/vector-store-connectors/vector-search.md @@ -46,7 +46,7 @@ Note that `VectorStoreCollection` implements from `IVectorSearcha Assuming you have a collection that already contains data, you can easily search it. Here is an example using Qdrant. ```csharp -using Microsoft.SemanticKernel.Connectors.Qdrant; +using CommunityToolkit.VectorData.Qdrant; using Microsoft.Extensions.VectorData; using Qdrant.Client; @@ -100,7 +100,7 @@ If the data model contains no vector or multiple vectors and `VectorProperty` is ```csharp using Microsoft.Extensions.VectorData; -using Microsoft.SemanticKernel.Connectors.InMemory; +using CommunityToolkit.VectorData.InMemory; var vectorStore = new InMemoryVectorStore(); var collection = vectorStore.GetCollection("skproducts"); diff --git a/semantic-kernel/get-started/supported-languages.md b/semantic-kernel/get-started/supported-languages.md index 3cf9d4ff2..aa10c12e4 100644 --- a/semantic-kernel/get-started/supported-languages.md +++ b/semantic-kernel/get-started/supported-languages.md @@ -40,15 +40,14 @@ In C#, there are several packages to help ensure that you only need to import th | `Microsoft.SemanticKernel.Connectors.Ollama` | The AI connector for Ollama | | `Microsoft.SemanticKernel.Connectors.Onnx` | The AI connector for Onnx | | `Microsoft.SemanticKernel.Connectors.OpenAI` | The AI connector for OpenAI | -| `Microsoft.SemanticKernel.Connectors.AzureAISearch` | The vector store connector for Azure AI Search | -| `Microsoft.SemanticKernel.Connectors.CosmosMongoDB` | The vector store connector for Azure CosmosDB MongoDB | -| `Microsoft.SemanticKernel.Connectors.CosmosNoSql` | The vector store connector for Azure CosmosDB NoSQL | -| `Microsoft.SemanticKernel.Connectors.MongoDB` | The vector store connector for MongoDB | -| `Microsoft.SemanticKernel.Connectors.Pinecone` | The vector store connector for Pinecone | -| `Microsoft.SemanticKernel.Connectors.Qdrant` | The vector store connector for Qdrant | -| `Microsoft.SemanticKernel.Connectors.Redis` | The vector store connector for Redis | -| `Microsoft.SemanticKernel.Connectors.SqliteVec` | The vector store connector for Sqlite | -| `Microsoft.SemanticKernel.Connectors.Weaviate` | The vector store connector for Weaviate | +| `CommunityToolkit.VectorData.AzureAISearch` | The vector store connector for Azure AI Search | +| `CommunityToolkit.VectorData.CosmosMongoDB` | The vector store connector for Azure CosmosDB MongoDB | +| `CommunityToolkit.VectorData.CosmosNoSql` | The vector store connector for Azure CosmosDB NoSQL | +| `MongoDB.VectorData` | The vector store connector for MongoDB | +| `CommunityToolkit.VectorData.Qdrant` | The vector store connector for Qdrant | +| `CommunityToolkit.VectorData.Redis` | The vector store connector for Redis | +| `CommunityToolkit.VectorData.SqliteVec` | The vector store connector for Sqlite | +| `CommunityToolkit.VectorData.Weaviate` | The vector store connector for Weaviate | | `Microsoft.SemanticKernel.Plugins.OpenApi` (Experimental) | Enables loading plugins from OpenAPI specifications | | `Microsoft.SemanticKernel.PromptTemplates.Handlebars` | Enables the use of Handlebars templates for prompts | | `Microsoft.SemanticKernel.Yaml` | Provides support for serializing prompts using YAML files |