memory-capture

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Memory Capture

记忆捕获

Capture the gist of a working thread — the decisions made, insights surfaced, and context built — into a single coherent Basic Memory note that reflects where the thread has landed.
将工作线程的核心内容——已做出的决策、浮现的见解以及构建的上下文——捕获为一篇连贯的Basic Memory笔记,反映对话线程的最终结论。

Purpose

目的

A thread has a beginning, middle, and end. Things change as the conversation progresses: an early decision gets revised, a problem looks different in light of new information, a trade-off is settled differently than it first seemed. When this skill is invoked, capture the current state of understanding, not the history of how it got there.
If the skill is invoked more than once in the same thread, the same note is rewritten so it stays coherent — not appended to. The result should read top-to-bottom as a single document about the thread's outcome, with brief prose where a meaningful change is worth acknowledging.
一个对话线程有开头、中间和结尾。随着对话推进,情况会发生变化:早期的决策被修订,问题在新信息的背景下呈现出不同面貌,权衡结果与最初的设想不同。调用此技能时,需捕获当前的认知状态,而非达成该状态的历史过程。
如果在同一线程中多次调用此技能,将重写同一笔记以保持连贯性,而非追加内容。最终的笔记应从头到尾读起来像一篇关于对话结果的独立文档,仅在有意义的变更处添加简短说明。

When to Use

使用时机

Typical timing is mid-thread or end-of-thread, after enough has been settled to be worth preserving.
Use this skill when:
  • Key decisions have been made and shouldn't evaporate when the thread closes
  • A design, debugging, or planning discussion has produced something concrete
  • The user explicitly asks to capture, save, or remember what's been discussed
  • Toward the end of a session, to summarize the outcome
It is fine — and expected — to invoke this skill multiple times in the same thread as the conversation evolves.
典型的使用时机是对话中途或结束时,当已有足够多的内容确定下来值得保留时。
在以下场景使用此技能:
  • 已做出关键决策,且不应在对话结束后丢失
  • 设计、调试或规划讨论产生了具体成果
  • 用户明确要求捕获、保存或记住讨论内容
  • 会话即将结束时,总结对话结果
随着对话的推进,在同一线程中多次调用此技能是正常且预期的操作。

Same-Thread Detection

同线程检测

To rewrite the same note on re-capture instead of duplicating, key the note to a stable
thread_id
in its frontmatter.
If your agent exposes a stable session or thread id, store it as
thread_id
so subsequent captures within the same thread find and rewrite the same note. Any value that stays constant for the duration of the thread works — a session UUID, a conversation id, a ticket number the work is scoped to.
Example (hosts with a JSONL transcript): some agents write a per-session transcript whose filename is a stable session UUID. If yours does, you can derive the id from the most-recently-modified transcript file and use it as
thread_id
. This is optional — only do it if your host actually exposes such a transcript.
If no stable id is available, match the existing note by title/topic instead: search for a note covering the same thread (
search_notes(query="<topic>")
), and if you find the one this thread already produced, rewrite it. Omit
thread_id
and rely on a consistent title.
为了在再次捕获时重写同一笔记而非重复创建,需在笔记的前置元数据中关联一个稳定的
thread_id
如果你的Agent暴露了稳定的会话或线程ID,将其存储为
thread_id
,以便同一线程内的后续捕获操作能找到并重写同一笔记。任何在整个线程期间保持不变的值均可使用——会话UUID、对话ID、工作所属的工单编号等。
**示例(带有JSONL转录文件的宿主):**部分Agent会生成每个会话的转录文件,文件名是稳定的会话UUID。如果你的Agent是这种情况,可以从最近修改的转录文件中提取ID并将其用作
thread_id
。这是可选操作——仅当你的宿主确实暴露此类转录文件时才需要执行。
如果没有稳定ID可用,则通过标题/主题匹配现有笔记:搜索涵盖同一线程的笔记(
search_notes(query="<topic>")
),如果找到该线程已生成的笔记,则重写它。省略
thread_id
,依赖一致的标题进行匹配。

