Technical Report 343, c4e-Preprint Series, Cambridge
Ontology-to-tools compilation for executable semantic control of large language models
Reference: Technical Report 343, c4e-Preprint Series, Cambridge, 2026
- Ontological constraints are compiled into executable tools for LLM agents within The World Avatar.
- Tool-using LLM agents iteratively extract and instantiate knowledge under se mantic constraints.
- A synthesis literature case study in The World Avatar demonstrates rule-consistent, stateful generation.
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.
This preprint is also available in the arXiv at doi:10.48550/arXiv.2602.03439.
PDF (1.4 MB)


