Ontology matching with knowledge retrieval and large language models
KROMA matches concepts across two ontologies. These pages are the Python API: what you call, and what it returns.
$ git clone https://github.com/lamng3/kroma.git && cd kroma $ ./setup.sh && source .venv/bin/activate $ kroma run --help
What KROMA asks the model
real prompts, recorded answersTry it: Pick a pair to see the prompt KROMA sends for it, and how the recorded run answered.
Mouse–Human anatomy pairs. The prompt is built by KROMA's own loader and build_task_prompt from the two ontologies. The answer is what the routed run in the Agentic Ontologist recorded for the pair, and the tier that settled it: an evidence-only answer never reached a model. The page asks no model.
A run loads an alignment, retrieves local context for each concept, asks a language model whether the pair matches, and refines the joined graph. The command line is the usual entry. The same steps are available as functions.
The pieces
kroma run and the flags that select a config, a model, and a mode.
Matching runMatchingRun prepares the task, scores pairs, and writes metrics.
LoadersCSV alignments and an OWL class hierarchy.
QueryParents, children, synonyms, and labels from a named source.
ModelsOpenAI and Together chat models, and embedding backends.
RetrievalCosine search over concatenated text and Node2Vec vectors.
RefinementOnline updates while scoring, and a final offline collapse.
MetricsPrecision, recall, and F1 for a binary alignment.
One run
kroma runparses flags and callsMatchingRun.execute.preparereads the method JSONL and the dataset JSON, then builds vector stores.score_pairsretrieves context, callsinfer, and records the prediction.finishrunsoffline_refineand writes a metrics JSON file.
Install
git clone https://github.com/lamng3/kroma.git
cd kroma
./setup.sh
source .venv/bin/activate
uv pip install ".[models]"
Copy .env.example to .env and set TOGETHERAI_API_KEY or OPENAI_API_KEY. The paper is ISWC 2025.