From 953d12f34174938bb151ae96efa74eee424dc229 Mon Sep 17 00:00:00 2001 From: Minal Agashe Date: Thu, 14 Aug 2025 12:14:04 +0530 Subject: [PATCH 1/9] Added oracle-db connector information. --- .../oracledb-connector.md | 267 ++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracledb-connector.md diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracledb-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracledb-connector.md new file mode 100644 index 00000000..42d877dd --- /dev/null +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracledb-connector.md @@ -0,0 +1,267 @@ +# Using the Oracle Database Vector Store connector (Preview) + +::: zone pivot="programming-language-csharp" + +> [!WARNING] +> The Oracle Database 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-python" + +> [!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-java" + +> [!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 + +## Overview + +The Oracle Database Vector Store Connector can be used to access and manage data in Oracle Database. The connector has the following characteristics. + +::: zone pivot="programming-language-csharp" + +| Feature Area | Support | +| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Collection maps to | Oracle database table | +| Supported key property types | | +| Supported data property types | | +| Supported vector property types | | +| Supported index types | | +| Supported distance functions | | +| Supported filter clauses | | +| Supports multiple vectors in a record | Yes | +| IsIndexed supported? | Yes | +| IsFullTextSearchable supported? | No | +| StorageName supported? | Yes | +| HybridSearch supported? | No | +| Restricted at least one vector | Yes | +| Allow multiple primary keys | No | + +Vector data searches require Oracle Database 23ai. All other Oracle connector features are available using Oracle Database 19c or higher. + +::: zone-end +::: zone pivot="programming-language-python" +More information coming soon. +::: zone-end +::: zone pivot="programming-language-java" + +More information coming soon. + +::: zone-end + +::: zone pivot="programming-language-csharp" + +## Getting started + +Add the Oracle Database Vector Store connector NuGet package to your project. + +```dotnetcli +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. + +```csharp +using Microsoft.SemanticKernel; +using Oracle.VectorData; +using Microsoft.Extensions.DependencyInjection; + +// Using Kernel Builder. +var builder = Kernel.CreateBuilder(); +builder.Services.AddOracleVectorStore(""); +``` + +```csharp +using Microsoft.AspNetCore.Builder; +using Oracle.VectorData; +using Microsoft.Extensions.DependencyInjection; + +// Using IServiceCollection with ASP.NET Core. +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddOracleVectorStore(""); +``` + +Extension methods that take no parameters are also available. These require an instance of the `Oracle.ManagedDataAccess.Client.OracleDataSource` class to be separately registered with the dependency injection container. + +```csharp +using Microsoft.SemanticKernel; +using Oracle.VectorData; +using Microsoft.Extensions.DependencyInjection; +using Oracle.ManagedDataAccess.Client; + +// Using Kernel Builder. +var kernelBuilder = Kernel.CreateBuilder(); +builder.Services.AddSingleton(sp => +{ + OracleDataSourceBuilder dataSourceBuilder = new(""); + return dataSourceBuilder.Build(); +}); + +builder.Services.AddOracleVectorStore(); +``` + +```csharp +using Microsoft.AspNetCore.Builder; +using Oracle.VectorData; +using Microsoft.Extensions.DependencyInjection; +using Oracle.ManagedDataAccess.Client; + +// Using IServiceCollection with ASP.NET Core. +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddSingleton(sp => +{ + OracleDataSourceBuilder dataSourceBuilder = new(""); + return dataSourceBuilder.Build(); +}); + +builder.Services.AddOracleVectorStore(); +``` + +You can construct an Oracle Database Vector Store instance directly with a custom data source or with a connection string. + +```csharp +using Oracle.VectorData; +using Oracle.ManagedDataAccess.Client; + +OracleDataSourceBuilder dataSourceBuilder = new(""); +var dataSource = dataSourceBuilder.Build(); + +var connection = new OracleVectorStore(dataSource); +``` + +```csharp +using Oracle.VectorData; + +var connection = new OracleVectorStore(""); +``` + +It is possible to construct a direct reference to a named collection with a custom data source or with a connection string. + +```csharp +using Oracle.VectorData; +using Oracle.ManagedDataAccess.Client; + +OracleDataSourceBuilder dataSourceBuilder = new(""); +var dataSource = dataSourceBuilder.Build(); + +var collection = new OracleCollection(dataSource, "skhotels"); +``` + +```csharp +using Oracle.VectorData; + +var collection = new OracleCollection(""); +``` + +::: zone-end + +::: zone pivot="programming-language-python" + +## Getting started + +More information coming soon. +::: zone-end +::: zone pivot="programming-language-java" + +## Getting started + +More information coming soon. +::: zone-end +::: zone pivot="programming-language-csharp" + +## Data mapping + +The Oracle Database Vector Store connector provides a default mapper when mapping data from the data model to storage. This mapper does a direct conversion of the data model properties list to the Oracle database columns to convert to the storage schema. + +The Oracle Database Vector Store connector allows the application to provide a custom mapper in combination with a `VectorStoreCollectionDefinition`. In this case, the `VectorStoreCollectionDefinition` can differ from the supplied data model. The `VectorStoreCollectionDefinition` is used to define the database schema, while the data model is used to interact with the vector store. A custom mapper is required in this case to map from the data model to the custom database schema defined by the `VectorStoreCollectionDefinition`. + +The following table shows the default primary key data type mapping between Oracle database and C#: + +| C# Data Type | Database Type | +| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| short/int16 | NUMBER(5) | +| int/int32 | NUMBER(10) | +| long/int64 | NUMBER(19) | +| string | NVARCHAR2(2000) | +| Guid | RAW(16) | + +The following table shows the default data property type mapping, including nullable types: + +| C# Data Type | Database Type | +| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| bool | BOOLEAN for Oracle Database 23ai and higher
NUMBER(1) for earlier versions | +| byte | NUMBER(3) | +| short/int16 | NUMBER(5) | +| int/int32 | NUMBER(10) | +| decimal | NUMBER(18,2) | +| long/int64 | NUMBER(19) | +| float | BINARY_FLOAT | +| double | BINARY_DOUBLE | +| DateTime | TIMESTAMP(7) | +| DateTimeOffset | TIMESTAMP(7) WITH TIME ZONE | +| TimeSpan | INTERVAL DAY(8) TO SECOND(7) | +| char | NVARCHAR2(1) | +| char[] | NVARCHAR2(2000) | +| byte[] | RAW(2000) | +| string | NVARCHAR2(2000) | +| Guid | RAW(16) | + +Starting with Oracle Database 23ai, database vectors can be mapped to .NET. data types. Multiple vector columns are supported. The following table shows the default vector property type mapping, including nullable types: + +| C# Data Type | Database Type | +| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|
  • ReadOnlyMemory\
  • Embedding\
  • BinaryEmbedding
  • Embedding\
  • byte[]
  • System.Byte[]
  • BitArray