Decision Flow

决策流程

  1. Determine the thread key. Use a stable session/thread id if your agent exposes one; otherwise plan to match by title/topic.
  2. Search Basic Memory for the existing thread note.
    • With a thread id, use
      metadata_filters
      (not
      query
      ) — full-text query doesn't reliably match YAML frontmatter custom fields:
      python
      search_notes(
          metadata_filters={"thread_id": "<thread-id>"},
          project="<project>"
      )
    • Without one, search by topic and identify the note this thread already produced:
      python
      search_notes(query="<thread topic>", project="<project>")
  3. If a match is found:
    • Read the existing note (use the full permalink returned by search)
    • Synthesize a new version that integrates the latest understanding from the conversation
    • Overwrite via
      write_note
      with
      overwrite=True
      (same title, same
      thread_id
      if used, same directory)
  4. If no match is found:
    • Synthesize the note from the conversation
    • If you have a thread id, pass
      metadata={"thread_id": "<thread-id>"}
      to
      write_note
      (it surfaces as a custom frontmatter field)
    • Save it
  1. 确定线程标识:如果你的Agent暴露了稳定的会话/线程ID,则使用该ID;否则计划通过标题/主题进行匹配。
  2. 在Basic Memory中搜索现有线程笔记。
    • 如果有线程ID,请使用
      metadata_filters
      (而非
      query
      )——全文查询无法可靠匹配YAML前置元数据中的自定义字段:
      python
      search_notes(
          metadata_filters={"thread_id": "<thread-id>"},
          project="<project>"
      )
    • 如果没有线程ID,则按主题搜索并识别该线程已生成的笔记:
      python
      search_notes(query="<thread topic>", project="<project>")
  3. 如果找到匹配笔记
    • 读取现有笔记(使用搜索返回的完整永久链接)
    • 整合对话中的最新认知,生成新版本的笔记内容
    • 通过
      write_note
      并设置
      overwrite=True
      进行覆盖(保持相同标题、相同
      thread_id
      (如果使用)、相同目录)
  4. 如果未找到匹配笔记
    • 根据对话内容生成笔记
    • 如果有线程ID,在
      write_note
      中传入
      metadata={"thread_id": "<thread-id>"}
      (它会作为自定义前置元数据字段显示)
    • 保存笔记

Synthesis Rules

内容整合规则

When updating an existing thread note, synthesize, don't append:
  • Decisions that are still current → keep, possibly refined
  • Decisions that have been superseded → replaced inline (the new one goes where the old one was)
  • Significant revisions that deserve explanation → a sentence woven into the relevant section, not an appended changelog
  • Outdated context → removed
Goal: the note reads top-to-bottom as a single coherent document. A reader who never saw the conversation should still understand the outcome from the note alone. There is no
## Changes
section at the bottom; revisions live in the prose where they're relevant.
更新现有线程笔记时,需整合内容,而非追加
  • 仍有效的决策 → 保留,可酌情优化表述
  • 已被取代的决策 → 直接替换(新决策放在旧决策的位置)
  • 值得说明的重大修订 → 在相关章节中加入一句话说明,而非追加变更日志
  • 过时的上下文 → 删除
目标:笔记从头到尾读起来是一篇连贯的独立文档。即使从未参与对话的读者,也能仅通过笔记理解对话结果。笔记底部无需设置
## 变更
章节;修订内容应融入相关的正文段落中。

Escape Hatch

例外情况

If the user explicitly asks for a separate note (e.g., "capture this as a new note, don't merge with the existing thread note"), skip the same-thread lookup and create a fresh note without setting
thread_id
. This is rare; the default is to update.
如果用户明确要求创建独立笔记(例如:“将此内容捕获为新笔记,不要与现有线程笔记合并”),则跳过同线程查找,创建新笔记且不设置
thread_id
。这种情况很少见,默认操作是更新现有笔记。

Note Structure

笔记结构

