Ontology, Knowledge Graphs, RAG, and GraphRAG: How to Choose
What you’ll learn
- What ontology, knowledge graphs, RAG, and GraphRAG each manage
- How to divide one business question across meaning, facts, passages, and relationship paths
- How the roles appear in life sciences, web search, internal search, and supply-chain analysis
- How to choose a small starting point from where the answer lives and how deeply relationships must be followed
- Which permissions and evidence people must manage when AI chooses where to search
The different roles of ontology, knowledge graphs, RAG, and GraphRAG
An ontology (shared definitions and rules for terms and their relationships) and a knowledge graph (records of things such as companies and contracts, together with their connections) help organize knowledge. An ontology defines what “customer” means; a knowledge graph records that “Company A holds Contract 123.”
RAG (a way for AI to answer using information retrieved from external sources) puts that information to use in an answer. GraphRAG (RAG that uses connections between entities or groups of related entities during retrieval) is one form of RAG.
The choice depends on where the answer is and which information must be followed to reach it. Finding a clause in a contract calls for a different approach from investigating the contracts of a company’s subsidiaries. By the end of this article, the contract example and real-world cases will help you choose an approach for your own work and identify the operational checks it requires.
From definitions to answers: roles in a contract question
Consider how each approach helps investigate a company’s contracts.
An ontology defines terms and the rules for their relationships. Defining what “customer” and “contract” mean reduces differences in interpretation between departments.
Tom Gruber’s widely cited explanation describes an ontology in terms of concepts in a domain, their relationships, and the distinctions between them. It specifies both meaning and formal constraints (explicit rules that computers can process) so terms can be used consistently.[1]
A knowledge graph records individual facts and connections. It records statements such as “Company A holds Contract 123” and “Company B is a subsidiary of Company A,” along with their sources. Here, a graph is a data structure that represents entities such as companies and contracts as points and their relationships as connecting lines.
A broad survey of knowledge-graph research identifies the types of information modeled, recognition of the same entity, context, and quality management as central concerns alongside the recording format.[2]
RAG uses retrieved information to produce an answer. Its full name is Retrieval-Augmented Generation. It retrieves information relevant to a question and passes it to a large language model (AI trained on large amounts of text to generate responses and other text).
The original 2020 paper combined knowledge learned by the model with an index (information organized for retrieval) for finding Wikipedia passages.[3] In the contract example, RAG finds Contract 123 and the relevant cancellation terms, then uses those passages as evidence for an answer. RAG names this combination of retrieval and generation, rather than a specific product.
GraphRAG uses relationships or groups of related entities to gather evidence. For example, it can follow Company A to its subsidiaries and then to their contracts. A sequence of connections followed in this way is a relationship path.
GraphRAG includes several approaches. Microsoft Research’s approach extracts entities such as companies and people, along with their relationships, from text. It groups closely related entities and prepares summaries in advance.
At query time, it can search around a particular entity or examine major themes across a document collection.[4][5] Systems that traverse an existing business knowledge graph are also called GraphRAG, so adoption requires checking which relationships are used, who creates them, and how retrieval works.
The following table compares the roles using the same contract example. It is this article’s practical classification, not an official product taxonomy.
| Concept | What it manages | Contract example | What it does not do by itself |
|---|---|---|---|
| Ontology | Meanings, types, relationships, and constraints | Defines customer, contract, subsidiary, and how they relate | Records Company A’s current contract |
| Knowledge graph | Particular entities, attributes, relationships, and sources | Records that Company A holds Contract 123 and Company B is its subsidiary | Writes the answer |
| RAG | Retrieval of relevant passages for answer generation | Finds the contract and cancellation clause as evidence | Guarantees a relationship absent from the documents |
| GraphRAG | Retrieval through relationship paths or document groups | Traverses subsidiaries, contracts, and incidents to gather risk evidence | Treats every extracted relationship as an approved fact |
An ontology can exist before individual facts are entered. A small knowledge graph can operate without a formal ontology, and RAG can work without a graph. Some GraphRAG systems build a retrieval-only graph from documents. Using GraphRAG therefore does not automatically produce an approved enterprise knowledge graph.
Examples in life sciences, web search, internal search, and supply-chain analysis
The roles vary with the task, from a research resource that defines shared terminology to a service that investigates supplier connections. The following examples include both deployed systems and a service still in development.
Gene Ontology: shared biological terms and relationships
Gene Ontology (a knowledge resource for describing gene functions using shared terms) describes gene products (proteins and RNA produced from genetic information) by their molecular functions, the biological processes they participate in, and their locations within cells.
The ontology defines biological categories and relationships. Individual gene products receive annotations (information linking each product to the shared terms), with references and evidence types.
Its official site describes it as a foundation for computational analysis of large-scale molecular biology and genetics experiments.[6]
Shared definitions, mappings to individual records, evidence, and update procedures are maintained together. This makes it easier to compare findings across research institutions and species.
Google’s Knowledge Graph: distinguishing entities with the same name
Google introduced the Knowledge Graph to Japanese search in 2012. When the same words could name a film, city, or person, it distinguishes candidates and presents summaries and related items.[7] It identifies what the entered words refer to, then follows attributes (information describing an entity’s characteristics) and relationships to other entities. That differs from simply finding passages containing the same keywords.
Morgan Stanley: internal document search and answer evaluation
According to OpenAI’s case study, Morgan Stanley Wealth Management uses AI @ Morgan Stanley Assistant for internal knowledge search. The organization evaluates realistic questions, asks experts to grade answers, and runs daily regression tests to check whether previously correct answers remain correct after changes.[8]
The case study also describes continued adjustments to retrieval as the document collection grows.[8]
Quality checks continue after documents become searchable. Does the system find documents relevant to the question? Does its answer stay grounded in the evidence? Does it still answer correctly after an update? Continued evaluation makes RAG usable in practice.
LINEA: GraphRAG development for multi-level supplier research
An AWS case study published in 2025 describes LINEA combining company data, trading relationships, and news in a graph. The service is being developed to investigate several levels of supplier relationships through natural-language questions (questions written in everyday language).
Amazon Neptune (an AWS database service for storing and searching connections) follows the relationships between companies. Amazon Bedrock (an AWS service for using generative AI models) interprets questions and generates answers.
At the time of publication, the service was in development toward full-scale adoption in fiscal 2027.[9]
Finding a description of one company is not enough for this investigation. It needs connections to direct suppliers, their sources, and related news. That is why retrieval uses relationships between companies as well as similarity between the question and the text.
Selection criteria based on where the answer is
Before choosing a data format, ask where the answer is and what must be crossed to reach it.
| Concept | Suitable uses | Unsuitable or lower-priority uses |
|---|---|---|
| Ontology | Aligning terms across departments; reusing meanings and constraints; deriving classifications from rules | Narrow document search; a rapidly changing domain without an owner; classifications simple tags already handle |
| Knowledge graph | Following ownership, dependency, trade, or impact across several links; matching aliases; sharing sourced relationships | A list that fits in one table; fixed totals; work without a relationship-maintenance owner or source information |
| RAG | Questions grounded in policies, manuals, contracts, or research; search over changing documents; cited summaries | Exact calculations; database updates; exhaustive collection-wide comparison; answers that are relationship paths |
| GraphRAG | Cross-document research; multi-step relationships; collection-wide themes; analysis grounded in both paths and passages | Simple search over a small collection; low-latency, low-cost screens; unreliable relationship extraction; high-risk decisions without review |
Microsoft’s official guidance describes GraphRAG as suitable for document collections with a shared theme and many entities, such as people and organizations. It supports cross-document investigation and thematic analysis, while calling for expert review of answers and traceable evidence.[10]
Exact sales totals and inventory updates need the appropriate operations. Complete numerical aggregation calls for a query against a database (a system for storing, retrieving, and aggregating data such as sales and inventory). Changing inventory or other business records requires a workflow that checks the operator’s permissions and approvals.
Adopting ontology or RAG does not replace these operations. Where an existing process is simpler and easier to verify without generative AI, it is appropriate to keep using it.
Small-scale evaluation and criteria for adding a graph
Choose from representative questions, not from a favored technology.
| Representative question | First approach to try | When to add more |
|---|---|---|
| “What is the deadline for a leave request?” | Keyword search or RAG | Improve retrieval and document attributes if wording hides the policy |
| “Which services and teams are related to this incident?” | A knowledge graph, or RAG with graph search | Add incident passages as GraphRAG evidence when text must support the path |
| “What does customer mean in each department?” | Terminology alignment and a small ontology | Add shared identifiers, mappings, and a change process when several systems reuse it |
| “Which issues and people recur across all investigation reports?” | Evaluate ordinary RAG as a baseline | Compare GraphRAG if a few similar passages miss recurring connections and themes |
| “What was revenue by product last month?” | Database aggregation | Give the verified total to a model only when adding an explanation |
When RAG fails to find the necessary information, first examine the retrieval method: how documents are split into passages and whether titles and dates can serve as search clues. Combining keyword search with semantic similarity (how closely meanings match even when wording differs), or reordering results, may solve the problem.
Adding a graph becomes worth evaluating when relevant passages are found but their connections remain unclear, or when questions about the whole collection still produce answers covering only a small part of it.
Ontology work can also begin with one recurring business question. Define the types, relationships, and rules it requires, then share definitions used by several workflows or systems. Compared with defining every concept across the organization at once, this makes it easier to weigh maintenance costs against the benefits of reuse.
Microsoft’s GraphRAG documentation likewise advises teams to watch indexing cost and version changes and to start small.[11]
The AWS Context Ontology Accelerator article covers one AWS implementation for meaning and relationships. The Palantir Ontology article explains a layer that also handles state changes, permissions, and records. This article stays vendor-neutral and focuses on choosing a role from the shape of a question.
Summary: Choosing from business questions, with people responsible for evidence and permissions
Adoption begins with one real business question and a check of how far ordinary search or RAG can answer it. Identifying whether the evidence lies in passages, multiple connections, or collection-wide patterns makes it easier to decide when GraphRAG adds value and when a dedicated aggregation process is appropriate.
Even when AI chooses where to search, people remain responsible for the evidence and for deciding who may view or change information. Adoption can expand only as far as the organization can support relationship maintenance, traceable evidence, permission management, and continued answer evaluation.
References
- Tom Gruber, Ontology, 2009
- Aidan Hogan et al., Knowledge Graphs, 2020
- Patrick Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, 2020
- Darren Edge et al., From Local to Global: A Graph RAG Approach to Query-Focused Summarization, April 2024
- Microsoft, Query Engine
- Gene Ontology Consortium, The Gene Ontology Resource
- Google, ナレッジグラフ “モノ”を認識する検索エンジンに向けて, December 5, 2012
- OpenAI, Morgan Stanley uses AI evals to shape the future of financial services
- Amazon Web Services, 株式会社リネア様のAWS生成AI事例:GraphRAGで実現するサプライチェーンリスク検知と管理への取り組み, October 24, 2025
- Microsoft, GraphRAG: Responsible AI FAQ
- Microsoft, GraphRAG
For the latest releases and updates, see the official websites and documentation.