Noise-Aware Graph + Hub Dampening (Discern)
File: src/search/graph_ppr.rs (type_base_weight, dampen_hubs)
The problem
The live knowledge graph was ~94% taxonomy noise: tagged_with edges
(note → tag noun) dwarfed the ~134 semantic edges, and degree-73/101/150
mega-hubs let PPR mass wash out across tag clouds. Unweighted PPR on such a
graph returns noise. And a query that looked “too vague” to answer (abstention)
never got a graph chance at all.
The references
- GAAMA (arXiv:2603.27910) — hub dampening
w_ij · min(1, θ/deg(i))tames mega-hubs; edge-type weights separate taxonomy from semantics. - MemORAI (arXiv:2605.01386) — static-type weighting.
- “Use Graph When It Needs” (arXiv:2602.03578) — complexity-gated activation: engage the graph leg precisely when the estimator says it helps.
The implementation (v1.12.0 “Discern”)
- Edge-type weights:
type_base_weight—tagged_with/alias_of→ 0.1, all other relation types → 1.0. The pair-aggregation SQL groups byrelation_type, scales each group by its type weight, then sums per pair. - Hub dampening:
SparseGraph::dampen_hubs(θ)withHUB_DAMPING_THETA = 50— GAAMA’s per-sourcemin(1, θ/deg(i)), applied to the reachable-bounded graph before PPR. Per-source asymmetry is intentional (matches the reference). Determinism hardened by sorting edge rows. - Complexity-gated rescue:
should_attempt_graph_rescuefires a bounded graph-augmented pass only when the estimator saysClarifyQuery, the graph leg isn’t already on, andBRAIN_GRAPH_RESCUE_ENABLED(default true).abstention_decisionreturnslow_confidenceonly whenClarifyQueryAND the final hit list is empty — a successful rescue returns its hits withdecision: "ok", strictly additive, no behavior regression when the kill switch is off.
Measured ceiling
- θ=50 and the 0.1 type weight are corpus-calibrated constants, not learned (deterministic + auditable by design).
- The rescue fires only on the would-be-abstention path; a query with no KG structure (no entity match → no seeds) still abstains.
- Type weights are static (no query conditioning); concept nodes (GAAMA), query-conditioned weights (MemORAI), and noun-phrase seeding remain future options. The tag cloud is structural — re-created on every re-ingest.
Pinned by a regression test that temporarily reverting to the v1.11 arithmetic fails — the mechanism is proven, not asserted.