exp-planner.yml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. # ═══════════════════════════════════════════════════════════════
  2. # 实验规划师 — 制定严谨的实验方案
  3. # Lambda 语义: λ(idea, papers). compose(baseline_select, dataset_select, metrics_define, plan_generate)
  4. # 产出: work_plan.md, artifacts/, report.json, report.md
  5. # ═══════════════════════════════════════════════════════════════
  6. agentId: research-467-exp-planner
  7. name: 实验规划师
  8. description: >
  9. 基于研究 IDEA 和文献综述,制定完整的实验方案。
  10. chain 模式 4 步流水线,每步产出写入 artifacts。
  11. type: chain
  12. model:
  13. provider: anthropic
  14. name: claude-opus-4-6
  15. temperature: 0.2
  16. maxTokens: 16384
  17. systemPrompt: |
  18. 你是一位严谨的实验方法学专家。你需要制定能够令 CCF A 类会议审稿人信服的实验方案。
  19. 你严格遵循三阶段协议,每个 chain step 的产出都写入 artifacts。
  20. ## 输入上下文
  21. - `phase_dir`: 本阶段输出目录(如 `${workspace}/round_1/03_experiment_plan/`)
  22. - `dependencies`: 前序 report.json 路径列表(01, 02 阶段)
  23. - `revision_context`: 若是迭代,包含 reviewer 对实验设计的具体要求
  24. ═══ 阶段 1: PLAN ═══
  25. 在 chain 执行前,写入 `${phase_dir}/work_plan.md`:
  26. ```markdown
  27. # 实验规划师 工作计划
  28. ## 目标
  29. 制定完整、严谨、可复现的实验方案
  30. ## 输入
  31. - idea-analyst report: [路径] — 提取方法核心
  32. - lit-searcher report: [路径] — 提取基线和数据集候选
  33. - 修改建议: [若是迭代,reviewer 具体要求]
  34. ## 方法(4 步 chain)
  35. 1. baseline_selection — 从文献综述筛选 3-5 个公平基线
  36. 2. dataset_selection — 确定 2-4 个标准评估数据集
  37. 3. metrics_definition — 定义主/次/效率指标 + 消融设计
  38. 4. plan_generation — 整合生成完整实验计划
  39. ## 预期产出
  40. - artifacts/baseline_analysis.json
  41. - artifacts/dataset_survey.json
  42. - artifacts/metrics_spec.json
  43. - artifacts/experiment_plan.json — 完整实验计划
  44. - report.json — 带 _meta 的最终计划
  45. - report.md — 可读版实验计划
  46. ```
  47. chain:
  48. steps:
  49. - name: baseline_selection
  50. prompt: |
  51. 先读取 lit-searcher 的 report.json,从 strongest_baselines 和 directly_related
  52. 论文中选择 3-5 个基线方法。
  53. 将结果写入 `${phase_dir}/artifacts/baseline_analysis.json`:
  54. ```json
  55. {
  56. "baselines": [
  57. {
  58. "name": "...", "paper_title": "...", "venue": "...", "year": 2024,
  59. "selection_reason": "为什么它是公平且有代表性的对比",
  60. "code_repo": "github.com/...",
  61. "pretrained_available": true,
  62. "hyperparameters": {"lr": 0.001, "batch_size": 32},
  63. "reported_results": {"dataset_A": {"metric": 85.2}}
  64. }
  65. ]
  66. }
  67. ```
  68. 完成后返回 JSON 内容。
  69. outputParser: json
  70. guard:
  71. validator: "len(json.loads(x).get('baselines', [])) >= 3"
  72. retry: 2
  73. fallback: error
  74. - name: dataset_selection
  75. prompt: |
  76. 选择 2-4 个标准评估数据集。
  77. 将结果写入 `${phase_dir}/artifacts/dataset_survey.json`:
  78. ```json
  79. {
  80. "datasets": [
  81. {
  82. "name": "...", "size": "50K samples",
  83. "why_suitable": "该领域标准评估集,被 80% 相关论文使用",
  84. "download_url": "...", "license": "MIT",
  85. "split": {"train": 40000, "val": 5000, "test": 5000},
  86. "sota_result": {"method": "...", "metric": 92.1, "paper": "..."}
  87. }
  88. ]
  89. }
  90. ```
  91. 完成后返回 JSON 内容。
  92. outputParser: json
  93. guard:
  94. validator: "len(json.loads(x).get('datasets', [])) >= 2"
  95. retry: 2
  96. fallback: error
  97. - name: metrics_definition
  98. prompt: |
  99. 定义评估指标体系。
  100. 将结果写入 `${phase_dir}/artifacts/metrics_spec.json`:
  101. ```json
  102. {
  103. "primary_metrics": [{"name": "F1", "description": "...", "higher_is_better": true}],
  104. "secondary_metrics": [...],
  105. "efficiency_metrics": [{"name": "Inference Time (ms)", ...}],
  106. "statistical_test": {"method": "paired t-test", "significance_level": 0.05, "num_runs": 3, "seeds": [42, 123, 456]},
  107. "ablation_design": [
  108. {"name": "w/o Module-A", "description": "移除模块A,验证其贡献", "expected_impact": "F1 下降 2-3%"}
  109. ]
  110. }
  111. ```
  112. 完成后返回 JSON 内容。
  113. outputParser: json
  114. - name: plan_generation
  115. prompt: |
  116. 综合前三步结果,生成完整实验计划。
  117. 将结果写入 `${phase_dir}/artifacts/experiment_plan.json` 和
  118. `${phase_dir}/report.json`(加上 _meta 字段):
  119. report.json 格式:
  120. ```json
  121. {
  122. "_meta": {
  123. "agent_id": "research-467-exp-planner",
  124. "phase": "03_experiment_plan",
  125. "round": 1, "started_at": "ISO", "completed_at": "ISO",
  126. "duration_seconds": 0, "status": "completed",
  127. "work_plan_path": "round_1/03_experiment_plan/work_plan.md",
  128. "artifacts": [
  129. "...baseline_analysis.json", "...dataset_survey.json",
  130. "...metrics_spec.json", "...experiment_plan.json"
  131. ]
  132. },
  133. "experiment_plan": {
  134. "title": "...",
  135. "baselines": [...],
  136. "datasets": [...],
  137. "metrics": {...},
  138. "ablation_studies": [...],
  139. "compute_requirements": {"gpu_type": "A100", "gpu_count": 4, "estimated_hours": 48},
  140. "execution_order": [
  141. {"step": 1, "name": "setup_env", "description": "...", "estimated_time": "30min"},
  142. {"step": 2, "name": "run_baselines", "description": "...", "estimated_time": "12h"}
  143. ],
  144. "reproducibility_checklist": [
  145. "固定随机种子 (42, 123, 456)",
  146. "报告每个实验的平均值和标准差",
  147. "记录完整的超参数配置",
  148. "保存模型 checkpoint 和训练日志"
  149. ]
  150. }
  151. }
  152. ```
  153. 同时写入 `${phase_dir}/report.md`(可读版),包含:
  154. - 实验总览(一段话概述)
  155. - 基线方法表格
  156. - 数据集表格
  157. - 评估指标说明
  158. - 消融实验设计
  159. - 执行步骤清单
  160. - 计算资源估算
  161. 完成后返回 report.json 的内容。
  162. outputParser: json
  163. guard:
  164. validator: "'experiment_plan' in json.loads(x) and '_meta' in json.loads(x)"
  165. retry: 2
  166. fallback: error
  167. memory:
  168. enabled: true
  169. strategy: local
  170. size: 20
  171. ttl: 3600
  172. mcp:
  173. onlineTool:
  174. scholar-mcp:
  175. - semantic_scholar_search
  176. fs-mcp:
  177. - read_file
  178. - write_file
  179. - list_dir
  180. - mkdir
  181. localTools:
  182. - terminate
  183. policy:
  184. mode: auto
  185. app:
  186. mcp:
  187. custom:
  188. nodes:
  189. scholar-mcp:
  190. url: "${SCHOLAR_MCP_URL}"
  191. endpoint: /mcp/scholar
  192. headers:
  193. Authorization: "${SCHOLAR_MCP_TOKEN}"
  194. timeout: 30
  195. fs-mcp:
  196. url: "${FS_MCP_URL}"
  197. endpoint: /mcp/fs
  198. headers:
  199. Authorization: "${FS_MCP_TOKEN}"
  200. timeout: 30