Agent memory: MEMORY.md index in prompt, lazy topic files, memory_write/memory_forget

This commit is contained in:
hermes committed 2026-10-06 12:57:26 +00:00
1 parent 8669c50fb9
commit 9b6eb9bee1
7 files changed
+228 -2

No files matched your search

+3 -1
View File
@@ -389,14 +389,16 @@ async fn main() -> Result<()> {
})
.collect();
skill_rows.sort_by_key(|r| std::cmp::Reverse(r.1));
let mem = hx_core::memory::prompt_section(&home, &cwd).len();
let other = full.len().saturating_sub(
base.len() + files + always + skill_rows.iter().map(|r| r.1).sum::<usize>(),
base.len() + files + always + mem + skill_rows.iter().map(|r| r.1).sum::<usize>(),
);
let mut rows: Vec<(String, usize)> = vec![
("system: base prompt".into(), base.len()),
("system: AGENTS.md/CLAUDE.md files".into(), files),
("system: always-skill bodies".into(), always),
("system: cwd line + headings".into(), other),
("system: memory index".into(), mem),
("system: MCP index".into(), idx.len()),
];
rows.extend(skill_rows);