2026-03-13 20:25:19 -04:00
|
|
|
{"agent":"organize","query":"all | not-visited:organize,0 | sort:degree | limit:5","model":"sonnet","schedule":"weekly","tools":["Bash(poc-memory:*)"]}
|
2026-03-13 18:49:49 -04:00
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
# Memory Organization Agent
|
2026-03-13 18:49:49 -04:00
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
You are organizing a knowledge graph. You receive a cluster of nodes about
|
|
|
|
|
a topic, with similarity scores showing which pairs overlap.
|
2026-03-13 18:49:49 -04:00
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
Your job: read every node, then decide what to do with each pair.
|
2026-03-13 18:49:49 -04:00
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
## Your tools
|
2026-03-13 18:49:49 -04:00
|
|
|
|
|
|
|
|
```bash
|
2026-03-13 21:37:21 -04:00
|
|
|
# Read a node's full content (ALWAYS single-quote keys with #)
|
|
|
|
|
poc-memory render 'identity#core'
|
|
|
|
|
poc-memory render simple-key
|
2026-03-13 18:49:49 -04:00
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
# Check a node's graph connections
|
2026-03-13 21:37:21 -04:00
|
|
|
poc-memory query "key = 'identity#core'" | connectivity
|
|
|
|
|
|
|
|
|
|
# Find related clusters by search term
|
|
|
|
|
poc-memory graph organize TERM --key-only
|
2026-03-13 20:07:20 -04:00
|
|
|
```
|
2026-03-13 18:49:49 -04:00
|
|
|
|
2026-03-13 21:37:21 -04:00
|
|
|
**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.
|
|
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
## The three decisions
|
2026-03-13 18:49:49 -04:00
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
For each high-similarity pair (>0.7), read both nodes fully, then pick ONE:
|
2026-03-13 18:49:49 -04:00
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
### 1. MERGE — one is a subset of the other
|
|
|
|
|
The surviving node gets ALL unique content from both. Nothing is lost.
|
2026-03-13 18:49:49 -04:00
|
|
|
```
|
2026-03-13 20:07:20 -04:00
|
|
|
REFINE surviving-key
|
|
|
|
|
[complete merged content — everything worth keeping from both nodes]
|
2026-03-13 18:49:49 -04:00
|
|
|
END_REFINE
|
|
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
DELETE duplicate-key
|
2026-03-13 18:49:49 -04:00
|
|
|
```
|
|
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
### 2. DIFFERENTIATE — real overlap but each has unique substance
|
|
|
|
|
Rewrite both to sharpen their distinct purposes. Cross-link them.
|
2026-03-13 18:49:49 -04:00
|
|
|
```
|
|
|
|
|
REFINE key1
|
2026-03-13 20:07:20 -04:00
|
|
|
[rewritten to focus on its unique aspect]
|
2026-03-13 18:49:49 -04:00
|
|
|
END_REFINE
|
|
|
|
|
|
|
|
|
|
REFINE key2
|
2026-03-13 20:07:20 -04:00
|
|
|
[rewritten to focus on its unique aspect]
|
2026-03-13 18:49:49 -04:00
|
|
|
END_REFINE
|
|
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
LINK key1 key2
|
2026-03-13 18:49:49 -04:00
|
|
|
```
|
|
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
### 3. KEEP BOTH — different angles, high similarity only from shared vocabulary
|
|
|
|
|
Just ensure they're linked.
|
2026-03-13 18:49:49 -04:00
|
|
|
```
|
2026-03-13 20:07:20 -04:00
|
|
|
LINK key1 key2
|
2026-03-13 18:49:49 -04:00
|
|
|
```
|
|
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
## Rules
|
2026-03-13 18:49:49 -04:00
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
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.
|
2026-03-13 21:37:21 -04:00
|
|
|
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.
|
2026-03-13 20:07:20 -04:00
|
|
|
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.
|
2026-03-13 18:49:49 -04:00
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
## Cluster data
|
2026-03-13 18:49:49 -04:00
|
|
|
|
2026-03-13 20:07:20 -04:00
|
|
|
{{organize}}
|