Previous Next JavaScript must be enabled to correctly display this content

## 5.23.3 Managing Vector Providers

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

Note:

Vector Providers requires Oracle AI Database 26ai or later.

- About Vector Providers
  Learn about Vector Providers.
- Creating a Vector Provider
  Create a Vector Provider on the Vector Providers page in Workspace Utilities.
- Editing and Deleting a Vector Provider
  Edit or delete Vector Provides on the Vector Providers Detail page in Workspace Utilities.
- Viewing the Vector Providers History Report
  View a report of recent modifications made to Vector Provider in this workspace.

Parent topic: Using Workspace Utilities

### 5.23.3.1 About Vector Providers

Learn about Vector Providers.

Starting with Oracle AI Database 26ai, 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.

Parent topic: Managing Vector Providers

### 5.23.3.2 Creating a Vector Provider

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

Note:

Vector Providers requires Oracle AI Database 26ai 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.

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 be displayed in the Vector Provider overview page.
   2. Local Embedding, ONNX Model Owner - Select the owner of the ONNX model which should be used for the Vector Provider. Schemas assigned to your workspace are listed, but only those that contain mining model objects.

      If no schema is explicitly selected, the current parsing schema is used during execution. Vector Providers can be used with and without an application context, for example by using an Oracle AI Vector Search Configuration or an `apex_ai.get_vector_embeddings` function call. Ensure that the executing schema has the necessary privileges.

   3. 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, AI Provider - Select the AI Provider to use for this Vector Provider. Options include:
      - OCI Generative AI Service
      - OpenAI
      - Cohere
      - Google Gemini
      - Generic (OpenAI API Compatible)
   2. Identification, Name - Enter the name of the Vector Provider. The name must be unique and will display in the Vector Provider overview page.

      Note:

      The UI changes based on the AI Provider you select. See item Help, to learn more about attributes specific to a given AI Provider.
6. If Provider Type is Custom PL/SQL:
   1. 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`.
   2. 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. Advanced:
   1. Advanced, 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`
   2. Advanced, Maximum AI Tokens - Enter the maximum number of AI Tokens per 24 hour period that Oracle APEX can use for the Generative AI Service. Not every Generative AI Service provides token usage information, so Oracle APEX may not be able to enforce this limit.

      The `APEX_AI.GET_AVAILABLE_TOKENS` function also returns the numbers of tokens available.

      An administrator can also set the Maximum AI Tokens at the workspace or instance-level. See Viewing Existing Workspace Information and Configuring Instance-Level Workspace Isolation Attributes in Oracle APEX Administration Guide.

   3. Advanced, Additional Attributes - Include additional attributes to added to the JSON request payload as part of performing a Generative AI Service operation.
8. Click Create.

Parent topic: Managing Vector Providers

### 5.23.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.

Parent topic: Managing Vector Providers

### 5.23.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.

Parent topic: Managing Vector Providers