MCPcopy Index your code
hub / github.com/AI45Lab/Code / score

Method score

core/src/memory.rs:141–146  ·  view source on GitHub ↗
(&self, item: &MemoryItem, now: DateTime<Utc>)

Source from the content-addressed store, hash-verified

139 }
140
141 pub(crate) fn score(&self, item: &MemoryItem, now: DateTime<Utc>) -> f32 {
142 let age_days = (now - item.timestamp).num_seconds() as f32 / 86400.0;
143 let decay = (-age_days / self.relevance_config.decay_days).exp();
144 item.importance * self.relevance_config.importance_weight
145 + decay * self.relevance_config.recency_weight
146 }
147
148 /// Store a memory in long-term storage and add to short-term
149 pub async fn remember(&self, item: MemoryItem) -> anyhow::Result<()> {

Callers 2

add_to_workingMethod · 0.80

Calls

no outgoing calls

Tested by 1