Summary

AI Agents Are Only as Accurate as Their Ontology


Part of a workshop series run by the Graph User Group, July 2026

Graph User Group poster for AI-Assisted Ontology Engineering with Dougal Watt and Yitae Jeong

Key takeaways

1

Accuracy starts with the ontology

An agent is only as accurate as the ontology it is grounded in.

2

Databases won't check it

Graph databases don't check ontology quality, so evaluation has to be built in.

3

Validate, then prove it

Validate as the model grows, then prove it with real data before production.

How an ontology can improve agent accuracy beyond RAG

AI agents answer by prediction. They draw on patterns in public training data, not on an organisation's own knowledge. That accuracy gap is a main reason so many enterprise agents stall between 30% and 80% accuracy.

An ontology closes the gap. It gives the agent a precise, shared definition of the organisation that people and machines can both read. Grounded in an ontology and the data that conforms to it, an agent answers from the organisation rather than from the internet.

There is a catch. An agent can only be as accurate as the ontology it is grounded in. Much is written about why ontologies matter. Very little is written about how to tell whether an ontology is any good and fit for purpose. Graph Research Labs has developed tools that help people create better ontologies, so LLMs can be more accurate.

Where LLM-built ontologies go wrong

Large language models now draft many ontologies, and they speed the work up considerably. But they learned from public ontologies of very uneven quality. The same four mistakes keep appearing.

1Class sprawl

Like a relational schema, they produce deep trees of subclasses that barely differ. The ontology grows, but it describes the business less well.

2Misplaced taxonomies

Labels such as payment types end up in several places. The ontology can then no longer classify things consistently.

3Property proliferation

Near-duplicate properties appear for every situation. Many reinvent what an upper ontology such as gist or BFO already provides: events, roles, monetary amounts.

4Modelling anti-patterns

A concept like a role can be modelled several valid ways. A good model picks one and sticks to it. LLMs tend to mix them.

An ontology with these mistakes will still load into a database without any errors. But each mistake makes it harder for an agent to give accurate answers.

Graph databases are not designed to check ontology errors

It is tempting to assume that loading an ontology into a graph database checks it. It doesn't. Databases store and query data. They are not built to judge whether a model makes sense.

Take a payment declared as both an event and a task. An event happens at a point in time; a task persists. No database will flag that contradiction. Nor will it notice two disjoint classes sharing a subclass, or one modeller renaming a class that another modeller's module still imports.

Some stores can validate data against SHACL shapes, including GraphDB and Neo4j through its neosemantics plugin. That helps at the data level. But a store applies shapes faithfully even when they no longer match the ontology. Validating data against a model is not the same as validating the model.

Validating data against a model is not the same as validating the model.

How to evaluate an ontology

Ontology evaluation works best as checks run continuously, not as a review at the end.

Competency questions

Before modelling, break the business problem into small questions the ontology must answer, each with a draft SPARQL query. For cross-border payments, one might be: which accounts are held at a given bank? A question with no working query is a gap in the model.

A reasoner

Confirms the ontology is logically consistent and that data will classify as expected.

SHACL shapes

Written once the core model settles, and kept in step with it.

Linting

Tools such as GRL's OntoLinter automatically check an ontology for anti-patterns, missing labels and definitions, top-level classes outside the upper ontology, hallucinated identifiers, and broken import chains across modules. Linting hourly while building an ontology picks up most errors as soon as they appear.

A conformance report

A readiness checklist covering competency questions, reasoner results, shapes, profile, change records and sign-offs. It is rerun whenever the ontology changes.

Each change an LLM makes can break a query or a shape somewhere else. Rerunning the checks after every change catches that while it is still cheap to fix.

Decisions that stay with people

LLMs get some decisions wrong often enough that a human modeller needs to be in charge. These six decisions should be made by people, not automated by an LLM:

  • Top-level classes and the choice of upper ontology
  • Equivalence between classes or properties inside one ontology
  • Anything that affects reasoning, such as disjointness
  • Disagreements between modellers, which need resolving before an agent touches them
  • Identifiers, which should come from natural keys in source data
  • Safety and compliance values, such as manufacturing tolerance limits

That is why an ontology still needs an experienced modeller behind it. LLMs make that person faster, but they should not make the key decisions.

Proving it with real data

The final test is real data. Once an ontology passes its checks, it should be tested in a pre-production setting. Real data is loaded into the graph through an API or data pipeline. The competency question queries are then run against that data to confirm they return the right answers.

This often exposes modelling choices that looked fine on paper, such as a missing identifier or two concepts that need separating. When it does, the fix goes back into the ontology. The checks are rerun, the API is regenerated and the data is tested again. The cycle repeats until every competency question returns the right answer from real data.

Only then is it ready to ground an agent. At that point the ontology stops being a document. It becomes part of the organisation's critical data infrastructure, and the foundation for accurate agents across the organisation.

How Graph Research Labs helps

Graph Research Labs builds a suite of licensable tools that put this method into practice, and offers advisory services to organisations working with graphs and ontologies. GRL tools work with any graph database, from established ones such as Amazon Neptune and GraphDB to newer engines such as Tentris and open-source stores such as Oxigraph.

Modelling

The GRL ontology modelling plugin guides an LLM through competency questions, upper ontology patterns, SHACL and validation. It rechecks the model after every change.

Quality

GRL OntoLinter checks an ontology for the mistakes commonly made, including across imported modules. A free version is on the GRL website, and a comprehensive Pro version is available to license.

Governance

The GRL Ontology Manager lets several modellers work on the same ontology. It versions and publishes the result as a formal contract other systems can rely on.

Bringing in data

The GRL Data Pipeline maps structured data, such as database records, spreadsheets and streaming messages, onto the ontology and loads it into the graph. The GRL Document Integrator extracts information from unstructured documents such as PDFs and Word files, using the same ontology.

Testing with real data

GRL Generators turn a published ontology into APIs, React apps and MCP servers in minutes. The ontology meets real data before it reaches production.

Agent control

The GRL Semantic Agent Harness keeps agents grounded in that ontology. It gives them shared memory and limits what each agent can read and write by role. It also keeps an audit trail the agent cannot alter.

The aim of GRL tools is simple: help organisations run their own graphs and AI agents, and take those agents beyond 90% accuracy. To get there, GRL's advisory team can work alongside an organisation's own team to build more accurate ontologies and graph solutions. For larger programmes, GRL supplies the tools and its partners bring the delivery.

To find out more, book a 30-minute call.