Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Oracle · Agentic AI Foundations

AI Database and vectors

Agentic AI Foundations · Lesson 16 of 20 · 2:03:35

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 Oracle Agentic AI Foundations Associate exam (1Z0-1157-26). In this lesson: agentic AI in Oracle AI Database, vectors and embeddings, the VECTOR data type, and similarity search with VECTOR_DISTANCE and its metrics, combined with relational filters in one SQL query. Includes three original practice questions, with Fairhaven Furniture, a fictional furniture seller, as the example.

Study notes

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

Search by meaning

Fairhaven's shopping agent must find products that match what a customer means, not only the words they type. A customer asks for a couch for a small flat, and the catalog calls it a compact two-seat sofa. The catalog already sits in Oracle AI Database, so the team wants the search right where the data is.

Four capabilities

Oracle AI Database brings four agentic AI capabilities to your data. AI Vector Search stores, indexes, and searches vector embeddings next to your business data, with SQL. Private Agent Factory is a no-code platform to build, test, and deploy agents, with prebuilt agents and a visual builder. Select AI Agent is an agent framework that runs inside the database, and you manage it with PL/SQL packages. And the Autonomous AI Database MCP server lets external agents and MCP clients reach the database securely, with no integration code to write.

Inside or outside

This changes where agents run. With LangChain or the Agents SDK, the agent is application code, and it reaches into the database from the outside. Select AI Agent flips that: the agent belongs to the database, with a model set in an AI profile, and data reached through SQL and tools. And the MCP server is not a separate server that you run next to the database: it is part of the database service, so when you turn it on, the database itself answers MCP requests.

Vectors and embeddings

A vector is a list of numbers, like GPS coordinates, but with hundreds or thousands of dimensions instead of two. An embedding model is a neural network that turns data, like text, images, or audio, into these vectors. Similar meanings land close together: couch, sofa, and settee cluster in one place, while a delivery van lands far away. Because each model builds its own space, embed your documents and your questions with the same model.

How embeddings are made

Here is how an embedding is made. A tokenizer splits the input into tokens, which are word pieces. Then a neural network, usually a transformer, turns those tokens into one vector that captures the meaning of the whole input. Tokenizers accept a limited number of tokens, often around five hundred, so long documents are split into chunks first, as you will see in the next lesson. And with Oracle AI Vector Search, you can load ONNX embedding models and create embeddings inside the database itself.

The VECTOR data type

In Oracle AI Database, embeddings are stored in a column of the VECTOR data type. You can set the number of dimensions and their format, which is INT8, FLOAT32, FLOAT64, or BINARY. Both are optional: with an asterisk, or with nothing, the column accepts vectors of any size and format, which helps when you start. Vectors are dense by default, and a sparse vector stores only its non-zero values.

Similarity search

To search, you embed the question, then order the rows by the vector distance function, between each embedding and the question's vector. The fetch first clause keeps only the closest rows, like the five nearest products. And because it is regular SQL, the same statement can filter on price and stock, and join other tables. There is no separate vector database to copy data into, and the database's security, transactions, and backups apply to your vectors too.

Distance metrics

The distance function takes a metric. Cosine compares the angle between two vectors, it is common for text, and it is the default when you name no metric. Euclidean measures the straight line between them, and dot product combines their sizes with that angle. Manhattan adds up the distance on each dimension, while Hamming and Jaccard suit binary vectors. The rule is simple: pick the metric that your embedding model recommends.

Recap

Let's recap. Oracle AI Database offers AI Vector Search, Private Agent Factory, Select AI Agent, and a built-in MCP server. An embedding model turns data into vectors where similar meanings land close, so embed documents and questions with the same model. The VECTOR data type stores embeddings, with optional dimensions and format, next to your business data. And the vector distance function, with the metric that your model recommends, finds the closest rows in plain SQL, with filters and joins in the same statement.

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. Fairhaven’s merchandising team wants to build an agent over its sales data, test it, and publish it, without writing any code. Which capability fits?

    • AI Vector Search, with SQL statements
    • Private Agent Factory, with its visual builder
    • Select AI Agent, with PL/SQL packages
    • The MCP server, for external clients
    Show the answer

    Private Agent Factory, with its visual builder

    Private Agent Factory is the no-code platform, with prebuilt agents and a visual builder. “AI Vector Search, with SQL statements” searches embeddings with SQL, and it is a building block, not an agent builder. “Select AI Agent, with PL/SQL packages” is managed with PL/SQL packages, so someone writes code. And “The MCP server, for external clients” would let external agents reach the database, but it builds no agent.

  2. Fairhaven embedded its catalog with one embedding model. The search app now embeds customer questions with a different, newer model, and the results look random. What should the team do?

    • Switch from cosine to Euclidean distance
    • Add a vector index on the catalog
    • Fetch more rows from each search
    • Embed both with the same model
    Show the answer

    Embed both with the same model

    Documents and questions must be embedded with the same model, so that their vectors share one space. “Switch from cosine to Euclidean distance” changes the comparison, but vectors from two models still cannot be compared. “Add a vector index on the catalog” speeds up the search, without fixing what it finds. And “Fetch more rows from each search” keeps two spaces apart, whatever the number of results.

  3. Fairhaven’s agent needs the five sofas closest in meaning to a customer’s description, but only those under $900 and in stock. The catalog is in Oracle AI Database. What is the simplest approach?

    • One SQL statement with distance and filters
    • A separate vector database, synced each night
    • A new embedding model with more dimensions
    • Fetch 500 rows, then filter in the agent
    Show the answer

    One SQL statement with distance and filters

    One SQL statement can order by vector distance, filter with a WHERE clause, and fetch the first five rows. “A separate vector database, synced each night” adds a second system, and code to keep both stores in sync. “A new embedding model with more dimensions” changes the vectors, but the filter on price and stock is still missing. And “Fetch 500 rows, then filter in the agent” would filter in the agent, after fetching far too many rows.