Temporal Edge Decay
The tool ecosystem changes constantly. Edge decay ensures that ToolPilot’s graph relationships stay current by gradually reducing the weight of edges that haven’t been reinforced by new evidence.
The Problem
Tool relationships change over time. A library that was the go-to choice three years ago may now be abandoned, superseded, or incompatible with modern ecosystems. Static edge weights would preserve stale relationships indefinitely, leading to outdated recommendations. ToolPilot needs a mechanism to let old relationships fade while keeping active ones strong.
The Formula
Edge weights decay exponentially over time using a standard radioactive-decay-style formula:
effective_weight = base_weight × e−λ × Δt
λ (lambda) = 0.001 — the decay constant
Δt = days since last reinforcement
Half-life ≈ 693 days (~2.7 years)
1// Temporal edge decay formula
2effective_weight = base_weight × e^(-λ × days_since_reinforcement)
3
4// With default parameters:
5// λ (lambda) = 0.001 (decay constant)
6// half-life ≈ 693 days (~2.7 years)
7
8// Examples:
9// After 30 days: 0.82 × e^(-0.001 × 30) = 0.82 × 0.970 = 0.796
10// After 365 days: 0.82 × e^(-0.001 × 365) = 0.82 × 0.694 = 0.569
11// After 730 days: 0.82 × e^(-0.001 × 730) = 0.82 × 0.482 = 0.395
12// After 1095 days: 0.82 × e^(-0.001 × 1095) = 0.82 × 0.335 = 0.275
Decay Curve
The following visualization shows how an edge with base weight 1.0 decays over time without any reinforcement events:
Weight
1.0 ┤ ●
│ ╲
0.8 ┤ ╲
│ ╲
0.6 ┤ ╲
│ ╲ ← half-life (~2.7 years)
0.5 ┤ · · · ·╲· · · · · · · · · · · · · · · ·
│ ╲
0.4 ┤ ╲
│ ╲
0.2 ┤ ╲____
│ ╲________
0.0 ┤ ╲_______________
└──┬────┬────┬────┬────┬────┬────┬────┬────┬─ Days
0 365 730 1095 1460 1825 2190 2555 2920
1yr 2yr 3yr 4yr 5yr 6yr 7yr 8yrThe curve is intentionally gentle. A ~2.7-year half-life means relationships don’t vanish overnight — they slowly lose influence unless reinforced. This balances freshness against stability.
What Triggers Reinforcement
An edge’s decay timer resets (and its weight receives a small boost) when new evidence confirms the relationship is still valid:
report_outcomewith success — An agent confirms a tool worked well in a given context. This resetslast_reinforcedand adds a +0.05 weight boost (capped at 1.0).- GitHub indexer co-occurrence — The indexer detects tools appearing together in new repositories (package.json, go.mod, requirements.txt, etc.), refreshing the edge timestamp.
- Manual curation — Admin updates via the web interface can reinforce or adjust edges when automated signals miss context.
1// When report_outcome("success") is called:
2MATCH (a:Tool)-[r:RELATED_TO]->(b:Tool)
3WHERE a.name = $tool_a AND b.name = $tool_b
4SET r.last_reinforced = datetime(),
5 r.weight = min(r.weight + 0.05, 1.0),
6 r.reinforcement_count = r.reinforcement_count + 1
Why This Matters
Temporal decay creates a self-correcting system:
- Abandoned tools fade naturally — No one needs to manually flag them. Without new co-occurrence data or success reports, their edges weaken.
- Rising tools gain prominence — New tools that get used successfully accumulate strong, fresh edges that outcompete decayed ones.
- No manual curation required — The graph evolves organically based on real-world usage patterns, not editorial decisions.
Living Graph