Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Oracle · Agentic AI for Oracle AI Database Professional

Embedding Models, ONNX, and Providers

Agentic AI for Oracle AI Database Professional · Lesson 2 of 20 · 8:53

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Agentic AI for Oracle AI Database Professional exam (1Z0-1159-26). In this lesson: embedding models, importing ONNX models with DBMS_VECTOR.LOAD_ONNX_MODEL and LOAD_ONNX_MODEL_CLOUD, generating vectors in SQL with VECTOR_EMBEDDING, and calling external providers over REST. Follows Ambergate Appliances, a fictional appliance maker. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

The data stays home

Ambergate wants to embed its support tickets, but its legal team has one rule: customer tickets are never sent to an outside service. So the embedding model has to run where the data already is. This lesson covers embedding models, ONNX models imported into Oracle AI Database, vectors created in SQL, and external providers.

Embedding models

An embedding model is a trained neural network, usually a transformer, that maps content to vectors of a fixed size. Text models handle sentences and chunks, and some models, like CLIP, map images and text into one shared space. Each model has its own number of dimensions, such as three hundred eighty four or one thousand twenty four, and its own recommended distance metric. Pick a model that fits your languages and your content, then keep it for both the documents and the questions.

Where vectors are made

You can generate vectors in three places. Outside the database, in your application or a data pipeline, before you load them. Inside the database, with an ONNX model that you import, so the data never leaves it. Or from the database, by calling a third-party provider through its REST endpoint, such as OCI Generative AI, Cohere, or OpenAI.

ONNX models

ONNX, the Open Neural Network Exchange, is an open format for machine learning models. Oracle AI Database includes an ONNX runtime, so an imported embedding model runs inside the database, next to the data. The ONNX file must hold the whole pipeline, including the tokenizer and the steps before and after the network, and it is limited to two gigabytes. Oracle's Python library, OML for Python, converts pretrained models from Hugging Face into such files, and Oracle also offers a model that is ready to use, with three hundred eighty four dimensions.

Load the model

The DBMS_VECTOR package loads the model with its LOAD_ONNX_MODEL procedure. You give a database directory, the file name, a model name, and JSON metadata, which says that the model's function is embedding and names its input and output. To load the file straight from Object Storage, LOAD_ONNX_MODEL_CLOUD takes a credential and the file's address instead. Once loaded, the model is a database object, like a table, with a name that SQL can call.

Vectors in SQL

In SQL, the VECTOR_EMBEDDING function calls an imported model by its name. You pass the text with the using clause, and the function returns a vector. Inside an INSERT or an UPDATE statement, it fills the vector column from the text column, row by row. And at search time, the same function turns the user's question into a vector, with the same model, inside the same statement.

External providers

The DBMS_VECTOR_CHAIN package can also call third-party providers through their REST endpoints. It supports OCI Generative AI, Cohere, Google AI, Vertex AI, Hugging Face, OpenAI, Mistral AI, and local servers like Ollama. The database user needs a credential with the provider's key, created with CREATE_CREDENTIAL, and a network access control list that allows connections to the provider's host. The UTL_TO_EMBEDDING function then takes JSON parameters that name the provider, the credential, the URL, and the model. Keep in mind that the text then travels to the provider, which is exactly what Ambergate's legal team wanted to avoid.

Recap

Let's recap. An embedding model maps content to vectors of a fixed size, and the same model must embed the documents and the questions. An imported ONNX model runs inside the database, so the data never leaves it. LOAD_ONNX_MODEL loads it from a directory, and LOAD_ONNX_MODEL_CLOUD from Object Storage, with JSON metadata. The VECTOR_EMBEDDING function then creates vectors in SQL, for stored rows and for questions. And third-party providers are called through REST, with a credential and a network access control list, while the text leaves the database.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. Ambergate must embed millions of support tickets, and its legal team forbids sending them to any outside service. Which approach fits?

    • Call an embedding model in OCI Generative AI
    • Import an ONNX model into the database
    • Send the tickets to Hugging Face in batches
    • Call an OpenAI embedding model through REST
    Show the answer

    Import an ONNX model into the database

    An imported ONNX model runs inside Oracle AI Database, so the tickets never leave it. “Call an embedding model in OCI Generative AI” calls a hosted service, so the ticket text would travel to OCI Generative AI. “Send the tickets to Hugging Face in batches” sends the tickets to an outside provider too, in batches. And “Call an OpenAI embedding model through REST” is a remote call as well, whatever the model's quality.

  2. Ambergate’s ONNX model sits in an Object Storage bucket, and the administrator does not want to copy it to a database directory first. Which procedure fits?

    • DBMS_VECTOR.LOAD_ONNX_MODEL
    • VECTOR_EMBEDDING with the bucket path
    • UTL_TO_EMBEDDING with a provider
    • DBMS_VECTOR.LOAD_ONNX_MODEL_CLOUD
    Show the answer

    DBMS_VECTOR.LOAD_ONNX_MODEL_CLOUD

    LOAD_ONNX_MODEL_CLOUD loads the model straight from Object Storage, with a credential. “DBMS_VECTOR.LOAD_ONNX_MODEL” needs the file in a database directory, which is the copy the administrator wants to avoid. “VECTOR_EMBEDDING with the bucket path” uses a model that is already loaded, so it cannot load one. And “UTL_TO_EMBEDDING with a provider” calls a provider's REST endpoint, which is not an import at all.

  3. Ambergate’s marketing team calls a hosted embedding model from PL/SQL, for public product pages. The call fails with a network access error, although the API key and the credential are correct. What is missing?

    • A larger vector memory pool in the SGA
    • An ONNX copy of the model
    • A network ACL for the provider’s host
    • A vector index on the target column
    Show the answer

    A network ACL for the provider’s host

    The database user needs a network access control list that allows connections to the provider's host. “A larger vector memory pool in the SGA” sizes memory for vector indexes, which has nothing to do with an outgoing call. “An ONNX copy of the model” would replace the provider, but the team chose a hosted model. And “A vector index on the target column” speeds up searches, long after the vectors are made.