| VECTOR(dimensions, BINARY) | +|
  • ReadOnlyMemory\
  • ReadOnlyMemory\
  • Embedding\
  • Embedding\
  • short[]
  • System.Int16[]
| VECTOR(dimensions, INT8) | +|
  • ReadOnlyMemory\
  • ReadOnlyMemory\
  • Embedding\
  • Embedding\
  • double[]
  • System.Double[]
| VECTOR(dimensions, FLOAT64) | +|
  • ReadOnlyMemory\
  • ReadOnlyMemory\
  • Embedding\
  • Embedding\
  • float[]
  • System.Float[]
| VECTOR(dimensions, FLOAT32) | + +### Property name override + +For data properties and vector properties, you can override names to use in storage that are different from the data model property names. The property name override occurs when setting the `StorageName` option either in the data model properties or record definition. + +Here is a data model with `StorageName` set code sample and how that will be represented in an Oracle SQL command. + +```csharp +using Microsoft.Extensions.VectorData; + +public class Hotel +{ + [VectorStoreKey] + public long HotelId { get; set; } + + [VectorStoreData(StorageName = "hotel_name")] + public string? HotelName { get; set; } + + [VectorStoreData(StorageName = "hotel_description")] + public string? Description { get; set; } + + [VectorStoreVector(Dimensions: 384, DistanceFunction = DistanceFunction.CosineDistance)] + public ReadOnlyMemory? DescriptionEmbedding { get; set; } +} +``` + +```SQL +CREATE TABLE "MYSCHEMA"."Hotels" + ("HotelId" NUMBER(10), + "hotel_name" NVARCHAR2(2000), + "hotel_description" NVARCHAR2(2000), + "DescriptionEmbedding" VECTOR(384, FLOAT32), + PRIMARY KEY ( "HotelId" ) +); +``` + +## Learn More +Refer to the following Oracle Database Vector Store connector resources to learn more: +- [Documentation: Oracle Database Vector Store Connector Classes for Semantic Kernel (.NET) APIs](https://docs-uat.us.oracle.com/en/database/oracle/oracle-database/23/odpnt/oracle-database-vector-store-provider-classes-microsoft-vector-stores-and-semantic-kernel1.html) +Contains information on Oracle Database Vector Store connector classes for adding data, retrieving data, and performing vector search in the Oracle vector database. +- Sample Code: Oracle Database Vector Store Connector for Semantic Kernel (.NET) + - Coming soon +- [Documentation: Oracle Data Provider for .NET](https://docs-uat.us.oracle.com/en/database/oracle/oracle-database/23/odpnt/intro.html) +Contains information on Oracle Data Provider for .NET (ODP.NET), the ADO.NET data provider for Oracle Database Vector Store connector. + +::: zone-end From f4d981982b8bd76c2b743f1f366509eca5cbaf62 Mon Sep 17 00:00:00 2001 From: Minal Agashe Date: Thu, 14 Aug 2025 12:32:22 +0530 Subject: [PATCH 2/9] Added oracledb-connector information. --- .../vector-store-connectors/out-of-the-box-connectors/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/index.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/index.md index 77ecf733..82430680 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/index.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/index.md @@ -47,6 +47,7 @@ Semantic Kernel provides a number of out-of-the-box Vector Store integrations ma | Milvus | Planned | | | | [MongoDB](./mongodb-connector.md) | ✅ | ✅ | Microsoft Semantic Kernel Project | | [Neon Serverless Postgres](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/neon1722366567200.neon_serverless_postgres_azure_prod) |Use [Postgres Connector](./postgres-connector.md)| ✅ | Microsoft Semantic Kernel Project | +[OracleDB](./oracledb-connector.md) | ✅ | ✅ | Microsoft Semantic Kernel Project | [Pinecone](./pinecone-connector.md) | ✅ | ❌ | Microsoft Semantic Kernel Project | | [Postgres](./postgres-connector.md) | ✅ | ✅ | Microsoft Semantic Kernel Project | | [Qdrant](./qdrant-connector.md) | ✅ | ✅ | Microsoft Semantic Kernel Project | From e5eb9149f47a40a53e7b069766ffeebda52d8267 Mon Sep 17 00:00:00 2001 From: Minal Agashe Date: Thu, 14 Aug 2025 14:35:43 +0530 Subject: [PATCH 3/9] Updated oracledb-connector for the correct documentation links --- .../out-of-the-box-connectors/oracledb-connector.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracledb-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracledb-connector.md index 42d877dd..946b336e 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracledb-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracledb-connector.md @@ -257,11 +257,11 @@ CREATE TABLE "MYSCHEMA"."Hotels" ## Learn More Refer to the following Oracle Database Vector Store connector resources to learn more: -- [Documentation: Oracle Database Vector Store Connector Classes for Semantic Kernel (.NET) APIs](https://docs-uat.us.oracle.com/en/database/oracle/oracle-database/23/odpnt/oracle-database-vector-store-provider-classes-microsoft-vector-stores-and-semantic-kernel1.html) +- [Documentation: Oracle Database Vector Store Connector Classes for Semantic Kernel (.NET) APIs](https://docs.oracle.com/en/database/oracle/oracle-database/23/odpnt/oracle-database-vector-store-connector-semantic-kernel-classes.html) Contains information on Oracle Database Vector Store connector classes for adding data, retrieving data, and performing vector search in the Oracle vector database. - Sample Code: Oracle Database Vector Store Connector for Semantic Kernel (.NET) - Coming soon -- [Documentation: Oracle Data Provider for .NET](https://docs-uat.us.oracle.com/en/database/oracle/oracle-database/23/odpnt/intro.html) +- [Documentation: Oracle Data Provider for .NET](https://docs.oracle.com/en/database/oracle/oracle-database/23/odpnt/intro.html) Contains information on Oracle Data Provider for .NET (ODP.NET), the ADO.NET data provider for Oracle Database Vector Store connector. ::: zone-end From f1e93b3c056692f1f0eb5e39af23251f58674b3f Mon Sep 17 00:00:00 2001 From: Minal Agashe Date: Sun, 17 Aug 2025 21:18:28 +0530 Subject: [PATCH 4/9] Updated oracle-connector with metadata information. --- .../{oracledb-connector.md => oracle-connector.md} | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) rename semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/{oracledb-connector.md => oracle-connector.md} (97%) diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracledb-connector.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracle-connector.md similarity index 97% rename from semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracledb-connector.md rename to semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracle-connector.md index 946b336e..2c3be6ba 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracledb-connector.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracle-connector.md @@ -1,3 +1,13 @@ +--- +title: Using the Semantic Kernel Oracle Database Vector Store connector (Preview) +description: Contains information on how to use a Semantic Kernel Vector store connector to access and manipulate data in Oracle Database. +zone_pivot_groups: programming-languages +author: minal-agashe-oracle +ms.topic: conceptual +ms.author: +ms.date: 08/14/2025 +ms.service: semantic-kernel +--- # Using the Oracle Database Vector Store connector (Preview) ::: zone pivot="programming-language-csharp" @@ -39,7 +49,7 @@ The Oracle Database Vector Store Connector can be used to access and manage data | IsFullTextSearchable supported? | No | | StorageName supported? | Yes | | HybridSearch supported? | No | -| Restricted at least one vector | Yes | +| Restricted at least one vector | No | | Allow multiple primary keys | No | Vector data searches require Oracle Database 23ai. All other Oracle connector features are available using Oracle Database 19c or higher. From f53fd6ada98ed676b3f064be9882c75bf3bce2fd Mon Sep 17 00:00:00 2001 From: Minal Agashe Date: Sun, 17 Aug 2025 21:24:26 +0530 Subject: [PATCH 5/9] Updated file with the link to changed oracle-connector file. --- .../vector-store-connectors/out-of-the-box-connectors/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/index.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/index.md index 82430680..da63d825 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/index.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/index.md @@ -47,7 +47,7 @@ Semantic Kernel provides a number of out-of-the-box Vector Store integrations ma | Milvus | Planned | | | | [MongoDB](./mongodb-connector.md) | ✅ | ✅ | Microsoft Semantic Kernel Project | | [Neon Serverless Postgres](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/neon1722366567200.neon_serverless_postgres_azure_prod) |Use [Postgres Connector](./postgres-connector.md)| ✅ | Microsoft Semantic Kernel Project | -[OracleDB](./oracledb-connector.md) | ✅ | ✅ | Microsoft Semantic Kernel Project +[OracleDB](./oracle-connector.md) | ✅ | ✅ | Microsoft Semantic Kernel Project | [Pinecone](./pinecone-connector.md) | ✅ | ❌ | Microsoft Semantic Kernel Project | | [Postgres](./postgres-connector.md) | ✅ | ✅ | Microsoft Semantic Kernel Project | | [Qdrant](./qdrant-connector.md) | ✅ | ✅ | Microsoft Semantic Kernel Project | From 474b117cb0a1a179d13e4c71901bb5e84ad9d960 Mon Sep 17 00:00:00 2001 From: Minal Agashe Date: Mon, 18 Aug 2025 11:35:04 +0530 Subject: [PATCH 6/9] Modied index.md file to remove C# oracle connector entry. --- .../vector-store-connectors/out-of-the-box-connectors/index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/index.md b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/index.md index da63d825..77ecf733 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/index.md +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/index.md @@ -47,7 +47,6 @@ Semantic Kernel provides a number of out-of-the-box Vector Store integrations ma | Milvus | Planned | | | | [MongoDB](./mongodb-connector.md) | ✅ | ✅ | Microsoft Semantic Kernel Project | | [Neon Serverless Postgres](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/neon1722366567200.neon_serverless_postgres_azure_prod) |Use [Postgres Connector](./postgres-connector.md)| ✅ | Microsoft Semantic Kernel Project | -[OracleDB](./oracle-connector.md) | ✅ | ✅ | Microsoft Semantic Kernel Project | [Pinecone](./pinecone-connector.md) | ✅ | ❌ | Microsoft Semantic Kernel Project | | [Postgres](./postgres-connector.md) | ✅ | ✅ | Microsoft Semantic Kernel Project | | [Qdrant](./qdrant-connector.md) | ✅ | ✅ | Microsoft Semantic Kernel Project | From f7afe13a595ab8ff78bc7e81cb42f08bb874191f Mon Sep 17 00:00:00 2001 From: Minal Agashe Date: Mon, 18 Aug 2025 14:32:30 +0530 Subject: [PATCH 7/9] Updated TOC.yml for oracle database connector entry. --- .../vector-store-connectors/out-of-the-box-connectors/TOC.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/TOC.yml b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/TOC.yml index 4822cb9d..4b6bde0f 100644 --- a/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/TOC.yml +++ b/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/TOC.yml @@ -20,6 +20,8 @@ href: jdbc-connector.md - name: MongoDB connector href: mongodb-connector.md +- name: Oracle Database connector + href: oracle-connector.md - name: Pinecone connector href: pinecone-connector.md - name: Postgres connector From f625c1d687cec0d661d63ca735009349ab1894c2 Mon Sep 17 00:00:00 2001 From: Minal Agashe Date: Wed, 20 Aug 2025 11:23:29 +0530 Subject: [PATCH 8/9] Updated oracle-connector .md file for ms author. --- .../out-of-the-box-connectors/oracle-connector.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2c3be6ba..b3b218aa 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 @@ -4,7 +4,7 @@ description: Contains information on how to use a Semantic Kernel Vector store c zone_pivot_groups: programming-languages author: minal-agashe-oracle ms.topic: conceptual -ms.author: +ms.author: westey ms.date: 08/14/2025 ms.service: semantic-kernel --- From b236df21180f6e3d0d246bb7c24a61b02871ac3e Mon Sep 17 00:00:00 2001 From: Minal Agashe Date: Wed, 20 Aug 2025 11:49:20 +0530 Subject: [PATCH 9/9] Updated oracle-connector.md for adding an important highlight. --- .../out-of-the-box-connectors/oracle-connector.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 b3b218aa..c06423c9 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 @@ -52,7 +52,8 @@ The Oracle Database Vector Store Connector can be used to access and manage data | Restricted at least one vector | No | | Allow multiple primary keys | No | -Vector data searches require Oracle Database 23ai. All other Oracle connector features are available using Oracle Database 19c or higher. +> [!IMPORTANT] +> Vector data searches require Oracle Database 23ai. All other Oracle connector features are available using Oracle Database 19c or higher. ::: zone-end ::: zone pivot="programming-language-python"