AI Agent 研究管线
一组单一职责的 AI agent 如何把当前宏观 regime 一步步变成一份可复核的策略提案 —— 全程留痕、离线运行、并在「人工把关」处强制停下。
这是组合背后的离线研究管线(vN.3)—— 不是自动交易器。它复用了经过测试的回测引擎(vN.1)与有界搜索(vN.2),再叠加一个「红队批判 + 人工把关」。每一次 provider 调用都写进审计日志;管线只写 research/proposals/,绝不碰 data/ 里的实盘账本。
管线流程
把它当「编排器-工人(orchestrator-workers)」系统来读:一个控制平面(Orchestrator)从左到右驱动数据平面里一组单一职责 agent,每次调用都留痕,而唯一的决策点是人工把关 —— 机器自己永不写入实盘账本。
逐步拆解
- 1RegimeAgent纯读取 data/regime.yaml → 大类资产视图(无 LLM、无随机)。
- 2Signals · 信号从价格面板算真实跨资产因子 z-score(动量、防御)。
- 3HypothesisAgentregime + 信号 → 一份显式、可证伪的假设(方向 / 陈述 / 证伪条件)。
- 4Generator + 搜索从假设构造有界 vN.2 搜索空间,跑样本外 walk-forward 搜索。
- 5CriticAgent · 红队DSR 闸门(去通胀 Sharpe)+ 用 finalist 自己权重做真实资产冲击压力重模拟。
- 6Curator + 编排编译草案、写 proposal + 审计;交给「人」复核。
单一职责 agent
RegimeAgent
负责: 数字把细粒度战术矩阵(OW=+1/N=0/UW=−1)聚合成大类资产得分。完全确定性,不产出任何文字。
HypothesisAgent
负责: 假设把 regime 视图 + 真实信号 z-score 变成每个大类的显式方向、一段陈述、以及 4–6 条证伪条件。全程留痕。
Generator + 搜索
负责: 候选策略从假设导出有界搜索空间(方向固定、幅度搜索),再按样本外目标对 trial 排名。
CriticAgent
负责: 红队严格的 DSR 闸门(零/负证据直接否决)+ 真实压力重模拟:用 finalist 自己的权重算 r_group = Σ wᵢ·shockᵢ。
CuratorAgent
负责: 草案编译 base/bull/bear 权重(各自和为 1、通过约束)与决策时点字段。复用假设的陈述 + 证伪条件。
Orchestrator
负责: 溯源哈希出可复现的 proposal_id、回放审计日志、写 5 份工件、追加 leaderboard。只写 research/proposals/。
管线只写 research/proposals/ —— 永不创建或修改 data/ 下任何东西。有测试断言一次运行前后 `git status data/` 完全不变。由人复核草案,接受后才手动把权重抄进实盘账本。
不需要联网。默认 provider 是确定性的规则引擎;只有在配置了 key 时,Claude provider 内部才会导入 Anthropic SDK。CI 跑确定性路径,所以 proposal_id 可复现。
Worked example · 最新一份真实 proposal
proposal_id cc02400ae096 · provider rulebased · grid/seed · deterministic=true · code c2baf21 · data 4def167
Regime quadrant Q4 (growth momentum -0.519, inflation momentum +0.275). Overweight tilt orientation: commodities, rates. Underweight tilt orientation: equities. Coarse-class views are aggregated from the fine tactical_matrix (OW=+1/N=0/UW=-1, mean per coarse class); the sign sets the search bound orientation, the magnitude is searched.
- base_allocator
- 60_40
- tilt_strength
- 0.5
- OOS Sharpe
- 0.4870
- 样本
- 77 obs · 3 splits · 162 trials
- Deflated Sharpe
- 0.0000 (SR0 2.70)
- 是否接受
- false
- 压力测试口径
- finalist_asset_shock_resim
- 压力 flag
- inf2022
审计轨迹 · 编排器实际跑了什么
编排器为这份 proposal 驱动的每一次 provider 调用,按发生顺序回放自 audit.jsonl。model 为空,是因为这次跑的是确定性规则引擎 —— 只有配置了 key 时才会导入 Claude provider。RegimeAgent(纯读取)与 Orchestrator(只写工件)不发起 provider 调用,所以不在此列。
逐条调用日志
- 01hypothesis · regime_summary provider=rulebased model=—state the macro hypothesis from the regime view
- 02hypothesis · falsification provider=rulebased model=—falsification conditions for the hypothesis
- 03generator · search_space provider=rulebased model=—generate vN.2 search_spec for the current regime
- 04critic · critique provider=rulebased model=—critique the finalist from DSR + stress context
- 05curator · rationale provider=rulebased model=—decision rationale prose
诚实声明
- 已提交的价格历史很薄、且单一 regime(~120 个交易日,一个 Q4 宏观 regime)。样本内没有 bull/bear 切换,所以 regime tilt 无法做跨 regime 验证。
- 压力冲击是按情景 benchmark 估的区间量级,不是逐 ETF 的实测值 —— 仅作框架验证。
- 这些 proposal 是示意性的、并不稳健。不要仅凭这点证据部署 —— 这正是一切都停在人工把关处的原因。