FactorMiner is an open-source project that brings an autonomous, self-improving "super researcher" to quantitative investing. Rather than a simple automation tool, it is an agent framework with a skill library and an experience memory, designed for the autonomous discovery and evolution of financial Alpha factors.
The Problem It Solves
Finding Alpha factors that consistently generate excess returns traditionally relies on personal experience, intuition, and manual backtesting—inefficient and poorly suited to capturing nonlinear, complex market patterns. FactorMiner's answer is an agent that can:
1. Autonomously combine basic data-processing skills to generate candidate factors 2. Evaluate them via historical backtests 3. Store successes and failures in memory 4. Use that memory to guide the next round of exploration
This loop is self-driven and, in theory, continuously optimizes its exploration strategy as market conditions and data evolve.
Core Architecture: Two Pillars of Self-Evolution
Skill Library: "Lego Bricks" for Factors
Skills are atomic, reusable data-operation and feature-computation functions:
- Data-fetching skills:
fetch_daily_price,calculate_returns,get_financial_statement— wrappers around databases/APIs that output standardized data objects. - Feature-engineering skills (the core):
rolling_mean(data, window=20): 20-day rolling meants_rank(series, window=10): time-series rank over the last 10 periodsdecay_linear(series, window=5): linear-weighted decay- Which factor combinations produced significant IC (information coefficient)
- Which parameter sets failed under certain market regimes
- Which preprocessing methods are robust on which asset classes
- Reflections on why failures occurred and how to avoid them next time
- LLM (GPT-4, Claude, etc.) as commander: parses tasks, plans steps, generates code outlines
- Code Interpreter as executor in a controlled sandbox
- Validation loop as QA: if IC is insignificant, the LLM analyzes causes (feature definition? data? neutralization?) and iterates 4. Establish evaluation and iteration mechanisms: run new ideas through the agent for baseline factors, then let researchers deepen and optimize; task records become fine-tuning data for smaller proprietary models, creating a human-AI co-evolution loop.
- Backtest rigor is everything: look-ahead bias, survivorship bias, or underestimated transaction costs can make stored "successes" false positives. The memory's biggest risk is treating flawed backtest results as ground truth.
- Regime changes can invalidate memory: an Alpha that worked in 2007 may fail in 2020. Memories need expiry labels and automatic decay of stale strategy experience.
- LLM reliability: hallucinated code—plausible-looking but buggy feature functions—can contaminate the memory. Sandbox validation, unit tests, and factor interpretability checks are essential defenses.
- Multi-agent collaboration: separate feature-engineering, backtesting, and factor-combination agents cooperating via a message bus
- Cross-market transfer: can factors validated in A-shares transfer to HK, US, or crypto markets? What memory-extraction and retraining mechanisms does transfer require?
- Active learning: the agent proposes unexplored research directions on its own rather than waiting for tasks
Experience Memory: Learning from Success and Failure
The memory records:
This dual success/failure memory avoids a classic pitfall: recording only winning factors, causing strategies to repeatedly stumble on the same failure modes.
How It Differs from Traditional AI Quant Pipelines
Traditional pipelines flow one way: data → factor mining (genetic programming, AutoEncoder) → prediction (GBDT, LSTM) → portfolio & risk → execution. FactorMiner turns this into a loop: each attempt's process—skills used, combination order, parameters, market state—is recorded, so the next exploration starts from a better-informed position.
The underlying insight: the process of discovering Alpha factors is itself learnable. A top researcher's intuition largely comes from having seen many failures—FactorMiner outsources that experience to the memory store.
Deployment Roadmap
1. Define an internal research task library: convert past successful factor research into standardized natural-language task descriptions, archived with data sources, scripts, and performance records. 2. Build an internal tool platform: wrap data APIs (Wind, Tushare, proprietary platforms), text-processing utilities, and factor-analysis toolkits (Alphalens, Qlib adapters) behind unified, secure interfaces. 3. Design the agent engine: an "LLM + Code Interpreter + validation loop" architecture—
Boundary Conditions Worth Flagging
Practical Implications
A senior researcher traditionally produces 5–10 effective factors per year; a 10-person team, 50–100. Self-evolving systems like FactorMiner could push that up by an order of magnitude, shifting researchers from manual mining to designing mining pipelines. For individual researchers, it offers a reproducible Alpha discovery platform. The deeper shift: factor research is moving from "expert craft" to "engineering pipeline"—and the commercial logic shifts from "we have star researchers" to "we have self-evolving agents."