Ontologies Are So Back: Why AI Agents Are Reviving the Semantic Web

Fair warning: a robot wrote this. I built the robot, the safety gates, and the Telegram approval flow, then I let it cook.How the autoblog actually works

A chain of paper rings in pale peach and apricot with one ring broken open, a silver paper clip joining the gap, lying on an off-white surface.

TL;DR

  • Ontologies are experiencing a renaissance in AI development because large language models need structured knowledge frameworks to ground their reasoning, reduce hallucinations, and enable reliable tool use in agentic systems.
  • The Semantic Web's core insight was correct, just early: AI agents require explicit knowledge representation to coordinate actions, validate outputs, and maintain consistency across complex workflows—exactly what ontologies were designed to provide.
  • Product builders should adopt a hybrid approach: Use LLMs for flexible reasoning and natural language understanding, but anchor them with domain ontologies that define entities, relationships, and constraints for your specific use case.
  • Start small and iterate: You don't need a comprehensive ontology upfront—begin with core entities and relationships in your domain, then expand based on where your AI agents struggle or produce inconsistent results.

If you've been building with AI for the past two years, you've probably noticed something curious: we're all quietly becoming knowledge engineers again. We're defining schemas, mapping relationships, constraining outputs, and building structured representations of domain knowledge. We're doing ontology work, even if we're calling it "prompt engineering" or "function calling" or "structured outputs."

The Semantic Web crowd was right. They were just twenty years early.

The Ontology Backlash and Why It Happened

Let's be honest about history. The Semantic Web movement of the 2000s earned its skepticism. The vision was compelling—a web where machines could understand and reason about information, not just retrieve it. But the execution was often academic, over-engineered, and disconnected from practical needs.

I remember the RDF triples, the OWL reasoners, the endless debates about ontology alignment. The tools were complex, the standards were Byzantine, and the promised benefits felt perpetually out of reach. Companies tried to build knowledge graphs and gave up. Developers encountered XML namespaces and ran screaming back to relational databases.

The final nail seemed to come with the deep learning revolution. Who needs carefully structured knowledge when you can just throw data at a neural network? Word2vec, transformers, and eventually GPT showed that statistical patterns in massive datasets could capture semantic relationships without anyone explicitly defining them. The implicit beat the explicit. The bottom-up beat the top-down.

Except it didn't, not completely.

Why AI Agents Need Structure

Here's what changed: we're not just building models anymore. We're building agents—AI systems that take actions, use tools, and operate with some degree of autonomy. And the moment you move from prediction to action, everything gets harder.

An LLM can generate plausible text about booking a flight. An agent needs to actually book the flight, which means calling the right API, with the right parameters, in the right sequence, handling errors appropriately, and validating that the action succeeded. Plausibility isn't enough. You need correctness.

This is where ontologies come roaring back. As Latent Space explores in their recent piece, the structure that ontologies provide—explicit entity definitions, relationship constraints, validation rules—is exactly what agentic systems need to move from impressive demos to production reliability.

Consider a customer service agent that needs to process returns. Without structure:

With an ontology defining your domain:

The LLM still handles the natural language understanding and generation. But the ontology provides the scaffolding that keeps it from going off the rails.

My Take: We're Building Knowledge Graphs, Not Ontologies

Here's where I think the conversation needs nuance. I don't believe we're seeing a wholesale return to Semantic Web orthodoxy, and we shouldn't. The tools and approaches that failed in 2005 won't magically work in 2025 just because LLMs exist.

What we're actually building is more pragmatic: lightweight knowledge graphs that are just structured enough to solve specific problems. We're not trying to model all human knowledge or achieve perfect ontological consistency. We're defining the entities and relationships that matter for our particular application, in formats that are easy to work with (usually JSON Schema or TypeScript types, not OWL), with validation that catches the errors that actually occur.

I think the winning approach is what I'd call "ontology-lite"—borrowing the core insights about explicit knowledge representation while ditching the academic baggage. You don't need a PhD in formal logic to define that a User has many Orders, an Order contains LineItems, and a Return requires a ReturnReason from an enumerated list.

