Twitter/X

chengyongru recommends a scheduled nanobot maintenance task (e.g., weekly) that…

Brief

chengyongru shares a ready-to-use scheduled-task prompt for nanobot to regularly prune built-in agent memory and migrate durable technical material into an external knowledge base (he uses Obsidian). The routine inspects SOUL.md, USER.md, memory/MEMORY.md, reads memory/history.jsonl only, runs git diff checks, stages only related files, and emits a report with commit hashes and unresolved risks.

Why it matters

chengyongru recommends a scheduled nanobot maintenance task (e.g., weekly) that enforces clear boundaries: keep built-in memory only for identity, communication preferences, long-term work principles, and cross-task routing; migrate technical facts, project snapshots, provider/API behavior, deployment runbooks, PR/issue records, benchmarks, research results, and one-off troubleshooting into an external knowledge base (e.g., Obsidian).

Key details

  • The prompt prescribes concrete steps: read applicable skill docs; check SOUL.md, USER.md and memory/MEMORY.md; only read (not edit) memory/history.jsonl; perform minimal, non-speculative pruning; update knowledge-base notes respecting metadata/schema; run git diff --check; confirm memory/history.jsonl unchanged; stage and commit only task-related files (avoid git add -A); and output a short report listing migrated content, modified files, commit hashes, and outstanding risks.
  • chengyongru notes nanobot's 'dream' can continuously extract long-term info but @nanobot_project intentionally keeps memory simple; he urges automation and personal customization of organization—'automation is all you need.'
Source evidence

Agent memory doesn’t need to be complicated—it needs good boundaries and regular maintenance.

chengyongru (@chengyongru)

分享一个我用 nanobot 管理长期记忆的小技巧(虽然这已经有点老生常谈了), 那就是用定时任务维护内置 memory 和外部知识库的边界

这个定时任务我已经用了很长一段时间, 效果如图所示, 我觉得还行.

nanobot 的 dream 已经能从会话中持续整理长期信息, 但 @nanobot_project 目前并没有把 memory 设计得很复杂. 现在各种 agent memory 方案还在快速变化, 我们也很鼓励每个使用者根据自己的习惯, 探索适合自己的组织方式.

下面是我设置的定时任务 prompt, 我先在这里抛砖引玉.

你可以复制粘贴让nanobot根据这段prompt创建一个每周一次或者随便什么时间间隔一次的定时任务都行, 取决于你的想法, 这里的外部知识库可以换成你喜欢的任意选项,比如我就是obsidian仓库

参考 gist.githubusercontent.com/k… 完成一次知识库整理

第一步: 读取并遵守当前环境中与 memory 和外部知识库相关的 skill 说明. 把本次工作作为一个受限且可恢复的维护任务执行.

第二步: 检查当前 memory 文件, 包括 SOUL.md, USER.md 和 memory/MEMORY.md. 必要时只读搜索 memory/history.jsonl, 不要编辑它.

第三步: 重新检查内置 memory 与外部知识库的边界.

内置 memory 只保留每轮对话都值得注入 system prompt 的身份, 沟通偏好, 长期工作原则和跨任务路由.

技术事实, 项目快照, provider/API 行为, 部署 runbook, PR/issue 记录, benchmark, 调研结果和一次性排障记录迁入外部知识库.

第四步: 查询知识库的操作日志, 知识地图和相关笔记. 优先更新已有笔记, 只有主题缺失时才新建. 新增或更新笔记时, 遵守当前知识库的 metadata, schema 和写作规范.

第五步: 对内置 memory 做最小必要瘦身. 不要臆造新事实, 拿不准的内容就保留, 并在报告中说明.

第六步: 更新知识库操作日志, 必要时同步更新知识地图或索引.

第七步: 验证改动.

运行 git diff --check.

复读修改后的 memory 文件, 确认结构连贯.

确认 memory/history.jsonl 未被修改或暂存.

确认没有混入其他无关改动.

第八步: 分别在 workspace 和外部知识库中, 只暂存并提交本次任务相关的文件. 不要使用 git add -A, 保留已有的无关 worktree 改动.

第九步: 最后输出一份简短报告, 说明迁移了哪些内容, 修改了哪些文件, 对应的 commit hash, 以及未处理项或风险.

总之, automation is all you need!

— https://nitter.net/chengyongru/status/2085205384357466397#m