markdown
---
title: <descriptive title for the thread>
type: note
thread_id: <thread-id, if your agent exposes one>
tags:
- relevant
- tags
---
markdown
---
title: <线程的描述性标题>
type: note
thread_id: <线程ID,如果你的Agent暴露了该ID>
tags:
- relevant
- tags
---

<Title>

<标题>

Context

上下文

What this thread is about — the situation, problem, or topic being explored.
此线程的主题——所探讨的场景、问题或话题。

<One or more topical sections>

<一个或多个主题章节>

The actual content. Could be decisions, a design rationale, an investigation summary, etc.
实际内容。可以是决策、设计依据、调查总结等。

Observations

关键要点

  • [decision] What was decided #tag
  • [insight] Key understanding gained #tag
  • [tradeoff] Option A chosen over B because... #tag
  • [decision] 已做出的决策 #tag
  • [insight] 获得的核心认知 #tag
  • [tradeoff] 选择方案A而非方案B的原因... #tag

Relations

关联内容

  • relates_to [[Related Concept]]
  • implements [[Parent Spec]]
undefined
  • relates_to [[相关概念]]
  • implements [[父级规范]]
undefined

Common Observation Categories

常见关键要点分类

  • [decision]
    — choices made
  • [insight]
    — understanding gained
  • [pattern]
    — reusable approaches
  • [learning]
    — lessons learned
  • [tradeoff]
    — options weighed
  • [problem]
    — issues identified
  • [solution]
    — fixes applied
  • [decision]
    — 已做出的选择
  • [insight]
    — 获得的认知
  • [pattern]
    — 可复用的方法
  • [learning]
    — 学到的经验
  • [tradeoff]
    — 已权衡的选项
  • [problem]
    — 已识别的问题
  • [solution]
    — 已应用的修复方案

Title

标题

The title should reflect the thread's topic. On update, the title can be refined if the topic has clarified — but it should still describe the same thread. Don't drift to a wholly new topic; if that's needed, use the escape hatch and create a new note.
标题应反映线程的主题。更新笔记时,如果主题变得更清晰,可以优化标题——但仍需描述同一线程。不要切换到完全无关的主题;如果需要,使用例外情况创建新笔记。

MCP Tools Used

使用的MCP工具

python
undefined
python
undefined

Find existing thread note by thread id (use metadata_filters, not query)

通过线程ID查找现有线程笔记(使用metadata_filters,而非query)

search_notes( metadata_filters={"thread_id": "<thread-id>"}, project="<project>" )
search_notes( metadata_filters={"thread_id": "<thread-id>"}, project="<project>" )

Or, without a thread id, find it by topic

或者,没有线程ID时,按主题查找

search_notes(query="<thread topic>", project="<project>")
search_notes(query="<thread topic>", project="<project>")

Read existing thread note (use the full permalink from search results)

读取现有线程笔记(使用搜索结果返回的完整永久链接)

read_note( identifier="<full-permalink>", project="<project>" )
read_note( identifier="<full-permalink>", project="<project>" )

Create

创建笔记

