Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Oracle · OCI AI Foundations

AI in Oracle AI Database

OCI AI Foundations · Lesson 14 of 16 · 1:38:25

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 Cloud Infrastructure AI Foundations Associate exam (1Z0-1122-26). In this lesson: Oracle AI Database 26ai (formerly called Oracle Database 23ai) and AI Vector Search (the VECTOR data type, VECTOR_DISTANCE and its metrics), HNSW and IVF vector indexes, ONNX embedding models inside the database, Select AI (natural language to SQL, AI profiles, and the showsql, runsql, explainsql, narrate, and chat actions), Select AI Agent, Private Agent Factory and its three prebuilt agents, and the built-in MCP server. Includes three original practice questions, with Willowmere Motors, a fictional network of car dealerships and repair shops, as the example.

Study notes

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

AI next to the data

Willowmere keeps its parts inventory and its sales in Oracle AI Database. Its analysts want to ask questions in plain English, without writing SQL. And its service team wants to find similar repair cases, right next to the business data.

AI Vector Search

Oracle AI Database 26ai, the release that older material calls Oracle Database 23ai, brings AI to your data, starting with AI Vector Search. It adds a vector data type, to store embeddings in a table column, with a number of dimensions and a format, like int eight, float thirty two, float sixty four, or binary. The VECTOR_DISTANCE function measures how close two vectors are, with metrics like cosine, the default, Euclidean, dot product, or Manhattan. And because the vectors sit next to the business data, one SQL query can combine a similarity search with filters and joins, with no separate vector database.

Vector indexes and embeddings

Without an index, a search compares the question with every vector: an exact search, accurate, but slow on large tables. A vector index gives approximate searches instead, much faster, with a target accuracy that you can set. HNSW, for Hierarchical Navigable Small World, builds a graph in memory, and is the fastest, while IVF, for Inverted File Flat, groups vectors into partitions, and searches only the nearest ones. To create the embeddings, the database can load an ONNX model and run it inside the database, or call an external provider, like OCI Generative AI. A typical flow converts documents to text, splits them into chunks, creates the embeddings, stores and indexes them, and then searches.

Select AI

Select AI, in Autonomous AI Database, turns natural language into SQL: you write select AI, followed by a question in plain English. An AI profile sets the provider and the model, the credentials, and the tables that the model may know about. Actions choose what you get back: showsql shows the generated query, runsql runs it and returns the rows, and explainsql explains the query in plain language. With narrate, the model answers in sentences, from the query results, and chat sends the prompt straight to the model, without any query. Select AI can also do RAG, with a vector index over your documents.

Agents in the database

Select AI Agent goes further, with agents that live inside the database, managed with PL/SQL packages, which plan, use tools, reflect, and remember. Their tools cover natural language to SQL, RAG, and PL/SQL functions, and agents can work together in teams. Private Agent Factory is a no-code platform to build, test, and deploy agents on your data, with a drag-and-drop Agent Builder. It comes with three prebuilt agents: the Knowledge Agent, the Data Analysis Agent, and, since version 26.4, the Deep Data Research Agent. And a managed MCP server, built into Autonomous AI Database, lets outside agents use these tools, with the rights of a database user.

Recap

Let's recap. Oracle AI Database 26ai stores embeddings in a vector column, and the VECTOR_DISTANCE function compares them, with cosine by default. HNSW, in memory and fastest, and IVF, with partitions, give approximate searches, and ONNX models can create embeddings inside the database. Select AI turns natural language into SQL, with an AI profile, and actions like showsql, runsql, narrate, chat, and explainsql. Select AI Agent runs agents inside the database, with PL/SQL packages and tools. And Private Agent Factory builds agents with no code, with three prebuilt agents.

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. Willowmere’s service team searches millions of repair notes by meaning, and the exact search is too slow. What should it add?

    • More dimensions for each vector
    • A vector index, such as HNSW
    • A separate vector database
    • A higher temperature in the profile
    Show the answer

    A vector index, such as HNSW

    A vector index, like HNSW or IVF, makes the search approximate and much faster, with a target accuracy. “More dimensions for each vector” would make each vector larger, and the search slower, not faster. “A separate vector database” is not needed, because the vectors already sit next to the business data. And “A higher temperature in the profile” is a setting of text generation, with no effect on search speed.

  2. A Willowmere analyst wants to see the SQL query that Select AI generates for a question, before anything runs. Which action fits?

    • runsql
    • narrate
    • showsql
    • chat
    Show the answer

    showsql

    Showsql returns the generated query, without running it. “runsql” would run the query, and return its rows. “narrate” also runs the query, then answers in sentences. And “chat” sends the prompt to the model directly, with no query at all.

  3. Willowmere’s business users want an agent that answers questions about their documents and data, with no code at all. Which option fits best?

    • Private Agent Factory
    • Select AI Agent packages
    • The VECTOR_DISTANCE function
    • An IVF vector index
    Show the answer

    Private Agent Factory

    Private Agent Factory is a no-code platform, with prebuilt agents like the Knowledge Agent. “Select AI Agent packages” is built with PL/SQL packages, which means writing code. “The VECTOR_DISTANCE function” is a SQL function that measures similarity, not an agent. And “An IVF vector index” only speeds up vector searches.