Video summary

Why Agentic Systems Need Ontologies — Frank Coyle, UC Berkeley

Main summary

Key takeaways

Educational

Main ideas, concepts, and lessons

  • Why agentic AI needs ontologies

    • The talk argues that modern agentic systems (including those built with LLMs) benefit from ontologies because LLMs are probabilistic and can produce unreliable outputs (“hallucinations”).
    • Ontologies provide structured, formal “guardrails” so agents can better determine whether an LLM’s proposed action/response is reasonable and constrained to a domain.
  • Agents and ontology are a “good fit”

    • Agents (as an AI lineage) are systems that perceive, decide, and act.
    • Ontologies (as a knowledge lineage) provide a shared conceptualization of the world/domain—i.e., the “entities” and their relationships and properties.
  • Neuro-symbolic convergence (“neuro-symbolic AI”)

    • The speaker connects probabilistic models (LLMs) with more formal symbolic representations (ontologies, knowledge graphs).
    • The goal is to combine:
      • Neural/probabilistic reasoning (LLM generation)
      • with symbolic constraints/inference (ontology rules and validation)
  • Ontologies are not complicated (practical framing)

    • Ontologies can be thought of as a graph data structure:
      • Nodes/entities
      • Edges/relationships
      • Properties/attributes on entities/relationships
  • How ontologies relate to data modeling (graph vs relational)

    • Ontologies/graph models handle evolving domains better than rigid relational schemas:
      • In relational databases, adding new concepts may require schema/table changes.
      • In graph databases/ontologies, you can add properties and relationships more flexibly.
  • Two main approaches to building ontologies

    • Top-down approach
      • Convene domain experts
      • Identify key entities and relationships
      • Define properties and structure explicitly
    • Bottom-up approach
      • Start from observed behavior/data (e.g., what customers do/reactions)
      • Add entities/relationships discovered from real usage patterns
      • Leverage existing vocabularies/taxonomies instead of reinventing everything
  • Use existing vocabularies/taxonomies

    • Examples mentioned:
      • schema.org
      • FOAF (Friend of a Friend)
      • Dublin Core (for describing research papers/books)
      • DBpedia (behind Wikipedia’s structured graph)
  • Ontology languages support inference and constraints

    • The talk emphasizes RDFS and OWL as “augmenting technologies” that sit alongside the ontology graph to enable:
      • Inference
      • Validation constraints
    • Examples:
      • RDFS domain/range inference
        • If a property like teaches has domain = Teacher, then using it implies the subject is a Teacher.
        • If teaches has range = Student, then using it implies the object is a Student.
      • OWL transitive properties
        • Example: ancestor is transitive, so if Sue is ancestor of Mary and Mary is ancestor of Ann, infer Sue is ancestor of Ann.
      • OWL functional properties
        • Example: has father is functional (only one father), enabling detection that two claims likely refer to the same individual.
    • The broader purpose: these rules/constraints help prevent LLM outputs from drifting outside the domain.
  • Agent loops: capability plus risk

    • Agents often use loops (iteration over steps: decide → act → check → repeat).
    • Loops make systems Turing complete in the classic computation sense (framed via programming constructs: sequence, conditionals, loops).
    • Risks of loops in agentic systems:
      • Infinite loops
      • Drift when agents communicate and “go off the rails”
      • Cost escalation (more iterations → more token usage)
  • Concrete agent loop example (Claude agent-style pseudocode logic)

    • The speaker describes a repeated loop structure around an LLM + tool calling + checking:
      • While true
        • LLM produces a response containing tool-parameter instructions
        • Check stop reason
          • If tool use, then:
            • Execute tool using the LLM-proposed parameters
          • After tool execution:
            • Use ontology-based validation/logic to assess whether results are reasonable
        • If results are not reasonable:
          • Return feedback to the LLM for another attempt or involve a human-in-the-loop
    • Key idea: surround LLM behavior with checks and structured validation.
  • Type and schema validation (Pydantic + ontology)

    • The speaker recommends pairing:
      • Pydantic for enforcing types of tool parameters/results
      • Ontology validation/reasoning to ensure outputs conform to domain constraints
    • Emphasized theme:
      • Pydantic at the door
      • Ontology at the ledger
  • Reduce side effects

    • The advice includes that agents should ideally have no side effects until validated:
      • Run agent proposals through ontology checks before making database-changing actions.
  • OWL catches domain-specific logical errors

    • The speaker gives examples of constraints that are hard to reliably enforce in raw natural language but can be enforced with ontology logic:
      • Disjoint properties (entity separation)
        • Example: preventing “support desk vs buyer” confusion by declaring customer and support rep as disjoint entity types.
      • Allowed value restrictions
        • Example: “status” must be one of paid, shipped, refunded (reject other values like “probably shipped”).
      • Disjoint/constraint-based error detection
        • Example: “a second refund on the same order” treated as an error via ontology constraints.
  • Bottom-line message / philosophy

    • Reiterated mantra from the speaker’s educational philosophy:

      “Nothing is a mistake. There’s no win. There’s no fail. There’s only make.”

    • Practical implication: build iteratively—generate, validate with ontologies, correct with feedback loops, and don’t assume one-shot LLM output is correct.

  • Where to reach the speaker

    • Email mentioned: coil@burkly (spelled as stated in subtitles)
    • Website mentioned: codesupreme.ai

