Ontology vs RAG: which does your AI need?

Updated · Simplibot

IN SHORT

RAG, retrieval-augmented generation, finds passages of text related to a question and gives them to a language model, which suits unstructured knowledge such as policies and manuals. An ontology models structured business objects, their relationships and permitted actions, which suits questions that need counting, filtering, following connections or changing a record. Most business AI needs both: RAG for what is written down, an ontology for what is recorded in systems.

When a company first connects a language model to its own information, it usually starts with RAG, retrieval-augmented generation. It works well, up to a point. Then someone asks a question with a number in it, or asks the AI to do something, and the limits appear. That is usually when the word ontology enters the conversation.

This guide explains what each one is, what each is good at and why most serious business AI ends up using both.

The short version

RAGOntology
What it isA technique for finding relevant text and giving it to a modelA model of business objects, relationships and actions
Works onDocuments: policies, manuals, contracts, notesRecords: customers, orders, policies, claims
Finds things bySimilarity of meaningExact properties and links
Good atExplaining, summarizing, answering from what is writtenCounting, filtering, following connections, acting
Weak atExact figures, joins across systems, permissions per recordFree text that has no structure
Typical failureA confident answer from the wrong passageA question about something not yet modeled

What RAG does well

RAG splits documents into passages, finds the passages closest in meaning to a question and passes them to a language model to write an answer. For knowledge that lives in prose, this is the right tool. "What does our refund policy say about damaged goods?" has its answer in a document, and retrieval finds it.

It is also quick to set up, which is why most teams start there.

Where RAG runs out

Three kinds of question expose its limits.

  • Questions with arithmetic. "How many policies renew next month?" The answer is not written anywhere; it has to be computed from records. A model given a few similar-looking passages will estimate, and an estimate is a wrong answer.
  • Questions that cross systems. "Which customers have an overdue invoice and an open support ticket?" That needs the billing customer and the support contact to be known as the same person, then a join. Similarity search does neither.
  • Requests to act. "Reschedule that appointment." Retrieval finds text. It has no concept of an action, who may take it or what must be approved.

There is also a quieter problem: permissions. Deciding who may see which passage of which document is hard to do well, and a retrieved passage can carry details the asker should not have.

What an ontology adds

An ontology models the things themselves: object types such as Customer, Order and Invoice, their properties, the links between them, and the actions allowed on them. Our guide to what an ontology is covers the parts.

With that model, the three hard questions become ordinary:

  • Arithmetic is done by running a query on real records, not by the language model.
  • Crossing systems works because each system's records are mapped to shared objects and matched.
  • Acting goes through defined actions, each with rules and approvals.

Permissions attach to object types and properties, so the same question gives a manager names and an analyst only totals.

Using both

They are not rivals. A business has knowledge that is written down and facts that are recorded, and an AI system needs both.

The strongest arrangement links them. A policy document belongs to a product; a call note belongs to a customer; a contract belongs to an account. When documents are attached to the objects they concern, a question about one customer retrieves the documents that apply to that customer, and not merely ones that sound similar. The ontology narrows where retrieval looks, and retrieval supplies the wording the ontology does not hold.

How to decide what to build first

  1. List ten real questions your teams want an AI to answer.
  2. Mark each one: is the answer written in a document, or does it have to be worked out from records?
  3. Mostly documents? Start with RAG.
  4. Mostly records, or any request to act? You need an ontology over your systems.
  5. A mix? Start with whichever group matters most, and plan for both.

Where Ontolo-G fits

Ontolo-G, pronounced "ontology", is Simplibot's ontology platform. It connects the systems a company already runs into one governed model of the business. When someone asks a question, the AI model turns it into a structured query over that model; it does not write database queries or make up the figures. Ontolo-G applies the asker's permissions, runs the query on the data, and the answer is written around the numbers that come back, with the records it read shown alongside.

Company knowledge, such as products, pricing, policies and procedures, is part of the model too.

Read how Ontolo-G works, or book a demo with your ten questions.

Frequently asked questions

What is the difference between an ontology and RAG?

RAG is a technique: search documents for text related to a question, then have a language model answer from that text. An ontology is a model: the business objects, their properties, relationships and permitted actions. RAG helps a model read; an ontology helps it understand the structure of the business and act within it.

Can RAG answer questions about our customers and orders?

Only weakly. RAG returns passages that resemble the question. A question like how many orders shipped late last month, by warehouse, needs exact records, dates and counting, which similarity search does not provide. That kind of question belongs to an ontology over your systems.

Is a knowledge graph with RAG the same as an ontology?

Graph-based RAG uses connections between pieces of information to retrieve better context, which helps. It still needs a model that says what the things are and how they may relate, which is the ontology. An ontology with actions and permissions also covers what RAG does not attempt: changing records safely.

Does an ontology replace RAG?

No. Policies, contracts, manuals and call notes are text, and retrieval is the right way to use them. The two work together best when documents are linked to the objects they apply to, so that a question about one customer retrieves the documents that apply to that customer.

Which reduces AI hallucination more?

They address different causes. RAG reduces invented facts by giving the model source text. An ontology removes the model from the arithmetic: the query runs on real records and the model writes around the result. For figures, counts and lists, that is the stronger guarantee.

How does Ontolo-G use these ideas?

Ontolo-G is Simplibot's ontology platform. When someone asks a question, the AI model turns it into a structured query over the business model; it does not write database queries or make up figures. Ontolo-G applies the asker's permissions, runs the query on the data and the answer is written around the numbers that come back.

See Ontolo-G on your own systems

Ontolo-G (pronounced “ontology”) is Simplibot's ontology platform. See what it does, then book a walkthrough with your own systems and questions in mind.