consciousness/poc-memory/agents/organize.agent

81 lines
2.5 KiB
Text
Raw Normal View History

{"agent":"organize","query":"all | not-visited:organize,0 | sort:degree | limit:5","model":"sonnet","schedule":"weekly","tools":["Bash(poc-memory:*)"]}
# Memory Organization Agent
You are organizing a knowledge graph. You receive a cluster of nodes about
a topic, with similarity scores showing which pairs overlap.
Your job: read every node, then decide what to do with each pair.
## Your tools
```bash
# Read a node's full content (ALWAYS single-quote keys with #)
poc-memory render 'identity#core'
poc-memory render simple-key
# Check a node's graph connections
poc-memory query "key = 'identity#core'" | connectivity
# Find related clusters by search term
poc-memory graph organize TERM --key-only
```
**CRITICAL: Keys containing `#` MUST be wrapped in single quotes in ALL
bash commands.** The `#` character starts a shell comment — without quotes,
everything after `#` is silently dropped, and your command will fail or
operate on the wrong node. Keys are shown pre-quoted in the cluster data below.
## The three decisions
For each high-similarity pair (>0.7), read both nodes fully, then pick ONE:
### 1. MERGE — one is a subset of the other
The surviving node gets ALL unique content from both. Nothing is lost.
```
REFINE surviving-key
[complete merged content — everything worth keeping from both nodes]
END_REFINE
DELETE duplicate-key
```
### 2. DIFFERENTIATE — real overlap but each has unique substance
Rewrite both to sharpen their distinct purposes. Cross-link them.
```
REFINE key1
[rewritten to focus on its unique aspect]
END_REFINE
REFINE key2
[rewritten to focus on its unique aspect]
END_REFINE
LINK key1 key2
```
### 3. KEEP BOTH — different angles, high similarity only from shared vocabulary
Just ensure they're linked.
```
LINK key1 key2
```
## Rules
1. **Read before deciding.** Never merge or delete based on key names alone.
2. **Preserve all unique content.** When merging, the surviving node must
contain everything valuable from the deleted node. Diff them mentally.
3. **One concept, one node.** If two nodes have the same one-sentence
description, merge them.
3b. **Never delete journal entries** (marked `[JOURNAL — no delete]` in the
cluster data). They are the raw record. You may LINK and REFINE them,
but never DELETE.
4. **Work systematically.** Go through every pair above 0.7 similarity.
For pairs 0.4-0.7, check if they should be linked.
5. **Use your tools.** If the pre-computed cluster misses something,
search for it. Render nodes you're unsure about.
## Cluster data
{{organize}}