5.20.3 Managing Vector Providers

Utilize Vector Providers to create vector embeddings for a text string.

Note:

Vector Providers requires Oracle Database 23ai or later.

5.20.3.1 About Vector Providers

Learn about Vector Providers.

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.

About Vector Providers

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.

Vector Providers are stored at the workspace-level and available in all applications. When you export an application, used Vector Providers are added to the export file. When you import the application into another workspace, Oracle APEX checks whether the target workspace already contains Vector Providers with the same static ID. If a Vector Provider already exists, the application uses it. Otherwise the Vector Provider from the import file are created in the target workspace.

Retrieving and Using Embeddings

You can retrieve the embedding from a Vector Provider using the GET_VECTOR_EMBEDDINGS functions in APEX_AI package. To learn more, see APEX_AI in Oracle APEX API Reference.

Once your retrieve the embedding, you can create a Oracle Vector Search configuration based on your Vector Provider. To learn more, see Creating an Oracle Vector Search.

5.20.3.2 Creating a Vector Provider

Create a Vector Provider on the Vector Providers page in Workspace Utilities.

Note:

Vector Providers requires Oracle Database 23ai or later.

To create a Vector Provider:

  1. Navigate to the Vector Provider page:
    1. On the Workspace home page, click the App Builder icon.
    2. On the App Builder home page, click the Workspace Utilities icon.
    3. On the Workspace Utilities page, click Vector Providers.

      The Vector Providers page appears.

  2. Click Create.

    The Create/Edit page appears.

  3. Under Identification:
    1. Identification, Provider Type - Select a vector provider type. Options include:
      • Database ONNX Model
      • Generative AI Service
      • Custom PL/SQL

      Note that UI pages based on the Provider Type you select.

    2. Identification, Name - Enter the name of the Vector Provider. The name must be unique and will be displayed in the Vector Provider overview page.
    3. Identification, Static ID - Enter a Static ID for the Vector Provider. The Static ID must be unique and will be referenced when using the service with the APEX_AI package, APEX_AI.GET_VECTOR_EMBEDDINGS.
      Example: VP_OPENAI_EMBEDDING
  4. If Provider Type is Database ONNX Model:
    1. Identification, Name - Enter the name of the Vector Provider. The name must be unique and will display in the Vector Provider overview page.
    2. Identification, Static ID - Enter a Static ID for the Vector Provider. The Static ID must be unique and will be referenced when using the service with the APEX_AI package, APEX_AI.GET_VECTOR_EMBEDDINGS.
    3. Local Embedding, ONNX Model Owner - Select the owner of the ONNX model which should be used for the vector provider. All schemas assigned to your workspace are listed.
    4. Local Embedding, ONNX Model Name - Select the ONNX model that will be used to get an embedding for a given term.
  5. If Provider Type is Generative AI Service:
    1. Identification, Name - Enter the name of the Vector Provider. The name must be unique and will display in the Vector Provider overview page.
    2. Identification, Static ID - Enter a Static ID for the Vector Provider. The Static ID must be unique and will be referenced when using the service with the APEX_AI package, APEX_AI.GET_VECTOR_EMBEDDINGS.
    3. Identification, AI Provider - Select the AI Provider to use for this Vector Provider. Options include:
      • OCI Generative AI Service
      • Open AI
      • Cohere

      The UI changes based on the AI Provider you select. See item Help, to learn more about an attribute.

  6. If Provider Type is Custom PL/SQL:
    1. Identification, Name - Enter the name of the Vector Provider. The name must be unique and will display in the Vector Provider overview page.
    2. Identification, Static ID - Enter a Static ID for the Vector Provider. The Static ID must be unique and will be referenced when using the service with the APEX_AI package, APEX_AI.GET_VECTOR_EMBEDDINGS.
    3. Local Embedding, Custom Function Name - Specify the name of a custom PL/SQL function which converts an end user input to an embedding. The function needs to take the end user input as VARCHAR2 and returns a VECTOR data type as a result.
  7. Click Create.

5.20.3.3 Editing and Deleting a Vector Provider

Edit or delete Vector Provides on the Vector Providers Detail page in Workspace Utilities.

To edit or delete a Vector Provider:

  1. Navigate to the Vector Provider page:
    1. On the Workspace home page, click the App Builder icon.
    2. On the App Builder home page, click the Workspace Utilities icon.
    3. On the Workspace Utilities page, click Vector Providers.

      The Vector Providers page appears.

  2. To edit a Vector Provider:
    1. On the Vector Providers page, click the Vector Provider Name.

      The Vector Provider Details appears.

    2. Edit the appropriate attributes. To learn more about a specific attribute, see item Help.
    3. Click Apply Changes.
  3. To delete a Vector Provider:
    1. On the Vector Providers page, click the Vector Provider Name.

      The Vector Provider Details appears.

    2. Click Delete.
    3. Confirm your selection and click Delete again.

5.20.3.4 Viewing the Vector Providers History Report

View a report of recent modifications made to Vector Provider in this workspace.

To edit or delete a Vector Provider:

  1. Navigate to the Vector Provider page:
    1. On the Workspace home page, click the App Builder icon.
    2. On the App Builder home page, click the Workspace Utilities icon.
    3. On the Workspace Utilities page, click Vector Providers.

      The Vector Providers page appears.

  2. On the Vector Providers page, click History.

    The Vector Providers History report appears.