Files
tw/features/self_evolution_mvp.md

46 lines
1.6 KiB
Markdown
Raw 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.
# 自我进化 MVP可控版
目标:让客服 agent 持续变聪明,同时避免“自动改坏线上”。
## 1. 已落地能力
- 失败样本采集:从 `db/chat_log_db/chats.db` 抽取近 N 小时客服问答对。
- 离线评测:自动识别高风险未转人工、低置信度兜底、慢回复等问题。
- 改进建议生成:输出可执行的模块级 proposalprompt/router/workflow
- 发布门禁:结合运行指标(`config/.runtime_metrics.jsonl`)判断是否允许发布候选版本。
- 候选产物:通过门禁后写入 `config/evolution_candidate.json`,用于 5% 灰度。
## 2. 运行方式
```bash
python scripts/evolution_cycle.py --hours 24 --publish
```
默认即读取线上 MySQL`--source mysql`)。连接信息来自 `.env``MYSQL_*`
常用参数:
- `--max-customers 200`
- `--max-messages-per-customer 80`
- `--runtime-hours 24`
- `--policy-path config/evolution_policy.json`
## 3. 产物说明
运行后会在 `evolution/artifacts/` 生成:
- `samples_*.jsonl`:评测样本
- `eval_report_*.json`:评测摘要与门禁结果
- `proposals_*.json`:改进建议列表
`--publish` 且门禁通过时:
- 写入 `config/evolution_candidate.json`
- 状态标记为 `ready_for_gray_5_percent`
## 4. 下一步建议
-`scripts/evolution_cycle.py` 加入每日定时任务(例如凌晨 2 点)。
- 在灰度层接入 `evolution_candidate.json` 的版本号,按店铺或客户哈希做 5% 放量。
- 将 proposal 落地为具体 patch 后,先跑 `tests/` 回归,再扩大流量。