Skip to main content

Module scoring

Module scoring 

Source

Structs§

ScoringParams

Constants§

ABSTENTION_MIN_TEXT
Abstention threshold — collection-level gate on max text overlap. Dense embeddings (bge-small-en-v1.5) produce 0.80+ cosine similarity even for unrelated content, so vec_sim is NOT used for abstention. Lowered from 0.30 to 0.15 to avoid dropping valid results for numeric/synonym-heavy queries where word overlap is inherently lower.
ENTITY_EXPANSION_BOOST
Multiplicative boost for memories found via entity tag expansion. Applied on top of the standard scoring pipeline. AutoMem uses +0.15 additive; we use a multiplicative 1.15 to integrate with the existing RRF-based scoring.
GRAPH_MIN_EDGE_WEIGHT
GRAPH_NEIGHBOR_FACTOR
Graph enrichment — re-enabled at a conservative factor. Grid search over [0.0, 0.05, 0.1, 0.15, 0.2, 0.3] showed no regression on LoCoMo (benchmark data has sparse relationship graphs). 0.1 chosen as a safe default: neighbors get at most 10 % of the seed score, enough to surface related memories in production without dominating rankings.
RRF_WEIGHT_FTS
RRF_WEIGHT_VEC
Weighted RRF fusion — equal weight for vector and FTS (grid search optimal). Previous bias (1.5 vec / 1.0 fts) was suboptimal on LongMemEval.

Functions§

feedback_factor
Feedback is an explicit user/system signal — asymmetric by design. Negative feedback aggressively suppresses (explicit downvote). Positive feedback gives only a mild boost (prevents displacing unrelated results).
jaccard_pre
Like jaccard_similarity, but accepts pre-computed token sets.
jaccard_similarity
priority_factor
query_coverage_boost
Extra bonus for candidates that cover most query terms.
time_decay_et
Time decay using a typed EventType (avoids string round-trip).
type_weight_et
Returns the type weight for a typed EventType (avoids string round-trip).
word_overlap_pre
Like word_overlap, but accepts pre-computed token sets for both query and candidate.