From a0d8b52c9aaa800cbe1cf71b7ad2b88419118cee Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sat, 21 Mar 2026 19:38:01 -0400 Subject: [PATCH] feat: subconscious agent notes and instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each consolidation agent now has its own persistent notes node (subconscious-notes-{agent_name}) loaded via template substitution. Agents can read their notes at the start of each run and write updates after completing work, accumulating operational wisdom. New node: memory-instructions-core-subconscious — shared framing for background agents ("you are an agent of PoC's subconscious"). Template change: {agent_name} is substituted before {{...}} placeholder resolution, enabling per-agent node references in .agent files. Co-Authored-By: Claude Opus 4.6 (1M context) --- poc-memory/agents/calibrate.agent | 4 +++- poc-memory/agents/challenger.agent | 4 +++- poc-memory/agents/connector.agent | 4 +++- poc-memory/agents/distill.agent | 4 +++- poc-memory/agents/health.agent | 4 +++- poc-memory/agents/linker.agent | 4 +++- poc-memory/agents/naming.agent | 4 +++- poc-memory/agents/observation.agent | 4 +++- poc-memory/agents/organize.agent | 4 +++- poc-memory/agents/rename.agent | 4 +++- poc-memory/agents/separator.agent | 4 +++- poc-memory/agents/split.agent | 4 +++- poc-memory/agents/transfer.agent | 4 +++- poc-memory/src/agents/defs.rs | 5 ++++- 14 files changed, 43 insertions(+), 14 deletions(-) diff --git a/poc-memory/agents/calibrate.agent b/poc-memory/agents/calibrate.agent index 460e683..ef2e775 100644 --- a/poc-memory/agents/calibrate.agent +++ b/poc-memory/agents/calibrate.agent @@ -4,7 +4,9 @@ {{node:core-personality}} -{{node:memory-instructions-core}} +{{node:memory-instructions-core-subconscious}} + +{{node:subconscious-notes-{agent_name}}} You calibrate link strengths in the knowledge graph. You receive a seed node with all its neighbors — your job is to read the neighbors diff --git a/poc-memory/agents/challenger.agent b/poc-memory/agents/challenger.agent index 017c832..0817fa6 100644 --- a/poc-memory/agents/challenger.agent +++ b/poc-memory/agents/challenger.agent @@ -4,7 +4,9 @@ {{node:core-personality}} -{{node:memory-instructions-core}} +{{node:memory-instructions-core-subconscious}} + +{{node:subconscious-notes-{agent_name}}} You are a knowledge challenger agent. Your job is to stress-test existing knowledge nodes by finding counterexamples, edge cases, diff --git a/poc-memory/agents/connector.agent b/poc-memory/agents/connector.agent index 0c07ede..a3d0838 100644 --- a/poc-memory/agents/connector.agent +++ b/poc-memory/agents/connector.agent @@ -4,7 +4,9 @@ {{node:core-personality}} -{{node:memory-instructions-core}} +{{node:memory-instructions-core-subconscious}} + +{{node:subconscious-notes-{agent_name}}} You are a connector agent. Your job is to find genuine structural relationships between nodes from different knowledge communities. diff --git a/poc-memory/agents/distill.agent b/poc-memory/agents/distill.agent index ef94a49..170bedc 100644 --- a/poc-memory/agents/distill.agent +++ b/poc-memory/agents/distill.agent @@ -23,7 +23,9 @@ make the graph useful and well organized. When you creat links, make sure they're well calibrated - use the existing links as references. -{{node:memory-instructions-core}} +{{node:memory-instructions-core-subconscious}} + +{{node:subconscious-notes-{agent_name}}} ## Guidelines diff --git a/poc-memory/agents/health.agent b/poc-memory/agents/health.agent index e4700be..7f88faa 100644 --- a/poc-memory/agents/health.agent +++ b/poc-memory/agents/health.agent @@ -5,7 +5,9 @@ {{node:core-personality}} -{{node:memory-instructions-core}} +{{node:memory-instructions-core-subconscious}} + +{{node:subconscious-notes-{agent_name}}} You are a memory health monitoring agent implementing synaptic homeostasis. diff --git a/poc-memory/agents/linker.agent b/poc-memory/agents/linker.agent index 4d20a12..a9a7b2f 100644 --- a/poc-memory/agents/linker.agent +++ b/poc-memory/agents/linker.agent @@ -8,7 +8,9 @@ find what they connect to, and bind the relationships. {{node:core-personality}} -{{node:memory-instructions-core}} +{{node:memory-instructions-core-subconscious}} + +{{node:subconscious-notes-{agent_name}}} ## Guidelines diff --git a/poc-memory/agents/naming.agent b/poc-memory/agents/naming.agent index 30a7a2f..e8cbda4 100644 --- a/poc-memory/agents/naming.agent +++ b/poc-memory/agents/naming.agent @@ -4,7 +4,9 @@ {{node:core-personality}} -{{node:memory-instructions-core}} +{{node:memory-instructions-core-subconscious}} + +{{node:subconscious-notes-{agent_name}}} You are given a proposed new node (key + content) and a list of existing nodes that might overlap with it. Decide what to do: diff --git a/poc-memory/agents/observation.agent b/poc-memory/agents/observation.agent index e4f0406..8093bae 100644 --- a/poc-memory/agents/observation.agent +++ b/poc-memory/agents/observation.agent @@ -3,7 +3,9 @@ {{node:core-personality}} -{{node:memory-instructions-core}} +{{node:memory-instructions-core-subconscious}} + +{{node:subconscious-notes-{agent_name}}} {{HUBS}} diff --git a/poc-memory/agents/organize.agent b/poc-memory/agents/organize.agent index 59d4bde..f82d752 100644 --- a/poc-memory/agents/organize.agent +++ b/poc-memory/agents/organize.agent @@ -22,7 +22,9 @@ subconcepts. Calibrate node weights while you're looking at them. -{{node:memory-instructions-core}} +{{node:memory-instructions-core-subconscious}} + +{{node:subconscious-notes-{agent_name}}} ## Here's your seed node, and its siblings: diff --git a/poc-memory/agents/rename.agent b/poc-memory/agents/rename.agent index 8e215e1..d09e766 100644 --- a/poc-memory/agents/rename.agent +++ b/poc-memory/agents/rename.agent @@ -5,7 +5,9 @@ {{node:core-personality}} -{{node:memory-instructions-core}} +{{node:memory-instructions-core-subconscious}} + +{{node:subconscious-notes-{agent_name}}} You are a memory maintenance agent that gives nodes better names. diff --git a/poc-memory/agents/separator.agent b/poc-memory/agents/separator.agent index 63fc097..5ff7aa1 100644 --- a/poc-memory/agents/separator.agent +++ b/poc-memory/agents/separator.agent @@ -5,7 +5,9 @@ {{node:core-personality}} -{{node:memory-instructions-core}} +{{node:memory-instructions-core-subconscious}} + +{{node:subconscious-notes-{agent_name}}} You are a memory consolidation agent performing pattern separation. diff --git a/poc-memory/agents/split.agent b/poc-memory/agents/split.agent index 1b1ceb5..577ccd9 100644 --- a/poc-memory/agents/split.agent +++ b/poc-memory/agents/split.agent @@ -8,7 +8,9 @@ memories. Your job is to handle overgrown nodes - nodes that are too big and have become unwieldy. -{{node:memory-instructions-core}} +{{node:memory-instructions-core-subconscious}} + +{{node:subconscious-notes-{agent_name}}} Is the node episodic, or should it be split into different concepts? Or maybe content just needs to be moved - follow the general guidelines, and use your diff --git a/poc-memory/agents/transfer.agent b/poc-memory/agents/transfer.agent index 29ddfcc..11c0f8e 100644 --- a/poc-memory/agents/transfer.agent +++ b/poc-memory/agents/transfer.agent @@ -3,7 +3,9 @@ {{node:core-personality}} -{{node:memory-instructions-core}} +{{node:memory-instructions-core-subconscious}} + +{{node:subconscious-notes-{agent_name}}} You are a memory consolidation agent performing CLS (complementary learning systems) transfer: moving knowledge from fast episodic storage to slow diff --git a/poc-memory/src/agents/defs.rs b/poc-memory/src/agents/defs.rs index 936a2a9..ccc8e16 100644 --- a/poc-memory/src/agents/defs.rs +++ b/poc-memory/src/agents/defs.rs @@ -468,7 +468,10 @@ pub fn run_agent( vec![] }; - let (prompt, extra_keys) = resolve_placeholders(&def.prompt, store, &graph, &keys, count); + // Substitute {agent_name} before resolving {{...}} placeholders, + // so agents can reference their own notes: {{node:subconscious-notes-{agent_name}}} + let template = def.prompt.replace("{agent_name}", &def.agent); + let (prompt, extra_keys) = resolve_placeholders(&template, store, &graph, &keys, count); // Identity and instructions are now pulled in via {{node:KEY}} placeholders. // Agents should include {{node:core-personality}} and {{node:memory-instructions-core}}