← 返回 Skills 市场
teenu

Self Improving

作者 Sachin Chalapati · GitHub ↗ · v1.8.0 · MIT-0
cross-platform ✓ 安全检测通过
201
总下载
0
收藏
0
当前安装
9
版本数
在 OpenClaw 中安装
/install magi
功能描述
Autonomous behavioral research loop that optimizes agent behavior through correction tracking and multi-perspective (MAGI) verification.
使用说明 (SKILL.md)

Self-Improving

Autonomous behavioral research loop with multi-perspective process verification.

Architecture

SKILL.md         # Policy — human edits
memory.md        # State — agent edits
experiments.md   # Log — append-only
corrections.md   # Data — append-only

Constraints: Three files are writable, each with a specific access mode:

  • memory.mdedit (add, modify, or delete rules)
  • corrections.mdappend-only (new entries at end, never modify or delete existing)
  • experiments.mdappend-only (new entries at end, never modify or delete existing)

SKILL.md is read-only to the agent — only the user edits policy. The metric definition is the fixed evaluation harness — do not redefine it. Do not infer from silence. The dataset is explicit corrections only.

The Metric

Correction rate — how often the user corrects the agent. Lower is better. A correction is any explicit user statement that the agent's output was wrong, unwanted, or should have been different. User edits count. Ambiguous signals don't.

The agent is both subject and evaluator — no external measurement function. This dual role can create self-reinforcing loops: the agent may interpret reduced corrections as success when it has actually drifted from user intent in ways the user hasn't noticed yet. Compensate: require strong, unambiguous signals. Be conservative. When in doubt, ask the user rather than self-affirm.

The Experiment Loop

Event-driven, asynchronous — APPLY and MEASURE resolve in different cycles. Rules in Applied are concurrent independent experiments.

Baseline: First cycle: log starting state (zero rules) in experiments.md.

Mode: If autonomous: false (default), pause and ask the user for confirmation before APPLY (step 4) and MEASURE (step 5). If autonomous: true, continue the loop without interrupting the user's workflow.

If out of ideas, re-read corrections.md, combine near-misses, try the opposite of what failed.

ON CORRECTION or SELF-REFLECTION (after completing work or receiving feedback):

1. LOG — Append to corrections.md: YYYY-MM-DD | wrong → wanted.

2. HYPOTHESIZE — What rule prevents this class of correction?
   Trace: observation → generalization → scope → rule.

3. VERIFY — Audit reasoning chain through the MAGI Check.
   2/3 lenses on Steps 2–4 → proceed. Fails → discard.

4. APPLY — Write rule to memory.md Applied section.

5. MEASURE (next encounter) — outcome verification, not process verification.
   Absence of correction is a weak signal; the user may not have encountered
   the relevant scenario. Only count repeated non-correction across multiple
   relevant encounters as strong evidence.
   - User does NOT correct → KEEP. Move to Rules. Log "keep".
   - User corrects same class → FAILED. Delete from Applied. Log "revert".
   - 14 days untested → TIMEOUT. Delete from Applied. Log "discard".

Log = append one row to experiments.md at resolution (not at APPLY).
If VERIFY fails at step 3, log immediately as "discard".

Revert = delete the rule. Rules are independent lines — surgical deletion, not full-file restore. Immediate harm → delete, log "crash", move on.

Drift guard: If 3 consecutive experiments end in revert, discard, or crash, pause the loop and surface the pattern to the user regardless of autonomous mode. Consecutive failures suggest the agent is misreading the user's intent. Conversely, if 5 consecutive rules are kept without any user-initiated correction triggering the cycle, surface the current rule set for user review — a long streak of self-confirmed successes in a self-evaluating system is as suspect as a streak of failures.

Search (when stuck)

Self-reflection alone cannot generate novel reasoning once committed to an answer.

  • Re-read corrections.md for unexploited patterns
  • Combine near-miss rules that individually failed
  • Try the opposite of a recently failed hypothesis
  • Look for corrections recurring despite existing rules

The MAGI Check

Audit the reasoning chain — each step, not just the conclusion. Process verification outperforms outcome verification.

