Notes26aiVector SearchRAG

GraphRAG in Oracle AI Database 26ai: for answers spread across two chunks

DBMS_AI_GRAPHRAG (Release Update 23.26.4) builds a knowledge graph from a text column with one call and queries it with another, by vector, graph or both.

Vector RAG finds the passage that looks like your question. It can miss an answer that needs two passages. Oracle's example: "Who is the spouse of the author of Young Man Luther?" No single text chunk holds that. It takes two hops, book to author and author to spouse. DBMS_AI_GRAPHRAG, in Release Update 23.26.4 of Oracle AI Database 26ai, is built for this.

What to know

  • CREATE_KNOWLEDGE_GRAPH uses an LLM to extract entities and relationships from a text column, then builds the graph, embeddings and indexes.
  • QUERY_KNOWLEDGE_GRAPH searches by VECTOR, GRAPH or HYBRID. HYBRID is the default and merges results with Reciprocal Rank Fusion (a standard way to merge ranked lists).
  • n_hops sets how far GRAPH and HYBRID search travel: 1 to 5, default 3.
  • generate_answer => TRUE adds a generated answer. The default, FALSE, returns only the context, for your own agent to use.
  • dml_maintenance => TRUE updates the graph asynchronously as the table changes. Tables only: for views it must stay FALSE, the default.

Test it on the questions RAG gets wrong

Collect 20 questions your current RAG answers badly. Build a graph on the same documents and run each question as VECTOR, then as HYBRID. Start small: building the graph calls an LLM across all of your text.

My take: when an answer depends on how facts relate, better retrieval of single paragraphs won't fix it. Source: DBMS_AI_GRAPHRAG.

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.