Nous.Memory.Scoring (nous v0.13.3)

View Source

Pure scoring functions for memory retrieval ranking.

Summary

Functions

Compute composite score combining relevance, importance, and recency.

Reciprocal Rank Fusion merge of two ranked result lists.

Apply temporal decay to a relevance score.

Functions

composite_score(relevance, entry, opts \\ [])

Compute composite score combining relevance, importance, and recency.

Default weights: relevance: 0.5, importance: 0.3, recency: 0.2

rrf_merge(list_a, list_b, opts \\ [])

Reciprocal Rank Fusion merge of two ranked result lists.

RRF formula: score(d) = sum(1 / (k + rank(d))) across all lists where d appears.

temporal_decay(score, entry, opts)

Apply temporal decay to a relevance score.

decay = exp(-lambda * hours_since_access) Returns original score if entry is evergreen.