tree-ring-memory
它能做什么
这个工具可以帮助 AI 记住并整理项目中的重要信息。它能以有条理的方式保存经验教训、决策和注意事项,而无需保留整段对话。
适用场景
- ✓重新推进项目之前,回顾过去的决策。
- ✓对项目的运作方式做重大改动之前。
- ✓当你让 AI 记住、回顾或删除某些信息时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/tree-ring-memory/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“AI,提醒我这个项目架构相关的重要决策。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会先检查是否存在本地的现有指令来组织记忆。如果没有找到,它可以安装一个工具,帮助以结构化的方式存储和检索信息,例如经验教训或注意事项。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Tree Ring Memory
Overview
Tree Ring Memory is a framework-agnostic, local-first memory lifecycle layer for AI agents. Use this skill when an agent should recall, preserve, audit, or forget durable project memory without treating raw conversation transcripts as memory.
The public runtime is a Rust CLI/TUI with local SQLite/FTS storage, scoped recall, evidence records, audit, deterministic consolidation, maintenance, DOX/Revolve source adapters, framework discovery, redaction, and explicit forgetting.
When to Use This Skill
- Use before resuming a project where prior decisions, warnings, preferences, or failed approaches may matter.
- Use before changing architecture, storage, security, privacy, release, or agent-memory behavior.
- Use when the user asks to remember, recall, audit, redact, forget, or consolidate agent memory.
- Use after tests, reviews, incidents, or production behavior validate a lesson future agents should preserve.
- Use when a project contains
.tree-ring/SKILL.md,.tree-ring/CLI.md, or other Tree Ring bridge files.
How It Works
Step 1: Discover Local Guidance
Check whether the current project already has Tree Ring guidance:
test -f .tree-ring/SKILL.md && sed -n '1,220p' .tree-ring/SKILL.md
test -f .tree-ring/CLI.md && sed -n '1,220p' .tree-ring/CLI.md
Treat project-local .tree-ring files as more authoritative than generic
examples in this skill. If the CLI is installed, inspect the current command
surface before assuming flags:
tree-ring --help
tree-ring recall --help
tree-ring remember --help
tree-ring evidence --help
tree-ring audit --help
tree-ring forget --help
If Tree Ring is not installed, resolve the actual project root and explain the
exact project-local download before obtaining explicit approval to fetch it.
Download the official, version-pinned v0.15.0/install.sh to a temporary file,
verify its SHA-256 is
ef0d5eb8f09cbe2e4c3abe80ee9a98a56759c89ad4ddd103d6c68314cd653ade,
inspect it, then run it. The pinned source is
https://raw.githubusercontent.com/TerminallyLazy/Tree-Ring-Memory/v0.15.0/install.sh.
cd <project-root>
sh <verified-installer-path> --project --init --release v0.15.0 --no-animation
Do not pipe a network response directly to a shell. After verification and
inspection, show the exact installer command and obtain explicit approval again
before executing it. For an installed global CLI, initialize from the project root with
tree-ring --root .tree-ring init; for a project-local CLI, use
.tree-ring/bin/tree-ring --root .tree-ring init.
Check for a newer release without changing files using
tree-ring update --check. Run tree-ring update only with user authorization,
then rerun init in each project root to refresh managed guidance while
preserving custom content.
Step 2: Recall Before Risky Work
Use narrow, project-scoped recall first:
tree-ring recall "release behavior" --project example-service
tree-ring recall "sqlite migration" --project example-service
tree-ring recall "user preference"
Use recalled memory as context, not authority. Verify it against current source files, tests, docs, issues, pull requests, logs, and runtime state before making changes.
Step 3: Write Only Durable Memory
Write concise memory only when it is likely to help future agents:
tree-ring remember "Run project-scoped recall before release changes." --event-type lesson --scope project
Prefer specific event types when supported locally:
decisionlessonwarningcorrectionuser_preferencetool_resultsummaryhypothesis
Store the durable lesson, decision, warning, or follow-up. Do not store the full conversation.
Step 4: Record Evidence for Evaluated Outcomes
Use evidence records for test runs, incidents, reviewed changes, or other evaluated outcomes:
tree-ring evidence \
"Installer smoke test passed in an isolated HOME." \
--outcome observed \
--evidence-ref "ci/install-smoke/2026-07-08"
Outcome guidance:
promoted: durable truth backed by strong evidencerejected: failed or rolled-back approach worth keeping visibledeferred: unresolved idea or future optionobserved: normal evaluated result
Do not promote weak, stale, or unreviewed claims to durable truth.
Step 5: Use Source Adapters Carefully
When a repo has structured source records, run dry runs first:
…
常见问题
“local-first”是什么意思?
意思是信息主要保存在你的电脑上,而不是远程服务器上。
我可以删除 AI 保存的信息吗?
可以。当某些信息不再有用或内容有误时,你可以让该工具删除或遗忘特定信息。
AI 会保存我的所有对话吗?
不会。它的目标是只保存重要且有用的项目信息,例如总结的经验教训或做出的决策,而不是整段对话。
详情
作者的原始描述
Use Tree Ring Memory for local-first AI-agent memory lifecycle work: recall, evidence, audit, forgetting, and consolidation without transcript dumping.
热度
- GitHub 星标
- 48k
- 排名
- #6018
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。