Context. MemGraphRAG's most portable, deterministic mechanism is Thematic Denoising via Unified Schema Filtering: a schema is promoted candidate→stable only once its extraction frequency ≥ τ, and only facts aligned to a stable schema activate. Ablation shows removing the schema filter degrades accuracy. Fathom already has the cross-fact counting shape (fathom_count_exceeds, fathom_last_n, fathom_distinct_count) but no relation-type support-count gate — so it can't yet serve as the deterministic, auditable denoising stage after an external extractor.
Proposal. Add a schema_frequency_exceeds temporal operator + a candidate_schema/stable_schema rule-pack contract.
fathom_schema_frequency_exceeds(template_name, slot_name, slot_value, threshold) — count facts of that type via tmpl.facts(), return count >= τ (near-identical to fathom_last_n).
- Register operator key
schema_frequency_exceeds in _TEMPORAL_OPS; add a _compile_temporal_condition branch mirroring count_exceeds.
- Ship a pack with
candidate_schema/stable_schema templates + a promotion rule; downstream rules pattern-match only stable_schema. τ is a per-rule literal arg (stays deterministic).
Where.
src/fathom/engine.py _register_external_functions :301 (add beside fathom_count_exceeds :334 / fathom_last_n :395-403).
src/fathom/compiler.py _TEMPORAL_OPS :930 + _compile_temporal_condition :1068 (mirror count_exceeds branch :1112-1122).
- New pack under
src/fathom/rule_packs/.
Acceptance criteria.
Honest framing. The counter is functionally identical to fathom_last_n (count ≥ n) — the real new content is the candidate/stable pack contract, not the counting primitive.
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.
Context. MemGraphRAG's most portable, deterministic mechanism is Thematic Denoising via Unified Schema Filtering: a schema is promoted candidate→stable only once its extraction frequency ≥ τ, and only facts aligned to a stable schema activate. Ablation shows removing the schema filter degrades accuracy. Fathom already has the cross-fact counting shape (
fathom_count_exceeds,fathom_last_n,fathom_distinct_count) but no relation-type support-count gate — so it can't yet serve as the deterministic, auditable denoising stage after an external extractor.Proposal. Add a
schema_frequency_exceedstemporal operator + acandidate_schema/stable_schemarule-pack contract.fathom_schema_frequency_exceeds(template_name, slot_name, slot_value, threshold)— count facts of that type viatmpl.facts(), returncount >= τ(near-identical tofathom_last_n).schema_frequency_exceedsin_TEMPORAL_OPS; add a_compile_temporal_conditionbranch mirroringcount_exceeds.candidate_schema/stable_schematemplates + a promotion rule; downstream rules pattern-match onlystable_schema. τ is a per-rule literal arg (stays deterministic).Where.
src/fathom/engine.py_register_external_functions:301 (add besidefathom_count_exceeds:334 /fathom_last_n:395-403).src/fathom/compiler.py_TEMPORAL_OPS:930 +_compile_temporal_condition:1068 (mirrorcount_exceedsbranch :1112-1122).src/fathom/rule_packs/.Acceptance criteria.
count >= τsemantics.stable_schema.Honest framing. The counter is functionally identical to
fathom_last_n(count ≥ n) — the real new content is the candidate/stable pack contract, not the counting primitive.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 currentmainby the analysis pass.