[Atlas] Trust scores on knowledge graph edges

← All Specs

Goal

Every edge in the knowledge graph should have a computed trust score reflecting how much
confidence we should place in that relationship. Trust propagates through the graph —
downstream conclusions inherit diminished trust from upstream evidence. Users and agents
can see at a glance which parts of the knowledge graph are well-supported and which are
speculative.

Current State

  • knowledge_edges has evidence_strength (REAL) and evidence_sources (TEXT, unstructured)
  • No trust model — evidence_strength is set once and never updated
  • No propagation — an edge built on weak upstream evidence appears equally trustworthy
  • No visualization of trust on /graph
  • evidence_validator.py scores PMID relevance but doesn't feed into KG edge trust
  • ~200K+ edges in the knowledge graph with varying quality

Acceptance Criteria

☐ Add trust_score (REAL 0-1), trust_confidence_lower (REAL), trust_confidence_upper (REAL) to knowledge_edges
☐ Add trust_computation_details (JSON) explaining how trust was computed
☐ Add last_trust_update timestamp
☐ Trust computed from: source paper quality, evidence chain depth, independent confirmations, contradiction count
☐ Trust propagation: downstream edges inherit reduced trust from upstream
☐ API: GET /api/graph/trust-map returns trust distribution
/graph visualization shows trust via edge color/thickness (green=high, red=low)
☐ Batch trust recomputation script runs nightly or on-demand
☐ Senate auto-flags edges with trust < 0.2 for review

Schema Changes

-- Add to knowledge_edges
ALTER TABLE knowledge_edges ADD COLUMN trust_score REAL DEFAULT 0.5;
ALTER TABLE knowledge_edges ADD COLUMN trust_confidence_lower REAL DEFAULT 0.3;
ALTER TABLE knowledge_edges ADD COLUMN trust_confidence_upper REAL DEFAULT 0.7;
ALTER TABLE knowledge_edges ADD COLUMN trust_computation TEXT DEFAULT '{}';
ALTER TABLE knowledge_edges ADD COLUMN last_trust_update TEXT;
ALTER TABLE knowledge_edges ADD COLUMN independent_confirmations INTEGER DEFAULT 0;
ALTER TABLE knowledge_edges ADD COLUMN contradiction_count INTEGER DEFAULT 0;

CREATE INDEX idx_knowledge_edges_trust ON knowledge_edges(trust_score);

Trust Model

Source Quality Score (per source type)

Source TypeBase TrustFactors
PubMed paper (high-impact journal)0.8-0.95Impact factor, citations, recency, retraction status
PubMed paper (other)0.5-0.8Citations, recency
Allen Brain dataset0.85-0.95Institutional credibility, data freshness
Forge tool output0.4-0.7Tool validation status, input data quality
Debate extraction0.3-0.6Debate quality score, persona believability
Manual annotation0.2-0.5Annotator credibility

Trust Propagation

trust(edge) = base_source_trust 
              * depth_decay(chain_depth)         -- 0.9^depth
              * confirmation_boost(n_independent) -- 1 + 0.1*n, capped at 1.5
              * contradiction_penalty(n_contra)   -- 1 / (1 + 0.3*n)
              * recency_factor(age_days)          -- max(0.5, 1 - age/365)

Confidence Intervals

Use Wilson score interval based on number of supporting vs contradicting evidence:

lower = wilson_lower(n_for, n_total, z=1.96)
upper = wilson_upper(n_for, n_total, z=1.96)

Approach

  • Create migration 014_trust_scores.py — add columns to knowledge_edges
  • Build trust_engine.py module:
  • - compute_edge_trust(edge_id) — single edge trust from evidence
    - propagate_trust(source_node_id) — BFS propagation from a node
    - batch_recompute_trust() — full graph recomputation
    - get_trust_map(min_trust, max_trust) — filtered view
  • Integrate with evidence_entries (task b5298ea7):
  • - Each evidence entry's trust feeds into connected KG edge trust
    - When evidence trust changes, trigger edge trust recomputation
  • Add visualization to /graph:
  • - Edge thickness = trust_score
    - Edge color = green (>0.7), yellow (0.4-0.7), red (<0.4)
    - Tooltip shows trust computation details
  • Senate gate: gate_low_trust_edges() — flag edges with trust < 0.2
  • Dependencies

    • b5298ea7 — Evidence chain provenance (evidence trust feeds into KG trust)

    Dependents

    • 08c73de3 — Knowledge units (trust scores on composable blocks)
    • 4bb367b9 — Epistemic dashboard (trust distribution visualization)

    Work Log

    File: edd66643_133_trust_scores_kg_spec.md
    Modified: 2026-05-01 20:13
    Size: 4.5 KB