memory-ledger

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Memory Ledger Protocol

记忆账本协议

Keep a structured log of everything learned during a task. Goal: when a new instance takes over, it reads the ledger and continues from where things left off — no starting from scratch.

在任务执行过程中,对所有获取到的信息进行结构化记录。目标:当新的实例接管任务时,它可以读取账本并从中断处继续执行——无需从头开始。

Ledger Structure

账本结构

One ledger block per task. Updated incrementally as the task progresses — never rewritten from scratch.
MEMORY LEDGER
Task        : [task name / short description]
Started     : [first step number or timestamp]
Last updated: [step number or description]
每个任务对应一个账本区块。随着任务推进逐步更新——绝不从头重写。
MEMORY LEDGER
Task        : [task name / short description]
Started     : [first step number or timestamp]
Last updated: [step number or description]

Goal

Goal

[What is being done — 1-2 sentences. Scope and success criteria.]
[What is being done — 1-2 sentences. Scope and success criteria.]

User Preferences & Constraints

User Preferences & Constraints

  • [Preference / constraint 1]
  • [Preference / constraint 2] [If empty: "None established yet"]
  • [Preference / constraint 1]
  • [Preference / constraint 2] [If empty: "None established yet"]

Decisions Made

Decisions Made

#DecisionRationaleStep
1[what was decided][why][which step]
#DecisionRationaleStep
1[what was decided][why][which step]

Current Status

Current Status

Completed : [list or "—"] In progress: [list or "—"] Pending : [list or "—"]
Completed : [list or "—"] In progress: [list or "—"] Pending : [list or "—"]

Failed Approaches

Failed Approaches

ApproachWhy It FailedStep
[what was tried][error / issue][which step]
[If empty: "None yet"]
ApproachWhy It FailedStep
[what was tried][error / issue][which step]
[If empty: "None yet"]

Bugs & Fixes

Bugs & Fixes

BugFixStatus
[error message / description][applied fix]Fixed / Open
[If empty: "None yet"]
BugFixStatus
[error message / description][applied fix]Fixed / Open
[If empty: "None yet"]

Next Step

Next Step

[The next thing to do — clear and actionable]

---
[The next thing to do — clear and actionable]

---

Update Rules

更新规则

Update the ledger when any of these events occur:
EventSection to Update
Subtask completedCurrent Status, Next Step
Decision madeDecisions Made
Error occurredBugs & Fixes
Error resolvedBugs & Fixes (update status)
Approach failedFailed Approaches
User stated preference/constraintUser Preferences & Constraints
Updates must be small and surgical — only change the affected section, do not rewrite the entire ledger.

当发生以下任一事件时,更新账本:
事件需要更新的章节
子任务完成当前状态、下一步计划
做出决策已做出的决策
出现错误Bug与修复方案
错误已解决Bug与修复方案(更新状态)
尝试方法失败失败的尝试方法
用户说明偏好/约束条件用户偏好与约束条件
更新必须精准且局部——仅修改受影响的章节,不得重写整个账本。

Handover Protocol

交接协议

When a new instance takes over a task, first action is to read the ledger:
LEDGER READ — Task resumed
Task    : [task name]
Status  : [current status summary]
Next    : [next step]
Warning : [if any open bugs or failed approaches]
Continuing...

当新的实例接管任务时,首要操作是读取账本:
LEDGER READ — Task resumed
Task    : [task name]
Status  : [current status summary]
Next    : [next step]
Warning : [if any open bugs or failed approaches]
Continuing...

Ledger Close

账本关闭

When the task is complete, close the ledger:
LEDGER CLOSED
Task completed
Total steps   : N
Decisions made: N
Bugs resolved : N

任务完成后,关闭账本:
LEDGER CLOSED
Task completed
Total steps   : N
Decisions made: N
Bugs resolved : N

When to Skip

可跳过场景

  • Single-step, short tasks (< 5 minutes, < 3 steps)
  • User is only asking a question, no task
  • Context is already small and manageable

  • 单步骤、短时长任务(<5分钟,<3个步骤)
  • 用户仅提出问题,无任务执行需求
  • 上下文范围小且易于管理

Guardrails

约束规则

  • Never let the ledger grow stale — if 3+ steps pass without an update, force one.
  • Keep entries concise — one line per decision, one line per bug. No paragraphs.
  • Cross-skill: integrates with
    task-decomposer
    (tracks subtask progress),
    error-recovery
    (logs errors and fixes), and
    agent-reviewer
    (provides retrospective data).
  • 绝不允许账本过期——若超过3个步骤未更新,强制进行一次更新。
  • 保持条目简洁——每项决策、每个Bug仅用一行记录。不得使用段落。
  • 跨技能集成:可与
    task-decomposer
    (跟踪子任务进度)、
    error-recovery
    (记录错误与修复方案)、
    agent-reviewer
    (提供回顾数据)集成。