Agent-OM: Leveraging LLM Agents for Ontology Matching

Zhangcheng Qiang, Weiqing Wang, Kerry Taylor · DOI

TL;DR

Agent-OM is a novel framework that transforms Large Language Models (LLMs) from simple predictors into autonomous agents capable of complex Ontology Matching (OM). By combining specialized tools, hybrid memory, and automated planning, it matches the performance of traditional expert systems on simple tasks and significantly outperforms them in complex, "few-shot" scenarios where training data is scarce.

What Problem Does This Paper Address?

In our data-driven world, different organizations often use different "languages" (ontologies) to describe the same things. Ontology Matching is the process of finding correspondences between these different structures—for example, realizing that "Staff_Member" in one database is the same as "Employee" in another.

Historically, we’ve relied on two methods:

  1. Expert Systems: These require human experts to write thousands of manual rules. They are precise but incredibly labor-intensive.
  2. Machine Learning (ML): These systems learn to match entities but require massive amounts of high-quality training data, which most niche domain ontologies simply don't have.

While LLMs seem like a natural fit for this linguistic task, they face three major hurdles: they "hallucinate" (make things up), they have strict token limits that prevent them from seeing a whole ontology at once, and they struggle with the non-linguistic logic required for complex data structures.

Methods

The authors introduce Agent-OM, a framework that uses two "Siamese" agents—a Retrieval Agent and a Matching Agent—that share a common memory.

  • The Retrieval Agent: Instead of just reading a file, this agent uses Chain-of-Thought (CoT) planning to extract metadata, syntactic info, and semantic context (like RDFS comments) for every entity. It stores this in a Hybrid Database (combining traditional PostgreSQL with a Vector database for similarity searches).
  • The Matching Agent: This agent performs the actual alignment. It uses Reciprocal Rank Fusion (RRF) to combine results from three different perspectives: syntactic, lexical, and semantic.
  • The Validator: To solve the hallucination problem, the system includes a "self-check" step. The agent asks the LLM a binary question: "Is Entity A truly equivalent to Entity B in this specific context?" This simple validation step drastically improves precision.
  • Efficiency: By using a vector database (RAG approach), the system avoids the "all-pairs" comparison problem. Instead of comparing every item in Ontology A to every item in Ontology B (which is $O(N \times M)$ and very expensive), it performs a targeted search ($O(N+M)$).

Datasets

The system was evaluated using the OAEI (Ontology Alignment Evaluation Initiative) benchmarks, the gold standard in the field:

  • Conference Track: Small-to-medium ontologies related to organizing academic conferences.
  • Anatomy Track: A massive, complex task matching human and mouse anatomical structures (notorious for using cryptic codes instead of natural language).
  • MSE Track: A specialized track for Materials Science and Engineering, involving complex terminology and abbreviations (e.g., "Au" for Gold).

Key Insights and Ideas

  • The "Siamese" Advantage: By splitting the task into retrieval and matching but allowing the agents to share memory, the system mimics how a human expert might first "study" a domain before attempting to link it to another.
  • Moravec’s Paradox in OM: The authors observed that for LLMs, "hard problems are easy and easy problems are hard." LLMs excel at complex, nuanced semantic matches that baffle traditional systems, but they can sometimes be outperformed by simple string-matching algorithms on trivial tasks.
  • Validation is Key: The most significant "aha moment" was the effectiveness of the Matching Validator. Simply asking the LLM to double-check its own work in a separate step pruned away the majority of false positives.
  • Context over Fine-Tuning: The paper demonstrates that In-Context Learning (ICL) and RAG are more scalable for OM than fine-tuning, as most ontologies don't have enough entities to provide a sufficient training set for a model as large as GPT-4.

Key Results

  • Superior Performance: On the OAEI Anatomy track, Agent-OM achieved the second-highest F1 score for trivial matches and outperformed all 11 competing systems (including other LLM-based systems like OLaLa) on non-trivial, complex matches.
  • Efficiency: Compared to a naive "LLM-only" approach, Agent-OM reduced token consumption and costs by orders of magnitude while maintaining higher stability across multiple runs.
  • Versatility: The system proved resilient across diverse domains, from the highly technical language of materials science to the structured hierarchies of biomedical anatomy.

Limitations and Future Work

  • TBox vs. ABox: Currently, the system only matches the "schema" (classes and properties). It does not yet handle ABox matching (aligning individual data instances), partly due to privacy concerns regarding sensitive data.
  • Cost: While more efficient than naive prompting, using top-tier commercial models like GPT-4o still incurs significant API costs for very large ontologies.
  • Future Directions: The authors suggest moving toward Multimodal OM (incorporating diagrams and visual data) and exploring Small Language Models (SLMs) that can run locally on secure hardware to handle sensitive data without needing cloud APIs.

Summary updated

Abstract

Ontology matching (OM) enables semantic interoperability between different ontologies and resolves their conceptual heterogeneity by aligning related entities. OM systems currently have two prevailing design paradigms: conventional knowledge-based expert systems and newer machine learning-based predictive systems. While large language models (LLMs) and LLM agents have revolutionised data engineering and have been applied creatively in many domains, their potential for OM remains underexplored. This study introduces a novel agent-powered LLM-based design paradigm for OM systems. With consideration of several specific challenges in leveraging LLM agents for OM, we propose a generic framework, namely Agent-OM (Agent for Ontology Matching), consisting of two Siamese agents for retrieval and matching, with a set of OM tools. Our framework is implemented in a proof-of-concept system. Evaluations of three Ontology Alignment Evaluation Initiative (OAEI) tracks over state-of-the-art OM systems show that our system can achieve results very close to the long-standing best performance on simple OM tasks and can significantly improve the performance on complex and few-shot OM tasks.
BibTeX
@article{qiang2024agent,
  author = {Zhangcheng Qiang and Weiqing Wang and Kerry Taylor},
  title = {{Agent-OM: Leveraging LLM Agents for Ontology Matching}},
  journal = {Proceedings of the VLDB Endowment},
  year = {2024},
  doi = {10.14778/3712221.3712222},
}
Figure