Series · Knowledge layer deep dives
How AI agents use your knowledge graph
An AI agent uses your knowledge graph in five steps. Approved terms become concepts, the ontology types the graph, retrieval finds connected records and their evidence, your rules check the result, and failures go to a person. How each step works, and what the GraphRAG research shows.
Inovagio team · Published · 17 min read

On this page
Orrenby Industrial's head of legal operations has a question no single document answers. A knowledge graph for AI agents lets an agent turn the words of a request into concepts your business approved, follow typed relationships between records, retrieve the passages that prove each link and check the result against your rules before anyone acts on it.
Her question is this: which of our active supplier contracts are with a company whose parent was acquired this year, and what does each one's change-of-control clause say? (Orrenby Industrial · Example company.) In March a logistics group bought the parent company of two of Orrenby's freight suppliers. The contracts are signed by the subsidiaries, talk about delivery windows and rates, and never mention the deal. Search the documents for passages that resemble the question and you get the deal memo and some news alerts. The answer needs three hops between records, and similarity can't make them.
This guide follows that question through the five steps Inovagio's Virtual Employees take, and stops at each one to say what the research and the standards say. The middle of it compares GraphRAG with vector retrieval, because "use a knowledge graph" means different things in different papers, and the difference decides how far you can trust the answer.
Five steps from a request to a checked answer
#Each step has its own owner. Whoever your organization makes responsible approves the vocabulary and the ontology. Retrieval, with the permission checks inside it, belongs to MNEMOS, our data engine. Approved rules and the policy checks of Phylax own the verdict. A person owns anything the checks can't confirm. The model reads and drafts at several points, but it doesn't own any of the decisions.
Words become concepts
#The question says "acquired", "parent" and "supplier contract". Orrenby's systems don't say those things consistently. The deal register calls it a transaction, the vendor master says supplier, and the contracts say "the Supplier" in one template and "Vendor" in another. The first job is to map the words of the request to concepts the business approved.
That's the job of the approved vocabulary, along with the taxonomy and thesaurus built on it. In Synesis, our knowledge layer, each concept has one preferred label plus alternate and hidden labels (the hidden ones catch common misspellings), written in SKOS, the W3C standard for vocabularies. The agent asks Synesis to resolve a phrase. Exact labels match first, then near spellings, then concepts close in meaning, reordered by a reranking model. Below a tuned similarity floor the answer is an explicit "no match", so a term nobody approved is reported rather than forced onto the nearest concept.
Then each concept is expanded. "Change of control" brings in its alternate labels, such as "assignment on merger", and its narrower concepts, and each added concept counts for less the further it sits from the one asked about. The expansion feeds every store at once. Full-text search gets weighted terms; vector search runs one query per concept and fuses the lists with weighted reciprocal rank fusion; SQL gets the columns the concepts are bound to. A search for one approved concept isn't limited to one word for it.
Departments own their own terms. Legal's "active contract" may include contracts in their notice period while procurement's doesn't, and both meanings are recorded. Where a department's term conflicts with the organization's, Synesis puts the conflict in front of both approvers rather than letting one meaning quietly win.
The ontology types the graph
#Concepts name things. The ontology says what kinds of things exist and how they may relate: an Acquisition has a TARGET, a Company can be SUBSIDIARY_OF another, and a Contract has a COUNTERPARTY. The knowledge graph holds the instances. Deal MA-2026-018 targeted Corvane Logistics; Brackwater Freight is a subsidiary of Corvane; contract CT-4471 is with Brackwater. Each instance is typed by an ontology class, and each fact records the system it came from.
The ontology is approved the way the vocabulary is, one level up. Concepts move through five gated stages: controlled vocabulary, taxonomy, thesaurus, ontology and knowledge graph. You decide who approves each stage, often a department head for its own terms and a governance body or compliance for the ontology, and each knowledge graph version is evaluated before it publishes. Agents read only published content by default.
Two standards do different work here, and practitioners keep them apart. OWL infers. From "every supply contract is a contract" and "CT-4471 is a supply contract", the engine concludes that CT-4471 is a contract, and it keeps conclusions like that current as facts change; Synesis materializes OWL 2 RL, a rule-based profile of OWL, incrementally. SHACL validates. It checks that data has the shape the business requires, and a missing fact counts as missing, not as unknown. We check shapes against the inferred graph, so a fact the ontology entails isn't reported as absent. The pillar guide on ontology for AI agents covers both in depth.
Bindings connect the graph to where the data lives. Following R2RML, the W3C's standard for mapping relational data, each class and property binds to tables, graph labels and document collections. The graph doesn't copy the contract system. It knows which table holds contracts and which column holds the counterparty.
Retrieval finds the records and the evidence
#Now the agent can look things up, and two kinds of retrieval run for two kinds of evidence.
Text retrieval finds passages. Keyword search ranks documents by the terms they share with the query, usually with BM25, a ranking formula that rewards rare terms, stops rewarding a term after a few repeats and discounts long documents. It's hard to beat on exact identifiers like a contract number. Vector search turns each chunk of text into an embedding, a list of numbers that places passages with similar meaning close together, and returns the chunks nearest to the question. Approximate nearest-neighbor indexes make that fast over millions of chunks by giving up a little recall: HNSW (hierarchical navigable small world graphs) for speed, IVF-PQ (an inverted file with product quantization) when the vectors have to be compressed to fit in memory.
MNEMOS runs both and merges the two ranked lists with reciprocal rank fusion, which scores each passage by the sum of 1/(k + rank) across the lists. The method's authors fixed k at 60 in their original experiments and found the choice not critical (Cormack, Clarke and Büttcher, SIGIR 2009). Fusion uses only ranks, so a BM25 score and a cosine similarity never have to be put on one scale. A cross-encoder reranking model, served by the Inovagio inference server, then reads each passage against the question and orders the short list.
Graph retrieval finds connections. The walk is a query, here in ISO GQL (ISO/IEC 39075, published in 2024), the graph query standard MNEMOS supports:
MATCH (a:Acquisition)-[:TARGET]->(p:Company)
<-[:SUBSIDIARY_OF]-(s:Company)<-[:COUNTERPARTY]-(c:Contract)
WHERE a.closed_on >= DATE('2026-01-01')
AND c.status = 'Active'
AND c.type = 'Supply'
RETURN c.contract_id, s.name, p.name, a.deal_id, c.owner_idThe deal is a node of its own, so its closing date and parties hang off it rather than off an edge. Synesis keeps its facts in RDF, the W3C graph data model, and GQL and SQL/PGQ read a property-graph view of those same facts, so this walk and a SPARQL query see one graph, not two copies. The walk returns, say, seven contracts across two suppliers. Then text retrieval does what it's good at: for each contract, hybrid search returns the change-of-control and assignment clauses to cite.
Two words in that query do quiet work. "Active" has to mean what legal means, which step one settled. "This year" has to be judged by when each fact was true, not when it was loaded, which is why the graph keeps both times (bi-temporal storage) and answers "as of" a date.
Those two times are also the answer to the usual complaint about knowledge graphs, that they go stale. Each fact records the system it came from, when it was true and when it was loaded, so an agent can see how old a fact is and ask what the graph knew on any date. A curated graph reads its facts from systems of record through mappings instead of copies kept by hand, and a contract on each source catches an upstream change before an agent acts on it. Our guide to preparing data for AI agents covers both.
The agent doesn't write that walk freehand. Synesis gives it a small set of tools. It can describe the part of the ontology it may see, resolve a phrase, ground a request in the bound tables and relations, and list the legal next steps from an entity. Grounding returns an ambiguous request as alternatives instead of guessing, and a hop the agent proposes outside the permitted neighborhood is refused. For an agent, that's the practical value of a typed graph: it limits which connections the agent may consider, so the agent doesn't invent joins.
Permissions apply inside retrieval, not after it. A document the user may not see is never a candidate, so the model never reads it. Filtering a top 10 after the search is the common mistake: it can hand back two results when the user was entitled to ten, with no sign that anything was dropped. MNEMOS applies document-level security trimming to every result with the filter inside the search, and binds every record to its tenant in code. Past cases come through the same gate. The agent can also search how similar contracts were handled before, in memory shared by the Virtual Employees on one queue. How the context for each step is then assembled and budgeted is in our guide to context engineering for AI agents.
GraphRAG vs RAG: which retrieval for which question
#The word GraphRAG covers two different things, and the research uses it for both:
- An extracted graph. A model reads every chunk and pulls out entities and relationships, then the system groups them into a hierarchy of communities (with the Leiden community detection algorithm) and has a model write a summary of each. This is the method in the paper that popularized the name (Edge et al., From Local to Global, arXiv, April 2024, revised February 2025). Its global search answers from the community summaries; its local search starts from the entities a question names and gathers their neighbors and source text. Every edge is a model's reading of a sentence.
- A curated knowledge graph. The entities and relationships follow an ontology the business approved, and the facts come from systems of record through mappings, with the source of each edge recorded. It takes modeling work, and every edge can be traced. This is the graph the five steps above walk.
Darren Edge and colleagues built an extracted graph over two collections, one of podcast transcripts at about a million tokens and one of news articles at about 1,700,000, then asked 125 broad questions of each, the kind that need a whole collection. A model acting as judge compared answers in pairs.
Against vector RAG, the graph-based answers won on comprehensiveness 72% to 79% of the time and on diversity 62% to 81%, depending on the collection and the community level. Vector RAG gave the most direct answers in every comparison. One detail rarely makes it into summaries of the paper: a baseline that summarized the source text directly, with no graph at all, beat vector RAG by similar margins. Head to head, the graph's lower-level summaries edged that baseline out on some measures and tied it on others, and the top-level summaries held level with it while using far fewer tokens per question. Much of what the graph bought was cost. The judging was done by a model, and the authors didn't measure fabrication.
The most useful study for practitioners is Haoyu Han and colleagues' systematic comparison of RAG and GraphRAG methods across question answering and summarization benchmarks (Han et al., RAG vs. GraphRAG, arXiv, February 2025, revised November 2026). Plain RAG did better on single-hop and detail-oriented questions, graph methods did better on multi-hop and reasoning-heavy ones, and neither dominated.
On time-based questions in the MultiHop-RAG benchmark, a local graph method scored 50.6 against 30.7 for plain RAG. On questions whose answer isn't in the data at all, plain RAG answered correctly (by declining) 96.0 times in 100, and the global, summary-based graph method only 19.3. For regulated work the second number is the one to remember: a system that rarely says "no answer" is a system that makes answers up. Only about two thirds of answer entities appeared in the extracted graphs at all (65.8% on HotpotQA), which caps what any graph-only method can retrieve. And on combining the two, routing each query to one method with a classifier improved the best single method by 1.1% on MultiHop-RAG; running both and merging their context improved it by 6.4%, at the cost of running both pipelines.
Two other results are worth knowing. A 2025 benchmark built to find when graphs help starts from reports that GraphRAG "frequently underperforms vanilla RAG on many real-world tasks" (Xiang et al., When to use Graphs in RAG, arXiv, June 2025). For structured data the strongest result is older: over an insurance database, a model answered 16% of business questions correctly from the raw tables and 54% from a knowledge graph of the same data (Sequeda, Allemang and Jacob, arXiv, November 2023). That graph was curated against an ontology, not extracted.
Summaries carry a permission risk that passages don't. A community summary is written from many documents at once, so if one of them is restricted (a deal memo, a sealed legal file), the summary can carry its content to every reader, and trimming the summary afterward can't take it back out. Build summaries per permission scope, or skip them for regulated data and walk a curated graph that sits in the same database as the records. For regulated data, that last one is the approach we take. Edges leak too: a walk that returns "supplier whose parent is being acquired" reveals a deal the user can't see, so trim edges as well as nodes. In Synesis an inferred relationship is visible to a reader only if at least one way of deriving it rests entirely on facts that reader may see.
Each kind of graph has its own cost. An extracted graph needs a model pass over every chunk and a summary for every community, repeated as documents change. A curated graph needs modeling, mostly people's time. Either one only answers questions about what someone put in it, so write down the questions it must answer before you build it. Ontologists call these competency questions. Synesis runs them as executable queries, and an ontology doesn't pass its stage until every one of them does.
Our view, plainly: most teams don't need GraphRAG for document question answering. Where answers cross records, as they do in contracts or accounts payable, a curated graph earns its cost quickly, because the alternative is an agent guessing at joins. Forrester's analysts make a related point about readiness: most organizations aren't yet ready to build a knowledge graph, and a semantic layer is the right place to start (Forrester, June 2, 2026).
Rules check the result
#Retrieval produces a draft: seven contracts, each with its path and its cited clause, and a model's summary of what each clause requires on a change of control. The model wrote the summaries. It doesn't get to decide whether the draft is acceptable, or what the rules say.
Rules that check data are written as SHACL shapes. This one says every change-of-control review names exactly one supply contract, cites at least one clause and goes to exactly one contract owner:
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix ex: <https://example.org/orrenby/> .
ex:ChangeOfControlReviewShape
a sh:NodeShape ;
sh:targetClass ex:ChangeOfControlReview ;
sh:property [
sh:path ex:aboutContract ;
sh:class ex:SupplyContract ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;
sh:property [
sh:path ex:citesClause ;
sh:class ex:Clause ;
sh:minCount 1 ;
sh:message "A review cites the clause it relies on." ;
] ;
sh:property [
sh:path ex:routedTo ;
sh:class ex:ContractOwner ;
sh:minCount 1 ;
sh:maxCount 1 ;
] .A review with no cited clause fails, with the shape's message attached. Rules that pick an outcome, such as who must sign off on a notice for a contract above a certain value, are approved rules. Each carries an owner and a version along with the name of whoever approved it, and a rule that touches regulated decisions can require two approvers. Our guide on how a rule is approved shows what one looks like.
Then policy. Before and after each protected action, such as routing a review or writing a flag to the contract system, Phylax checks whether this Virtual Employee, acting for this person, may do it, and the action is attributed to the person it acts for. Guard screens what goes into and comes out of the model, tool-call inputs included, for prompt injection and personal data. Those are different kinds of check, and our piece on business rules and AI guardrails explains why regulated work needs both.
Failures go to a person, and every step is recorded
#A check that fails isn't retried until it happens to pass. The review goes to the contract's owner with the reason, in an approval inbox that keeps the decision history. Nobody approves their own change, and agents never approve. When the owner corrects a review, the correction becomes a proposed rule for whoever approves that rule, so a mistake your team fixes once stays fixed.
Every step lands on the task record. That covers the concepts the request resolved to, the path the walk took and the passages it read. It also names each rule by id and version, and records every policy decision along with whoever approved the result. Each entry carries the seal of the one before it, so a change anywhere shows. If one contract in the answer is wrong, the record shows which step went wrong, down to the hop or the rule. Reading a task record walks through one line by line.
And if something goes wrong at scale, the kill switch in Archon, our control plane, stops one Virtual Employee, a department or everything at once. The knowledge graph stays where it was, approved and versioned, because agents can propose changes to it but never publish them.
Where to start with a knowledge graph for AI agents
#- Write five to ten questions the graph must answer that cross records, like the one above. Those are your competency questions.
- Model only the classes and relationships those questions need, and get them approved.
- Bind each class and property to the table or collection that holds it.
- Write the checks for the answer as shapes and approved rules before you let an agent act on one.
- Decide who gets each kind of failure, and read the first week of task records yourself.
For the business case behind all of this, read what is a context layer. For the questions buyers ask most, see knowledge layer questions and answers. Every piece on the subject is collected under knowledge graph.
Further reading
#- Edge, Trinh, Cheng, Bradley, Chao, Mody, Truitt, Metropolitansky, Ness and Larson, From Local to Global: A Graph RAG Approach to Query-Focused Summarization, arXiv, April 2024, revised February 2025.
- Han, Ma, Wang, Shomer, Lei, Qi, Guo, Hua, Long, Liu, Aggarwal and Tang, RAG vs. GraphRAG: A Systematic Evaluation, arXiv, February 17, 2025, revised November 7, 2026.
- Xiang, Wu, Zhang, Chen, Hong, Huang and Su, When to use Graphs in RAG: A Comprehensive Analysis for Graph Retrieval-Augmented Generation, arXiv, June 6, 2025, revised February 22, 2026.
- Sequeda, Allemang and Jacob, A Benchmark to Understand the Role of Knowledge Graphs on Large Language Model's Accuracy for Question Answering on Enterprise SQL Databases, arXiv, November 13, 2023.
- Cormack, Clarke and Büttcher, Reciprocal Rank Fusion Outperforms Condorcet and Individual Rank Learning Methods, SIGIR 2009.
- W3C, SKOS Simple Knowledge Organization System Reference, W3C Recommendation, August 18, 2009.
- W3C, Shapes Constraint Language (SHACL), W3C Recommendation, July 20, 2017.
- ISO/IEC, ISO/IEC 39075:2024, Information technology: Database languages, GQL, April 2024.
- Forrester, Build Meaning Before Machines: Why Semantics, Ontologies, And Knowledge Graphs Matter For Agentic AI, June 2, 2026.
Questions
What people ask.
How does an AI agent use a knowledge graph?
In five steps. It resolves the words of a request to approved concepts and expands them, reads the graph the ontology types, retrieves connected records with a graph walk and the supporting passages with hybrid search, checks the result against approved rules and shapes, and sends anything that fails to a person. Every step is recorded.
What is GraphRAG?
GraphRAG is retrieval-augmented generation that finds context by following relationships between entities in a graph, instead of only ranking text passages by similarity to the question. The graph is either extracted from documents by a model, with summaries of related groups of entities, or a curated knowledge graph built against an approved ontology.
Is GraphRAG better than vector RAG?
It depends on the question. Published comparisons find that plain vector RAG does better on single-fact and detail questions and graph methods do better on multi-hop and time-based questions. Using both together gave the best results in a 2025 systematic study, at the cost of running both.
What is the difference between an extracted graph and a curated knowledge graph?
An extracted graph is built by a model reading documents and pulling out entities and relationships, which is automatic but lossy and hard to trace. A curated knowledge graph follows an ontology the business approved, with facts mapped from systems of record, so every relationship can be traced to its source and approver.
Can GraphRAG leak data a user is not allowed to see?
Yes, in two ways. Summaries written from many documents can carry restricted content to anyone who reads the summary, and graph edges can reveal that a restricted record exists. Build summaries per permission scope or avoid them for restricted data, trim edges as well as nodes, and apply the permission filter inside the search rather than to its results.
Does the model decide whether the answer is right?
No. The model reads passages and drafts summaries. Approved rules and SHACL shapes check the result, policy is checked before and after each protected action, and anything the checks can't confirm goes to a person, with the reason on the task record.
What is reciprocal rank fusion?
Reciprocal rank fusion is a way to merge ranked result lists from different search methods, such as keyword and vector search. A result's score is the sum, over the lists, of one divided by a constant plus its rank in that list, so items ranked well by several methods rise to the top. The original 2009 paper used a constant of 60 and found the exact value was not critical.
The products, industries and examples it covers.
- Knowledge layerSynesisTurns your policies, procedures, records and your people’s know-how into a rulebook your experts approve, which you own and can take anywhere.
- Data engineMNEMOSRecords, documents, vectors, graph and agent memory in one engine, with a ledger behind every write.
- Governance and auditPhylaxSign-in, policy, secrets and one audit trail from the screen to the disk, so you can show any examiner what happened.
- Agent control planeArchonSee every agent at work, and stop or start any of them.
- IndustryLegalEach party on a new matter searched with its parent companies and former names, ethical wall requests drafted for lateral hires, and contracts compared with your playbook. Lawyers decide.
- OverviewArchitectureHow the platform fits together, from your data to finished work.
- OverviewDevelopersBuild agents, workflows and apps, already governed.
Read next.
Guide · OntologyOntology for AI agents: how to build one in five stagesHow to build an ontology AI agents can use, in five gated stages from a controlled vocabulary to a knowledge graph. The W3C standards for each stage, competency questions, Turtle and SPARQL for a worked example, entity resolution, versioning and "as of" queries. · updated November 18, 2026 · 21 min read
Guide · Context engineeringContext engineering for enterprise AI agentsContext engineering decides what an AI agent sees at each step of a task. The research on why long contexts fail, the techniques that keep context small, how agent memory fits in, and the controls that stop context from becoming an attack path. · updated November 18, 2026 · 18 min read
Article · GovernanceBusiness rules or AI guardrails? Why regulated work needs bothGuardrails filter what an AI model takes in and says. Business rules check what the work itself must satisfy. In regulated work you need both, plus a model's judgment for the messy parts. What each one catches, a worked example, and what to ask a vendor. · updated November 18, 2026 · 12 min read
Developer edition
Build on Inovagio.
The MNEMOS data engine, the command line and the desktop app, with guides and API references.






