agentsclimarketplace

Memory

Skill dongliutony/myagent-skill/skills/memory

实现记忆与会话系统 — 持久化、三层压缩、选择性召回、文件历史From its SKILL.md

Install
npx -y skills add dongliutony/myagent-skill --skill memory

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.3 KB, as published. Nobody here has run it

记忆与会话设计

你在解决什么问题

管理 Agent 的长短期记忆:如何存储、何时压缩、如何召回、如何恢复会话。

参考实现 Snippets

  • snippets/memory/auto-compact.ts — 自动压缩触发 + 断路器 + 两阶段恢复
  • snippets/memory/memory-types.ts — 四种记忆类型 + 存储格式 + 漂移防护
  • snippets/memory/session-persistence.ts — JSONL 持久化 + boundary 优化加载

设计检查清单

  • 三层压缩:AutoCompact(13k buffer)、Context Collapse、MicroCompact
  • 压缩连续失败 3 次 → 断路器
  • 四种记忆类型(user/feedback/project/reference)
  • 记忆召回用轻量模型选择 Top-5
  • 漂移防护:使用前验证当前状态
  • JSONL 格式 + 文件 > 5MB 时 boundary 优化
  • 文件历史快照上限 100
  • 会话记忆 10k token 后自动初始化

常见错误

错误后果正确做法
无断路器压缩无限重试MAX_FAILURES = 3
记忆存代码结构过时后误导只存不能推导的信息
全量加载大会话恢复慢boundary 只加载后半
召回无漂移检查推荐已删除文件使用前验证

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.