Autoresearch
Karpathy-style keep-or-discard loop for runtime strategy self-improvement.
How It Works
- Agent runs for N ticks
- Evaluates performance: win rate, P&L, drawdown, avg win/loss
- LLM proposes parameter changes based on results
- Safety bounds are checked
- Human approves or rejects
Self-Evaluation
forge strategy view ./my-agentversion: 1
parameters:
spread_pct: 1.0
position_size_pct: 1.0
momentum_threshold: 0.5
performance:
Win rate: 62% (target: >45%)
Max drawdown: 3.2% (target: <5%)
Avg win/loss: 1.8 (target: >1.5)Mutation Proposals
The LLM analyzes performance and proposes changes:
IMPROVEMENT PROPOSAL [prop_a1b2c3]
Hypothesis: Relax entry confirmations
Change: momentum_threshold 0.5 → 0.3
Expected: +15% more trades
Safety check:
position_size ≤ 25% ✓
stop_loss ≤ 20% ✓Safety Bounds
The agent cannot propose unsafe parameters:
| Parameter | Max allowed |
|---|---|
position_size | 25% |
stop_loss | 20% |
leverage | 5x |
max_daily_trades | 100 |
Accept or Reject
# Accept the proposal — strategy advances to v2
forge strategy accept prop_a1b2c3
# Reject — keep current version
forge strategy reject prop_a1b2c3Enable
forge run ./my-agent --autoresearch --eval-interval 6--eval-interval controls how many ticks between self-evaluations (default: 10).
Last updated on