Memory Reflect

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

作者 basicmachines-cob941460b4d99480fa2eb1a230a62d2847927ea05無授權條款4.1K 個星標收錄於 2026年10月9日更新於 2026年10月9日儲存庫今天更新

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 & Agents
AI 產生的概覽

在背景反思流程中,把近期對話與每日筆記濃縮並整併為長期記憶。

功能
引導代理執行一次週期性反思:蒐集近期修改過的筆記與進行中的任務,判斷哪些內容屬於長期有效的決策、經驗教訓、偏好或關係資訊,並把濃縮結果寫入長期記憶檔案 MEMORY.md。它也會在當天的筆記中附加一則簡短反思紀錄,並更新或移除已被取代的項目。產出是經過整理的長期記憶檔案與反思日誌,而不是原始筆記的副本。
適用情境
適用於排程或心跳任務需要回顧近期活動時、使用者明確要求反思、整併或回顧記憶時,以及上下文視窗壓縮之後。
執行需求
僅有指令,沒有隨附指令碼。它假定可使用 recent_activity、read_note、search_notes 等筆記與記憶工具,並具備可寫入的 MEMORY.md 與每日筆記。

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 — json gives structured rows; text output# across all projects shows only the top itemsrecent_activity(timeframe="2d", output_format="json")
# Read specific daily notesread_note(identifier="memory/<YYYY-MM-DD>")
# 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.

來源與署名

來源:basicmachines-co/basic-memory位於skills/memory-reflect提交b941460

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架