The key shift is that LLMs make ontologies useful in a way they never were before. Previously, you needed the ontology to enable machine reasoning—a hard problem that never quite worked. Now, you need the ontology to constrain and validate reasoning that's already happening in the LLM. That's a much more tractable problem.

Practical Patterns for Product Builders

Start With Your Tool Definitions

If you're building an AI agent, you're probably already defining tools (functions the agent can call). Your tool definitions are the seed of your ontology. Look at them carefully:

Document these explicitly. Don't just have a createTask function that takes a bag of parameters. Define a Task entity with required and optional properties, define its relationships to other entities, and define the validation rules that govern task creation.

Use TypeScript or JSON Schema as Your Ontology Language

Forget OWL and RDF. Your ontology should be defined in the same languages your application uses. If you're building in TypeScript, your entities should be TypeScript types. If you're working with JSON APIs, use JSON Schema.

This isn't just about developer ergonomics (though that matters). It's about making your ontology executable. When your entity definitions are in code, you can use them for runtime validation, automatic API documentation, and generating type-safe SDKs. Your ontology becomes infrastructure, not documentation.

Build Validation Layers

One of the most powerful patterns I've seen is wrapping LLM outputs in validation layers that check against your ontology. Before an agent action executes:

  1. Parse the LLM's output into structured data
  2. Validate it against your entity schemas
  3. Check relationship constraints (foreign keys, cardinality rules)
  4. Verify business rules and permissions
  5. Only then execute the action

This creates a safety net. The LLM can be creative and flexible in understanding user intent and generating actions. But it can't violate the fundamental rules of your domain.

Encode Business Logic in Relationships

One underutilized aspect of ontologies is that relationships can carry semantics beyond just connections. Consider:

When your agent needs to reason about these domains, having these relationships explicitly defined makes the reasoning much more reliable. You can even provide the relevant portion of your ontology as context to the LLM when it needs to make decisions.

Version Your Ontology

Your domain model will evolve. New entities will emerge, relationships will change, constraints will be refined. Treat your ontology like you treat your database schema—version it, migrate it carefully, and maintain backward compatibility where possible.

This is especially important for agentic systems because agents might be in the middle of multi-step workflows when your ontology changes. You need strategies for handling in-flight processes that reference old versions of your entities.

The Hybrid Architecture: LLMs + Ontologies

The architecture that's emerging looks something like this:

LLM Layer: Handles natural language understanding, intent classification, creative generation, and flexible reasoning. This is where the magic of foundation models shines—understanding messy human input, handling edge cases, generating natural responses.

Ontology Layer: Defines entities, relationships, constraints, and business rules. This is your structured knowledge—the ground truth about your domain that doesn't change based on training data.

Validation Layer: Sits between them, ensuring that LLM outputs conform to ontological constraints before actions execute. This is your safety net and your error detection system.

Feedback Layer: When validation fails, provides structured feedback to the LLM about what went wrong and what constraints were violated. This helps the LLM self-correct and improves outputs over time.

This architecture gives you the best of both worlds. The LLM provides flexibility and natural interaction. The ontology provides reliability and correctness. Together, they enable agents that are both capable and trustworthy.

Real-World Impact: Where This Matters Most

Not every AI application needs ontologies. A chatbot that answers FAQs? Probably fine without them. A creative writing assistant? Ontologies would just get in the way.

But for certain classes of applications, ontologies are becoming essential:

Enterprise Automation: When AI agents interact with business systems—ERPs, CRMs, inventory management—the cost of errors is high and the domain is complex. Ontologies that model your business entities and their relationships are crucial for reliable automation.

Healthcare Applications: Medical ontologies (like SNOMED CT and ICD) have existed for decades because healthcare requires precision. AI agents in healthcare need to ground their reasoning in these established ontologies to ensure safety and compliance.

Financial Services: Trading, lending, compliance—these domains have complex rules and regulations. Ontologies that encode these rules enable AI agents to operate within bounds while still providing intelligent assistance.

