Glossary

What is an AI Ontology?

An AI ontology is a formal, machine-readable model of the entities, attributes, and relationships in a domain, used to constrain and ground AI systems. In production AI, ontologies underpin typed retrieval, structured extraction, and agents that reason over a knowledge graph instead of free text.

By Antoni Elkenbracht·Updated January 15, 2026

The three layers of an ontology

  1. Entities (classes). The types of things in the domain: Patient, Drug, Trial, Contract, Component.
  2. Attributes (properties). The data each entity carries. A Patient has a birthdate, an MRN, an insurance status.
  3. Relationships. How entities link: Patient → prescribed → Drug → manufactured by → Manufacturer.

With those three layers, you can write queries like "show every drug interaction within a patient's active prescriptions" and get a verifiable, typed answer, instead of asking an LLM to paraphrase a paragraph.

Ontologies + LLMs = grounded reasoning

Three patterns dominate production usage:

  • Schema-constrained extraction. An LLM reads a document and emits entities + relations conforming to the ontology. Tools: OpenAI structured outputs, Outlines, Instructor, guidance.
  • GraphRAG. Retrieval traverses the knowledge graph rather than (or in addition to) a vector index. Microsoft's open-source GraphRAG reported 30-70% lift on multi-hop QA over vanilla RAG.
  • Tool-calling with typed APIs. An agent's tools are CRUD operations against the ontology, such as findPatient(id) prescriptionsFor(patient). Types constrain hallucination at the API boundary.

Why ontologies matter for regulated AI

Healthcare, finance, legal, and supply-chain teams adopt ontologies for the same reason they adopt typed code: it makes errors visible early and it produces audit-grade traces. The EU AI Act's high-risk category (Annex III) implicitly favors systems with structured, citable provenance, a property ontology-backed retrieval gives by construction.

When to skip the ontology

Greenfield prototypes, chat over unstructured wikis, summarization, and creative generation rarely need a formal ontology. The cost (modeling time, alignment with domain experts, ETL into a triple store or labeled-property graph) is only worth it when typed reasoning or auditability is a hard requirement.

Frequently asked questions

How is an ontology different from a schema?
A schema describes the shape of data (column names, types). An ontology describes the meaning: what entities exist (Patient, Diagnosis, Drug), how they relate (treats, contraindicated-with), and what's true by definition (every Prescription must reference a Patient and a Drug). Schemas constrain storage; ontologies constrain meaning.
Do I need an ontology if I'm already using RAG?
Not always. Vanilla RAG retrieves text chunks and works fine for unstructured Q&A. You need an ontology when you must reason about typed entities, like "every drug that interacts with metformin and is prescribed to patients over 65," or when regulatory provenance requires entity-level citations. Ontology-aware retrieval is also called "GraphRAG" or "structured RAG."
What standards exist for ontologies?
Web standards: RDF, RDFS, OWL, SKOS, SHACL. Industry ontologies: SNOMED CT and ICD-11 (healthcare), FIBO (finance), schema.org (web), GoodRelations (e-commerce), BFO and DOLCE (upper ontologies). LinkML and Pydantic are popular code-first alternatives for newer applications.
What tools are used to build production ontologies?
Protégé (open-source ontology editor), TopBraid Composer (commercial), Stardog and GraphDB (triple stores with reasoning), Neo4j (property graphs, less formal but operationally simpler), and increasingly LLM-assisted tools that propose ontology updates from raw text.

Related concepts