Not all memories are created equal. Some are gold, others are garbage. So how does the system know the difference?
Trust Scores
Every memory in the Cognitive Substrate has a trust score that changes over time. When the AI uses a memory to answer a question, the system watches what happens next. If the answer was helpful and correct, that memory's trust score goes up. If the user corrects it or the answer falls flat, the score goes down.
This creates a natural quality filter. Memories that consistently prove useful become stronger and more likely to be used. Memories that mislead or waste time slowly lose influence and eventually get suppressed or forgotten.
Here is the actual scoring function. Seven normalized input channels combine into a single reinforcement value, plus coupled outputs for decay rate, retrieval priority, policy drift, and identity impact:
// packages/reinforcement-engine/src/scoring.ts
export function scoreReinforcement(signal: ReinforcementSignal): ReinforcementResult {
const reinforcement = clamp(
signal.importance * 0.18 +
noveltyScore(signal) * 0.16 +
signal.predictionAccuracy * 0.14 +
signal.emotionalWeight * 0.12 +
signal.goalRelevance * 0.14 +
signal.policyAlignment * 0.16 +
(1 - signal.contradictionRisk) * 0.1
)
return {
reinforcement,
decayAdjustment: clamp(1 - reinforcement * 0.65), // high RL -> slow decay
retrievalPriority: clamp(
reinforcement * 0.7 + signal.usageFrequency * 0.15 + signal.goalRelevance * 0.15
),
policyDelta: clampSigned((reinforcement - 0.5) * 0.2),
identityImpact: clampSigned(
signal.novelty * 0.25 + signal.emotionalWeight * 0.2 - signal.contradictionRisk * 0.3
),
// NOTE: article omits toolDependenceDelta field present in source:
// toolDependenceDelta: clampSigned(((signal.toolUsefulness ?? 0.5) - 0.5) * 0.2),
}
}
// Combined novelty: 70% raw + 30% inverse-usage so frequently-retrieved
// memories do not receive a novelty bonus even when semantically novel.
function noveltyScore(signal: ReinforcementSignal): number {
return clamp(signal.novelty * 0.7 + (1 - signal.usageFrequency) * 0.3)
}The weights are empirical - chosen so no single channel can fully dominate, while still allowing a memory with strong importance, novelty, and policy alignment to score clearly above one that is merely old and frequently retrieved.
The engine also implements Hebbian compounding: each positive reinforcement evaluation nudges retrieval_priority upward rather than resetting it, so trusted memories compound away from memories receiving weak signal over time:
// packages/reinforcement-engine/src/engine.ts
//
// Hebbian compounding (Experiment 10):
// When countBonus > 0, adds countBonus * log2(1 + count) to retrieval_priority.
// The log2 curve prevents unbounded growth while still rewarding consistency.
if (this.countBonus > 0) {
newCount = (prior?.reinforcement_count ?? 0) + 1
// Gate the bonus on reinforcement quality so that low-signal memories
// don't accumulate strength through count alone.
finalRp += this.countBonus * Math.log2(1 + newCount) * result.reinforcement
}How Scores Change
Trust scoring happens at two points:
During retrieval - the arbitration layer weighs each candidate memory's current trust score when deciding what to surface. High-trust memories get priority.
After interaction - when a conversation completes, feedback signals flow back through the reinforcement scoring engine. Explicit corrections, implicit signals like follow-up clarifications, and outcome quality all feed into trust adjustments.
Why This Matters
Without trust scoring, a memory system would degrade over time as it accumulates stale or incorrect information alongside good information. Every bad memory competes equally with every good one.
With trust scoring, the system self-corrects. Bad memories lose influence before they cause compounding problems. Good memories get reinforced precisely because they keep working.
The beautiful part is that this happens automatically. The system is constantly learning which parts of its own experience are reliable and which are not - the same way people do through real-world feedback.
Trust is not given. It is earned.