show scoring progress and per-response memory attribution

Status bar shows "scoring 3/7..." during scoring. Debug pane logs
per-memory importance and top-5 response breakdowns. F10 context
screen shows which memories were important for each assistant
response as drilldown children (← memory_key (score)).

Added important_memories_for_entry() to look up the matrix by
conversation entry index.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-02 22:27:43 -04:00
parent c01d4a5b08
commit 19205b9bae
2 changed files with 71 additions and 7 deletions

View file

@ -739,11 +739,27 @@ impl Agent {
Role::System => "system".to_string(),
}
};
// Show which memories were important for this response
let children = if m.role == Role::Assistant {
self.memory_scores.as_ref()
.map(|s| s.important_memories_for_entry(i))
.unwrap_or_default()
.into_iter()
.map(|(key, score)| ContextSection {
name: format!("← {} ({:.1})", key, score),
tokens: 0,
content: String::new(),
children: Vec::new(),
})
.collect()
} else {
Vec::new()
};
ContextSection {
name: format!("[{}] {}: {}", i, role_name, label),
tokens,
content: text,
children: Vec::new(),
children,
}
})
.collect();