Where RAG Breaks: Completeness and Cross-Metric Questions
In the ontology-grounded enterprise agent (UniDataAgent) review covered recently, the gap between document-based RAG and the ontology-grounded approach on simple fact-lookup questions was small — 81.8% to 90.9%. But on questions that require full coverage across regions or departments, and on questions that cross-diagnose different metrics, plain RAG fell to 57.1-63.6%. Retrieved text chunks "look relevant" to the query, but nothing about retrieval guarantees completeness or consistency across metrics.
This asymmetry isn't a model or embedding-quality problem. Vector similarity can only answer "is this chunk close to the question" — it was never the right tool for "did this cover every region" or "do these two metrics share the same definition." A question about structure needs a structural answer.
Ontology Isn't Smarter Search — It's a Different Query Path
Adding an ontology doesn't mean swapping embedding models; it means declaring entity, relationship, and metric definitions as a schema so that some queries shift from "search" to "structured lookup." AWS's knowledge-graph reference architecture extracts entities with an LLM, loads them as Cypher, then refines the graph with entity resolution (deduplication) and community detection. Google's Spanner Graph documentation recommends the same order — define entity and relationship tables first, then map them to a graph schema. Schema comes first; queries run on top of it.
From Schema Design to Operations: A Roadmap for Adding Ontology to RAG
Planning doesn't mean converting all of RAG to an ontology. Start by measuring baseline accuracy per question type (simple lookup / completeness / cross-metric), and set the entry bar at domains where the type-to-type gap exceeds 15 points. Reasonable targets: 90%+ accuracy on completeness and cross-metric questions once grounded, and under one business day of lead time between a metric-definition change and that change showing up in query results.
Four failure patterns recur. Converting all of RAG to an ontology at once, which adds schema-mapping errors and latency even to simple lookup queries that didn't need it. Over-engineering the schema — too many entity and relationship types, where maintenance cost outpaces the accuracy gained. Bundling schema changes into the same deployment unit as the query pipeline, so a single metric-definition change forces a full redeploy. And building the graph without entity resolution, letting the same region or metric pile up as duplicate nodes under slightly different names.
Design the recovery branch assuming schema-mapping failures will happen. When an ontology lookup returns empty or low-confidence, fall back automatically to the vector-RAG result or show both side by side; when a query references an entity or metric the schema doesn't recognize yet, flag it as "unregistered" rather than failing outright, and queue it as a candidate for the next schema update.
On the operational side, run a regression test against a golden set split by question type (simple / completeness / cross-metric) before every deploy, version schema changes separately from application code, and run entity-resolution batches on a schedule, logging the duplicate-node rate as a standard field. Treat sensitive business rules — metric definitions, units, aggregation logic — as access-controlled even though they aren't PII.
For ongoing operation, pull the top categories of "questions the ontology still can't answer" every week and sort them into two buckets: domains that need schema reinforcement, and queries plain vector RAG was already handling well enough. Keep expanding schema investment into domains with a low rate of completeness/cross-metric questions, and maintenance cost piles up while accuracy gains stall.
Quick Reference
Adding an ontology to RAG is a per-question-type decision, not a wholesale migration. Declare schema first for the domains where completeness and cross-metric gaps exceed 15 points, and build a fallback path to vector RAG on mapping failure plus routine entity-resolution checks into operations — that's where the investment closes the largest share of the gap.
References
Knowledge Graphs and GraphRAG with AWS and Neo4j — AWS reference architecture
Ask AI about this article
The assistant has read this article. Ask anything — it answers from the text and says so when something isn't in it.
Loading the chat…