Self-hosted AI investment committee

OpenInvest

Four LLM roles cross-examine each other and a CIO aggregates one verdict. Execution remains your decision.

$ /plugin marketplace add longsizhuo/openInvest
$ /plugin install invest@openinvest

Installs the MCP server (tools auto-registered) + committee skills. Then say “set up invest” to onboard. No API key needed (Coordinator path).

678 Installs|4,488 Copies

Why OpenInvest

Most “AI trading” demos quote returns. We measure what can actually be tested.

Return significance is bounded by t ≈ SR·√T: Sharpe 0.5 needs ~16 years and Sharpe 1 ~4 years to reach t≈2 (paper §4.3). OpenInvest therefore grades calibration and removes components that fail testing.

81 / 80 / 76%

Calibration-first

Pre-registered out-of-sample acceptance (fit 2007–2017, test 2018–2026): 30/60/90-day P10–P90 coverage 76/73/70% → 81/80/76%, inside the [75%, 85%] target band; Brier improves at all three horizons.

0 / 3

We reject what fails

TradingAgents-style analyst agents scored 50.3 / 57.4 / 64.7% on 30-day direction — all below the 70.7–73.1% naive baseline. 0 of 3 passed the pre-registered gate.

42%

Small samples flagged

At effective n=1, probability-band coverage falls to 42%. Thin buckets are flagged low_confidence and shrunk (k=80) toward the asset’s unconditional distribution.

0.60

Self-reported confidence not used

LLM self-reported confidence has a median of 0.60 (n≈2,100) and clusters on multiples of 0.05; it carries no probabilistic meaning (paper Fig. 7).

Round 2Macro StrategistVIX · rates · FXQuant Analysttechnicals · blind to holdingsRisk Officerconcentration · tail riskCIOsynthesizes · confidenceBUY · HOLD · SELL

Three analysts argue from separate data sources, cross-examine in round 2, and a CIO aggregates one verdict.

Product Philosophy

The Investment Operating System, Not Another Chatbot

OpenInvest is not another AI assistant, and it is not trying to replace your agent.

We believe the future belongs to increasingly capable personal agents such as Claude Code, Codex, Hermes, OpenClaw, and future Agent OSs. These agents already understand their users far better than a standalone investment application ever could. They naturally accumulate long term context, remember past conversations, observe user behavior, and evolve alongside their owners.

Instead of rebuilding these capabilities, OpenInvest focuses on one thing: the investment decision engine.

OpenInvest Provides

  • ✓A verifiable investment committee
  • ✓Evidence-based reasoning
  • ✓Long-horizon backtesting and calibration
  • ✓Structured decision records
  • ✓Market intelligence and research
  • ✓Decision APIs and protocols that any agent can consume

Your Personal Agent Provides

  • ✦Natural conversation
  • ✦Long-term memory
  • ✦Understanding of your preferences and risk tolerance
  • ✦Decision reflection
  • ✦Personalized coaching
  • ✦Multi-turn discussion

OpenInvest produces auditable decision evidence; your agent helps you make the choice.

An Intentional Separation

We do not want to compete with the rapidly evolving agent ecosystem by building another chat interface or another memory system. Instead, OpenInvest is designed to become the decision infrastructure that powers those agents.

Smarter Agents, More Valuable OpenInvest

As agents become smarter, OpenInvest becomes more valuable. Every improvement in the agent ecosystem immediately benefits OpenInvest users without requiring OpenInvest to reinvent conversation, memory, or personalization.

OpenInvest does not build another AI agent. It provides the decision engine that agents call.

Evidence

Calibration-first results on real data, positive and negative

Figures are recomputed from the public research archive. Look-ahead-prone windows are flagged; results where the committee trails the baseline are included.

Defensive replay

+0.00%

2022 bear market replay

GC=F, 2022: committee +1.95%, buy-and-hold -0.43%, 200-DMA trend -6.46%, regime rule -5.70%. One asset-year does not establish an edge (paper §4.3).

Walk-forward replay on GC=F, 2022 (pre-training-cutoff, no look-ahead). n=251 trading days.

experiments/ta-analysts/baselines/gold_fourth_arm_result.json

Negative results: underperformance and rejected components

Risk-adjusted return across three regimes

Sharpe, committee vs buy-and-hold: 2022 bear 0.20 vs 0.05; 2024–26 bull 1.82 vs 1.74; 2020 V-shaped crash 0.73 vs 1.13. Three windows do not establish an edge (paper §4.3).

† 2024–26 bull carries LLM look-ahead (upper-bound only). * 2020 / 2022 are clean. Sharpe ratio, GC=F.

experiments/ta-analysts/baselines/gold_fourth_arm_result.json

TradingAgents-style analysts vs a naive baseline

Fundamental, news and sentiment analysts all missed our pre-registered hit-rate gate — a naive “always-majority” baseline beat every one.

30-day directional hit-rate, Wilson 95% CI, n≈244/analyst. The single-sided bull window makes the ~73% baseline a high bar by design.

docs/wiki/16-ta-analysts-experiment.md

Cross-model validation: one passing cell is not a signal

Of 9 window × model cells, 1 cleared the gate (2022 bear · fundamental 74.3%). A result is accepted only once replicated.

Gate = Wilson CI lower bound above both the naive baseline and the mechanical mapping.

docs/wiki/16-ta-analysts-experiment.md

Calibration & rigor

