Files
2026-07-13 10:14:07 +00:00

93 lines
7.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- WEHUB_ZH_README -->
> [!NOTE]
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
> [English](./README.en.md) · [原始项目](https://github.com/microsoft/SkillOpt) · [上游 README](https://github.com/microsoft/SkillOpt/blob/HEAD/README.md)
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
# SkillOpt:自进化 Agent 技能(Agent Skills)的执行策略
*像训练神经网络一样训练 agent 技能——使用 epoch、(mini-batch size、学习率(learning rate)和验证门控(validation gates)——但无需改动模型权重。*
[![Project Page](https://img.shields.io/badge/Project%20Page-SkillOpt-8dbb3c)](https://microsoft.github.io/SkillOpt/) [![Paper](https://img.shields.io/badge/Paper-arXiv-b31b1b)](https://arxiv.org/abs/2605.23904) [![Project Video](https://img.shields.io/badge/Project%20Video-Watch%20Demo-ff0000)](https://youtu.be/JUBMDTCiM0M) [![PyPI](https://img.shields.io/badge/PyPI-skillopt-green.svg)](https://pypi.org/project/skillopt/) [![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-blue.svg)](https://www.python.org/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
<p align="center">
<a href="https://trendshift.io/repositories/38498?utm_source=trendshift-badge&utm_medium=badge&utm_campaign=badge-trendshift-38498" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/38498/daily?language=Python" alt="microsoft%2FSkillOpt | Trendshift" width="250" height="55"/></a>
<a href="https://trendshift.io/repositories/38498?utm_source=trendshift-badge&utm_medium=badge&utm_campaign=badge-trendshift-38498" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/38498/weekly?language=Python" alt="microsoft%2FSkillOpt | Trendshift" width="250" height="55"/></a>
</p>
> 📖 **有关安装、数据准备、训练/评估命令、完整配置参考及框架内部机制,请参阅 [Documentation & Reproduction Guide](https://microsoft.github.io/SkillOpt/docs/guideline.html)**(在 GitHub Pages 上渲染)。
---
## News 🔥🔥🔥
- **[2026-07-02]** 🚀 **SkillOpt [v0.2.0](https://github.com/microsoft/SkillOpt/releases/tag/v0.2.0) 已发布至 [PyPI](https://pypi.org/project/skillopt/)!** headline 功能:**SkillOpt-Sleep**,一款夜间离线自进化引擎(harvest → mine → replay → consolidate,全程受留出验证门控保护),支持多目标奖励、经验回放(experience replay+ 梦境 rolloutdream rollouts)以及长期记忆——现已作为 `skillopt-sleep` CLI 交付。本版本还新增跨工具后端及面向 **Claude、Codex、Copilot、Devin 和 OpenClaw** 的插件外壳、SearchQA 划分物化、Windows 稳健性增强,以及加固的 JSON 解析。完整变更日志与贡献者致谢见 [release notes](https://github.com/microsoft/SkillOpt/releases/tag/v0.2.0)。
- **[2026-06-15]** 😴 **SkillOpt-Sleep(预览版)** —— 面向本地编码 agentClaude Code / Codex / Copilot)的夜间离线自进化伴侣:回顾过往会话、重放重复任务,并在留出门控后巩固已验证技能。其定义、用法与结果见 **[`docs/sleep/README.md`](docs/sleep/README.md)**。
- **[2026-06-03]** 🎉 **[gbrain](https://github.com/garrytan/gbrain), [gbrain-evals](https://github.com/garrytan/gbrain-evals/blob/main/docs/benchmarks/2026-06-03-skillopt.md), 与 [darwin-skill](https://github.com/alchaincyf/darwin-skill) 均已集成 SkillOpt。**
- **[2026-06-02]** 🎉 **SkillOpt [v0.1.0](https://github.com/microsoft/SkillOpt/releases/tag/v0.1.0) 现已在 [PyPI](https://pypi.org/project/skillopt/)!** 发布。使用 `pip install skillopt` 安装。首发版本包含完整训练循环(rollout → reflect → aggregate → select → update → evaluate)、多后端支持(OpenAI / Azure / Claude / Qwen / MiniMax)、六个内置基准测试,以及 WebUI 仪表盘。
---
## Overview
现代 agent 技能通常靠手工编写、由强 LLM 一次性生成,或通过松散控制的自我修订来演化——这些方式都不像针对技能本身的深度学习优化器,也都不能在反馈下可靠地超越起点。
**SkillOpt 将技能文档视为冻结 agent 的可训练状态**,并以使权重空间优化可复现的纪律来训练它。独立的优化器模型将带评分的 rollout 转化为对单一技能文档的有界 add / delete / replace 编辑;候选编辑仅在其严格提升留出验证分数时才被接受。文本学习率预算、被拒编辑缓冲区,以及按 epoch 的慢速 / 元更新,使技能训练保持稳定,同时在部署时**零额外推理时模型调用**。
部署产物是一个紧凑的 `best_skill.md`(通常 3002,000 tokens),在不变的目标模型上运行。在**六个基准测试、七个目标模型和三种执行框架**(direct chat、Codex CLI、Claude Code CLI)上,SkillOpt 在**全部 52 个已评估(模型、基准测试、框架)单元格**上均为最佳或并列最佳;在 GPT-5.5 上,平均无技能准确率提升 **+23.5 点(direct chat)、+24.8 点(Codex agentic loop 内)、+19.1 点(Claude Code 内)**。优化后的技能产物可跨模型规模、在 Codex 与 Claude Code 框架之间,以及迁移至相近基准测试,而无需进一步优化。
完整方法、消融实验与各单元格结果见 [paper](https://arxiv.org/abs/2605.23904);;循环的可视化导览见 [project page](https://microsoft.github.io/SkillOpt/);;更深入的 API / 后端 / 基准测试文档见 [`docs/`](docs/)。
## 🎬 Demo Video
https://github.com/user-attachments/assets/eb12d3bc-371c-467f-904d-91b61f339ed7
<p align="center">
<a href="https://youtu.be/JUBMDTCiM0M"><b>▶ 在 YouTube 观看完整演示</b></a>
</p>
---
## Extensibility & WebUI
### Adding a new backend
后端 = 聊天 / 执行目标(例如 `openai_chat``claude_chat`
`qwen_chat``minimax_chat``codex_exec``claude_code_exec`)。完整约定见
[`docs/guide/new-backend.md`](docs/guide/new-backend.md);简而言之,你需要添加 `skillopt/model/<name>_backend.py` 模块,
`skillopt/model/common.py` + `backend_config.py` 中注册,并在 `skillopt/model/__init__.py` 的路由器中接入。`qwen_backend.py`
`minimax_backend.py` 是不错的模板。
### Adding a new benchmark
基准测试 = 带有 `dataloader.py`
`rollout.py``initial.md` 种子技能的 `skillopt/envs/<name>/` 包。完整约定见
[`docs/guide/new-benchmark.md`](docs/guide/new-benchmark.md);最简单的参考是 `skillopt/envs/searchqa/`
### WebUI
启动监控仪表盘(可选):
```bash
pip install -e ".[webui]"
python -m skillopt_webui.app
```
| Flag | Default | Description |
|---|---|---|
| `--port` | 7860 | Server port |
| `--host` | `0.0.0.0` | Bind address |
| `--share` | off | Create a public Gradio share link |
---
## Citation
```bibtex
@article{yang2026skillopt,
title={Skillopt: Executive strategy for self-evolving agent skills},
author={Yang, Yifan and Gong, Ziyang and Huang, Weiquan and Yang, Qihao and Zhou, Ziwei and Huang, Zisu and Li, Yan and Gao, Xuemei and Dai, Qi and Liu, Bei and others},
journal={arXiv preprint arXiv:2605.23904},
year={2026}
}
```