graphify icon indicating copy to clipboard operation
graphify copied to clipboard

Feature: first-class canonical entity registry (aliases/trigrams) consumed by extraction, build_merge and query

Open Ns2384-star opened this issue 4 months ago • 0 comments

Version: graphifyy 0.9.5, documentary corpus (~6800 nodes).

Problem

Fuzzy dedup (Jaro-Winkler threshold 92, dedup.py) can't — and shouldn't — merge a trigram with a full name (MWA ↔ Mickael Wagner) or two phrasings of an org (datafab_by_alteca ↔ datafab). But nothing else does either. Lived consequences on our corpus:

  • 200+ manual merges over a month;
  • a god node destroyed by replace-on-re-extract after a subagent emitted a different ID for the same entity (174 edges → 0).

Proposal

A first-class canonical-entity registry, e.g. graphify-out/entities.json (id, label, type, aliases, forbidden-merge homonyms), consumed by:

  1. the extraction prompt/spec (subagents emit canonical IDs directly);
  2. build_merge (remap aliases → canonical ID before replace-on-re-extract);
  3. query expansion (querying an alias finds the canonical node).

The aliases field already exists on nodes — this is mostly about making it bidirectional, persistent, and honored at merge time. We maintain such a file by hand today and inject it into extraction prompts; it works, but it's all outside the tool.

Related: #595 (graph hygiene primitives).

Ns2384-star avatar Jul 04 '26 16:07 Ns2384-star