dsh-self-evolve
其他 活跃维护

dsh-self-evolve

jianghuife/dsh-self-evolve

为智能体赋予自我演进能力,自动记录并保存已验证的操作流程,逐步构建可复用的技能库。无需人工干预,每一次成功尝试都在优化未来的决策路径。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
TypeScript
主要语言
MIT
开源协议
42 KB
仓库大小
3 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:jianghuife/dsh-self-evolve
git clone https://github.com/jianghuife/dsh-self-evolve.git
git clone git@github.com:jianghuife/dsh-self-evolve.git
README.md main

dsh-self-evolve

中文 | English

Hermes-style self-evolution for DeepSeek Harness: the agent saves proven procedures as skills, a background curator keeps the self-authored library healthy, and future sessions follow the proven procedure instead of rediscovering it.

The loop

  1. The agent solves a non-trivial problem (multi-step fix, hard-won root cause, user correction).
  2. Prompt guidance nudges it to call skill_manage(create) with the proven procedure: steps, pitfalls, verification.
  3. The skill lands as <skills root>/<name>/SKILL.md — the exact directory-package shape dsh-skill-filesystem scans — so it enters the next session's skill catalog with no extra wiring and full progressive disclosure (catalog shows name + description; the body loads only on demand).
  4. When a loaded skill turns out wrong, the agent patches it in the same session (patch is exact-text replace — token-cheap, like an Edit tool for skills).
  5. The curator ages out what stops earning its place.

Installation

Node.js 22.19 or later. Install the npm package into a DSH profile (replace web as needed):

dsh plugin --profile web add dsh-self-evolve

Installing through dsh plugin add activates the bundled default configuration automatically. Verify the composed config without starting DSH:

dsh --profile web --dump-config

Install a local checkout instead of the npm release:

dsh plugin --profile web add /path/to/dsh-self-evolve

What's registered

  • skill_manage tool — actions create / patch (preferred) / edit / delete / write_file / remove_file / pin / unpin. Every write stamps metadata.authoredBy: dsh-self-evolve plus createdAt / updatedAt / version; only skills carrying that stamp can ever be modified — bundled and human-authored skills are read-only. delete archives (moves into the state dir), never destroys. SKILL.md is capped at 15 KB by default; resource files at 64 KB.
  • Prompt guidance — one static system-prompt section (order 160) stating when to save, when to patch, and the memory-vs-skill rule ("skills store procedures; facts belong in memory"). Static text ⇒ cache-stable. Loads only where a systemPrompt service is composed.
  • Usage tracking — a tools/result observer records every successful skill tool load of a skill living in this root into <state dir>/usage.json. The ledger is separate from frontmatter so recording a use never rewrites SKILL.md.
  • Curator — one pass per curatorIntervalHours (default 24 h, 30 s after startup): agent-authored skills unused for staleDays (30) get metadata.status: stale; unused for archiveDays (90) are moved to <state dir>/archive/<name>-<timestamp>/. Pinned skills are exempt; nothing is ever hard-deleted; foreign skills are never touched. Status writes restore the file's mtime so curation bookkeeping never counts as activity.

Config

key default meaning
skillsRoot <dsh home>/skills Where agent-authored skills are written (must be a scanned skill root).
stateDir <dsh home>/self-evolve Usage ledger + archive.
staleDays 30 Days without use before a skill is marked stale.
archiveDays 90 Days without use before a skill is archived.
maxSkillBytes 15360 SKILL.md size cap.
maxResourceBytes 65536 Per-resource-file size cap.
curatorIntervalHours 24 Minimum hours between curator passes; 0 disables.
guidance true Contribute the self-improvement prompt section.

Out of scope (by design)

Hermes layers two more mechanisms on top; both are deliberately separate systems:

  • LLM-review curation (a forked agent voting keep / patch / consolidate / archive per skill) — the mechanical phase here leaves the hooks in place (metadata.status, the ledger, the ownership gate).
  • Offline GEPA evolution (trace-driven optimization of skills proposed as PRs) — belongs in a pipeline that reads session logs (ctx.sessionQuery), not in the runtime plugin.

License

MIT