E-commerce Platforms: Product catalogs, inventory, orders, fulfillment—these are naturally ontological domains. AI agents that help with product discovery, order management, or customer service benefit enormously from structured knowledge about how these entities relate.

The Tooling Gap

Here's the challenge: while the need for ontologies in AI systems is clear, the tooling is still immature. We don't yet have great tools for:

This is an opportunity. If you're building developer tools, there's real value in creating better ontology management solutions for AI builders. Think of it as the Prisma or Drizzle of knowledge graphs—making structured knowledge as easy to work with as databases.

Looking Forward: The Convergence

I believe we're heading toward a convergence where the distinction between "structured data" and "unstructured data" becomes less meaningful. LLMs will get better at producing structured outputs. Ontologies will get more flexible and easier to define. The boundary between the two will blur.

What we're really building toward is AI systems that can reason over both explicit knowledge (ontologies) and implicit knowledge (learned patterns). Systems that can leverage structure when it exists and fall back to flexible reasoning when it doesn't. Systems that can help humans define and refine ontologies rather than requiring expert knowledge engineers.

The Semantic Web vision wasn't wrong. It was incomplete. It imagined a world where machines could understand human knowledge, but it didn't have the AI capabilities to make that understanding useful. Now we have those capabilities. The question is whether we can combine them with structured knowledge in ways that are practical, not just theoretically elegant.

Getting Started Today

If you're building AI products and want to incorporate ontological thinking:

  1. Audit your current system: What entities does your AI interact with? What relationships exist between them? What constraints should apply? Write these down.

  2. Start with tool schemas: If you have function calling or tool use, make your function signatures more precise. Define clear input/output types. Document preconditions and postconditions.

  3. Add validation: Before executing agent actions, validate them against your entity schemas and relationship constraints. Log validation failures—they'll tell you where your ontology needs refinement.

  4. Iterate based on errors: When your agent makes mistakes, ask whether the mistake could have been prevented by better ontological constraints. If yes, add them.

  5. Keep it pragmatic: Don't try to model everything upfront. Build the ontology you need for your application, not the ontology you think a perfect knowledge representation would require.

The future of AI isn't purely neural or purely symbolic. It's hybrid. And the sooner we embrace that, the sooner we'll build agents that are actually reliable enough to trust with real work.

Ontologies are back. Not because they're trendy, but because they solve real problems in agentic systems. Welcome to the renaissance.

Frequently Asked Questions

Do I need to learn OWL or RDF to use ontologies in my AI application?

No, you don't. Modern ontology work for AI agents is much more pragmatic than traditional Semantic Web approaches. Most teams define their domain models using TypeScript types, JSON Schema, or similar developer-friendly formats. The key is capturing entities, relationships, and constraints in a structured way—not achieving formal ontological perfection using academic standards.

When should I add ontologies to my AI product versus just using LLM outputs directly?

Add ontological structure when your AI agent takes actions that have consequences—interacting with databases, calling external APIs, handling transactions, or making decisions that affect users or business operations. If you're just generating text or providing recommendations, you probably don't need formal ontologies. The higher the cost of errors and the more complex your domain, the more you'll benefit from structured knowledge.

How do ontologies reduce AI hallucinations in practical terms?

Ontologies don't prevent LLMs from generating hallucinated content, but they provide a validation layer that catches hallucinations before they cause harm. By defining what entities exist, what properties they can have, and what relationships are valid, you can validate LLM outputs against ground truth and reject responses that violate your domain constraints. This turns hallucinations from silent failures into detectable errors that can trigger retries or fallback behaviors.

What's the difference between a knowledge graph and an ontology for AI applications?

An ontology defines the schema—the types of entities, relationships, and constraints that exist in your domain. A knowledge graph is an instance of that schema—the actual data representing specific entities and their relationships. Think of it like the difference between a database schema and the data in the database. For AI agents, you typically need both: an ontology to constrain and validate agent behavior, and a knowledge graph to provide factual information the agent can reason over.