# Why Agentic Systems Need Ontologies — Frank Coyle, UC Berkeley

## Executive summary

The talk argues that while Large Language Models (LLMs) and agentic systems represent a powerful shift toward AI, their inherent probabilistic nature makes them unreliable for mission-critical tasks. To mitigate failures—such as incorrect order statuses or double refunds—the solution is 'Neurosymbolic AI': coupling the LLM's generative power with external, formal ontologies. An ontology acts as a logical guardrail, enforcing constraints (e.g., payment status must be one of three values) that are impossible to reliably enforce using prompt engineering alone.

## Key takeaways

- The Problem with Probabilistic Agents: LLMs reason probabilistically over domains they only half understand, leading to failures in brittle tools and fragile handoffs. These errors cannot be reliably stopped by mere instructions or prompt engineering.
- Neurosymbolic AI: Guardrails for LLMs: This approach ties together neural networks (LLMs) with symbolic AI (rule-based systems and ontologies). The ontology provides the necessary guardrails to keep the probabilistic model constrained and honest.
- The Role of Ontologies: An ontology is a formal specification of a shared conceptualization, defining typed entities, their relationships, and constraints. It allows systems to validate proposed actions (e.g., ensuring an order can only be refunded once).

## Technical details

- Ontology Structure and Standards: Ontologies are represented using standards like RDFS (Resource Description Framework Schema) and OWL (Web Ontology Language). These technologies allow for defining constraints, such as: 1. **Domain/Range:** Inferring entity types based on relationships (e.g., if 'teaches' has a domain of 'teacher', the subject must be a teacher). 2. **Functional Properties:** Enforcing uniqueness (e.g., an individual can only have one father).
- Agent Execution Flow and Validation: A robust agent loop must validate LLM outputs at multiple stages: First, use **Pydantic** to check the types of proposed tool parameters. Second, pass the resulting data through an ontology validator (the 'ledger') to ensure logical consistency against domain constraints before allowing any action.
- Agent Limitations: LLMs can only predict the next word with high probability; they cannot execute actions. Therefore, external tools and validation layers are mandatory to translate LLM intent into reliable system calls.

## Practical implications

- Build engineers should treat LLM outputs as proposals that require mandatory validation layers rather than final actions.
- Implementing a two-stage validation pipeline (Pydantic for type checking, Ontology for logical constraint checking) is critical for building reliable agentic systems.
- Leveraging existing taxonomies like Schema.org reduces the overhead of defining new domain ontologies.

## Topics

Agentic Systems, Ontology Engineering, Neurosymbolic AI, Knowledge Graphs, LLM Guardrails, System Reliability, RDFS, OWL (Web Ontology Language), Pydantic, Schema.org / DBPedia

Source: https://www.youtube.com/watch?v=Sir59K8ZDPU