Three sources of multi-agent value: independent information sources, de-correlated sampling with aggregation, and deterministic guardrails.
Three sources of multi-agent value: independent information sources, de-correlated sampling with aggregation, and deterministic guardrails.
Return significance: t ≈ SR·√T. Sharpe 0.5 needs ~16 years and Sharpe 1 ~4 years to reach t≈2; calibration is testable now.
Return significance: t ≈ SR·√T. Sharpe 0.5 needs ~16 years and Sharpe 1 ~4 years to reach t≈2; calibration is testable now.
Band expansion alone (γ=1.1), full-history diagnostic (n=1579): 30/60/90-day coverage 76/72/69% → 80/76/74%.
Band expansion alone (γ=1.1), full-history diagnostic (n=1579): 30/60/90-day coverage 76/72/69% → 80/76/74%.
View the remaining figures
Pre-registered out-of-sample acceptance (fit 2007–17, test 2018–26): coverage 81/80/76%, inside [75%, 85%]; Brier 0.236→0.233 / 0.237→0.230 / 0.215→0.209.
Pre-registered out-of-sample acceptance (fit 2007–17, test 2018–26): coverage 81/80/76%, inside [75%, 85%]; Brier 0.236→0.233 / 0.237→0.230 / 0.215→0.209.
LLM self-reported confidence (n=2,100): median 0.60, clustered on multiples of 0.05.
LLM self-reported confidence (n=2,100): median 0.60, clustered on multiples of 0.05.
Spurious precision (90-day): band width barely changes with effective n (median ~9%), while coverage falls to 42% at effective n=1.
Spurious precision (90-day): band width barely changes with effective n (median ~9%), while coverage falls to 42% at effective n=1.
90-day coverage by era × regime: downtrend column ~54% overall; worst cell GC=F 2007–09 downtrend at 7% (n=14).
90-day coverage by era × regime: downtrend column ~54% overall; worst cell GC=F 2007–09 downtrend at 7% (n=14).
p_below Brier by era, conditional vs same-asset unconditional (90-day): conditional is no better in all 7 eras (gold bear 0.356 vs 0.333).
p_below Brier by era, conditional vs same-asset unconditional (90-day): conditional is no better in all 7 eras (gold bear 0.356 vs 0.333).
How OpenInvest compares to other multi-agent trading frameworks.
How OpenInvest compares to other multi-agent trading frameworks.
Five-stage pre-registered evaluation plan.
Five-stage pre-registered evaluation plan.

Methodology & Deep Dive

Under the Hood: OpenInvest’s 5 Core Systems

Architecture decisions, calibration methods, and validation results.

System 01

1. Dreaming: Sleep-Cycle Memory Integration

To fix the LLM’s zero-session memory, a three-stage nightly job consolidates historical decisions. We apply volatility-aware opportunity cost thresholds to HOLD verdicts to counter over-conservatism.

Stage Mechanism

Starts at midnight. Reads all past verdicts and subsequent market price movements, tagging each with the true market regime on that decision day, generating short-term-recall files.

System 02

2. Probability Table Pathification

Instead of untestable point estimates, we query 20+ years of historical data for the active regime. Paths are sorted into 4 mutually-exclusive categories using volatility units.

90d Forward Path SimulationRegime-conditioned
0%-1 ATRDip (-1.2 ATR)End (+4.5%)
Calibration: small-sample shrinkage (k=80) and band expansion (γ=1.1). Out-of-sample P10–P90 coverage 81/80/76%, inside the pre-registered [75%, 85%] band.
System 03

3. Dual Execution Paths

The same prompts run through two distinct implementations. Disagreements between Claude and DeepSeek are used as a model divergence validation signal rather than a bug.

Coordinator Path (Claude Code)

Local sandboxed subprocesses on the user’s Claude subscription; no API charges.

Sandbox: subprocess isolation · Model: Claude (user subscription)

Direct Path (FastAPI + DeepSeek)

ThreadPool execution for cron-based automation and real-time live SSE stream.

Concurrency: ThreadPoolExecutor · Model: deepseek-v4-flash (default)
System 04

4. Bayesian Optimization & Negative Results

We optimize prompts and allocation rules programmatically. Rather than hiding failed assumptions, we document them to ensure scientific integrity.

Calibration Formulas
λ = eff_n / (eff_n + k)k = 80

Small-sample shrinkage — pull thin conditional buckets toward the asset’s unconditional distribution.

q′ = γ · qγ = 1.1 · P10/P90

Bandwidth expansion on the P10/P90 & downside quantiles — fixes the structural under-coverage.

t ≈ SR · √TSharpe 1 → ~4 yr

Why calibration, not P&L: Sharpe-1 skill takes ~4 years to prove; calibration is testable now.

Reward Signal
Reward Function: Annualized Return - 0.5 × MaxDrawdown + 0.2 × (Sharpe - 1)
Optimization Impact (Reward)
v0 Baseline (100% HOLD)0.00
v1 Prompt (Cash Opportunity)+0.398
Optuna Best / DSPy Optimized+0.422 (Dev accuracy +10pp)
Negative findings

Across 30 Optuna trials, debate rounds (1 vs 3) had no significant effect. TradingAgents-style analysts scored below the naive baseline and failed the pre-registered gate.

System 05

5. Markdown DB & Concurrency Locks

We use YAML frontmatter for schema validation (Pydantic) and the Markdown body for direct LLM ingestion. Atomic transactions are secured via fcntl file locks.

portfolio.mdYAML + GFM Markdown
---
schema_version: 2
cash:
  CNY: 50000
holdings:
  - symbol: NDQ.AX
    units: 50
    avg_cost: 38.50
---

# Current Holdings
- CNY Cash: ¥50,000
- NDQ.AX: 50 units @ A$38.50
Pydantic validation is run prior to atomic file writes
Concurrency Guarantees

Fcntl read-modify-write (RMW) locking prevents race conditions between chat bots, schedulers, and APIs.

Stress Test (0 lost updates)
50 threads × cash +1 CNY = precise 50.00 CNY delta

Reference Documentation

Browse and read the raw, unedited Markdown documentation and Architecture Decision Records (ADRs) directly from our codebase.