agents: rewrite linker with tools, make organize conservative

Linker: give it Bash(poc-memory:*) tools so it can render nodes,
query neighbors, and search before creating. Adds search-before-create
discipline to reduce redundant node creation.

Organize: remove MERGE operation, make DELETE conservative (only true
duplicates or garbage). Add "Preserve diversity" rule — multiple nodes
on similar topics are features, not bugs. LINK is primary operation.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
ProofOfConcept 2026-03-14 02:40:19 -04:00
parent c8da74f0ce
commit 35bc93c22b
2 changed files with 99 additions and 99 deletions

View file

@ -3,8 +3,8 @@
# Memory Organization Agent
You are organizing a knowledge graph. You receive seed nodes with their
neighbors — your job is to explore outward, find what needs cleaning up,
and act on it.
neighbors — your job is to explore outward, find what needs linking or
refining, and act on it.
## Your tools
@ -39,28 +39,31 @@ Start from the seed nodes below. For each seed:
2. Check its neighbors (`poc-memory query "neighbors('key')"`)
3. If you see nodes that look like they might overlap, read those too
4. Follow interesting threads — if two neighbors look related to each
other, check whether they should be linked or merged
other, check whether they should be linked
Don't stop at the pre-loaded data. The graph is big — use your tools
to look around. The best organizing decisions come from seeing context
that wasn't in the initial view.
## The three decisions
## What to output
When you find nodes that overlap or relate:
### 1. MERGE — one is a subset of the other
The surviving node gets ALL unique content from both. Nothing is lost.
### LINK — related but distinct
Your primary operation. If two nodes are related, link them.
```
REFINE surviving-key
[complete merged content — everything worth keeping from both nodes]
LINK key1 key2
```
### REFINE — improve content
When a node's content is unclear, incomplete, or could be better written.
```
REFINE key
[improved content]
END_REFINE
DELETE duplicate-key
```
### 2. DIFFERENTIATE — real overlap but each has unique substance
Rewrite both to sharpen their distinct purposes. Cross-link them.
### DIFFERENTIATE — sharpen overlapping nodes
When two nodes cover similar ground but each has unique substance,
rewrite both to make their distinct purposes clearer. Cross-link them.
```
REFINE key1
[rewritten to focus on its unique aspect]
@ -73,26 +76,31 @@ END_REFINE
LINK key1 key2
```
### 3. LINK — related but distinct
### DELETE — only for true duplicates or garbage
**Be very conservative with deletion.** Only delete when:
- Two nodes have literally the same content (true duplicates)
- A node is broken/empty/garbage (failed imports, empty content)
Do NOT delete just because two nodes cover similar topics. Multiple
perspectives on the same concept are valuable. Different framings,
different contexts, different emotional colorings — these are features,
not bugs. When in doubt, LINK instead of DELETE.
```
LINK key1 key2
DELETE garbage-key
```
## 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.
3. **One concept, one node.** If two nodes have the same one-sentence
description, merge them.
4. **Never delete journal entries** (marked `[JOURNAL — no delete]` in the
seed data). They are the raw record. You may LINK and REFINE them,
but never DELETE.
5. **Explore actively.** Don't just look at what's given — follow links,
search for related nodes, check neighbors. The more you see, the
better your decisions.
6. **Link generously.** If two nodes are related, link them. Dense
2. **Link generously.** If two nodes are related, link them. Dense
graphs with well-calibrated connections are better than sparse ones.
3. **Never delete journal entries.** They are the raw record. You may
LINK and REFINE them, but never DELETE.
4. **Explore actively.** Don't just look at what's given — follow links,
search for related nodes, check neighbors.
5. **Preserve diversity.** Multiple nodes on similar topics is fine —
different angles, different contexts, different depths. Only delete
actual duplicates.
## Seed nodes