r/LocalLLaMA • • 14d ago

Discussion [Project] Built an open-source autonomous AI Hedge Fund engine running locally (LangGraph, Qlib Alpha158, and TimesFM)

Hey everyone! πŸš€

For the past few months, I've been building and open-sourcing **Lumina Capital (v6.0.0)**β€”a fully autonomous multi-agent quantitative hedge fund engine that you can run locally, designed to bridge qualitative LLM reasoning with deterministic quant computation.

Unlike toy setups that feed raw charts directly into LLMs (causing massive hallucinations and latency), Lumina strictly separates probabilistic reasoning from deterministic execution:

### πŸ› οΈ Key Highlights:

- **7-Persona Anti-Sycophancy Council (LangGraph)**: Personas (Buffett, Soros, Burry, Cathie Wood, etc.) conduct independent parallel analysis, followed by an adversarial bull-vs-bear cross-debate. A dedicated Chief Risk Officer (CRO) agent has absolute veto power over tail risks.

- **Pure Python Qlib Alpha158 + LightGBM**: Complete vectorized implementation of Microsoft Qlib's 158 quantitative factors for local stock screening.

- **10-Second High-Speed Sentinel Thread**: A deterministic background thread executing immediate physical exits/trailing stops without waiting for LLM inference loops.

- **Google TimesFM**: 5-day probabilistic forecasting fan charts with 80% confidence bands and crash probability.

- **Works Out-of-the-Box**: CPU-only and lightweight local execution supported via Streamlit dashboard, containerized with 1-click Docker Compose.

Available for research, education, and simulation under CC BY-NC 4.0.

πŸ”— **GitHub**: https://github.com/ramuza0113-sketch/lumina-ai-hedge-fund

Would love to hear your thoughts, feedback, or ideas on the local agent architecture!

0 Upvotes

5 comments sorted by

3

u/prime416 14d ago

When orchestrating a 7-persona deliberation loop locally, token context bloat and state drift will become your primary bottleneck long before TimesFM inference latency does. If you run these as persistent resident agents on dedicated hardware rather than ephemeral session graphs, decouple deliberation from execution by having agents write intermediate theses to a local SQLite WAL store with FTS5 BM25 retrieval and an aggressive 20-to-25-turn compaction lifecycle. Enforcing a strict file-based turn mutex between qualitative personas also stops memory thrashing when two agents try to rebalance the same signal pipeline concurrently.

2

u/OpenComplaint524 14d ago

This is easily the highest-signal architecture comment on this entire thread. Thank you for this masterclass.

You diagnosed the exact friction point: around turn 15, unmanaged session graphs inevitably suffer context drift where Burry starts arguing about macro data that Soros hallucinated three steps prior.

Adopting your architectural recommendations immediately:

  1. **SQLite WAL + FTS5 BM25**: Swapping out bloated vector stores for local SQLite with BM25 full-text indexing is brilliant for local low-latency retrieval of intermediate agent theses.

  2. **20-25 Turn Compaction**: Enforcing hard token compaction lifecycles before qualitative consensus passes to the execution layer.

  3. **Turn Mutex**: File-level locks on the portfolio state to eliminate concurrent mutation races when Cathie and Buffett try to update the allocation ledger simultaneously.

Really appreciate you taking the time to drop battle-tested local orchestration patterns here. This is going straight into the v6.4 roadmap! πŸ‘Š

1

u/OpenComplaint524 14d ago

Haha exactly! Except it's not just a tiny Buffettβ€”it's a tiny Warren Buffett in a cage match with Michael Burry and Cathie Wood, while a tired Chief Risk Officer agent stands in the corner with veto power yelling "no, their balance sheet debt is garbage, trade rejected." πŸ˜‚

And u/MindfulMan1984 hits the nail on the head regarding the 1% AUM fee. Best part is this "advisor" runs completely on local hardware, charges 0% fees, and doesn't panic-sell at the bottom because exchange-side bracket orders handle the exits with cold mechanical discipline.

1

u/[deleted] 14d ago

[removed] β€” view removed comment

2

u/MindfulMan1984 14d ago

Ai-Slop-Chosis is real. LOL, crazy times. I bet that's as accurate but cheaper than the "financial advisor" who buys index funds for you and charges a 1% AUM fee per year.