
This blog is written by AI for SEO
Self-Healing Ontology: Keeping Links Right as Data Drifts
A self-healing ontology is an engineering loop, not a feature you switch on. You detect that your source data has drifted, find the links that are now wrong or broken, and repair them with evidence and a person approving the change. The ontology never fixes itself silently. It tells you what broke, shows you why, and lets someone decide.
That matters because an ontology goes wrong quietly. A column gets renamed, a new CRM shows up, a vendor changes its ID format, and the same customer now exists twice. Nothing errors. Your AI agent just starts answering with subtly wrong facts. This guide walks through the loop with any tool, then shows what Helix Foundry does at each step.
What 'self-healing' means for an ontology (and what it should not mean)
Self-healing means the ontology can notice when it no longer matches reality and get you back to a correct state through a short, reviewable path. Three parts: detect drift, locate the wrong links, repair with evidence.
It should not mean silent auto-repair. If a system rewrites links on its own, you lose the one thing an ontology is for: being able to say why a fact is true. A merge of two customers that nobody approved is worse than a duplicate, because the duplicate is visible and the bad merge is not.
The test for any tool that claims self-healing is simple. Ask what happens when it is unsure. A good answer is "it stops and shows a person the evidence." A bad answer is "it picks the likeliest match."
What drifts: renamed columns, new systems, changed IDs and duplicate customers
Four kinds of drift cause most broken links, and each one fails differently.
Renamed or retyped columns. A mapping that read cust_email now reads nothing. The link that depended on it goes orphaned, or worse, quietly maps to null.
New systems. Sales adopts a second CRM, or a team starts exporting from a new billing tool. Entities now arrive from a source your model has never seen, with its own names for things.
Changed IDs. A migration re-keys the customer table. Every link that matched on the old key now points at nothing, or at a different row that happens to reuse the number.
Duplicate customers. The same company appears in Stripe, Postgres and a CRM under slightly different names. Without a match rule you get three customers. With a sloppy one you get two companies fused into one.
If you want the match-key side in detail, see Link the Same Customer Across Stripe, Postgres and Notion.
Detect wrong and broken links: orphan checks, match-key audits and rule violations
You can run all three checks with SQL and a scheduled job, in any stack. Run them after every source sync, not on a calendar.
Orphan checks. Count links whose target no longer exists, and entities that used to have a link and now have none. A jump in orphans right after a sync is the clearest drift signal you will get.
Match-key audits. For every key you match on (email, tax ID, external ID), check for keys that map to more than one entity, and entities that share a key but were never linked. The first catches over-merging. The second catches duplicates. Also watch the null rate on each key: a key that goes from 4% null to 40% null means a column changed upstream.
Rule violations. Write down the business rules the model should obey: an invoice has exactly one customer, an order cannot ship before it is paid, a vendor cannot approve its own invoice. Run them as queries. Any row that breaks a rule is either bad data or a bad link, and both need a person.
Keep the output as a diff against the last known-good run. "Forty new orphans since Tuesday" is something you can act on. "Four thousand orphans" is not.
Repair with evidence and a human in the loop
Every repair needs three things attached: what changed, the evidence for the fix, and who approved it.
For a renamed column, the evidence is the old and new schema side by side, plus a sample of rows that prove the new column holds the same data. For a duplicate customer, it is the matching keys and the source rows on each side. For a changed ID, it is the crosswalk between old and new keys.
Then apply the fix as a new version of the model, not an edit in place. Versioning gives you two things. You can compare the new state to the old one before you rely on it, and you can roll back if the repair was wrong.
A reviewer should be able to approve or reject each proposed change in under a minute. If they can't, the evidence isn't good enough, and the change should wait.
Doing this in Helix Foundry: sync, new version, review, load
Helix Foundry is the open-source app at foundry.helix-db.com (Apache 2.0, repo on GitHub), and it builds this loop into how it works. It connects your databases, tools and documents, drafts an ontology, and loads it into HelixDB as one connected graph.
The flow when something drifts:
Sync the source. Re-sync the connection whose tables or documents changed, so Foundry sees the new columns, rows or files.
Generate or edit a new version. Versions are immutable. You generate a fresh draft from the synced tables and documents, or edit an existing version, and either way you get a new version rather than a changed old one.
Review it. Open the version and inspect its mappings, types, links, and rules.
Make it current and load it. Nothing changes in the database until you make a version current and load it.
Check what broke. After the load, look at the Rule breaks and any document conflicts, compare the new load with the previous one, and decide how to handle each.
That last step is the point. Rule breaks are surfaced for a person to decide, and Foundry does not assume it can fix them. Because every fact and relationship in the ontology is grounded in a source, you have the evidence for each decision in front of you.
Foundry can also be run locally. For a closer look at the versioning side, see How to Update an Ontology When Your Data Changes, and the Foundry docs cover each step.
Trade-offs: what Foundry surfaces and what a person still decides
Foundry gives you the detection and the paper trail. It doesn't give you judgment, and that's deliberate.
What it surfaces: schema changes after a sync, a new immutable version to review, rule breaks after a load, and document conflicts, each tied back to its source.
What a person still decides: whether a rule break is bad data or a rule that needs changing, which of two conflicting documents is right, and whether a new version is ready to become current. If you want an agent that repairs links without asking, this isn't that. For an ontology that business decisions run on, that's the right call.
There is a cost. Review takes human time, and a source that changes daily will generate review work daily. The fix is to keep rules tight and meaningful, so a rule break means something, rather than writing many rules that fire on noise.
Run the loop on one source this week
Self-healing is a habit: sync, detect, review, load. The tool only decides how cheap each step is. Pick the one source that changes most often, run the orphan and match-key checks on it, and see what the next sync breaks. If you want the versioned, evidence-backed version of that loop without building it yourself, clone helix-foundry, point it at that source, and review the first version it drafts.