16.9.7 Creating an Oracle Vector Search
Create an Oracle Vector Search to search both structured and unstructured data by semantics or meaning, and by values, enabling ultra-sophisticated AI search applications.
Note:
Oracle Vector Search requires Oracle Database 23ai or later.This topic demonstrates how to create a Oracle Vector Search on the
EBA_PROJECT_MILESTONES
table available in the sample dataset,
Project Data. This example assumes you have already installed the sample, dataset,
Project Data.
- About Oracle Vector Search Configurations
Learn about Oracle Vector Search configurations. - Adding a Vector Column
Learn how to add aVECTOR
column to a table. - Retrieving the Vector Embeddings from a Vector Provider
Retrieve vector embeddings from a Vector Provider. - Creating an Oracle Vector Search Configuration
Create an Oracle Vector Search configuration. - Creating an Oracle Vector Search Page
Create a Search page by running the Create Page Wizard.
Parent topic: Adding Search to an Application
16.9.7.1 About Oracle Vector Search Configurations
Learn about Oracle Vector Search configurations.
Starting with Oracle Database 23ai, you can use the VECTOR
data
type to store vector embeddings alongside business data in the database. Using
embedding models, you can transform unstructured data into vector embeddings that can
then be used for semantic queries on business data.
The process of creating an Oracle Vector Search configuration involves the following general steps:
- Add a column with a data type of
VECTOR
to your table. - Create a Vector Provider to create vector embeddings for text strings. See Managing Vector Providers.
- Retrieve the embeddings from a Vector Provider using the
GET_VECTOR_EMBEDDINGS
function inAPEX_AI
package. See Retrieving the Vector Embeddings from a Vector Provider - Create a Search Configuration based on your Vector Provider and your
VECTOR
column. See Creating an Oracle Vector Search Configuration. - Create an Oracle Vector Search page. Retrieving the Vector Embeddings from a Vector Provider.
See Also:
Parent topic: Creating an Oracle Vector Search
16.9.7.2 Adding a Vector Column
Learn how to add a VECTOR
column to a table.
The following examples uses the EBA_PROJECT_MILESTONES
table which is available in sample dataset, Project Data.
To add a VECTOR
column to a
table:
Parent topic: Creating an Oracle Vector Search
16.9.7.3 Retrieving the Vector Embeddings from a Vector Provider
Retrieve vector embeddings from a Vector Provider.
A Vector provider enables you to convert text into an embedding. The functionality can be covered by an AI Service, but also locally by an ONNX model in the database or a user-defined PL/SQL function.
The following example assumes you have created Vector Provider and are
retrieving the embeddings from the EBA_PROJECT_MILESTONES
table
using the GET_VECTOR_EMBEDDINGS
function in
APEX_AI
package.
To retrieve vector embeddings from a Vector Provider:
Parent topic: Creating an Oracle Vector Search
16.9.7.4 Creating an Oracle Vector Search Configuration
Create an Oracle Vector Search configuration.
Note:
An Oracle Vector Search configuration requires Oracle Database 23ai or later. Before you can create an Oracle Vector Search configuration, you must complete all the steps described in About Oracle Vector Search Configurations.A search configuration contains information about searchable data source.
To create a Oracle Vector Search configuration:
Parent topic: Creating an Oracle Vector Search
16.9.7.5 Creating an Oracle Vector Search Page
Create a Search page by running the Create Page Wizard.
The Create Page Wizard creates a Search field for you and prompts you to select search configurations. Note that you can also add additional search configurations later in Page Designer.
A Search page features a Search field and a Search Results region. In Page Designer, the Search Results region contains Search Sources which map to the search configurations defined in Shared Components.
To create a search page by running the Create Page Wizard:
Parent topic: Creating an Oracle Vector Search