Memory Lifecycle

basicmachines-co/basic-memory/skills/memory-lifecycle

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

Manage entity status transitions in Basic Memory: archive completed work, move notes between status folders, update frontmatter, and handle edge cases. Use when marking items complete, archiving old entities, or managing any folder-based status workflow.

AI 產生的概覽

在 Basic Memory 中管理實體狀態轉換,以封存、移動和更新筆記取代刪除。

功能
此技能定義了在 Basic Memory 中於狀態資料夾之間移動實體的流程,例如 active、archive、pipeline 或 completed。內容涵蓋從使用者用語辨識完成或狀態訊號、透過搜尋定位實體、使用 move_note 移動,以及用 edit_note 將狀態與完成日期合併到 frontmatter。它也處理已封存、部分完成、復原,以及不需移動資料夾的狀態變更等邊界情況。
適用情境
當使用者將某項目標記為已完成、已提交、已錯過或已取消,或筆記需要在狀態資料夾之間移動時使用。它也適合復原誤標的完成狀態,以及定期清理長期未動的活躍項目。
執行需求
需要 Basic Memory 及其筆記工具可用,包括 search_notes、move_note 和 edit_note。不隨附指令碼,僅為指示文件。

Memory Lifecycle

Manage how entities move through status stages in Basic Memory. The core principle: archive, never delete. Completed work is valuable context — move it out of the active view, but keep it in the knowledge graph.

When to Use

  • User says something is "done", "finished", "completed", "submitted", "missed", or "cancelled"
  • Moving entities between status folders (active → archive, pipeline → active, etc.)
  • Reverting a mistaken completion
  • Periodic cleanup of stale active items

Core Principle: Archive, Never Delete

Deleting a note removes it from the knowledge graph — all its observations, relations, and history disappear. Archiving preserves everything while signaling the entity is no longer active.

# Good — entity stays in the knowledge graphmove_note → active/ to archive/
# Bad — knowledge is lostdelete_note

The only exception: notes created by mistake (typos, true duplicates) can be deleted.

Folder Conventions

Organize entities by status using folders. The exact folder names depend on your domain, but follow a consistent pattern:

entities/  active/          # Currently relevant, in-progress  archive/         # Completed, no longer active, but worth keeping  pipeline/        # Future items, not yet started

For tasks specifically:

tasks/  active/          # Work in progress  completed/       # Finished work

For any entity type with a clear lifecycle:

[type]/  active/          # Current  [end-state]/     # Whatever "done" means for this type

Pick folder names that match your domain. The pattern matters more than the specific names.

Status Detection

When the user mentions completion or status change, extract the intent:

SignalStatusAction
"finished", "done", "completed", "shipped"CompleteMove to archive/completed folder
"submitted", "sent", "delivered"CompleteMove to archive/completed folder
"missed", "passed", "skipped", "expired"MissedMove to archive or missed folder
"cancelled", "abandoned", "killed"CancelledMove to archive folder
"paused", "on hold", "deferred"PausedUpdate frontmatter status, keep in place
"restarting", "reopening", "reviving"ReactivateMove back to active folder

Workflow

1. Find the Entity

Search Basic Memory with multiple variations to locate the entity:

python
search_notes(query="quarterly report")search_notes(query="Q1 report")

If multiple matches come back, present options and ask which one.

If no match is found, ask for clarification — don't guess.

2. Move the File

Use move_note to relocate the entity to the appropriate status folder:

python
move_note(  identifier="tasks/active/quarterly-report",  destination_path="tasks/completed/quarterly-report.md")

By default the permalink stays the same after a move, so links keep resolving. Projects with update_permalinks_on_move enabled rewrite it from the new path.

3. Update Frontmatter

After moving, merge the new status (and completion date, if the type tracks one) into frontmatter with the metadata parameter. An append with empty content changes only the frontmatter:

python
edit_note(  identifier="quarterly-report",  operation="append",  content="",  metadata={"status": "completed", "completed": "2026-02-22"})

If the note also carries a - [status] observation, update it too (for example with find_replace on - [status] active).

4. Confirm

Report what was done concisely:

Marked complete: Quarterly Report  Moved to: tasks/completed/quarterly-report.md  Status: completed

Edge Cases

Already Archived

If the entity is already in an archive/completed folder, notify the user:

"Quarterly Report is already in tasks/completed/. Want me to update anything on it?"

Partial Completion

Sometimes only part of an entity is done. Don't move it — instead, update observations or status notes within the entity to reflect partial progress.

Revert / Reactivate

If something was archived by mistake, move it back:

python
move_note(  identifier="tasks/completed/quarterly-report",  destination_path="tasks/active/quarterly-report.md")
edit_note(  identifier="quarterly-report",  operation="append",  content="",  metadata={"status": "active"})

Status Without Movement

Some status changes don't require a folder move — "paused" or "blocked" items often stay in active/ with just a frontmatter update. Reserve folder moves for terminal or major state transitions.

Relationship to Other Skills

  • memory-tasks: Tasks are a specific lifecycle case. This skill covers the general pattern; memory-tasks covers task-specific fields (steps, current_step, context).
  • memory-notes: Use search-before-create (from memory-notes) to find the entity before transitioning it.
  • memory-defrag: Periodic defrag can identify stale active items that should be archived.

Guidelines

  • Archive, never delete. The knowledge graph benefits from historical context.
  • Move first, then update frontmatter. This order ensures the file is in the right place even if the edit step fails.
  • Permalinks survive moves by default. Links to the entity keep working after a move_note unless the project enables update_permalinks_on_move.
  • Be concise in confirmations. The user knows their system — just report what changed.
  • Ask when ambiguous. If multiple entities match or the target folder isn't clear, ask rather than guess.
  • Batch operations are fine. If the user says "archive all completed tasks", find them all, confirm the list, then move them in sequence.

來源與署名

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

授權條款: 無授權條款

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

檢舉或申請下架