Summary
The heartbeat currently scans memories for triggers (stale work, missed follow-ups, etc.) but doesn't learn from what it knows. Add a reflect pass that analyzes existing memories and synthesizes higher-level insights.
Inspired by Hindsight's reflect operation — but integrated into Keyoku's existing heartbeat loop rather than as a separate call.
What this looks like
During each heartbeat cycle:
- Trigger scan (existing) — check for actionable items
- Reflect pass (new) — pull recent memories, find patterns, synthesize insights
- Store insight — save as a new memory with a distinct type (e.g.
insight or reflection) and higher weight so it surfaces more easily on recall
Examples
- 10 memories about a user preferring short responses → synthesize: "this user values brevity as a core communication principle"
- Multiple memories about missed deadlines on project X → synthesize: "project X is at risk"
- Contradicting memories about a preference → resolve into a coherent understanding
Why heartbeat
- Already runs periodically with access to all memories
- Reflect output feeds back into better trigger detection (insights make the heartbeat smarter over time)
- Turns the heartbeat from a monitoring loop into a learning loop
Implementation notes
- The consolidation processor already does decay and cleanup — reflection/synthesis would be a natural addition there
- New memory type or tag to distinguish raw memories from synthesized insights
- Configurable: how often to reflect, how many memories to consider, minimum cluster size before synthesizing
- Should deduplicate — don't re-synthesize insights that already exist
Summary
The heartbeat currently scans memories for triggers (stale work, missed follow-ups, etc.) but doesn't learn from what it knows. Add a reflect pass that analyzes existing memories and synthesizes higher-level insights.
Inspired by Hindsight's reflect operation — but integrated into Keyoku's existing heartbeat loop rather than as a separate call.
What this looks like
During each heartbeat cycle:
insightorreflection) and higher weight so it surfaces more easily on recallExamples
Why heartbeat
Implementation notes