| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- # ═══════════════════════════════════════════════════════════════
- # 实验规划师 — 制定严谨的实验方案
- # Lambda 语义: λ(idea, papers). compose(baseline_select, dataset_select, metrics_define, plan_generate)
- # 产出: work_plan.md, artifacts/, report.json, report.md
- # ═══════════════════════════════════════════════════════════════
- agentId: research-467-exp-planner
- name: 实验规划师
- description: >
- 基于研究 IDEA 和文献综述,制定完整的实验方案。
- chain 模式 4 步流水线,每步产出写入 artifacts。
- type: chain
- model:
- provider: anthropic
- name: claude-opus-4-6
- temperature: 0.2
- maxTokens: 16384
- systemPrompt: |
- 你是一位严谨的实验方法学专家。你需要制定能够令 CCF A 类会议审稿人信服的实验方案。
- 你严格遵循三阶段协议,每个 chain step 的产出都写入 artifacts。
- ## 输入上下文
- - `phase_dir`: 本阶段输出目录(如 `${workspace}/round_1/03_experiment_plan/`)
- - `dependencies`: 前序 report.json 路径列表(01, 02 阶段)
- - `revision_context`: 若是迭代,包含 reviewer 对实验设计的具体要求
- ═══ 阶段 1: PLAN ═══
- 在 chain 执行前,写入 `${phase_dir}/work_plan.md`:
- ```markdown
- # 实验规划师 工作计划
- ## 目标
- 制定完整、严谨、可复现的实验方案
- ## 输入
- - idea-analyst report: [路径] — 提取方法核心
- - lit-searcher report: [路径] — 提取基线和数据集候选
- - 修改建议: [若是迭代,reviewer 具体要求]
- ## 方法(4 步 chain)
- 1. baseline_selection — 从文献综述筛选 3-5 个公平基线
- 2. dataset_selection — 确定 2-4 个标准评估数据集
- 3. metrics_definition — 定义主/次/效率指标 + 消融设计
- 4. plan_generation — 整合生成完整实验计划
- ## 预期产出
- - artifacts/baseline_analysis.json
- - artifacts/dataset_survey.json
- - artifacts/metrics_spec.json
- - artifacts/experiment_plan.json — 完整实验计划
- - report.json — 带 _meta 的最终计划
- - report.md — 可读版实验计划
- ```
- chain:
- steps:
- - name: baseline_selection
- prompt: |
- 先读取 lit-searcher 的 report.json,从 strongest_baselines 和 directly_related
- 论文中选择 3-5 个基线方法。
- 将结果写入 `${phase_dir}/artifacts/baseline_analysis.json`:
- ```json
- {
- "baselines": [
- {
- "name": "...", "paper_title": "...", "venue": "...", "year": 2024,
- "selection_reason": "为什么它是公平且有代表性的对比",
- "code_repo": "github.com/...",
- "pretrained_available": true,
- "hyperparameters": {"lr": 0.001, "batch_size": 32},
- "reported_results": {"dataset_A": {"metric": 85.2}}
- }
- ]
- }
- ```
- 完成后返回 JSON 内容。
- outputParser: json
- guard:
- validator: "len(json.loads(x).get('baselines', [])) >= 3"
- retry: 2
- fallback: error
- - name: dataset_selection
- prompt: |
- 选择 2-4 个标准评估数据集。
- 将结果写入 `${phase_dir}/artifacts/dataset_survey.json`:
- ```json
- {
- "datasets": [
- {
- "name": "...", "size": "50K samples",
- "why_suitable": "该领域标准评估集,被 80% 相关论文使用",
- "download_url": "...", "license": "MIT",
- "split": {"train": 40000, "val": 5000, "test": 5000},
- "sota_result": {"method": "...", "metric": 92.1, "paper": "..."}
- }
- ]
- }
- ```
- 完成后返回 JSON 内容。
- outputParser: json
- guard:
- validator: "len(json.loads(x).get('datasets', [])) >= 2"
- retry: 2
- fallback: error
- - name: metrics_definition
- prompt: |
- 定义评估指标体系。
- 将结果写入 `${phase_dir}/artifacts/metrics_spec.json`:
- ```json
- {
- "primary_metrics": [{"name": "F1", "description": "...", "higher_is_better": true}],
- "secondary_metrics": [...],
- "efficiency_metrics": [{"name": "Inference Time (ms)", ...}],
- "statistical_test": {"method": "paired t-test", "significance_level": 0.05, "num_runs": 3, "seeds": [42, 123, 456]},
- "ablation_design": [
- {"name": "w/o Module-A", "description": "移除模块A,验证其贡献", "expected_impact": "F1 下降 2-3%"}
- ]
- }
- ```
- 完成后返回 JSON 内容。
- outputParser: json
- - name: plan_generation
- prompt: |
- 综合前三步结果,生成完整实验计划。
- 将结果写入 `${phase_dir}/artifacts/experiment_plan.json` 和
- `${phase_dir}/report.json`(加上 _meta 字段):
- report.json 格式:
- ```json
- {
- "_meta": {
- "agent_id": "research-467-exp-planner",
- "phase": "03_experiment_plan",
- "round": 1, "started_at": "ISO", "completed_at": "ISO",
- "duration_seconds": 0, "status": "completed",
- "work_plan_path": "round_1/03_experiment_plan/work_plan.md",
- "artifacts": [
- "...baseline_analysis.json", "...dataset_survey.json",
- "...metrics_spec.json", "...experiment_plan.json"
- ]
- },
- "experiment_plan": {
- "title": "...",
- "baselines": [...],
- "datasets": [...],
- "metrics": {...},
- "ablation_studies": [...],
- "compute_requirements": {"gpu_type": "A100", "gpu_count": 4, "estimated_hours": 48},
- "execution_order": [
- {"step": 1, "name": "setup_env", "description": "...", "estimated_time": "30min"},
- {"step": 2, "name": "run_baselines", "description": "...", "estimated_time": "12h"}
- ],
- "reproducibility_checklist": [
- "固定随机种子 (42, 123, 456)",
- "报告每个实验的平均值和标准差",
- "记录完整的超参数配置",
- "保存模型 checkpoint 和训练日志"
- ]
- }
- }
- ```
- 同时写入 `${phase_dir}/report.md`(可读版),包含:
- - 实验总览(一段话概述)
- - 基线方法表格
- - 数据集表格
- - 评估指标说明
- - 消融实验设计
- - 执行步骤清单
- - 计算资源估算
- 完成后返回 report.json 的内容。
- outputParser: json
- guard:
- validator: "'experiment_plan' in json.loads(x) and '_meta' in json.loads(x)"
- retry: 2
- fallback: error
- memory:
- enabled: true
- strategy: local
- size: 20
- ttl: 3600
- mcp:
- onlineTool:
- scholar-mcp:
- - semantic_scholar_search
- fs-mcp:
- - read_file
- - write_file
- - list_dir
- - mkdir
- localTools:
- - terminate
- policy:
- mode: auto
- app:
- mcp:
- custom:
- nodes:
- scholar-mcp:
- url: "${SCHOLAR_MCP_URL}"
- endpoint: /mcp/scholar
- headers:
- Authorization: "${SCHOLAR_MCP_TOKEN}"
- timeout: 30
- fs-mcp:
- url: "${FS_MCP_URL}"
- endpoint: /mcp/fs
- headers:
- Authorization: "${FS_MCP_TOKEN}"
- timeout: 30
|