Hebbian Memory Decay: Why Static Vector Databases Fail at Long-Term LLM Context

Static vector databases store embeddings in fixed metric spaces. If a user mentioned a preference 3 months ago, a standard k-NN query might retrieve it with high similarity even if it has been rendered obsolete by recent interactions.

Neurons That Fire Together, Wire Together

Spector implements Hebbian Memory Decay, a biologically-inspired mathematical model where memory weights dynamically adjust based on two factors:

$$\Delta W_{ij} = \eta \cdot R_{i} \cdot R_{j} - \gamma \cdot (t - t_{last})$$

  1. Reinforcement ($R$): Frequent activation of related memories strengthens edge weights.
  2. Temporal Decay ($\gamma$): Unreferenced memories naturally decay in weight over time, preserving relevant recent context while retaining deep foundation nodes.

Preventing Context Rot

Hebbian decay ensures your LLM prompts are filled with relevant, high-conviction memories rather than stale historical noise.