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

Select AI with RAG

Agentic AI for Oracle AI Database Professional · Lesson 13 of 20 · 1:28:46

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: Select AI and its AI profiles, SET_PROFILE and GENERATE, the actions (runsql, showsql, narrate, chat, and more), and Select AI with RAG through CREATE_VECTOR_INDEX. 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.

No pipeline to write

Ambergate's manuals now sit in Object Storage, and its data runs on Autonomous AI Database. The team wants RAG answers without writing a pipeline, and its managers want to ask questions about sales tables in plain English. This lesson covers Select AI, AI profiles, the actions, and Select AI with RAG.

Select AI

Select AI, on Autonomous AI Database, lets users ask questions in natural language, with the DBMS_CLOUD_AI package behind it. For questions about data, it turns the question into SQL, and the prompt is augmented with schema metadata only, not with the rows. For questions about documents, it runs RAG over a vector index. It works with many AI providers, chosen in an AI profile.

AI profiles

An AI profile names the provider, the credential, the model, and the objects the model may see, in an object list. For RAG, the profile also names the vector index, and it can name an embedding model. CREATE_PROFILE creates it, and SET_PROFILE makes it active for the session, before any select AI statement. For stateless connections, like a connection pool, the GENERATE function takes the profile name with each call.

Actions

After select AI, an action keyword says what to do. Run SQL, the default, runs the generated SQL and returns rows, show SQL only shows it, and explain SQL explains it. Narrate answers in natural language, from the query results or, with RAG, from the retrieved documents. Chat sends the prompt straight to the model, and show prompt shows the prompt that would be sent. Others include summarize, translate, feedback, agent, and show context.

Select AI with RAG

For RAG, DBMS_CLOUD_AI.CREATE_VECTOR_INDEX builds and maintains everything in one call. Its attributes name the location of the documents in Object Storage, the credential to read them, the AI profile, and the vector database provider, which is oracle. Documents in many formats are converted, chunked, by default into one thousand twenty four characters with an overlap of one hundred twenty eight, embedded, and stored in a vector table. A pipeline refreshes the index on a schedule, by default every one thousand four hundred forty minutes, which is once a day. Then select AI narrate embeds the question, retrieves the top matches, five by default, and answers with links to the source documents.

Recap

Let's recap. Select AI turns natural language into SQL, with schema metadata only, or into RAG answers over a vector index. An AI profile names the provider, the credential, the model, the object list, and the vector index. SET_PROFILE sets it for a session, and GENERATE takes it in each call, for stateless connections. Actions include run SQL by default, show SQL, explain SQL, narrate, chat, and show prompt. And CREATE_VECTOR_INDEX converts, chunks, embeds, and refreshes the documents, and narrate answers with sources.

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’s web app reaches the database through a connection pool, and its SELECT AI calls fail at random, because no profile is set in the session. What fits?

    • Run CREATE_PROFILE again before every call
    • Grant the profile to the pool user
    • Call GENERATE with the profile name
    • Add the profile name to its own object list
    Show the answer

    Call GENERATE with the profile name

    GENERATE takes the profile name in each call, so it does not depend on the state of the session. “Run CREATE_PROFILE again before every call” creates a profile that already exists, and it still does not set it for the session. “Grant the profile to the pool user” controls who may use a profile, not which profile a session uses. And “Add the profile name to its own object list” lists the objects the model may see, which has nothing to do with sessions.

  2. An analyst wants to review and copy the SQL that Select AI generates for a question about sales, without running it. Which action fits?

    • SELECT AI showsql
    • SELECT AI runsql, the default
    • SELECT AI narrate
    • SELECT AI chat
    Show the answer

    SELECT AI showsql

    Show SQL returns the generated statement, and does not run it. “SELECT AI runsql, the default” is the default, and it runs the statement and returns the rows. “SELECT AI narrate” answers in natural language, so the analyst sees no SQL. And “SELECT AI chat” sends the question straight to the model, without generating any SQL.

  3. New manuals land in Ambergate’s Object Storage bucket every day. What keeps the Select AI vector index current?

    • Running CREATE_VECTOR_INDEX each morning
    • The index pipeline, on a schedule
    • Running SET_PROFILE again in each session
    • A higher match_limit in its attributes
    Show the answer

    The index pipeline, on a schedule

    The vector index comes with a pipeline that loads new documents on a schedule, set by the refresh rate. “Running CREATE_VECTOR_INDEX each morning” rebuilds the whole index every morning, which is not needed. “Running SET_PROFILE again in each session” only sets the profile for a session, and it loads no documents. And “A higher match_limit in its attributes” changes how many chunks each answer retrieves, not which documents are indexed.