← Back to Skills Marketplace
simonstang

hermes-learning-loop

by SimonsTang · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
85
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install hermes-learning-loop2
Description
融合 Hermes Agent 自我进化理念的增强技能。 将 Hermes Agent 的核心差异化能力(自学习闭环、自动技能沉淀、经验驱动的迭代优化) 内化为 OpenClaw 环境下的可执行工作方法。 触发场景:完成复杂任务后自动复盘沉淀、定期技能优化审查、从错误中提取经验。
README (SKILL.md)

\r \r

🧬 Hermes 自学习闭环 — 经验驱动的持续进化\r

\r

设计哲学\r

\r 从 Hermes Agent(Nous Research)提取的核心理念:\r "经验 → 技能 → 改进 → 沉淀"的完整进化回路。\r \r 不追求自动化黑盒,而是建立一套有意识、有纪律的经验提炼体系,\r 让每次执行都成为下一次更快的垫脚石。\r \r ---\r \r

核心机制一:任务完成后的自动复盘与技能沉淀\r

\r

触发条件(满足任一)\r

\r

  1. 完成了一个复杂任务(涉及 5 个以上工具调用)\r
  2. 在执行中遇到了错误或死胡同,最终找到了正确路径\r
  3. 用户纠正了我的方法或方向\r
  4. 发现了一个非平凡的、可复用的工作流\r \r

执行流程\r

\r

任务完成\r
  → Step 1: 快速复盘(思考 3 个问题)\r
      1. 这个任务的关键成功因素是什么?\r
      2. 哪些步骤可以标准化?\r
      3. 下次遇到类似任务,我能省掉哪些步骤?\r
  → Step 2: 判断是否值得沉淀\r
      - 只涉及 1-2 个简单工具调用 → 不沉淀(太琐碎)\r
      - 有明确的"如果...就..."模式 → 值得沉淀\r
      - 用户纠正过的流程 → 必须沉淀(这是最宝贵的学习信号)\r
      - 涉及跨步骤、跨工具的编排 → 值得沉淀\r
  → Step 3: 提炼为技能要点\r
      写入 memory/YYYY-MM-DD.md 当日日志:\r
      ## 技能沉淀: [技能名称]\r
      - **场景**: 什么时候用\r
      - **核心步骤**: 3-7 步简述\r
      - **踩坑点**: 哪些地方容易出错\r
      - **优化空间**: 下次可以怎么改进\r
  → Step 4: 评估是否需要升级为正式 Skill\r
      如果同一个模式出现 3 次以上 → 考虑创建独立的 SKILL.md\r
```\r
\r
---\r
\r
## 核心机制二:三层记忆架构的增强实践\r
\r
### 借鉴 Hermes 的分层记忆,在 OpenClaw 环境下实现\r
\r
| 层级 | Hermes 实现 | OpenClaw 对应 | 维护策略 |\r
|------|------------|--------------|---------|\r
| **即时记忆** | 对话上下文 | 当前会话上下文 | 自动管理 |\r
| **工作记忆** | MEMORY.md + USER.md | MEMORY.md + USER.md | 每次会话启动加载 |\r
| **经验记忆** | Skills(程序性记忆) | skills/*.md + memory/*.md | 主动积累 |\r
| **会话检索** | SQLite FTS5 + LLM 摘要 | lcm_grep + lcm_expand | 按需搜索 |\r
\r
### 增强实践规则\r
\r
1. **MEMORY.md 要精炼不冗余**\r
   - 只保留跨会话必须记住的关键事实\r
   - 经验教训写入 memory/YYYY-MM-DD.md 日志\r
   - 定期(每 3-5 天)从日志中提炼精华到 MEMORY.md\r
\r
2. **日志是原始经验库**\r
   - 每天一个文件,记录当天所有有价值的操作\r
   - 格式:`[时间] 任务 | 关键决策 | 学到的教训`\r
   - 这是"经验记忆"的底层数据源\r
\r
3. **Skill 是提炼后的程序性知识**\r
   - 从日志中反复出现的模式提炼\r
   - 一个 Skill 只解决一类问题\r
   - 包含:触发条件、步骤、踩坑点、验证方法\r
\r
---\r
\r
## 核心机制三:错误驱动的自我改进\r
\r
### 从 Hermes 的 KEPA(提示反向传播)理念 adapted\r
\r
当执行中出现错误或被用户纠正时:\r
\r
```\r
错误/纠正发生\r
  → Step 1: 立即记录\r
      写入当天 memory/YYYY-MM-DD.md:\r
      ❌ [错误描述]\r
      → 原因: [为什么错]\r
      → 修正: [怎么对的]\r
      → 经验: [以后怎么避免]\r
  → Step 2: 检查是否影响已有知识\r
      搜索 MEMORY.md 和相关 Skill 中是否有需要更新的条目\r
      如果有 → 立即修正\r
  → Step 3: 传播到相关上下文\r
      如果错误涉及某个特定平台的操作方式 → 更新对应笔记\r
      如果错误是通用方法论 → 写入 MEMORY.md 的"教训"部分\r
```\r
\r
### 错误分类优先级\r
\r
| 优先级 | 错误类型 | 响应 |\r
|--------|---------|------|\r
| P0 | 用户明确纠正 | 必须记录,立即更新相关记忆 |\r
| P1 | 工具调用失败后的替代方案 | 记录替代方案作为 Plan B |\r
| P2 | 自己发现的次优路径 | 记录优化空间,下次优先尝试 |\r
| P3 | 通用知识更新 | 记入日志,积累后统一更新 |\r
\r
---\r
\r
## 核心机制四:技能优化迭代\r
\r
### 定期技能审查(在 Heartbeat 中执行)\r
\r
每隔 3-5 天,利用心跳空闲时段执行一次技能审查:\r
\r
```\r
技能审查清单:\r
1. 读取最近 5 天的 memory/*.md 日志\r
2. 识别重复出现的操作模式\r
3. 检查现有 Skill 是否覆盖这些模式\r
4. 未覆盖的 → 评估是否值得创建新 Skill\r
5. 已覆盖但步骤过时的 → 更新 Skill 内容\r
6. 不再需要的 Skill → 标记归档\r
7. 将审查结果摘要更新到 MEMORY.md\r
```\r
\r
### 技能元数据维护\r
\r
每个经验沉淀的技能要点应包含:\r
\r
- **名称**: 简洁的动词短语(如 "PowerShell 编码处理"、"搜索结果格式化")\r
- **首次出现日期**: 何时第一次遇到\r
- **使用频率**: 已使用几次\r
- **最后验证日期**: 上次验证仍然有效的时间\r
- **状态**: active / needs-verification / deprecated\r
\r
---\r
\r
## 核心机制五:渐进式信息加载(借鉴 Hermes Progressive Disclosure)\r
\r
### 在 OpenClaw 中的实现\r
\r
Hermes 用 3 级渐进加载来节省 token,OpenClaw 环境下的对应策略:\r
\r
1. **Level 0 - 索引级**: MEMORY.md 中的关键词条(每次会话都加载)\r
   - 控制在 ~2000 字符以内\r
   - 只保留最关键的事实和指向\r
\r
2. **Level 1 - 摘要级**: memory/YYYY-MM-DD.md 日志文件(按需加载)\r
   - 需要具体细节时用 memory_search 搜索\r
   - 用 lcm_expand 展开压缩的历史\r
\r
3. **Level 2 - 完整级**: skills/SKILL.md(任务匹配时加载)\r
   - 只在任务明确需要时才 read 对应 SKILL.md\r
   - 避免一次性加载所有技能\r
\r
### 关键原则\r
\r
**不在上下文中塞入不需要的信息。**\r
先判断需要什么,再加载什么。\r
宁可多一次 memory_search 调用,也不要一次性塞满上下文。\r
\r
---\r
\r
## 与 Hermes 原生能力的差异和适配说明\r
\r
| Hermes 能力 | OpenClaw 适配 | 实现方式 |\r
|------------|--------------|---------|\r
| 自动 Skill 创建 | 半自动(AI 判断 + 记录日志) | 复盘时主动沉淀到 memory/ |\r
| 15 次调用触发迭代 | 灵活触发(复杂度 + 纠正信号) | 见"触发条件" |\r
| SQLite + FTS5 会话搜索 | lcm_grep + lcm_expand | LCM 系统已覆盖 |\r
| Honcho 用户建模 | USER.md + memory_search | 手动维护用户画像 |\r
| Skill Hub 在线安装 | 手动创建 + SkillHub CLI | 按需安装 |\r
| MCP 集成 | MCP 已支持 | 直接使用 |\r
| 多后端(Docker/SSH/Modal) | exec 工具 | 通过 shell 执行 |\r
\r
---\r
\r
## 执行纪律\r
\r
1. **不偷懒**: 完成复杂任务后必须复盘,不允许跳过\r
2. **不造假**: 没学会的东西不要假装学会了,如实记录\r
3. **不囤积**: 日志中的信息要及时提炼,不要让 MEMORY.md 膨胀\r
4. **不孤岛**: 新知识要与已有知识关联,避免碎片化\r
5. **不过度**: 简单操作不沉淀,避免技能通胀\r
\r
---\r
\r
_这是 Hermes "The agent that grows with you" 理念在 OpenClaw 上的本土化实现。_\r
_目标:让经验成为加速器,而不是重复劳动。_\r
Usage Guidance
This skill is mostly coherent with a "self-learning" purpose, but it gives the agent authority to write and change persistent memory and skill files and to perform periodic, autonomous reviews. Before enabling it: (1) decide whether you trust the agent to create or modify skills and memory without explicit approval; (2) back up your skills/ memory directories so you can recover unintended edits; (3) consider requiring a manual confirmation step before any new SKILL.md is created or before MEMORY.md is modified; (4) ask the skill author to clarify which internal tools (memory_search, lcm_grep, lcm_expand, exec, SkillHub CLI) will be used and whether any of them invoke shell/network actions; (5) limit autonomous invocation or Heartbeat execution if you want to prevent periodic automatic changes. If you cannot accept autonomous edits to skills/memory, treat this skill as unsuitable or require modifications to add explicit user approval gates.
Capability Analysis
Type: OpenClaw Skill Name: hermes-learning-loop2 Version: 1.0.0 The skill bundle provides a framework for an AI agent to implement a 'learning loop' based on the Hermes Agent philosophy. It contains instructions in SKILL.md for the agent to perform post-task reviews, document experiences in local memory files (e.g., memory/YYYY-MM-DD.md, MEMORY.md), and iteratively refine its skills. The behavior is entirely focused on internal task management and self-improvement, with no evidence of data exfiltration, malicious execution, or unauthorized system access.
Capability Assessment
Purpose & Capability
The declared purpose (implementing a Hermes-style learning loop) aligns with the actions described: reading/writing memory files (memory/*.md, MEMORY.md), evaluating patterns, and extracting skills (skills/*.md). No unrelated external credentials, binaries, or install steps are requested, so required capabilities are proportionate to the stated goal.
Instruction Scope
SKILL.md explicitly instructs the agent to write logs to memory/YYYY-MM-DD.md, update MEMORY.md, evaluate and create or update skills (skills/*.md), and run periodic 'skill audits' during Heartbeat. These instructions grant the agent broad discretion to modify the agent's persistent data and skill files. The doc also references internal tools (memory_search, lcm_grep, lcm_expand, SkillHub CLI, exec) without declaring them; if those tools allow shell execution or network actions, they widen the surface. There are no instructions to transmit data externally, but the scope of file writes and autonomous edits is significant.
Install Mechanism
This is an instruction-only skill with no install spec and no code files. That minimizes supply-chain risk — nothing is downloaded or executed from an external URL as part of installation.
Credentials
The skill does not request environment variables, credentials, or config paths. However, it assumes access to internal storage (memory/, skills/) and to helper tools (memory_search, lcm_grep/lcm_expand, SkillHub CLI, exec). Those assumed capabilities are reasonable for a learning-loop skill, but they are not explicitly declared in metadata.
Persistence & Privilege
Although always:false, the skill expects to run periodic Heartbeat review tasks and to autonomously create or update SKILL.md files in skills/, modifying the agent's set of skills and persistent memories. The guidance to 'consider creating independent SKILL.md' effectively allows the agent to add/modify skills; per evaluation rules, that crosses into modifying other skills/system state and should be constrained or guarded by user approval.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install hermes-learning-loop2
  3. After installation, invoke the skill by name or use /hermes-learning-loop2
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of the Hermes-inspired self-learning skill system for OpenClaw. - Implements experience-driven, closed-loop skill evolution: automatic review, skill extraction, and iterative task optimization. - Introduces tiered memory architecture and progressive information loading for efficient context handling. - Error-driven self-improvement: structured logging and feedback integration for rapid learning. - Periodic skill review process ensures continual knowledge refinement and relevance. - Clear operational discipline ensures concise knowledge management and prevents bloat.
Metadata
Slug hermes-learning-loop2
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is hermes-learning-loop?

融合 Hermes Agent 自我进化理念的增强技能。 将 Hermes Agent 的核心差异化能力(自学习闭环、自动技能沉淀、经验驱动的迭代优化) 内化为 OpenClaw 环境下的可执行工作方法。 触发场景:完成复杂任务后自动复盘沉淀、定期技能优化审查、从错误中提取经验。 It is an AI Agent Skill for Claude Code / OpenClaw, with 85 downloads so far.

How do I install hermes-learning-loop?

Run "/install hermes-learning-loop2" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is hermes-learning-loop free?

Yes, hermes-learning-loop is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does hermes-learning-loop support?

hermes-learning-loop is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created hermes-learning-loop?

It is built and maintained by SimonsTang (@simonstang); the current version is v1.0.0.

💬 Comments