跳到正文
Skillpedia
智能体16k · #10898

memory

它能做什么

让助手随着时间推移查找、保存和整理它所记住的内容,例如关于人物和项目的事实。适合希望助手保留有用背景信息的人。

适用场景

  • ✓当你询问助手某人是谁,或某人正在做什么时。
  • ✓当助手学到一个值得之后保留的有用事实时。
  • ✓当保存的笔记中含有需要清理的过时或错误条目时。

技能链接

https://github.com/yc-software/qm/blob/main/skills-seed/memory/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/yc-software/qm/blob/main/skills-seed/memory/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请在你的记忆中搜索我们上个月关于柏林项目做出的决定。”

每周 5 个新技能,1 分钟读完。

工作原理

助手会使用记忆工具,在它可能访问的笔记本中搜索或写入笔记。笔记存储在记忆系统中,而不是普通文件里。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

memory — search, write, and curate what you remember

Everything here goes through the typed memory tool. Memory is NOT a file: writing memory/MEMORY.md with files action write or shell commands lands on your computer's disk and is silently lost — the tool is the one real path.

Every turn already auto-recalls a bounded selection from your notebooks into "## What you remember" and auto-extracts facts after you reply. This skill is for what the automatic path misses:

  • Search (action: "search") — what you remember is bigger than what auto-recall injects. Search spans every notebook this conversation may read (personal, channel, org); when more than one is in reach, each hit is tagged with the notebook it came from. Matching is substring-based (all terms must match), so prefer distinctive terms (a name, a project) over sentences. An empty result means those terms found no match, not that nothing is recorded. Try fewer terms or alternate wording before concluding a fact is absent.
  • Read another notebook (action: "read", scope: "channel:…") — use the exact scope ID from a search result to load that authorized notebook. search accepts scope too, to narrow a query. Omit it to search all authorized notebooks or read the current notebook. Access comes from this turn's sharing policy; naming a scope never grants access. Other notebooks are read-only.
  • Write now (action: "add", facts: [{text}, …]) — when the user corrects you or tells you something they'll expect you to know later, persist it immediately instead of hoping post-turn extraction catches it. Write self-contained facts (who/what, with enough context to be useful cold). Duplicates are dropped; added in the reply is the count actually new.
  • Curate (action: "edit" with facts: [{id, text}, …], action: "delete" with ids) — search or read to get each fact's #id, then fix facts that changed and delete stale, duplicate, or wrong ones. A call naming any id that isn't in this conversation's notebook changes nothing and lists the bad ids. Curation is for quality — merging duplicates, deleting disproven facts — not for deleting things the user asked you to remember.

The notebook you write is this conversation's own (your personal one in a DM, the channel's in a channel). Other authorized notebooks can be searched/read, not rewritten here.

The org-admin write path uses the self-API instead, called with $AGENT_API_URL and $AGENT_API_TOKEN (both already in your environment on every turn — if they are unset, this instance has no self-API; say so rather than pretending).

Org-wide notebook (admins)

When the chatting user is an org admin, the self-API additionally accepts the org-wide notebook as a target:

curl -sS --fail-with-body -X POST "$AGENT_API_URL/v1/memory/facts" \
  -H "x-agent-capability: $AGENT_API_TOKEN" \
  -H "content-type: application/json" \
  -d '{"scope":"org","facts":["..."]}'

(?scope=org on GET /v1/memory/self; "scope":"org" in the body of PATCH /v1/memory/facts with {"facts":[{"id","text"}]} or DELETE /v1/memory/facts with {"ids":[…]} to curate.) Those writes land in the notebook every conversation in the org recalls, so confirm the wording with the admin before writing and keep personal facts out of it. A 403 org memory writes require an org admin means the user isn't one — say so rather than retrying (GET $AGENT_API_URL/v1/admin/whoami answers it definitively).

Failure modes

  • "memory isn't available in this conversation" — this conversation's memory policy forbids it; don't retry, just say memory is off here.
  • On a read-only wake (a heartbeat glance), memory can be searched and read but not written — save the fact on a normal turn instead.
  • 401 unauthorized from the self-API — your token expired mid-turn; this resolves on the next turn.
  • 502 with an application/problem+json body from /v1/memory/facts or /v1/memory/search — a memory provider failed. added (or results) is what still worked, and each entry in problems names the provider, what happened and a fix. Don't send the same facts again; tell the user which provider failed and its fix.
常见问题

为什么搜索可能返回空结果?

空结果只说明这些词没有匹配上。助手可以尝试不同或更少的词,然后再判断某个事实是否缺失。

它能读取其他人的笔记本吗?

只能读取与本次对话共享的笔记本。访问权限来自当前聊天的共享规则。

把记忆文件保存到磁盘可以吗?

不可以。写入磁盘的记忆文件会丢失,因此助手会改用记忆工具。

详情

作者的原始描述

Deliberately search, add to, or curate your long-term memory with the `memory` tool — beyond the automatic recall/capture every turn already does. Use when asked who someone is or what they're working on, when you learn a durable fact worth keeping now, or when your notebook holds stale or wrong entries you should clean up.

repo: yc-software/qm

热度

GitHub 星标
16k
排名
#10898
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能