Memory Tasks

basicmachines-co/basic-memory/skills/memory-tasks

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

Task management via Basic Memory schemas: create, track, and resume structured tasks that survive context compaction. Uses BM's schema system for uniform notes queryable through the knowledge graph.

AI 產生的概覽

在 Basic Memory 中管理結構化任務筆記,讓工作可被追蹤並在上下文壓縮後恢復。

功能
為 Basic Memory 定義 Task 結構描述,並說明如何建立、更新、查詢與完成任務筆記。任務以筆記形式儲存,包含類型、狀態、步驟、目前步驟、上下文與選用關聯,並可透過知識圖譜搜尋或驗證。它也涵蓋壓縮前的狀態整理,用於記錄進度與恢復上下文。
適用情境
適用於開始可能超出上下文視窗的多步驟工作、在重新啟動或壓縮後恢復工作,或使用者要求建立、查看或管理任務時。
執行需求
需要 Basic Memory 及其結構描述系統與筆記工具,例如 write_note、edit_note、search_notes、schema_validate 和 schema_diff。不包含指令碼,僅為說明文件。

Memory Tasks

Manage work-in-progress using Basic Memory's schema system. Tasks are just notes with type: Task — they live in the knowledge graph, validate against a schema, and survive context compaction.

When to Use

  • Starting multi-step work (3+ steps, or anything that might outlast the context window)
  • After compaction/restart — search for active tasks to resume
  • Pre-compaction flush — update all active tasks with current state
  • On demand — user asks to create, check, or manage tasks

Task Schema

Tasks use the BM schema system. The schema note lives at schema/Task.md:

yaml
---title: Tasktype: schemaentity: Taskversion: 1schema:  description: string, what needs to be done  status?(enum, current state): [active, blocked, done, abandoned]  assigned_to?: string, who is working on this  steps?(array): string, ordered steps to complete  current_step?: integer, which step number we're on (1-indexed)  context?: string, key context needed to resume after memory loss  started?: string, when work began  completed?: string, when work finished  blockers?(array): string, what's preventing progress  parent_task?: Task, parent task if this is a subtasksettings:  validation: warn---

Creating a Task

When work qualifies, create a task note. Use write_note with note_type="Task" and put queryable fields in metadata:

python
write_note(  title="Descriptive task name",  directory="tasks",  note_type="Task",  metadata={    "status": "active",    "priority": "high",    "assigned_to": "claude",    "current_step": 1,    "steps": ["First step", "Second step", "Third step"]  },  tags=["task"],  content="""# Descriptive task name
## Observations- [description] What needs to be done, concisely- [status] active- [assigned_to] claude- [current_step] 1
## Steps1. [ ] First concrete step2. [ ] Second concrete step3. [ ] Third concrete step
## ContextWhat future-you needs to pick up this work. Include:- Key file paths and repos involved- Decisions already made and why- What was tried and what worked/didn't- Where to look for related context""")

Why both frontmatter and observations? Fields in metadata (stored as frontmatter) power search_notes with metadata_filters. Fields as observations (- [status] active) power schema_validate. Include queryable fields in both places for full coverage.

Key Principles

  • Steps are concrete and checkable — "Implement X in file Y", not "figure out stuff"
  • Context is for post-amnesia resumption — Write it as if explaining to a smart person who knows nothing about what you've been doing
  • Relations link to other entities — parent_task [[Other Task]], related_to [[Some Note]]
  • Note types are normalized to snake_case — write_note(note_type="Task") stores type: task, and note_types=["Task"] or note_types=["task"] both match it.

Resuming After Compaction

On session start or after compaction:

  1. Search for active tasks:

    python
    search_notes(note_types=["task"], status="active")
  2. Read the task note to get full context

  3. Resume from current_step using the context field

  4. Update as you progress — increment current_step, update context, check off steps

Updating Tasks

As work progresses, update the task note:

markdown
## Steps1. [x] First step — done, resulted in X2. [x] Second step — done, changed approach because Y3. [ ] Third step — next up
## ContextUpdated context reflecting current state...

Update frontmatter too, with the metadata parameter (empty content leaves the body alone):

python
edit_note(  identifier="tasks/descriptive-task-name",  operation="append",  content="",  metadata={"current_step": 3})

Completing Tasks

When done:

yaml
status: donecompleted: YYYY-MM-DD

Add a brief summary of what was accomplished and any follow-up needed.

Pre-Compaction Flush

When a compaction event is imminent:

  1. Find all active tasks: search_notes(note_types=["task"], status="active")
  2. For each, update:
    • current_step to reflect actual progress
    • context with everything needed to resume
    • Step checkboxes to show what's done
  3. Context that isn't written down is lost at compaction

Querying Tasks

With BM's schema system, tasks are fully queryable:

QueryWhat it finds
search_notes(note_types=["task"])All tasks
search_notes(note_types=["task"], status="active")Active tasks
search_notes(note_types=["task"], status="blocked")Blocked tasks
search_notes(note_types=["task"], metadata_filters={"assigned_to": "claude"})My tasks
search_notes("blockers", note_types=["task"])Tasks with blockers
schema_validate(note_type="Task")Validate all tasks against schema
schema_diff(note_type="Task")Detect drift between schema and actual task notes

Guidelines

  • One task per unit of work — Don't cram multiple projects into one task
  • Externalize early — write things down when you notice them
  • Context > steps — Steps tell you what to do; context tells you why and how
  • Close finished tasks — Don't leave completed work as active
  • Link related tasks — Use parent_task [[X]] or relations to connect related work
  • Schema validation is your friend — Run schema_validate(note_type="Task") periodically to catch incomplete tasks

來源與署名

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

授權條款: 無授權條款

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

檢舉或申請下架