memory-tasks
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMemory Tasks
基于Basic Memory的任务管理
Manage work-in-progress using Basic Memory's schema system. Tasks are just notes with — they live in the knowledge graph, validate against a schema, and survive context compaction.
type: Task使用Basic Memory的schema系统管理进行中的工作。任务本质是标记为的笔记——它们存储在知识图谱中,可通过schema验证,且能在上下文压缩后留存。
type: TaskWhen 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
- 启动多步骤工作(3个及以上步骤,或任何可能超出上下文窗口的工作)
- 压缩/重启后——搜索活跃任务以恢复工作
- 压缩前同步——更新所有活跃任务的当前状态
- 按需操作——用户要求创建、检查或管理任务
Task Schema
任务Schema
Tasks use the BM schema system (SPEC-SCHEMA). The schema note lives at :
memory/schema/Task.mdyaml
---
title: Task
type: schema
entity: Task
version: 1
schema:
description: string, what needs to be done
status?(enum): [active, blocked, done, abandoned], current state
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 subtask
settings:
validation: warn
---任务采用BM的schema系统(SPEC-SCHEMA)。Schema笔记存储在:
memory/schema/Task.mdyaml
---
title: Task
type: schema
entity: Task
version: 1
schema:
description: string, what needs to be done
status?(enum): [active, blocked, done, abandoned], current state
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 subtask
settings:
validation: warn
---Creating a Task
创建任务
When work qualifies, create a task note. Use with and put queryable fields in :
write_notenote_type="Task"metadatapython
write_note(
title="Descriptive task name",
directory="tasks",
note_type="Task",
metadata={
"status": "active",
"priority": "high",
"current_step": 1,
"steps": ["First step", "Second step", "Third step"]
},
tags=["task"],
content="""# Descriptive task name当工作符合条件时,创建任务笔记。使用函数并指定,将可查询字段放入:
write_notenote_type="Task"metadatapython
write_note(
title="Descriptive task name",
directory="tasks",
note_type="Task",
metadata={
"status": "active",
"priority": "high",
"current_step": 1,
"steps": ["First step", "Second step", "Third step"]
},
tags=["task"],
content="""# Descriptive task nameObservations
Observations
- [description] What needs to be done, concisely
- [status] active
- [assigned_to] claude
- [current_step] 1
- [description] What needs to be done, concisely
- [status] active
- [assigned_to] claude
- [current_step] 1
Steps
Steps
- First concrete step
- Second concrete step
- Third concrete step
- First concrete step
- Second concrete step
- Third concrete step
Context
Context
What 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.What 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""" )
**为何同时使用前置元数据(frontmatter)和观测项?** `metadata`中的字段(存储为前置元数据)支持`search_notes`的`metadata_filters`功能。观测项中的字段(如`- [status] active`)支持`schema_validate`功能。将可查询字段同时放入两处以实现全面覆盖。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]] - is case-sensitive —
note_typesstores the type as lowercasewrite_note(note_type="Task")in frontmatter. Usetask(lowercase) in search queries.note_types=["task"]
- 步骤需具体且可核查——例如“在文件Y中实现X”,而非“处理相关事项”
- 上下文用于失忆后恢复——撰写时假设要向完全不了解当前工作的聪明人解释
- 关联关系链接至其他实体——使用或关联关系连接相关工作
parent_task [[Other Task]] - 区分大小写——
note_types会将类型以小写write_note(note_type="Task")存储在前置元数据中。搜索查询时需使用task(小写)。note_types=["task"]
Resuming After Compaction
上下文压缩后恢复任务
On session start or after compaction:
-
Search for active tasks:python
search_notes(note_types=["task"], status="active") -
Read the task note to get full context
-
Resume fromusing the
current_stepfieldcontext -
Update as you progress — increment, update context, check off steps
current_step
在会话启动或压缩后:
-
搜索活跃任务:python
search_notes(note_types=["task"], status="active") -
读取任务笔记以获取完整上下文
-
从恢复工作,借助
current_step字段context -
随进度更新——递增,更新上下文,标记已完成步骤
current_step
Updating Tasks
更新任务
As work progresses, update the task note:
markdown
undefined随着工作推进,更新任务笔记:
markdown
undefinedSteps
Steps
- First step — done, resulted in X
- Second step — done, changed approach because Y
- Third step — next up
- First step — done, resulted in X
- Second step — done, changed approach because Y
- Third step — next up
Context
Context
Updated context reflecting current state...
Update frontmatter too:
```yaml
current_step: 3Updated context reflecting current state...
同时更新前置元数据:
```yaml
current_step: 3Completing Tasks
完成任务
When done:
yaml
status: done
completed: YYYY-MM-DDAdd a brief summary of what was accomplished and any follow-up needed.
任务完成时:
yaml
status: done
completed: YYYY-MM-DD添加一段简要总结说明完成的内容及后续需处理的事项。
Pre-Compaction Flush
压缩前同步
When a compaction event is imminent:
- Find all active tasks:
search_notes(note_types=["task"], status="active") - For each, update:
- to reflect actual progress
current_step - with everything needed to resume
context - Step checkboxes to show what's done
- This is critical — context not written down is context lost
当即将发生压缩事件时:
- 查找所有活跃任务:
search_notes(note_types=["task"], status="active") - 对每个任务进行更新:
- 反映实际进度
current_step - 包含恢复工作所需的所有信息
context - 步骤复选框标记已完成项
- 这一步至关重要——未记录的上下文将会丢失
Querying Tasks
查询任务
With BM's schema system, tasks are fully queryable:
| Query | What it finds |
|---|---|
| All tasks |
| Active tasks |
| Blocked tasks |
| My tasks |
| Tasks with blockers |
| Validate all tasks against schema |
| Detect drift between schema and actual task notes |
借助BM的schema系统,任务可被全面查询:
| 查询语句 | 查询结果 |
|---|---|
| 所有任务 |
| 活跃任务 |
| 受阻任务 |
| 我的任务 |
| 包含阻碍项的任务 |
| 验证所有任务是否符合schema |
| 检测schema与实际任务笔记之间的偏差 |
Guidelines
使用准则
- One task per unit of work — Don't cram multiple projects into one task
- Externalize early — If you think "I should remember this", write it down NOW
- 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 or relations to connect related work
parent_task [[X]] - Schema validation is your friend — Run periodically to catch incomplete tasks
schema_validate(noteType="Task")
- 每项任务对应一个工作单元——不要将多个项目塞进一个任务
- 尽早外部化记录——当你觉得“我应该记住这个”时,立即写下来
- 上下文优先于步骤——步骤告诉你要做什么;上下文告诉你原因和方法
- 关闭已完成任务——不要将已完成的工作标记为
active - 关联相关任务——使用或关联关系连接相关工作
parent_task [[X]] - Schema验证是好帮手——定期运行以发现不完整的任务
schema_validate(noteType="Task")