fix(memory): close the content gap so agents can actually write and retrieve learnings

- run-selected-prompt.mjs: set SCHEDULER_MEMORY_FILE env var before spawning each agent so
  store.mjs has a well-known path to read from (memory-updates/<ts>__<agent>.md)
- retrieve.mjs: format memories.md using m.summary + date/tags in readable markdown sections
  instead of raw m.content blobs; agents can now scan injected context at a glance
- store.mjs: remove semantically-empty fallback placeholder events that polluted the store
  and degraded retrieval quality; also fix default cadence 'weekly' -> 'daily' to match retrieve
- scheduler-flow.md: replace vague "write insights" instruction with a concrete three-section
  template (Key findings / Patterns / Warnings) and clarify that $SCHEDULER_MEMORY_FILE is
  set by the scheduler automatically

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
thePR0M3TH3ANandClaude Sonnet 4.6 committed 2026-02-20 10:51:03 -05:00
1 parent 87d6b3ef0c
commit 8a9080e7c3
4 files changed
+39 -32

No files matched your search

+8
View File
@@ -67,12 +67,20 @@ async function main() {
}
const runner = resolveRunner(promptMarkdown);
// Compute a stable, per-run memory output file path so agents know where to write learnings.
// store.mjs reads this env var; if absent it falls back to the root memory-update.md placeholder.
const agentName = process.env.SCHEDULER_AGENT || 'unknown-agent';
const runTs = new Date().toISOString().replace(/:/g, '-').replace(/\.\d+Z$/, 'Z');
const memoryFile = `memory-updates/${runTs}__${agentName}.md`;
const child = spawn(runner.command, runner.args, {
cwd: process.cwd(),
env: {
...process.env,
SCHEDULER_PROMPT_PATH: promptPath,
SCHEDULER_PROMPT_MARKDOWN: promptMarkdown,
SCHEDULER_MEMORY_FILE: memoryFile,
},
stdio: 'inherit',
});