write_note( title="<title>", content="<markdown body — frontmatter is generated from title/tags/metadata>", directory="<folder>", tags=["..."], metadata={"thread_id": "<thread-id>"}, # omit if no stable id project="<project>" )
write_note( title="<title>", content="<markdown正文——前置元数据由标题/标签/元数据生成>", directory="<folder>", tags=["..."], metadata={"thread_id": "<thread-id>"}, # 如果没有稳定ID则省略 project="<project>" )

Overwrite an existing note (same path)

覆盖现有笔记(相同路径)

write_note( title="<same title>", content="<new content>", directory="<same folder>", tags=["..."], metadata={"thread_id": "<same thread-id>"}, # omit if no stable id overwrite=True, project="<project>" )
undefined
write_note( title="<same title>", content="<new content>", directory="<same folder>", tags=["..."], metadata={"thread_id": "<same thread-id>"}, # 如果没有稳定ID则省略 overwrite=True, project="<project>" )
undefined

Examples

示例

Example 1 — First capture during a brand design conversation

示例1 — 品牌设计对话中的首次捕获

Preceding conversation: The user has been working through visual identity decisions for a new product. They settled on a deep navy primary (
#2B3651
), explored accent options and chose orange (
#F26B3A
) for warmth, and picked Inter as the body font with Helvetica Neue as the display font.
User asks to capture.
Result — note created:
markdown
---
title: Visual identity — initial decisions
type: note
thread_id: 7c1d4a2e-3b5f-4d8a-9e1c-2f6b8a4d7c39
tags:
- branding
- design
---
**前置对话:**用户一直在为新产品敲定视觉标识决策。他们确定了深海军蓝为主色调(
#2B3651
),尝试了多种强调色后选择橙色(
#F26B3A
)以增加温暖感,正文字体选用Inter,标题字体选用Helvetica Neue。
用户要求捕获内容。
结果——创建的笔记:
markdown
---
title: Visual identity — initial decisions
type: note
thread_id: 7c1d4a2e-3b5f-4d8a-9e1c-2f6b8a4d7c39
tags:
- branding
- design
---

Visual identity — initial decisions

Visual identity — initial decisions

Context

Context

Working through the visual identity for the new product. This thread covers the initial palette and typography pass — a starting point that will likely be refined.
Working through the visual identity for the new product. This thread covers the initial palette and typography pass — a starting point that will likely be refined.

Color palette

Color palette

  • Primary: deep navy
    #2B3651
    — calm and professional
  • Accent: warm orange
    #F26B3A
    — energy and warmth as a complement to the navy
  • Primary: deep navy
    #2B3651
    — calm and professional
  • Accent: warm orange
    #F26B3A
    — energy and warmth as a complement to the navy

Typography

Typography

  • Body: Inter — neutral, readable at small sizes
  • Display: Helvetica Neue — strong presence for headings without being heavy
  • Body: Inter — neutral, readable at small sizes
  • Display: Helvetica Neue — strong presence for headings without being heavy

Observations

Observations

  • [decision] Primary color is navy
    #2B3651
    #branding
  • [decision] Accent color is orange
    #F26B3A
    #branding
  • [decision] Inter for body, Helvetica Neue for display #typography
  • [tradeoff] Considered teal as accent; orange tested better for warmth #branding
  • [decision] Primary color is navy
    #2B3651
    #branding
  • [decision] Accent color is orange
    #F26B3A
    #branding
  • [decision] Inter for body, Helvetica Neue for display #typography
  • [tradeoff] Considered teal as accent; orange tested better for warmth #branding

Relations

Relations

  • relates_to [[Brand Strategy]]
undefined
  • relates_to [[Brand Strategy]]
undefined

Example 2 — Update capture later in the same thread

示例2 — 同一线程后续的更新捕获

Preceding conversation (continued): After the initial decisions above, the conversation continued. The orange accent felt too aggressive in mock-ups, so we tested a coral (
#E89B7A
) which read warmer and more refined. The body font also shifted: Geist felt slightly tighter and more modern than Inter. Helvetica Neue for display stayed.
User asks to capture again — same thread.
Result — same note rewritten (note the same
thread_id
):
markdown
---
title: Visual identity — initial decisions
type: note
thread_id: 7c1d4a2e-3b5f-4d8a-9e1c-2f6b8a4d7c39
tags:
- branding
- design
---
**前置对话(续):**在上述初始决策之后,对话继续推进。橙色强调色在原型中显得过于突兀,因此我们测试了珊瑚色(
#E89B7A
),它看起来更温暖、更精致。正文字体也有所调整:Geist比Inter更紧凑、更具现代感。标题字体仍保留Helvetica Neue。
用户再次要求捕获内容——同一线程。
结果——重写同一笔记(注意相同的
thread_id
):
markdown
---
title: Visual identity — initial decisions
type: note
thread_id: 7c1d4a2e-3b5f-4d8a-9e1c-2f6b8a4d7c39
tags:
- branding
- design
---

Visual identity — initial decisions

Visual identity — initial decisions

Context

Context

Working through the visual identity for the new product. This thread settled on a navy + coral palette and a Geist/Helvetica typography pairing after a round of refinement.
Working through the visual identity for the new product. This thread settled on a navy + coral palette and a Geist/Helvetica typography pairing after a round of refinement.

Color palette

Color palette

  • Primary: deep navy
    #2B3651
    — calm and professional
  • Accent: coral
    #E89B7A
    — warm and refined
The accent went through a round of revision: an initial orange (
#F26B3A
) felt too aggressive in mock-ups, so we shifted to a coral that reads warmer and more refined while keeping the energy.
  • Primary: deep navy
    #2B3651
    — calm and professional
  • Accent: coral
    #E89B7A
    — warm and refined
The accent went through a round of revision: an initial orange (
#F26B3A
) felt too aggressive in mock-ups, so we shifted to a coral that reads warmer and more refined while keeping the energy.

Typography

Typography

  • Body: Geist — slightly tighter and more modern than Inter, which we tried first
  • Display: Helvetica Neue — strong presence for headings without being heavy
  • Body: Geist — slightly tighter and more modern than Inter, which we tried first
  • Display: Helvetica Neue — strong presence for headings without being heavy

Observations

Observations

  • [decision] Primary color is navy
    #2B3651
    #branding
  • [decision] Accent color is coral
    #E89B7A
    — warmer and more refined than the originally-chosen orange #branding
  • [decision] Geist for body, Helvetica Neue for display #typography
  • [tradeoff] Inter felt neutral but Geist edged it for spacing and modernity #typography
  • [tradeoff] Orange accent rejected as too aggressive; coral preferred #branding
  • [decision] Primary color is navy
    #2B3651
    #branding
  • [decision] Accent color is coral
    #E89B7A
    — warmer and more refined than the originally-chosen orange #branding
  • [decision] Geist for body, Helvetica Neue for display #typography
  • [tradeoff] Inter felt neutral but Geist edged it for spacing and modernity #typography
  • [tradeoff] Orange accent rejected as too aggressive; coral preferred #branding

Relations

Relations

  • relates_to [[Brand Strategy]]

Notice that:
- The orange and Inter decisions are **no longer the primary content** — they're acknowledged in prose ("which we tried first," "originally-chosen orange") and in tradeoff observations
- There is **no "Changes" section** at the bottom — revisions are integrated where they belong
- The note still reads top-to-bottom as a single coherent document
- The `thread_id` is unchanged, so the note was updated in place rather than duplicated
  • relates_to [[Brand Strategy]]

注意:
- 橙色和Inter的决策**不再是主要内容**——它们在正文中(“我们最初尝试的Inter”、“最初选择的橙色”)和权衡要点中被提及
- 笔记底部**没有“变更”章节**——修订内容被融入到对应的位置
- 笔记仍从头到尾读起来是一篇连贯的独立文档
- `thread_id`保持不变,因此笔记被原地更新而非重复创建

Best Practices

最佳实践

  1. Capture the current state, not the history. The note represents where the thread has landed.
  2. Synthesize, don't log. Each invocation produces a coherent document, not an accumulating record.
  3. Brief prose for revisions. A sentence in the section that changed is enough — don't add a changelog.
  4. Always run the same-thread lookup before deciding to create or update.
  5. Use observations for the structured layer. Decisions, insights, tradeoffs go in
    ## Observations
    so they're searchable.
  6. Link relations liberally. Notes the user might want to reach from this one.
  1. 捕获当前状态,而非历史过程。笔记反映对话线程的最终结论。
  2. 整合内容,而非记录日志。每次调用都生成一篇连贯的文档,而非累积记录。
  3. 用简短文字说明修订。在变更的章节中添加一句话即可——不要添加变更日志。
  4. 在决定创建或更新前,始终执行同线程查找
  5. 用关键要点构建结构化层级。决策、见解、权衡等内容放在
    ## 关键要点
    中,以便于搜索。
  6. 尽可能关联相关内容。添加用户可能希望从此笔记跳转访问的其他笔记链接。",