Building an Open-Source AI Hedge Fund Engine with LangGraph: A 7-Person Research Team and TimesFM Forecasting

Lumina Capital cages the LLM with a layered architecture: probabilistic reasoning and deterministic computation each do their part.
Open-sourced by a Reddit developer, Lumina Capital v6.0.0 is an autonomous multi-agent quantitative hedge fund engine. Its core claim is strictly separating LLM probabilistic reasoning from deterministic quantitative computation to avoid hallucinations and latency from feeding raw candlesticks to large models. The system has four layers: a LangGraph-driven seven-person research committee with independent parallel analysis, bull-bear cross-debate, and a CRO with tail-risk veto; a pure-Python vectorized Qlib Alpha158 factor library plus LightGBM meta-decision filtering; Google TimesFM producing 5-day probability fan charts; and a 10-second sentinel thread independently monitoring dynamic ATR stop-loss for immediate physical exit. Neo4j causal knowledge graphs with GraphRAG provide memory, plus a Streamlit visualization workbench. Released under CC BY-NC 4.0 for research, education, and simulation; the author makes no live-trading claims.
Putting the LLM in a Cage: The Architecture Behind an Open-Source Quant Engine
A developer on Reddit has open-sourced Lumina Capital (v6.0.0) — an autonomous multi-agent quantitative hedge fund engine. Its core thesis is striking: most "LLM stock trading" projects on the market feed raw candlestick charts directly into large models, resulting in hallucinations and latency. Lumina's approach instead strictly separates probabilistic reasoning from deterministic quantitative computation, letting the LLM handle only what it excels at.
This boundary-drawing is the project's key design decision. The LLM does no numerical computation — only narrative judgment and debate; everything requiring precision is delegated to traditional quant tooling.
![reddit source: [Project] Built an autonomous AI Hedge Fund engine with LangGraph, Qlib Alpha158, and Google TimesFM](/media/screenshots/source/40226_0.png)
The Seven-Person Research Committee: Using Role Conflict to Dissolve the LLM's "Sycophancy"
Lumina's first layer is a 7-Persona anti-sycophancy committee running on LangGraph. The seven roles correspond to seven distinct investment philosophies: Buffett, Soros, Burry, Wood, Graham, O'Neil, and CIS (a well-known Japanese short-term trader).
The key design points are threefold:
- Parallel independent analysis: Each of the seven "analysts" reaches its own conclusion, avoiding cross-contamination;
- Bull-bear cross-examination: After independent analysis comes an adversarial debate round, with bulls and bears going head-to-head;
- CRO veto power: A dedicated Chief Risk Officer (CRO) holds absolute veto over tail risk and can overturn the entire committee's recommendation.
This mechanism targets a well-documented weakness of LLMs: under a single prompt, models tend to echo the user's stance and avoid conflict. Through role opposition and veto power, the system is forced to produce genuine disagreement.
LangGraph is an orchestration framework from the LangChain team for building stateful, multi-agent applications. Its core abstraction is the "graph": nodes represent processing steps (such as an LLM call or tool execution), edges represent transition conditions between steps, and it supports loops, branching, and interrupts.
Compared to earlier chained-call (Chain) approaches to wiring LLMs together, LangGraph's graph structure is better suited to this project's scenario — the seven roles' parallel analysis, mutual debate, and CRO veto interventions are essentially a directed graph with conditional jumps and shared state. Each agent reads and writes the same shared State, eliminating the need to repeatedly pass context. It also supports persistent checkpoints, allowing long workflows to be paused, resumed, and human-intervened — particularly important for auditable investment research processes.
The Quant Kernel: Qlib Alpha158 + LightGBM
The second layer is a pure-Python implementation of the Qlib Alpha158 factor library. Microsoft Qlib's Alpha158 is a widely cited factor set in quant circles; Lumina rewrites it fully in vectorized form and layers LightGBM on top as a meta-decision filter.
This layer's role is to provide "hard data" — the feature space formed by 158 factors is compressed by a tree model into actionable signals, which the LLM layer then interprets qualitatively. The vectorized implementation means it doesn't depend on the official Qlib framework, lowering the deployment barrier at the cost of maintaining factor-logic correctness yourself.
Alpha158 is a classic stock-selection factor set built into Microsoft Qlib, containing roughly 158 features extracted from market data. They fall into broad categories: candlestick-pattern features (such as the relative position of open and close, upper/lower shadow ratios), price momentum and moving-average features (returns across different windows, MA deviation), volatility features (rolling standard deviation, true range), and volume features (volume ratio, volume-price correlation). Its significance lies in providing machine learning models with a standardized, reproducible feature-engineering baseline.
LightGBM is Microsoft's gradient-boosted decision tree (GBDT) implementation, known for its histogram algorithm and leaf-wise growth strategy — fast to train, low memory footprint, and stable on structured features. Feeding Alpha158's hundred-plus-dimensional time-series features into LightGBM essentially lets the tree model learn "which combinations of factors under what conditions predict returns," then nonlinearly compress that into an output signal. Compared to deep sequence models, GBDT tolerates smaller samples and noisier features better and offers more interpretable feature importance — which is why it has long served as a baseline in quantitative stock selection.
TimesFM Forecasting and the 10-Second Sentinel: From Probability Fans to Physical Stop-Loss
Google's TimesFM handles time-series forecasting, outputting a 5-day probabilistic fan chart with an 80% confidence interval and a crash-probability estimate. Its value isn't in "how accurate the prediction is" but in giving the decision layer a distributional view with uncertainty, rather than a lone point estimate.
Complementing it is a 10-second high-speed sentinel thread: it continuously monitors a dynamic ATR stop-loss line in the background and executes a physical exit immediately upon trigger — never waiting on the LLM's reasoning loop. This is a direct engineering response to LLM latency — risk control cannot queue up waiting for the model to think.
TimesFM is a time-series foundation model released by Google Research. It adopts a "decoder + chunked patch" approach similar to large language models: continuous numerical sequences are sliced into segments and vectorized, then pretrained-then-zero-shot inference directly outputs several steps of future predictions. Its standout feature is that it can forecast without retraining on the target series — making it suitable for high-noise, fast-distribution-shift scenarios like financial market data.
It outputs quantile forecasts rather than point values, which is exactly where the "probability fan chart" comes from — different quantiles correspond to different confidence levels; for instance, an 80% interval means roughly an 80% estimated probability that future prices fall within that range. Crash probability is typically derived by accumulating quantiles that fall below the extreme downside range. ATR (Average True Range) is a volatility indicator proposed by Wilder, taking the moving average of true range. It's commonly used to set stop-loss distances that adapt to current volatility levels: widen stops when volatility expands, tighten them when volatility contracts — thereby avoiding fixed-point stops being triggered repeatedly during choppy conditions.
GraphRAG and Knowledge Graphs: Giving Agents Memory
The system also integrates a Neo4j-powered 3D causal knowledge graph and GraphRAG for two purposes: real-time monitoring of supply-chain bottlenecks, and providing agents with episodic memory. Combined with a full Streamlit visualization workbench, researchers can directly observe the intermediate process of multi-agent discussion.
The project is released under a CC BY-NC 4.0 license and is positioned for research, education, and simulation. Note that the author explicitly frames it as a simulation tool, not a trading system that can be plugged directly into live markets — between LLM debate and actual order placement lie backtesting validation, slippage modeling, compliance review, and many other engineering and institutional steps.
GraphRAG is an improvement over traditional RAG (retrieval-augmented generation): traditional RAG chunks documents and retrieves by vector similarity, only able to fetch "local" information and struggling with global questions that require cross-document synthesis. GraphRAG first uses an LLM to extract entities and relationships from text, builds a knowledge graph, then performs community detection and summarization on the graph — enabling retrieval along both "entity-relationship" and "community-topic" paths simultaneously.
Neo4j is the mainstream native graph database, using nodes, relationships, and properties as its data model, with the Cypher query language for traversing multi-hop relationships — naturally suited to storing networked structures like supply-chain upstream/downstream links and equity relationships. A "3D causal knowledge graph" refers to annotating directional causal edges on the graph (rather than mere co-occurrence) so agents can distinguish correlation from causation during reasoning. "Episodic memory" is borrowed from cognitive science: agents store past concrete events and conclusions in the graph structure, retrieving them when encountering similar situations — rather than relying solely on parameterized static knowledge.
Three Things Worth Noticing About This Architecture
First, the division-of-labor paradigm in multi-agent architectures is shifting from "let the LLM do everything" toward "LLM makes judgments, traditional tools do computation" — and Lumina is a relatively complete design sample in this direction.
Second, opposing roles + veto power is a reusable pattern for countering LLM sycophancy — not limited to finance; any agent system needing multi-perspective decisions can borrow it.
Third, layered risk control (LLM-layer reasoning + sentinel-layer physical execution) illustrates a reality: for autonomous systems involving capital safety, key actions must bypass probabilistic models and take deterministic paths.
The complete code is open-sourced on GitHub under the name lumina-ai-hedge-fund; the author welcomes issues and feedback.
Related articles

OpenAI Partners with Shield: How the Astra Agent Revolutionizes IT Troubleshooting
OpenAI and Shield launch the Astra agent, which autonomously logs into computers and legacy systems to fix IT issues in real time, 35-40% faster than traditional models, with humans involved only when judgment is needed.

iPhone Duo Battery Life Tested: One Charge a Day Is Unavoidable, and the Large Screen Is the Culprit
iPhone Duo battery test: heavy use needs at least one charge a day, and about 30% remains after 6.5 hours of screen-on time. How often the large screen is unfolded is key; a MagSafe battery pack helps, and long-term degradation is also worth watching.

Kimi K3.1 Pro Open-Sourced: 2.8 Trillion Parameters Close In on Opus
Moonshot releases the open-source MoE model Kimi K3.1 Pro, with 2.8T total parameters and 104B activated, trailing Opus 5.5 by under 1 point on Terminal Bench 4.0.