🤖 AI Summary
This work addresses the challenge that large language models (LLMs) struggle to adhere to formal semantic constraints in real time when generating structured knowledge, often relying on inefficient and error-prone post-hoc validation. To overcome this limitation, the authors propose an ontology-to-tool compilation mechanism that automatically translates domain ontology specifications into executable tool interfaces. By compelling LLM agents to interact with knowledge graphs exclusively through these generated tools, the approach proactively enforces semantic consistency during knowledge generation. Built upon The World Avatar framework, the method integrates the Model Context Protocol, ontology-driven tool synthesis, and agent workflows, substantially reducing the need for manual prompt engineering. Evaluated on the task of processing scientific literature on metal–organic polyhedra synthesis, the system successfully guides LLMs to extract, validate, and repair structured knowledge, demonstrating the feasibility and advantages of this paradigm for scientific text understanding.
📝 Abstract
We introduce ontology-to-tools compilation as a proof-of-principle mechanism for coupling large language models (LLMs) with formal domain knowledge. Within The World Avatar (TWA), ontological specifications are compiled into executable tool interfaces that LLM-based agents must use to create and modify knowledge graph instances, enforcing semantic constraints during generation rather than through post-hoc validation. Extending TWA's semantic agent composition framework, the Model Context Protocol (MCP) and associated agents are integral components of the knowledge graph ecosystem, enabling structured interaction between generative models, symbolic constraints, and external resources. An agent-based workflow translates ontologies into ontology-aware tools and iteratively applies them to extract, validate, and repair structured knowledge from unstructured scientific text. Using metal-organic polyhedra synthesis literature as an illustrative case, we show how executable ontological semantics can guide LLM behaviour and reduce manual schema and prompt engineering, establishing a general paradigm for embedding formal knowledge into generative systems.