The LLM Boundary
QuantContext enforces a strict boundary between what LLMs do and what code does:Why Determinism Matters for Trading
LLMs hallucinate numbers. QuantContext ensures every number returned to an agent is:- Computed from actual market data:not generated, estimated, or hallucinated
- Deterministic:same inputs produce identical outputs, always
- Auditable:the computation path is pure Python with no randomness
How the Tools Work
screen_stocks
screen_stocks
SKILL_REGISTRY. Each skill receives a pandas DataFrame and returns a filtered/ranked DataFrame. Stages execute sequentially.backtest_strategy
backtest_strategy
factor_analysis
factor_analysis
Data Sources and Caching
| Source | Data | Cache TTL | Location |
|---|---|---|---|
| yfinance | Daily OHLCV prices | 1 day | ~/.quantcontext/cache/prices/ |
| yfinance | Fundamentals (PE, ROE, etc.) | 7 days | ~/.quantcontext/cache/fundamentals/ |
| Kenneth French | Fama-French + momentum factors | 30 days | ~/.quantcontext/cache/factors/ |
| Bundled | Universe constituent lists | Package version | Installed with package |