Methodology / process presented (detailed bullet format)

1) Agentic loop with tool use + ontology-based guardrails

  • Initialize loop
    • Repeat indefinitely (conceptually while true)
  • LLM step
    • Provide the LLM:
      • a prompt
      • context
      • available tools
    • Ask the LLM to:
      • propose tool usage and the input parameters
  • Interpret LLM stop reason
    • If stop reason indicates tool use:
      • extract the tool-call parameters from the LLM output
      • execute the tool
  • Tool result validation
    • After the tool runs:
      • transform/represent the tool output in a form suitable for ontology-based checking
      • use ontology reasoning/constraints to decide if the result is reasonable and within the domain
  • Decision
    • If validation passes:
      • accept the result
    • If validation fails:
      • send feedback back to the LLM for another attempt
      • or use a human-in-the-loop intervention

2) Guardrails using typing + ontology constraints

  • Use Pydantic
    • Specify expected parameter/result types
    • Validate that tool inputs/outputs match required types
  • Use ontology reasoning/validation
    • Apply RDFS/OWL rules such as:
      • domain/range inference
      • transitive relations
      • functional-property constraints
      • disjoint properties
      • constrained allowed values (enumerations)
  • Order of protection
    • Pydantic at the “door” (type/schema entry checks)
    • Ontology at the “ledger” (domain correctness checks)

3) Side-effect minimization strategy

  • Until ontology validation succeeds:
    • keep the agent from making real-world/database-changing actions
  • After passing ontology checks:
    • allow actions that have side effects

Speakers / sources featured (identified in the subtitles)

  • Frank Coyle (speaker; UC Berkeley educator)
  • Sister Corita Kent (educational philosophy source quoted)
  • John Cage (popularized Sister Corita Kent’s ideas)
  • Alan Turing (referenced in computation/loops background)
  • Aristotle (ontologies/philosophy of being referenced)
  • Willard Van Quine (subtitles: “Von Quine”; philosopher referenced)
  • Thomas R. Gruber (1993) (ontology definition referenced)
  • John McCarthy (early AI lineage referenced)
  • M. S. (Selfridge) (subtitles: “Selfridge”; early AI lineage referenced)
  • Marvin Minsky (Society of Mind/agent lineage referenced)
  • Bohm and Jacopini (1966) (programming language constructs referenced)
  • Claude agent (example agent system referenced in code demonstration)
  • schema.org (existing ontology/taxonomy referenced)
  • FOAF (Friend of a Friend) (existing ontology referenced)
  • Dublin Core (existing ontology referenced)
  • DBpedia (referenced as underlying Wikipedia’s structured graph)
  • Wikipedia (referenced via DBpedia)
  • Pydantic (tool/library referenced)
  • RDFS (ontology-related language referenced)
  • OWL (Web Ontology Language) (ontology-related language referenced)
  • “Code Supreme” / codesupreme.ai (speaker’s website brand mentioned)
  • “Love Supreme” / John Coltrane (mentioned as naming inspiration)

Original video