synthesize episodic memory before injection — top-K + haiku, given goals + query
phi was getting raw top-K episodic notes dumped into its prompt as
[PHI'S RELEVANT MEMORIES]. Stale "pending X" notes appeared next to
fresh ones with equal weight, no synthesis, no contradiction-flagging.
Now: top-K from the vector store, then a haiku pass that takes phi's
current goals + the query as context and produces a coherent, deduped,
recency-aware block. Same shape as [STRANGER'S AUDIT] for posts.
The haiku can flag stale/contradictory entries ("pending follow X" vs.
the actual follow record) without requiring a parallel cleanup
pipeline. Phi can still verify with tools when it matters.
Block renamed to [RELEVANT MEMORIES — synthesized for this query] so
phi knows it's processed, not raw.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>