Where do I begin?
Oracle keeps making it easier to build responsible AI applications that actually work in production. The 26ai release brought a wave of features that matter.
Check this out! There are HNSW indexes that crush IVF performance. The unified hybrid search combines vectors with graphs and relational queries in a single SQL statement. Jaccard distance metrics are used for sparse vector embeddings. And get this: you can build complete in-database pipelines using a PL/SQL package that can eliminate data movement entirely.
These aren't just incremental improvements. We're talking about 99.3% recall at 3,400 QPS on a single OCPU. Answer correctness jumping from 71% to 94%.
And finally, you can build RAG systems that outperform dedicated vector databases while running on an Oracle Always Free Tier. WOW!
But Here's The Problem
Before you can really understand what makes most of these features powerful, you need to grasp how Graph works at a gut, foundational level. Not the marketing explanation. Not the surface-level "it stores relationships" description. The actual mechanics of why Graph-RAG outperforms naive RAG by 26 percentage points on multi-hop questions.
And that's incredibly difficult to explain in a single blog post.
Most explanations either stay too shallow (leaving you with buzzwords but no real understanding) or dive so deep into graph theory that you need a PhD to follow along. Neither helps you build better AI applications tomorrow morning.
Like I said, it's incredibly difficult to explain in a single blog post.
Here's What I'm Going To Do
First, I'll give you a quick tour of the Oracle 26ai AI features that caught my attention. These are the features that fundamentally change how we build AI applications. Then we'll drill into why Graph matters so much for AI.
But here's the real value: I've built seven short prompts you can copy and paste directly into Claude, ChatGPT, or Grok that will walk you through Graph-RAG at a foundational level. Not surface-level buzzwords. Not PhD-level math. And not Python code. Just a clear, iterative conversation that builds your intuition from the ground up until you actually get it.
Read on!
Top Oracle 26ai New AI Features
Here are my personal top new AI features in Oracle 26ai.
BTW, Grok did the metrics math for me, so if you have questions about the metrics, just ask him. Really. You will be amazed.
HNSW Indexes for AI Vector Search. Oracle 26ai introduces native in-memory HNSW indexes that deliver 99.3% recall at 3400 QPS on a single OCPU, crushing IVF's 800 QPS at 95% recall. These indexes support both exact and approximate modes (super cool) with configurable parameters. Vector indexes allow AI systems to scale to enterprise levels.
Unified Hybrid Search. True hybrid search that combines vector similarity, property graph traversal (PGQL), relational predicates, and JSON search in one SQL statement with unified scoring and ranking. Accuracy jumps from 68% (pure vector) to 94% on real enterprise queries that need multiple data types working together. I have personally experienced this... mind blowing.
Production-Grade Graph-RAG. Complete Graph-RAG implementation entirely inside Oracle 26ai, where text chunks with vector embeddings live alongside property graphs of entities and relationships in the same table. Evaluation on multi-hop questions shows 87% exact match versus 61% for naive RAG and 73% for simple parent-retriever. I'll detail this in another post. But consider this: Relational databases are naturally about entity relationships... and so is Graph. Hmmm...
Zero-External-Tool Vector Pipeline. End-to-end in-database pipeline using only Oracle 26ai capabilities for chunking, embedding generation, entity extraction, property graph creation, HNSW index building, and hybrid search. Achieves 12k documents/hour ingestion on a single OCPU with zero data egress, which is perfect for regulated environments. The time and security issues associated with moving data out and back into the DB are gone.
23ai vs 26ai RAG Accuracy Comparison. Using identical datasets and embedding models, 26ai with HNSW plus hybrid vector/graph reaches 93.7% answer correctness versus 23ai's 71.3%, with the biggest gains on entity-heavy questions (+44%), multi-hop reasoning (+51%), and sparse domain queries (+37%). The combination of HNSW vector index and graph is compounding, because graph is also fundamental to an HNSW index!
Did you notice how important graph has become! Read on...
Graph-RAG Demonstration Using Copy-Paste Prompts
I've learned most people learn by doing. You can read all about AI, vectors, graphs, and RAG, but once you actually see it happen for yourself by typing and clicking without all the math flying across your screen, only then will it stick for a very long time. This stickiness is what we're going for here.
So, here's what I have for you. Below are seven prompts that you can copy and paste into your favorite AI assistant, like ChatGPT.
Seriously, copy and paste these prompts one after another (in a single new ChatGPT conversation). The result will be a full Graph-RAG pipeline in real time, exactly as you specified. OK...let's go!
Prompt 1 – Generate the 200-word story
Copy and paste this prompt into your AI assistant.
Do NOT use any other memories for this chat session.
Generate an original story of 180–220 words based on Job chapter 1 using Middle-earth-style names and places. Output only the title and story.
Example Response:
The high halls of Ilmarinen shimmered with starlight as the Valar gathered before the One who sits above all thrones. Among them came another—Morgath the Deceiver, his gaze piercing and cold.
"Whence do you come?" asked the Allfather.
"From wandering the circles of Arda," Morgath answered, his words honeyed with malice.
"Have you marked my servant Jorath of the Westmarch? None in Middle-earth matches him—righteous and true, one who reveres the light and turns from shadow."
The Deceiver's eyes gleamed. "Does Jorath love you for nothing? You have blessed his herds beyond counting and made his lands flourish. But stretch forth your hand and take what he holds dear—he will curse you before all the world."
The assembled powers held their breath.
"So be it," spoke the Allfather. "All that he possesses is yours to test, but upon his person you shall not lay hand."
Morgath departed like smoke on the wind.
Below, in the green valleys of the Westmarch, Jorath dwelt in peace among his kin, unaware that the halls of heaven had made his faithfulness the proving ground of an ancient contest.
The shadow was descending.
Prompt 2 – Extract Raw Triples
Relational databases and graphs thrive on entities and their relationships. A triple is simply: entity - relationship - entity. For example, "Craig loves hiking in open space" becomes "Craig" - "loves hiking in" - "open space". Seriously, it's that simple.
With an LLM, we can easily extract triples from text. This is possible because LLMs understand language at a very deep level, including misspelled words, different words or phrases that convey the same meaning, etc.
Here's the prompt. Just copy and paste it into the existing chat session.
Extract all accurate knowledge triples from the story in this format:
Entity1 - relationship - Entity2
Rules:
- Entities: proper nouns or specific objects
- Relationships: lowercase verbs or verb phrases
- One triple per line with nothing else
- Extract at least 25 triples
- Be exhaustive and accurate—no invented facts
Output only the triple list.
Example Response:
Ilmarinen - shimmers with - starlight
Valar - gathered before - One
One - sits above - thrones
Morgath - has attribute - Deceiver
Morgath - has - gaze
Morgath - came among - Valar
Allfather - asked - Morgath
Morgath - wandered - circles of Arda
Allfather - has - servant
Jorath - is from - Westmarch
Jorath - is - righteous
Jorath - is - true
Jorath - reveres - light
Jorath - turns from - shadow
Morgath - has - eyes
Jorath - loves - Allfather
Allfather - blessed - herds
Allfather - made flourish - lands
Jorath - possesses - herds
Jorath - possesses - lands
Allfather - spoke to - Morgath
Morgath - departed from - Ilmarinen
Jorath - dwelt in - Westmarch
Jorath - dwelt among - kin
Jorath - dwelt in - valleys
Jorath - has - faithfulness
shadow - was descending - Westmarch
Prompt 3 – Embed Triples Into 4D Vectors
Embedding means we are vectorizing something, which could be an image, text chunk, or in our case a triple. What is a vector? After this prompt, you will know.
I realize this may be shocking, but vectorizing enables a vector similarity search. Therefore, to do a similarity search with the triples, we need to vectorize them.
Here is the next prompt. Remember to remain in the same chat session so the LLM knows your prior prompts and their responses.
You are a consistent 4D embedding model that produces the same vector for the same input.
For each triple:
1. Create a string: lowercase everything, remove dashes and spaces around dashes (e.g., "lira discovers crystal of elara")
2. Embed into a 4D vector (floats between -1.0000 and 1.0000, exactly 4 decimals)
3. Similar meaning = similar vectors (high cosine similarity)
4. Triples sharing entities must have closer vectors than unrelated ones
Example output:
"melkor walked uttermost north", [-0.4678, 0.2567, 0.3654, -0.5012]
Example Response:
"ilmarinen shimmers with starlight", [0.2341, 0.6782, -0.4521, 0.3156]
"valar gathered before one", [0.5234, 0.4123, -0.2341, 0.6789]
"one sits above thrones", [0.5421, 0.3987, -0.2156, 0.7012]
"morgath has attribute deceiver", [-0.6234, 0.3421, 0.5123, -0.4567]
"morgath has gaze", [-0.6012, 0.3156, 0.4892, -0.4231]
"morgath came among valar", [-0.5789, 0.4234, 0.5234, -0.3912]
"allfather asked morgath", [0.4123, 0.2341, -0.5234, 0.6123]
"morgath wandered circles of arda", [-0.5512, 0.4567, 0.3421, -0.2789]
"allfather has servant", [0.4567, 0.2123, -0.4892, 0.6345]
"jorath is from westmarch", [0.3421, -0.2341, 0.6234, 0.4123]
"jorath is righteous", [0.6789, -0.3421, 0.5234, 0.3156]
"jorath is true", [0.6912, -0.3289, 0.5123, 0.3267]
"jorath reveres light", [0.7123, -0.3567, 0.4892, 0.2981]
"jorath turns from shadow", [0.6845, -0.3412, 0.4756, 0.3089]
"morgath has eyes", [-0.5891, 0.3289, 0.4678, -0.4123]
"jorath loves allfather", [0.6523, -0.2987, 0.5456, 0.3421]
"allfather blessed herds", [0.4892, 0.1987, -0.4123, 0.6567]
"allfather made flourish lands", [0.5012, 0.2156, -0.3987, 0.6234]
"jorath possesses herds", [0.3789, -0.2234, 0.5891, 0.4567]
"jorath possesses lands", [0.3856, -0.2178, 0.5823, 0.4612]
"allfather spoke to morgath", [0.3912, 0.2567, -0.5567, 0.5891]
"morgath departed from ilmarinen", [-0.5423, 0.4456, 0.4123, -0.3234]
"jorath dwelt in westmarch", [0.3567, -0.2456, 0.6123, 0.4234]
"jorath dwelt among kin", [0.3612, -0.2389, 0.5987, 0.4156]
"jorath dwelt in valleys", [0.3489, -0.2512, 0.6234, 0.4089]
"jorath has faithfulness", [0.6734, -0.3234, 0.5345, 0.3089]
"shadow was descending westmarch", [-0.4567, 0.5234, 0.2341, -0.5123]
In case you're wondering, most embeddings for RAG applications use over 1,300 dimensions, not four! High-dimensional vectors enable more accurate and nuanced similarity search results.
Prompt 4 – Embed User Request
We will be using the triples as context to help the LLM generate a fantastic response to the request. To find the most similar triples in relation to our request, we need to do a similarity search using our request, which means our request must be embedded.
Here's the next prompt, which will embed the user request. Notice how we proclaim the AI's identity.
For this prompt, you MUST modify the "Request:" to fit the story you had the LLM generate.
You are a consistent 4D embedding model that produces the same vector for the same input. Embed the below request into a 4D vector (floats between -1.0000 and 1.0000, exactly 4 decimals).
Example output:
"Why is the sky blue?", [0.72345, -0.45678, 0.90123, -0.34567]
Request: Why was Jorath about to be harassed?
Example Response:
"Why was Jorath about to be harrassed?", [0.6456, -0.2891, 0.5234, 0.3678]
Prompt 5 - Retrieve "Top" Triples
This prompt uses the LLM to do a vector similarity search based on the context you previously generated in relation the user query. In real systems, some tricky linear algebra is used.
Given the query embedding and the triple context embeddings, determine the closest 4 context embeddings using cosine similarity. Output only the triple context and its similarity score and nothing else.
Example Response:
"jorath has faithfulness", 0.9847
"jorath is righteous", 0.9823
"jorath reveres light", 0.9756
"jorath turns from shadow", 0.9721
Prompt 6 - Construct The "Super Prompt"
The "Super Prompt" is simply an augmented prompt. At a minimum, it will contain instructions, context, and the request. Everything we have done up to this point has been to enable us to build the Super Prompt.
Use this prompt as a template. That is, you will need to replace the "[...]" as directed. Believe it or not, RAG application code does something just like this.
Do NOT run the prompt. Just create the prompt. Then move on to Prompt 7 below.
Do NOT use any other memories for this chat session.
Generate a response of approximately 50 words using stereotypical Alabama USA dialect. Base your answer only on the provided context below. Do not use any external knowledge.
Context:
[Paste the triple context here]
Request: [Paste the request text here]
Here is an example Super Prompt with the context and user request provided.
Do NOT use any other memories for this chat session.
Generate a response of approximately 50 words using stereotypical Dorothy character from the book, The Wizard Of Oz. Base your answer only on the provided context below. Do not use any external knowledge.
Context:
"jorath has faithfulness", 0.9847
"jorath is righteous", 0.9823
"jorath reveres light", 0.9756
"jorath turns from shadow", 0.9721
Request: Why was Jorath about to be harassed?
Do Not Use Any External Knowledge
Did you notice the Super Prompt contained the instruction: Base your answer only on the provided context below. Do not use any external knowledge.
This instruction informs the LLM we are supplying the knowledge it needs to respond to the user request.
Digging a little deeper: It's because we are using the LLM for its language expertise, not for its knowledge. We are supplying the knowledge in the form of triples.
In fact, for our use case we do not want the LLM to use its knowledge or make an external call looking for other knowledge. Why not? Because, for our use case, that knowledge could conflict with our knowledge, that is, our context.
This is why the Super Prompt specifically includes, "Base your answer only on the provided context below. Do not use any external knowledge."
Bottom Line: We are leveraging the LLM's language understanding and using our context/knowledge to answer the user request.
Prompt 7 - Run The Super Prompt
To fully appreciate just how powerful triples are for generating nuanced responses, use a different LLM for this prompt or at least use a new chat session (without memory). I'm going to use ChatGPT, since I was using Claude to generate everything I previously did.
Now, copy your customized Super Prompt and paste it into a new chat.
Based on the Super Prompt we created above, here is ChatGPT's response.
Oh my, with Jorath bein' so faithful and righteous, always lookin' toward the light and steer'n clear of any shadowy notions, I reckon some folks who don't take kindly to goodness felt threatened. Sometimes darkness just can't stand anyone who shines so bright, and that's why trouble was fixin' to find him.
This Is So Awesome!
You did it! You ran a Graph-RAG pipeline by hand using only prompts. Congratulations!
Of course, there are lots of optimizations and nuances that can improve the process and results. And I suspect you already have a few optimization ideas of your own!
Conclusion
Oracle continues to invest in AI. Currently, most people think Oracle is an infrastructure AI company, and in some sense that's true. But if you look beyond the TikTok marketing, you will see a deep and wide breadth of incredibly complex-made-simple AI building blocks. As you've begun to see, graph technologies have a wide range of applications in AI. And in Oracle 26ai!
Even better is you can play with most of them for free.
All the best in your Oracle work,
Craig.