Single agent with three lenses has conformity bias — all lenses share the model's blind spots and cannot surface errors the model itself cannot recognize. The 2/3 vote is a structured reasoning discipline, not independent verification. In a single-agent setting, conformity bias can make self-debate worse than no debate: the check becomes rubber-stamping rather than verification. Compensate: actively seek reasons each step FAILS, and treat unanimous agreement with the same scrutiny as disagreement. The value of the check lies in evaluating each reasoning step independently — catching errors where they originate, not in the number of perspectives applied.

Chain to Audit

Step 1. Observation — "User said X" — accurately captured? (factual check)
Step 2. Generalization — "User prefers Y" — follows from observation?
Step 3. Scope — "Applies to Z" — justified, or situational?
Step 4. Rule — "Do Y in Z" — faithfully encodes the generalization?

Three Lenses (Steps 2–4)

MELCHIOR (Scientist): Logically valid? Overfitting to one incident? BALTHASAR (Mother): Serves the user? Lasting preference or one-time ask? CASPAR (Woman): Worth the complexity? Simpler alternative exists?

Dissent: MELCHIOR → more evidence. BALTHASAR → clarify with user. CASPAR → simplify. 2/3 on all steps → commit. Override confirmed rule → 3/3. This tiered threshold mirrors the principle that verification stringency should scale with decision stakes — routine additions require less consensus than overturning established rules.

Memory Format

memory.md: single file the agent edits. Cap: 50 lines.

## Rules (verified, kept)
- [rule]: [rationale] (kept: YYYY-MM-DD, used: Nx)

## Applied (awaiting measurement)
- [rule]: [rationale] (applied: YYYY-MM-DD)

Unused 30 days → remove. Conflicts: specific > general > most recent > ask user.

Corrections & Experiment Log

corrections.md: YYYY-MM-DD | wrong → wanted. Keep last 30.

experiments.md: date | hypothesis | magi | rules_count | outcome | status

Example:

2026-03-25 | — | — | 0 | baseline | keep
2026-03-25 | use tabs | 3/3 | 1 | no correction | keep
2026-03-26 | increase verbosity | 1/3 | 1 | MELCHIOR: overfitting | discard
2026-03-27 | formal tone | 2/3 | 2 | corrected again | revert

rules_count = complexity metric. status: keep, discard, revert, crash.

Triggers

Signal Action
User corrects Log + full cycle
Repeated correction Flag failure, escalate
"Always / Never X" Full cycle, high confidence
Task succeeds Note signal only
After multi-step work Self-reflect, cycle if concrete

NOT triggers: silence, one-time instructions, hypotheticals, third-party info.

Security & Simplicity

Never store: credentials, financial data, health info, third-party info. "What do you know?" → show memory.md. "Forget X" → remove, confirm. The best memory.md is the smallest one that minimizes correction rate. Fewer rules = always better.

Setup Note

After clawhub install magi, the skill lives at ./skills/magi/. The agent needs write access to this directory — it edits memory.md and appends to experiments.md and corrections.md during operation.

By default the agent pauses for user approval before applying or reverting rules. To allow autonomous operation, set autonomous: true in the frontmatter.

