consciousness/src/agent
Kent Overstreet bbffc2213e Restore trim_conversation: dedup memories, evict to budget, snap boundary
Ported the old trim_entries logic to the new AstNode types:
- Phase 1: Dedup Memory nodes by key (keep last), drop DMN entries
- Phase 2: While over budget, evict lowest-scored memory (if memories
  > 50% of conv tokens) or oldest conversation entry
- Phase 3: Snap to User message boundary at start

Called from compact() which runs on startup and on /compact.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-08 21:27:16 -04:00
..
api Fix UTF-8 slicing panics: use floor_char_boundary for all truncation 2026-04-08 19:35:01 -04:00
tools Output tool via Arc<Mutex<Subconscious>> closure — complete 2026-04-08 20:41:42 -04:00
context.rs Restore trim_conversation: dedup memories, evict to budget, snap boundary 2026-04-08 21:27:16 -04:00
mod.rs Restore trim_conversation: dedup memories, evict to budget, snap boundary 2026-04-08 21:27:16 -04:00
oneshot.rs Remove dead AutoAgent.outputs field 2026-04-08 20:45:05 -04:00
tokenizer.rs WIP: Rename context_new → context, delete old files, fix UI layer 2026-04-08 15:20:26 -04:00