FactorMiner
Symbolic factor discovery with LLM-guided search, reproducible evaluation,
and transferable research memory.

FactorMiner generates interpretable formulas, evaluates them on market data,
and records their lineage, metrics, and admission decisions. Shared evaluation
and memory contracts support local mining, controlled experiments, and agent
integrations. Outputs are research artifacts; the project does not execute trades.
Capabilities
| Component | Function |
|---|
| Formula engine | Typed DSL with NumPy evaluation; optional compiled operators and Torch kernels |
| Mining | Ralph and Helix loops with generation, evaluation, memory, and checkpoints |
| Experiment selection | Opt-in generation, refinement, delay challenges, and stopping |
| Research skills | Versioned procedures with applicability, uncertainty, and contradiction tracking |
| Evaluation | Runtime recomputation, split-aware metrics, dependence, costs, and statistical diagnostics |
| Evidence | Formula lineage, trial ledgers, content-addressed evidence packs, and verifiable releases |
| Integration | CLI, Python API, MCP server, and reference agent packages |
Install
Requires Python 3.12+ and uv:
git clone https://github.com/minihellboy/factorminer.git
cd factorminer
uv sync --group dev --extra llm
NumPy is the default backend. Optional extras include mcp, research,
embeddings, visualization, and gpu; the CUDA extra targets Linux.
uv sync --frozen --extra gpu installs patched PyTorch with CUDA 12.6 and
CuPy for CUDA 12. The base install needs neither Torch nor a GPU.
See backend scope and
platform setup and checks.
Quick start
Run a local workflow without credentials:
uv run factorminer doctor --json
uv run factorminer quickstart
quickstart writes a sample library and HTML report to
/tmp/factorminer-quickstart. For a controlled mock campaign:
uv run factorminer -o output/mock mine --mock -n 2 -b 8 -t 10
uv run factorminer session inspect output/mock --telemetry
To run the action planner with DeepSeek Flash, set DEEPSEEK_API_KEY in .env:
uv run --env-file .env factorminer \
-c factorminer/configs/research_actions_deepseek.yaml \
-o output/deepseek-research mine --data data/binance_crypto_5m.csv
The bundled data is a workflow sample. Mining uses only the configured training
split and purges forward-target overlap. Local mining resumes in the
same output directory and defaults to no iteration ceiling or model-call/wall-time
quota. A positive -n sets a total campaign iteration boundary for experiments.
See research actions and
research skills for configuration and recovery.
Data and evaluation
Input panels require:
datetime, asset_id, open, high, low, close, volume, amount
Validate a panel, then recompute a saved library on it:
uv run factorminer validate-data path/to/market_data.csv --strict
uv run factorminer -c path/to/config.yaml evaluate output/run/factor_library.json \
--data path/to/market_data.csv --period both --top-k 10
Configure targets and train/test periods for the supplied data. Saved scores
remain metadata; analysis recomputes formulas through the evaluation kernel.
See reproducibility for field aliases, metric semantics,
frozen comparisons, and baseline provenance. Command-level --help lists the
available mining, analysis, benchmark, and data workflows.
Documentation
| Guide | Contents |
|---|
| Architecture | Components, ownership, execution, and persistence |
| Research actions | Experiment selection and campaign recovery |
| Research skills | Compile, transfer, and inspect procedure memory |
| Reproducibility | Data, metrics, splits, and benchmarks |
| Evidence protocol | Inference, risk residualization, and cost diagnostics |
| Qlib CN benchmark | A-share panels and PIT fundamentals, Qlib-conformant splits, Alpha158 lift and top-50 book evaluation |
| Security | Input, model, credential, and MCP boundaries |
| Agent integration | Plugin, managed-agent, and MCP setup |