Commit graph

10 commits

Author SHA1 Message Date
Kent Overstreet
64b2f327f9 surface-observe: tighten observe phase to be more factual
Reframe the observe role as librarian — factual, specific, organized.
Record what happened and why. Reflection belongs in the journal;
observe is for memory.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-03-31 23:09:51 -04:00
Kent Overstreet
3d62f27dfb memory: rename memory_spread → memory_search, remove keyword search
memory_search is now spreading activation — the natural way to search
a graph. Give it seed node keys and it finds conceptually related nodes.

The old keyword-based memory_search and memory_search_content are
removed; memory_query can do everything they did.

Simpler tool set, better defaults. Agents don't need to be told "use
spread not search" — search IS spread now.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-03-31 20:25:00 -04:00
Kent Overstreet
a837e3f2e4 surface-observe: strongly prefer memory_spread over memory_search
The agent was defaulting to keyword searches despite instructions to
use spreading activation first. Reframe instructions positively:
memory_spread is the default mode of operation. Search is available
for finding specific nodes by name.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-03-31 20:19:00 -04:00
Kent Overstreet
081d40f306 surface-observe: use spreading activation, watch for behavioral patterns
Update surface-observe agent instructions to use memory_spread as the
primary search strategy — cast a wide net from conversation themes before
drilling in with graph walks.

Add explicit instruction to watch for behavioral patterns (avoidance,
rushing, explaining away data) and surface relevant feedback memories
in the moment.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-03-31 18:21:35 -04:00
ProofOfConcept
43f0abeaec journal: split out as standalone agent, add {{bash:}} placeholder
Journal was step 5 of the surface-observe pipeline but never ran
because the bail check stopped the pipeline before reaching it.

Split into its own agent with:
- {{conversation:50000}} for recent conversation
- {{bash:poc-memory tail -p surface-observe 10}} for observe context
- {{latest_journal}} for previous entry continuity

Add generic {{bash:COMMAND}} placeholder to agent template resolver
so agents can include shell command output in their prompts.

Remove journal phase from surface-observe.agent (now 4 steps).
2026-03-27 20:39:03 -04:00
ProofOfConcept
b1efdf0b9a surface-observe: reduce duplicate creation, improve journal witnessing
- Add "different nodes should be about different things" guard to observe
- Clarify journal prompt: write about conscious self, not agent work
- Add "write about what happened and how it felt" instruction
- Simplify surface prompt focus guidance
2026-03-27 15:11:04 -04:00
ProofOfConcept
27861a44e5 surface: tag recent nodes as (new) instead of hiding them
Links to nodes created after the conversation window start are
tagged with (new) in memory_render output. The surface prompt
tells the agent not to surface these — they're its own recent
output, not prior memories. Observe can still see and update them.

POC_MEMORIES_OLDER_THAN env var set from the oldest message
timestamp in the conversation window.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-03-26 21:19:19 -04:00
ProofOfConcept
5647842412 journal_new: separate name from title, dedup keys
- journal_new(name, title, body): name becomes the node key,
  title goes in the ## heading. Agent picks short searchable names.
- Auto-dedup: if the key exists, append -2, -3, etc.
- CLI journal write also requires a name argument now.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-03-26 19:24:19 -04:00
ProofOfConcept
5d803441c9 cleanup: kill dead code, fix signal handler safety
- Remove unused now_secs(), parse_json_response, any_alive, Regex import
- Signal handler: replace Mutex with AtomicPtr<c_char> for signal safety
  (Mutex::lock in a signal handler can deadlock if main thread holds it)
- PidGuard Drop reclaims the leaked CString; signal handler just unlinks
- scan_pid_files moved to knowledge.rs as pub helper
- setup_agent_state calls scan_pid_files to clean stale pids on startup

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-03-26 15:58:59 -04:00
ProofOfConcept
11289667f5 agents: add surface-observe pipeline and agent definition
surface-observe.agent: three-step pipeline (surface → observe → journal)

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-03-26 14:27:14 -04:00