No Python glue and no separate vector store. In Oracle AI Database 26ai, one PL/SQL package, DBMS_VECTOR_CHAIN, plus plain SQL covers the whole retrieval-augmented generation flow. Ulrike Schwinn from Oracle walks through it end to end.
The five steps
UTL_TO_TEXTturns a document stored as aBLOB(orCLOB) into plain text.UTL_TO_CHUNKSsplits it.bydefaults towords,maxto 100,splittorecursively;overlapis 0 by default and can be 5–20% ofmax.UTL_TO_EMBEDDINGScreates the vectors. With the default"provider":"database"it calls an ONNX embedding model you loaded into the database.VECTOR_DISTANCE(..., COSINE)finds the chunks closest to the question.UTL_TO_GENERATE_TEXTsends the question and those chunks to an LLM and returns the answer. This step always calls an external provider over REST, so it needs a credential and a network ACL.
Two tips
- Don't trust the first chunk size. Try a few
max/overlapcombinations and compare the answers. - Tell the LLM to answer only from the supplied context and to cite chunk IDs, so every answer can be checked.
For APEX teams, a "chat with our documents" page becomes a PL/SQL job. Sources: From Raw to RAG with DBMS_VECTOR_CHAIN and the DBMS_VECTOR_CHAIN reference.
Get the Oracle + AI digest
One email when a new tested guide, template or APEX release note lands — English or Arabic. No spam; unsubscribe anytime.