Executable Ontology Fixes Graph Retrieval Hallucinations

coldoven · reddit · 2026-07-13

The author tackles a classic graph retrieval issue: the graph contains an edge, but the edge type is incorrect, ultimately returning a highly confident but wrong answer.

Solution

Additional Takeaways

The author discovered that the same declarations can be directly used for ranking:

Example

For queries like "Sci-Fi by Nolan," the system correctly ranks true matches while assigning a score of 0 to nodes like The Dark Knight (which is related to Nolan but the wrong category) without needing extra manual filters.

The author notes this method is essentially based on classic harmonic functions / current-flow centrality, with the novelty being the unification of these concepts with knowledge graph validity checks from a single source. The project offers an API compatible with 9 graph database backends and can run offline.

Original post →

More from coding & agent

coding & agent channel →