← Back to blog

Ontology-augmented generation: giving agents something to act on


Field notes
ontology rag agents knowledge-graph

TL;DR

RAG hands your model text. Ontology-augmented generation hands it typed objects with known relationships, which means an agent can query them, join across them, and write new ones back. That last part is why I care. A retrieved paragraph is something an agent can only quote. A typed entity is something it can act on, and something you can trace later when someone asks where an answer came from.

Where this came from

The pattern I keep returning to is an orchestrator agent that dispatches a swarm of subagents to investigate why something failed. One subagent per source type, running in parallel, results fanning back into a shared store, then a synthesis pass. The shape fits most enterprise settings: something stopped behaving, and the explanation is scattered across systems that were never designed to talk to each other.

Fan-out was easy. Fan-in is where it fell apart.

The problem retrieval doesn’t solve

When every subagent returns prose, the orchestrator is reduced to reading. Three write-ups arrive. Two describe the same finding in different vocabulary. One contradicts another. There is no reliable way to tell whether that’s a genuine disagreement or two sources saying the same thing with different words.

Embeddings don’t settle it. Surfacing plausible passages was never the bottleneck. Cosine similarity simply has no opinion about which source outranks the other, because authority isn’t a property of the text. It’s a property of the thing the text describes.

That’s what an ontology encodes. Not “here are some documents about assets” but “an Asset is governed by a Specification with an effective date, supersedes an earlier revision, and has zero or more observed FailureModes, each carrying evidence.” Once that structure exists, ranking stops being a heuristic buried in your synthesis prompt and becomes a lookup.

Chunk versus entity

Here’s the shape of what a vector store returns:

"...the unit shall not exceed the rated operating threshold under
continuous load. See section 4.2 for derating conditions..."

And roughly what an ontology layer returns for the same question:

Asset:A-17
  type:          <domain type>
  ratedLimit:    <value>     (source: SPEC-2 rev C, effective 2024-03)
  supersedes:    SPEC-1 rev A
  failureModes:  [FM-01, FM-02]
  observedBy:    [subagent:standards, subagent:internal-docs]

The first is something to read. The second is something to traverse.

More to the point, the second gives the orchestrator a join key. Fan-in stops being a reading comprehension exercise. Agreement is two subagents returning the same entity. Disagreement is the same field arriving with two values and two sources, which the orchestrator can surface explicitly instead of quietly averaging away. Swarm architectures fail when ten subagents all sound confident because they all saw the same weak signal, and typed results are the cheapest defense I’ve found against that.

Where it pays off: writing back

Reading structured data is the easy half. The half that changed how I think about these systems is that agents can create entities too.

When the swarm finishes an investigation, it doesn’t just return a summary. It proposes a new record: linked to the entity under investigation, carrying its evidence, flagged unconfirmed until a human signs off. Once confirmed, that record joins the graph the next investigation searches.

The system improves by using itself. That sounds obvious and turned out to be surprisingly hard with free text. You can append an agent’s write-up to a document store, sure, but nothing downstream can reason over it. Give the agent a schema to populate and its output lands in a shape the next query can actually find.

Typing also imposes a discipline that prose quietly lets you skip. An agent required to fill evidence: [] with real references can’t hand you a confident conclusion backed by nothing. The schema works as a hallucination filter that costs nothing at inference time.

The audit story

The other reason this matters has less to do with accuracy than with trust.

When someone asks why the system reached a conclusion, “the model read some documents and decided X” is not an answer anyone accepts. “This traces to a record confirmed by a named reviewer on this date, sourced from these three documents” is. Every hop is a typed edge, so the explanation is a graph walk instead of a reconstruction after the fact.

Skepticism about agent output isn’t going away, and it shouldn’t. The systems that survive contact with real users are the ones where you can inspect the reasoning without having to trust the reasoner.

What the research shows

OG-RAG (Sharma, Kumar and Li, EMNLP 2025) builds a hypergraph over ontology-grounded facts and retrieves a minimal set of hyperedges per query, reporting 55% higher recall of accurate facts and 40% better response correctness across four different LLMs. The number I keep coming back to is the 30% faster attribution of responses to context, because that’s the audit property showing up as a measurable result rather than a nice-to-have.

The wider graph-RAG family is worth reading alongside it; Peng et al.’s survey maps the territory well. The enterprise data platforms that popularized the phrase make roughly the same argument commercially: the ontology is where business meaning lives, and generation is the interface sitting on top of it.

The part nobody puts in the pitch deck

Building the ontology is most of the work.

Every team I’ve watched reach for this discovers that the modeling effort dwarfs the AI effort, and that it’s really a negotiation between people who disagree about what a “component” is. No amount of prompting gets you out of that.

But it’s work you’d need to do eventually anyway. The agent just makes the bill arrive earlier.

© 2026 Dr. Bin Liu