Building a RAG application in Oracle 23ai using PL/SQL follows a logical sequence: (1) Load Document
(e.g., via SQL*Loader) into the database; (2) Split Text into Chunks (e.g.,
DBMS_VECTOR_CHAIN.UTL_TO_CHUNKS) to manage token limits; (3) Load ONNX Model (e.g., via
DBMS_VECTOR) for embedding generation; (4) Create Embeddings (e.g., UTL_TO_EMBEDDINGS) for
the chunks; (5) Vectorize Question (using the same model) when a query is received; (6) Perform
Vector Search (e.g., VECTOR_DISTANCE) to find relevant chunks; (7) Generate Output (e.g., via
DBMS_AI with an LLM). Option B matches this flow. A starts with the model prematurely. C prioritizes
the question incorrectly. D is close but loads the model too early. Oracle’s RAG workflow
documentation outlines this document-first approach.
Reference:Oracle Database 23ai AI Vector Search Guide, Chapter on RAG Workflow.