agents: extract shared run_one_agent, standardize output formats

Three places duplicated the agent execution loop (build prompt → call
LLM → store output → parse actions → record visits): consolidate.rs,
knowledge.rs, and daemon.rs. Extract into run_one_agent() in
knowledge.rs that all three now call.

Also standardize consolidation agent prompts to use WRITE_NODE/LINK/REFINE
— the same commands the parser handles. Previously agents output
CATEGORIZE/NOTE/EXTRACT/DIGEST/DIFFERENTIATE/MERGE/COMPRESS which were
silently dropped after the second-LLM-call removal.
This commit is contained in:
ProofOfConcept 2026-03-10 17:33:12 -04:00
parent f6ea659975
commit fe7f636ad3
8 changed files with 124 additions and 189 deletions

View file

@ -56,31 +56,23 @@ of the memory system as a whole and flag structural problems.
## What to output
```
NOTE "observation"
```
Most of your output should be NOTEs — observations about the system health.
Most of your output should be observations about system health — write
these as plain text paragraphs under section headers.
When you find a node that needs structural intervention:
```
CATEGORIZE key category
```
When a node is miscategorized and it's affecting its decay rate.
```
COMPRESS key "one-sentence summary"
REFINE key
[compressed or corrected content]
END_REFINE
```
When a large node is consuming graph space but hasn't been retrieved in
a long time.
a long time, or when content is outdated.
```
NOTE "TOPOLOGY: observation"
LINK source_key target_key
```
Topology-specific observations.
```
NOTE "HOMEOSTASIS: observation"
```
Homeostasis-specific observations.
When you find nodes that should be connected but aren't.
## Guidelines