AI Concepts

Ontology

9 min read
On this page (19)

Definition: An ontology is an explicit, machine-readable model of what things exist in a domain, what properties they have, and how they relate to each other. In AI systems it gives an agent a shared vocabulary with the software it is acting on, so "close the deal" means one specific, checkable operation rather than a guess.

TL;DR: AI agents read well and write badly. Reading tolerates ambiguity because a human checks the answer. Writing does not, because a wrong write commits. An ontology is what turns a plausible action into a validated one. Build an AI app free →

The Read Path Is Solved, the Write Path Is Not

This is the asymmetry that explains most agent failures in production.

When an agent reads, a near-miss is cheap. It summarizes a document slightly wrong, a human notices, and nothing is damaged. Retrieval quality can be mediocre and the system still feels useful.

When an agent writes, a near-miss is expensive. It updates the wrong record, sets a status that does not exist, or creates a duplicate customer. There is no human in the path to catch it, and the damage persists.

Vector search and RAG made the read path work. Nothing equivalent happened for writes, which is why "our agent demo was great and production was a mess" is such a common story.

The Impedance Mismatch

Agents produce language. Systems accept typed operations. Those two things do not line up on their own.

   WHAT THE AGENT PRODUCES          WHAT THE SYSTEM ACCEPTS
   -----------------------          -----------------------
   "mark the Acme deal as won"      UPDATE opportunity
                                      SET stage_id = 7
                                      WHERE account_id = 4412
                                        AND status != 'closed'

   Ambiguous:                       Requires exactly:
   - which Acme? 3 accounts match     - a resolved account id
   - "won" -> which stage id?         - a valid stage from the enum
   - already closed? then what?       - a precondition check

Every gap in that middle column is a place the agent can be confidently wrong. An ontology is what fills them: it says an Opportunity has exactly these stages, belongs to exactly one Account, and can only move between stages along defined transitions.

What an Ontology Actually Contains

Element What it declares Example
Entities The things that exist Account, Opportunity, Contact
Attributes Properties and their types stage is one of six named values
Relationships How entities connect An Opportunity belongs to one Account
Constraints What must always hold Closed opportunities cannot change amount
Transitions Which state changes are legal Negotiation to Won, but not Prospect to Won

The last two rows are what turn a data model into an ontology worth having. A schema says what shape data takes. An ontology also says what changes are permitted, which is exactly what a write path needs.

Validation Before Commit

The practical pattern is a gate between the agent's proposal and the system's state. The agent never writes directly.

The critical detail is the retry edge. A validation error that says "stage must be one of: Prospect, Qualified, Proposal, Negotiation, Won, Lost" is information the agent can act on. A generic failure is not. Good validation errors are prompts.

This is why structured outputs and function calling matter beyond convenience: they are the transport for a validated action, and the schema is a small ontology.

Keep Facts, Inference, and Policy Apart

A common failure is collapsing three different kinds of statement into one layer.

Layer Statement type Example Who owns it
Facts What is recorded This invoice is 47 days old The system of record
Inference What follows from facts Therefore it is overdue Derived rules or a model
Policy What should be done Overdue invoices escalate to a manager The business

Mixing them makes systems impossible to debug, because you cannot tell whether a wrong outcome came from bad data, bad reasoning, or an outdated rule. Keeping them separate means a policy change is a policy edit, not a prompt rewrite.

What Structure Costs

Ontologies are not free, and pretending otherwise is how modelling projects die.

  • Modelling takes time, and the first version is always wrong in ways only production reveals.
  • Rigid models break when the business changes. A stage list that cannot gain a stage will be worked around.
  • Over-modelling is real. Not every field needs a constraint. Structure the operations that commit, and leave the rest loose.
  • It is a maintenance surface. An ontology that drifts from the actual system is worse than none, because it validates against a world that no longer exists.

The reasonable posture: you do not need a full modelling project before you start. Structure the specific write paths you are automating, leave the read paths flexible, and expand only where a wrong write would actually hurt.

Bounding the Agent Loop

An ontology also bounds behavior, which is the other half of reliability. If the legal transitions are declared, an agent cannot invent a new state. If the entity types are declared, it cannot act on a record type nobody defined.

That pairs with the external bounds every agent loop needs: step limits, spend caps, and human checkpoints for consequential actions. The ontology constrains what can be done; the loop bounds constrain how much. You need both, because loop termination cannot be proven in general.

The Version You Get Without a Modelling Project

Most teams do not need a formal ontology language. They need their actual entities, states, and legal transitions written down somewhere a system can enforce them.

That is what building on a structured workspace gives you. Describe it to Taskade Genesis: "a deal tracker where every deal belongs to one account, moves through prospect, qualified, proposal, won, or lost, and cannot skip from prospect straight to won." Taskade EVE assembles it as living software, your projects hold the entities and their states, and your agents act through defined operations rather than free text. The ontology is the app's structure, so it is enforced by construction instead of by discipline.

Start building free →

Frequently Asked Questions About Ontologies

What is an ontology in AI?

An explicit, machine-readable model of what entities exist in a domain, their attributes, their relationships, and which state changes are legal. It gives an agent and the software it acts on a shared vocabulary, so an instruction maps to one specific checkable operation.

Why do AI agents need an ontology?

Because the write path has no human to catch mistakes. Reading tolerates ambiguity; writing commits it. An ontology lets a system validate a proposed action against defined entities and legal transitions before anything changes.

What is the difference between an ontology and a schema?

A schema declares the shape data takes. An ontology also declares meaning, relationships, and which changes are permitted. The transition rules are the part a write path most needs and a plain schema usually lacks.

Do I need to build an ontology before using AI agents?

No. Structure the specific write paths you are automating, where a wrong action would actually cause harm, and leave read paths flexible. A full modelling project before any value ships is the common way these efforts fail.

What is the impedance mismatch between agents and systems?

Agents produce natural language; systems accept typed operations with resolved identifiers and valid enumerated values. Every gap between the two is a place the agent can be confidently wrong, and the ontology is what fills those gaps.

How do you validate an agent's output before it commits?

Put a gate between proposal and commit that checks the action's shape, resolves entities to real identifiers, and confirms the state transition is legal. Return a specific error on failure so the agent can correct itself, since a good validation error functions as a prompt.

Why separate facts, inference, and policy?

So you can tell which one is wrong. Facts are what is recorded, inference is what follows, and policy is what should be done. Collapsed together, a bad outcome is undebuggable and a policy change becomes a prompt rewrite.

What does an ontology cost?

Modelling time, a maintenance burden, and the risk of rigidity when the business changes. An ontology that drifts from the real system is worse than none, so structure only what commits and expand from there.

Further Reading