Memory Reflect

basicmachines-co/basic-memory-skills/memory-reflect

作者 basicmachines-co6d2b1d426d0dacf020aef45f029768c9d8c1e5e5无许可证24 个星标收录于 2026年10月9日更新于 2026年10月9日仓库5个月前更新

Sleep-time memory reflection: review recent conversations and daily notes, extract insights, and consolidate into long-term memory. Use when triggered by cron, heartbeat, or explicit request to reflect on recent activity. Runs as background processing to improve memory quality over time.

仅含说明
AI 生成的概览

回顾近期对话与每日笔记,提取有价值的见解并整合到长期记忆中。

功能
该技能定义了一套后台反思流程:收集近期修改的笔记、每日记录和活跃任务,并逐项评估其长期价值。它把决策、经验教训、偏好和关系细节整合写入长期记忆文件,更新或删除过时条目,并在当天每日笔记中追加一条简短的反思日志。它还会检查文件系统问题,例如递归嵌套、孤立文件或内容膨胀。
适用场景
适合作为周期性后台任务运行,例如通过定时任务或心跳调度,或在被明确要求反思、整合或回顾近期记忆时使用。它也用于上下文窗口压缩事件之后。
运行要求
不附带脚本,仅为说明文档。它需要访问记忆工具,用于查找近期活动、读取和搜索笔记,以及写入长期记忆文件和每日笔记文件。

Memory Reflect

Review recent activity and consolidate valuable insights into long-term memory.

Inspired by sleep-time compute — the idea that memory formation happens best between active sessions, not during them.

When to Run

  • Cron/heartbeat: Schedule as a periodic background task (recommended: 1-2x daily)
  • On demand: User asks to reflect, consolidate, or review recent memory
  • Post-compaction: After context window compaction events

Process

1. Gather Recent Material

Find what changed recently, then read the relevant files:

python
# Find recently modified notes — use json format for the complete list# (text format truncates to ~5 items in the summary)recent_activity(timeframe="2d", output_format="json")
# Read specific daily notesread_note(identifier="memory/2026-02-27")read_note(identifier="memory/2026-02-26")
# Check active taskssearch_notes(note_types=["task"], status="active")

2. Evaluate What Matters

For each piece of information, ask:

  • Is this a decision that affects future work? → Keep
  • Is this a lesson learned or mistake to avoid? → Keep
  • Is this a preference or working style insight? → Keep
  • Is this a relationship detail (who does what, contact info)? → Keep
  • Is this transient (weather checked, heartbeat ran, routine task)? → Skip
  • Is this already captured in MEMORY.md or another long-term file? → Skip

3. Update Long-Term Memory

Write consolidated insights to MEMORY.md following its existing structure:

  • Add new sections or update existing ones
  • Use concise, factual language
  • Include dates for temporal context
  • Remove or update outdated entries that the new information supersedes

4. Log the Reflection

Append a brief entry to today's daily note:

markdown
## Reflection (HH:MM)- Reviewed: [list of files reviewed]- Added to MEMORY.md: [brief summary of what was consolidated]- Removed/updated: [anything cleaned up]

Guidelines

  • Be selective. The goal is distillation, not duplication. MEMORY.md should be curated wisdom, not a copy of daily notes.
  • Preserve voice. If the agent has a personality/soul file, reflections should match that voice.
  • Don't delete daily notes. They're the raw record. Reflection extracts from them; it doesn't replace them.
  • Merge, don't append. If MEMORY.md already has a section about a topic, update it in place rather than adding a duplicate entry.
  • Flag uncertainty. If something seems important but you're not sure, add it with a note like "(needs confirmation)" rather than skipping it entirely.
  • Restructure over time. If MEMORY.md is a chronological dump, restructure it into topical sections during reflection. Curated knowledge > raw logs.
  • Check for filesystem issues. Look for recursive nesting (memory/memory/memory/...), orphaned files, or bloat while gathering material.

来源与署名

来源:basicmachines-co/basic-memory-skills位于memory-reflect提交6d2b1d4

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架