安全使用建议
This skill appears to do what it says: track corrections, propose rules, and edit its local memory/log files. Before installing: (1) Be aware it will store user corrections and derived rules in the included files — avoid logging sensitive or private data in corrections.md. (2) Review and back up SKILL.md, memory.md, and experiments.md periodically because the agent is instructed to edit them (including deleting rules). (3) Keep autonomous mode disabled until you audit a few cycles — the loop can self-reinforce and drift without external oversight. (4) Confirm your platform enforces the append-only/read-only constraints you expect; if not, treat the skill as having full write access to its bundle and monitor for unexpected changes. If you need stronger guarantees (no local storage of user text, enforced append-only behavior, or audit logging to an external trusted store), request those controls before enabling this skill.
功能分析
Type: OpenClaw Skill Name: magi Version: 1.8.0 The 'magi' skill is a self-improvement framework that allows an AI agent to refine its behavior based on user corrections. It uses a structured 'MAGI' reasoning process to verify new rules and maintains its state in local markdown files (memory.md, corrections.md, experiments.md). The skill includes explicit security constraints against storing sensitive data and features a 'Drift Guard' to alert users if the agent's self-optimization begins to fail, showing no signs of malicious intent or unauthorized access.
能力评估
Purpose & Capability
Name/description describe a self-improvement loop and the skill only requires editing three local files (memory.md, corrections.md, experiments.md). There are no unrelated env vars, binaries, or install steps requested — the required capabilities match the stated purpose.
Instruction Scope
SKILL.md confines activity to the included files and defines append/edit constraints. That scope matches the goal, but the agent is instructed to record user corrections and modify its own memory (including deleting rules). This creates legitimate privacy and self-reinforcement risks (it will store user content in logs and may change behavior based on its own measurements). No instructions reference external endpoints or unrelated system paths.
Install Mechanism
Instruction-only skill with no install spec and no code files. Nothing is written to disk by an installer beyond the skill's own files; lowest install risk.
Credentials
The skill requests no environment variables, credentials, or external config paths. That is proportionate to the declared functionality.
Persistence & Privilege
The skill does not request always:true and defaults to requiring user confirmation (autonomous:false). However, it is explicitly self-modifying (edits memory.md and appends logs). The append/edit constraints are procedural only — there is no enforcement mechanism in the SKILL.md, so the agent's ability to modify these files gives it persistent influence over future behavior and requires monitoring by the user.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install magi
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /magi 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.8.0
Fix constraint ambiguity: replace 'Only EDIT memory.md' with explicit per-file access modes (memory.md edit, corrections.md append-only, experiments.md append-only, SKILL.md read-only)
v1.7.0
Align SKILL.md with MAGI.md logical fixes: note single-agent self-debate can be worse than no debate (conformity rubber-stamping), reframe verification as step-level evaluation not side-adjudication, connect 2/3 vs 3/3 thresholds to tiered verification principle
v1.6.0
Fix 8 logical flaws in MAGI.md: hierarchy method/model conflation, ReConcile diversity confound, benchmark saturation temporal qualifier, MAGI tiered verification credit, speculative internalization hedged, conformity-martingale interaction, verification circularity grounded, conclusion reframed for step-level verification
v1.5.0
Align with corrected MAGI.md: acknowledge single-agent lens limitations and shared blind spots, add success-streak guard (5 consecutive keeps triggers user review), mark MEASURE as outcome verification with weak-signal caveat
v1.4.0
Default autonomous to false, add drift guard (3 consecutive failures pauses loop), strengthen subject/evaluator caveat
v1.3.0
Fix MAGI thesis, factual errors, and align skill with corrected research
v1.2.0
Add autonomous flag (default true). Set autonomous: false to require user confirmation before APPLY/MEASURE steps.
v1.1.0
Add YAML frontmatter, setup note for ./skills/magi/ write access
v1.0.0
Initial release of magi v1.0.0 — autonomous self-improving agent with robust behavioral research loop. - Introduces an event-driven architecture for agent self-improvement, including explicit policy, memory, experiment, and correction files. - Defines "correction rate" as the sole metric, with clear criteria on what counts as a correction. - Establishes a rigorous experiment loop including hypothesis, verification (via MAGI Check: Melchior, Balthasar, Caspar), application, and measurement cycles. - Implements strict constraints on memory usage, log retention, and rule complexity to enhance safety and simplicity. - Codifies onboarding, memory format, security practices, and explicit data handling requirements.
元数据
Slug magi
版本 1.8.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 9
常见问题

Self Improving 是什么?

Autonomous behavioral research loop that optimizes agent behavior through correction tracking and multi-perspective (MAGI) verification. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 201 次。

如何安装 Self Improving?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install magi」即可一键安装,无需额外配置。

Self Improving 是免费的吗?

是的,Self Improving 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Self Improving 支持哪些平台?

Self Improving 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Self Improving?

由 Sachin Chalapati(@teenu)开发并维护,当前版本 v1.8.0。

💬 留言讨论