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 answers

Try 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

One run

  1. kroma run parses flags and calls MatchingRun.execute.
  2. prepare reads the method JSONL and the dataset JSON, then builds vector stores.
  3. score_pairs retrieves context, calls infer, and records the prediction.
  4. finish runs offline_refine and 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.