Skip to content

Does LightRAG consume domain/range too #349

Description

@antejavor

Part of #344

Question

Does LightRAGBackend consume the ontology's structural constraints, or does it stay post-hoc-only — and is the resulting asymmetry acceptable?

The plan says LightRAG needs no change: the domain/range check runs against whatever is already in Memgraph, whichever backend wrote it. That holds cleanly only if enforcement is post-hoc everywhere. Once GLiNER2 gets extraction-time constraints, the backend choice starts changing enforcement semantics, not just extraction quality.

Context: Ontology.entity_types_guidance() already steers LightRAG's prompt for entity types, and Ontology's own docstring records that relation_types has no LightRAG consumer at all — LightRAG has no relation-type steering hook, and writes generic :DIRECTED edges with no typed label (which is why unstructured2graph/evals reports LightRAG's relation scores as n/a rather than zero).

Open:

  1. Can domain/range be expressed to LightRAG at all — as prompt guidance analogous to entity_types_guidance(), given there is no native hook?
  2. If yes, is prompt-level steering meaningfully "enforcement", or just a suggestion that needs the post-hoc check anyway?
  3. If no, is a two-tier model acceptable — GLiNER2 constrained at extraction, LightRAG validated after — or does that make the two backends non-comparable in a way that undermines them being pluggable alternatives at all?
  4. Does LightRAG's lack of typed relation labels make this moot until that is fixed separately?

Blocked by #348: there is only an asymmetry to resolve if extraction-time constraints are adopted. Most likely ticket on this map to turn out to be fog — if #348 lands on post-hoc-only, close this as out of scope rather than resolving it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions