Skip to content

kg_promotion: Unified Schema Filtering tau-gate in the triple -> fact promotion loop #150

Description

@se-jo-ma

Context. kg_promotion.PromoteTriplesToFacts is a pure per-row read-Cypher→Fact pass-through with no global corpus view — exactly the "isolated local extraction" failure mode MemGraphRAG diagnoses (GraphRAG raises recall 84.3 vs 71.8 but drops relevance 38.5 vs 62.9; filtering ~40% low-frequency triples improves accuracy). Adding a candidate→stable schema-promotion gate keyed on extraction frequency is the lowest-architecture-disruption attack on thematic irrelevance.

Proposal. Add a Unified Schema Filtering τ-gate before the per-row fact_store.pin().

  • Aggregate result.rows by schema signature (predicate; + subject/object kind once type nodes exist) into a frequency map.
  • Add tau: int = 1; only rows whose schema frequency ≥ τ are pinned; the rest dropped or pinned with a 'candidate' lineage flag.
  • Emit the candidate/stable decision into the existing lineage dict. Keeps the read-only-Cypher contract intact — pure additive gate.

Where.

  • src/stargraph/stores/kg_promotion.py:139-198 — per-row pin loop; gate before fact_store.pin() :197; interim in-process Counter over result.rows :139; lineage dict :186-193.
  • Durable frequency source = Type-node frequency column from the tri-view schema feature (linked issue).

Acceptance criteria.

  • Rows below τ are excluded (or flagged candidate); ≥τ pinned as stable.
  • Decision recorded in lineage; read-only-Cypher contract unchanged.

Caveat. The interim Counter only sees rows the filter query returns, not the true global corpus — a weaker approximation of the paper's global memory until frequency is materialized on Type nodes.


Source: arXiv:2606.00610v1 — "MemGraphRAG: Memory-based Multi-Agent System for Graph Retrieval-Augmented Generation". Distilled from arXiv-research/2606.00610v1/analysis.md; file refs verified against current main by the analysis pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High priority: load-bearing gap or correctnessarea/storesVector/graph/fact/memory storesenhancementNew feature or requestsize/M<2 days: multi-file feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions