← 返回
AI智能 中文

Correction Memory

Makes agent corrections persistent and reusable. When you override, reject, or correct an agent's output, this skill logs the correction and automatically in...
使智能体的修正持久化且可复用。当您覆盖、拒绝或修正智能体的输出时,该技能会记录修正内容并自动应用...
donovanpankratz-del
AI智能 clawhub v1.1.0 1 版本 99884.4 Key: 无需
★ 0
Stars
📥 864
下载
💾 18
安装
1
版本
#agent-forgets#agent-improvement#agent-learning#agent-memory#agent-teaching#context#correction-injection#correction-replay#corrections#cross-session#feedback#improvement#latest#learning#memory#mistakes#openclaw#persistent#remember#repeated-errors#spawn#subagent#teach

概述

Correction Memory

The Problem

When you correct an agent, that correction evaporates after the session. Next time you spawn the same agent type, it makes the same mistake. There's no memory of what you've already taught it.

What This Skill Installs

  • lib/correction-tracker.js — logs corrections per agent type to memory/corrections/[AgentType].jsonl
  • Hook into agent-context-loader.js — correction preamble prepended to spawns automatically (if intent-engineering is also installed)

Installation

Step 1 — Install correction-tracker

cp references/correction-tracker-template.js $OPENCLAW_WORKSPACE/lib/correction-tracker.js

Verify it runs:

node $OPENCLAW_WORKSPACE/lib/correction-tracker.js

Step 2 — Wire agent-context-loader (if using intent-engineering)

If lib/agent-context-loader.js is installed (from intent-engineering skill), correction injection is automatic — no wiring needed. The loader checks for correction-tracker.js at startup and loads it if present.

If you are NOT using intent-engineering, add this to your spawn logic manually:

const { buildCorrectionPreamble } = require('./lib/correction-tracker');

const agentType   = 'CoderAgent'; // or whatever agent you're spawning
const corrections = buildCorrectionPreamble(agentType, workspaceRoot);
const fullTask    = corrections ? corrections + '\n\n---\n\n' + originalTask : originalTask;

Logging Corrections

Programmatic

const { logCorrection } = require('./lib/correction-tracker');

logCorrection(
  'CoderAgent',                                    // agent type
  'Used ESM import instead of require()',          // what was wrong
  'Always use require() for Node.js stdlib modules', // correct behavior
  workspaceRoot,
  { session_channel: 'discord' }                  // optional metadata
);

Via main agent (natural language)

Just tell the main agent:

> "Note that [AgentType]: [what it did wrong] — [correct behavior]"

The main agent will log it programmatically.

How Corrections Are Replayed

On every subagent spawn, agent-context-loader detects the agent type from the task description and prepends:

## Corrections from Previous Sessions

The following corrections were logged for CoderAgent. Apply these behaviors:

1. **[2026-03-01] Issue:** Used ESM import instead of require()
   **Correction:** Always use require() for Node.js stdlib modules

Only corrections from the last 30 days are injected. Older corrections expire automatically — stale rules don't accumulate.

Viewing Corrections

# All corrections for an agent type
cat $OPENCLAW_WORKSPACE/memory/corrections/CoderAgent.jsonl | jq .

# List all agent types with corrections
ls $OPENCLAW_WORKSPACE/memory/corrections/

# Count corrections per agent
for f in $OPENCLAW_WORKSPACE/memory/corrections/*.jsonl; do
  echo "$(basename $f .jsonl): $(wc -l < $f) corrections"
done

Agent Type Detection

The loader auto-detects agent type from the task description. Default rules:

Task keywordsAgent type
------
code, coder, impl, debugCoderAgent
writ, author, novel, chapterAuthorAgent
world, buildWorldbuilderAgent
(anything else)general

To add custom agent types, edit detectAgentType() in agent-context-loader.js.

References

  • references/correction-tracker-template.js — Full implementation of correction-tracker.js

版本历史

共 1 个版本

  • v1.1.0 当前
    2026-03-29 19:34 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 714 📥 244,034
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,362 📥 318,822
ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 837 📥 213,335