Skip to content

Commit 1fb7df4

Browse files
committed
docs: document agentic design and feature iterations
1 parent fbf8156 commit 1fb7df4

1 file changed

Lines changed: 82 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,88 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Agentic Research Loop — 2026-09-12
11+
12+
This release documents the current agentic design and the features added while
13+
iterating from a parameter-tuning backtester toward a self-improving research
14+
agent.
15+
16+
#### Agentic design
17+
18+
AgentQuant runs a bounded, evidence-producing loop:
19+
20+
```text
21+
ANALYZE → HYPOTHESIZE → BACKTEST → REFLECT → STORE
22+
↑ │
23+
└──── retry on failure ──┘
24+
```
25+
26+
- **Analyze** computes market features and classifies the current regime from
27+
volatility, momentum, trend, and drawdown signals.
28+
- **Hypothesize** combines LLM reasoning, stored alpha memory, regime-aware
29+
grid search, and random fallback proposals.
30+
- **Backtest** evaluates proposals with warmup enforcement, transaction costs,
31+
and performance metrics.
32+
- **Reflect** applies quality gates, records falsifiable proposal claims, and
33+
decides whether another bounded iteration is justified.
34+
- **Store** persists accepted evidence and reusable negative evidence for later
35+
runs.
36+
37+
The loop is intentionally bounded: every proposal has parameters, a generation
38+
method, reasoning, confidence, and measurable outcomes. This keeps agentic
39+
behavior comparable to deterministic baselines instead of treating free-form
40+
LLM output as evidence by itself.
41+
42+
#### Iteration history
43+
44+
The implementation has evolved through these agentic stages:
45+
46+
1. **Core research platform** — multi-strategy OHLCV ingestion, feature
47+
engineering, realistic-cost backtesting, metrics, and dashboard views.
48+
2. **Bounded agent loop** — explicit analyze/hypothesize/backtest/reflect/store
49+
nodes with retry limits and a single proposal-generation entrypoint.
50+
3. **Regime-aware proposals** — VIX percentile and momentum regimes feed the
51+
prompt and parameter-grid priors.
52+
4. **Persistent learning**`StrategyMemory`, `AlphaStore`, and NLA memory
53+
retain cross-run context and successful candidates.
54+
5. **Tool-using orchestration** — Claude-compatible tool schemas, optional
55+
Tavily research/sentiment search, proposal parsing, and graceful fallback to
56+
local generation.
57+
6. **Harness evaluation** — falsifiable claim recording, benchmark tooling,
58+
generalization-gap measurements, and experimental harness evolution.
59+
7. **Failure-aware self-improvement** — structured failure records now capture
60+
regime, strategy, parameters, failure mode, metric gap, and a
61+
counterfactual hypothesis; matched failures are injected as proposal
62+
constraints.
63+
8. **Robustness evaluation** — anchored walk-forward utilities report median
64+
and worst-window metrics; counterfactual stress tests perturb regimes,
65+
volatility, outlier days, and trends.
66+
9. **Agent observability and extension points** — trace diagnostics expose node
67+
counts, proposal methods, improvements, and acceptances; regime transitions
68+
are detectable; generated strategy source is AST-validated before registry
69+
registration.
70+
71+
#### Added
72+
73+
- `failure_records` SQLite table and `FailureRecord` dataclass in
74+
`src/research/alpha_store.py`.
75+
- Automatic failure persistence from `reflect_node`.
76+
- Structured failure-memory prompt context in
77+
`src/agent/proposal_generator.py`.
78+
- `TraceRecorder.diagnostics()` and `.diagnostics_json()` for harness reports.
79+
- `src/backtest/walk_forward.py` for anchored walk-forward evaluation.
80+
- `src/backtest/stress_test.py` for counterfactual strategy stress tests.
81+
- `RegimeChangeDetector` for recording regime-label transitions.
82+
- `src/strategies/codegen.py` for AST validation and controlled strategy
83+
registration.
84+
- `stress_test_strategy` in the agent tool registry.
85+
86+
#### Validation
87+
88+
- 70 repository tests pass after integrating the latest `main` changes.
89+
- Unsafe generated imports are rejected before registration.
90+
- No force-push or destructive history rewrite was used for this release.
91+
1092
### Added — 2026-08-28
1193

1294
#### Tool Registry & Orchestration System

0 commit comments

Comments
 (0)