Why AI Agents Need Ontologies: Guardrails Your Memory Layer Can't Provide Alone
An agent that remembers everything can still refund the same order twice. Memory tells an agent what happened. It does not tell the agent what is allowed. That gap is the subject of Frank Coyle’s (UC Berkeley) talk at the AI Engineer World’s Fair 2026, “Why Agentic Systems Need Ontologies”, and it matters for anyone choosing an AI memory platform for production agents.
His argument is simple: large language models are good at plausible language and bad at being the final authority on business rules. The fix is a formal ontology that lives outside the model and checks what the agent proposes before anything is committed.
The Failures That Prompts Don’t Prevent
Coyle’s examples will look familiar to anyone who has shipped an agent into a real workflow:
- A second refund on an order that was already refunded. The agent saw a frustrated customer and a refund tool, and the prompt said “be helpful.”
- A payout sent to the support rep instead of the buyer. Both are “people on the ticket,” and nothing told the model they play different roles.
- An order status the system doesn’t have. The model writes “partially shipped, pending review” when the only valid values are paid, shipped and refunded.
You can add each rule to the system prompt in English. But English instructions are suggestions to a probabilistic model, not constraints. They get ignored under long context, drift over many loop iterations, and cost tokens on every call.
What an Ontology Actually Is
An ontology is a formal, shared description of a domain: the entities that exist (customer, support rep, order, refund), their properties, and the relationships and constraints between them. In practice it is data modeled as a graph, which is why it pairs naturally with the knowledge-graph memory layers we cover in Knowledge Graph vs. Vector Memory.
Two W3C standards do most of the work:
- RDFS adds simple inference. If “teaches” has a domain of teacher and a range of student, then the fact “Bob teaches Sam” lets a machine infer that Bob is a teacher (and, since every teacher is a person, a person) and that Sam is a student.
- OWL adds constraints a reasoner can enforce. A transitive property (ancestor of) chains automatically. A functional property (has exactly one father; has exactly one refund) means two values must refer to the same thing or the data is inconsistent. Disjoint classes mean a support rep can never also be the buyer on a payout.
Coyle frames this as neurosymbolic AI: the neural model reasons probabilistically on the inside, and symbolic logic acts as guardrails on the outside.
You also don’t have to start from a blank page. Reuse established vocabularies such as schema.org, Dublin Core, FOAF and DBpedia for the common concepts, then model only what is unique to your business.
Where the Ontology Sits in an Agent Loop
The talk walks through a standard Claude tool-use loop. The model receives a prompt and tool definitions, then proposes a tool call with parameters. It does not execute anything itself. Your application code runs the tool and feeds the result back.
The guardrail goes into that hand-off, in two layers:
- Structural check (types). A schema validator such as Pydantic confirms the tool call is well formed: the order ID is a string, the amount is a positive number, the status is a known field.
- Semantic check (meaning). The proposed action is translated into the ontology’s terms and checked by a validator or reasoner. Has this order already been refunded? Is the payee the buyer? Is this status a valid value?
If both pass, the action is committed. If not, the violation goes back to the model with an explanation so it can correct course, or the case is escalated to a human. The key rule: no durable side effects, such as a database write or a payment, until the proposal passes validation. Well-shaped input is not the same as a correct business decision.
Coyle’s summary of the pattern is a bounded set of rules around an unbounded loop. That boundary also limits the other classic loop failures: runaway iterations, gradual drift from the goal and spiraling token cost.
What This Means When You Choose a Memory Platform
An ontology is not a replacement for agent memory. It is the rulebook that memory gets checked against. The more structure your memory layer already has, the easier it is to add that rulebook:
- Zep / Graphiti stores memory as a bi-temporal knowledge graph with typed entities and edges. Superseded facts (an order that moved from paid to refunded) are closed out instead of competing with the current state, which is exactly what a “refund once” rule needs to check.
- Turion Brain builds a private company knowledge graph from your CRM, help desk and inbox, so customers, tickets, orders and owners already exist as connected entities, which is the raw material an ontology constrains.
- Memori sits on the inference path as a gateway and captures every tool call and result. That is the natural place to apply a validate-before-commit step across model providers.
- Mem0 and Supermemory extract facts and relationships for fast personalization. Both are strong choices for recall; for rule-heavy financial or support workflows, pair them with your own validation layer.
Four Steps to Get Started
- List the actions your agent can take that are expensive to undo: refunds, payouts, status changes, outbound messages.
- Write down the rules behind each one as constraints, not prose: “an order has at most one refund,” “payee must be the buyer,” “status is one of paid, shipped, refunded.”
- Model them with a reused vocabulary plus RDFS/OWL, and run a reasoner or validator over every proposed action before it executes.
- Keep Pydantic at the door and the ontology at the ledger: types on the way in, domain logic before anything is written.
Our Recommendation
If your agents touch money, orders or customer records, choose a memory platform that keeps entities and relationships explicit, then add an ontology layer on top. Compare graph support, temporal versioning and governance side by side in our Top 5 Comparison Table, or start with our #1 pick, Turion Brain if you want your company’s entities modeled as a live knowledge graph out of the box.
Source: Frank Coyle, “Why Agentic Systems Need Ontologies”, AI Engineer World’s Fair 2026.
