split agent: two-phase node decomposition for memory consolidation

Phase 1 sends a large node with its neighbor communities to the LLM
and gets back a JSON split plan (child keys, descriptions, section
hints). Phase 2 fires one extraction call per child in parallel —
each gets the full parent content and extracts/reorganizes just its
portion.

This handles arbitrarily large nodes because output is always
proportional to one child, not the whole parent. Tested on the kent
node (19K chars → 3 children totaling 20K chars with clean topic
separation).

New files:
  prompts/split-plan.md   — phase 1 planning prompt
  prompts/split-extract.md — phase 2 extraction prompt
  prompts/split.md        — original single-phase (kept for reference)

Modified:
  agents/prompts.rs — split_candidates(), split_plan_prompt(),
                      split_extract_prompt(), agent_prompt "split" arm
  agents/daemon.rs  — job_split_agent() two-phase implementation,
                      RPC dispatch for "split" agent type
  tui.rs            — added "split" to AGENT_TYPES
This commit is contained in:
ProofOfConcept 2026-03-10 01:48:41 -04:00
parent 4c973183c4
commit ca62692a28
6 changed files with 515 additions and 2 deletions

View file

@ -32,7 +32,7 @@ const POLL_INTERVAL: Duration = Duration::from_secs(2);
// Agent types we know about, in display order
const AGENT_TYPES: &[&str] = &[
"health", "replay", "linker", "separator", "transfer",
"apply", "orphans", "cap", "digest", "digest-links", "knowledge", "rename",
"apply", "orphans", "cap", "digest", "digest-links", "knowledge", "rename", "split",
];
fn status_sock_path() -> PathBuf {