agents: log raw LLM output to files, not graph nodes
Raw agent responses were being stored as nodes in the graph (_consolidate-*, _knowledge-*), creating thousands of nodes per day that polluted search results and bloated the store. Now logged to ~/.claude/memory/llm-logs/<agent>/<timestamp>.txt instead. Node creation should only happen through explicit agent actions (WRITE_NODE, REFINE) or direct poc-memory write tool calls. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f0df489465
commit
c7509a0c2d
1 changed files with 6 additions and 6 deletions
|
|
@ -674,13 +674,13 @@ pub fn run_one_agent(
|
||||||
let output_kb = output.len() / 1024;
|
let output_kb = output.len() / 1024;
|
||||||
log(&format!("response {}KB", output_kb));
|
log(&format!("response {}KB", output_kb));
|
||||||
|
|
||||||
// Store raw output for audit trail — key includes a content slug
|
// Log raw output to file, not the graph
|
||||||
let ts = store::compact_timestamp();
|
let ts = store::compact_timestamp();
|
||||||
let slug = make_report_slug(&output);
|
let log_dir = store::memory_dir().join("llm-logs").join(agent_name);
|
||||||
let report_key = format!("_{}-{}-{}{}", llm_tag, agent_name, ts,
|
fs::create_dir_all(&log_dir).ok();
|
||||||
if slug.is_empty() { String::new() } else { format!("-{}", slug) });
|
let log_path = log_dir.join(format!("{}.txt", ts));
|
||||||
let provenance = agent_provenance(agent_name);
|
fs::write(&log_path, &output).ok();
|
||||||
store.upsert_provenance(&report_key, &output, &provenance).ok();
|
log(&format!("logged to {}", log_path.display()));
|
||||||
|
|
||||||
let actions = parse_all_actions(&output);
|
let actions = parse_all_actions(&output);
|
||||||
let no_ops = count_no_ops(&output);
|
let no_ops = count_no_ops(&output);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue