Investment runtime for AI agents — LLM investment committee, portfolio ledger, decision accounting
A self-hosted investment decision engine built for modern AI agents. Multi-agent information isolation and cross-challenge protocol, providing an auditable decision trail (Audit Trail).
OpenInvest is a self-hosted investment decision engine built for modern AI agents.
It provides a verifiable investment committee, evidence-based reasoning, long-horizon backtesting, and auditable decision records. Instead of replacing Claude Code, Codex, Hermes, or OpenClaw, OpenInvest is designed to power them.
Upper half: 30-day total-equity curve (whole account, time-weighted so deposits/withdrawals don't count as returns, rebased to 100 at the window start) · Lower half: same-window return against 8 benchmark assets (transparent disclosure, not an alpha claim—the committee's proven value is discipline and transparency, not excess return, see ADR-023)
📌 Note: The current chart shows the author's live production portfolio. After self-hosting, the same job draws your own total-equity curve from your own ledger (memory/portfolio_history.jsonl) — any holdings, no fixed assets, no symbols or quantities in the public SVG. It appears once the ledger spans 2 trading days.
System Self-Disclosure: This system is an auditing tool to eliminate human investment cognitive biases and enforce reasoning transparency, not a return-amplifying black box. Latest automated audit (docs/verdict_accuracy.md): Directional verdicts (excluding HOLD) have a true hit rate of 42.2% (n=56, below random); HOLD accounts for 56% of all decisions. The system's value lies in transparency and discipline (mostly staying inactive, low turnover), not directional prediction. Detailed log stream can be found in docs/verdict_accuracy.md.
This project systematically attempts to falsify its own edge and publishes negative results as-is. The deterministic features the committee reads, and the timing signals around them, were tested against pre-registered statistical gates — none survived as tradable alpha.
| Test | Result | Verdict |
|---|---|---|
| Q1 cross-sectional stock picking | 6 features, mean-IC 0.025–0.067, Holm-corrected p=0.397 | No significant stock-picking signal |
| M1 multivariate GBM (out-of-sample) | mean OOS IC +0.003, p=0.925 | Feature combination doesn't help either — no signal |
| Q2 gold MA200 trend | p_holm=0.016, significant — but trend_dca shows it is beta, not tradable alpha: timing terminal value 3.07 vs 15.10 buy-and-hold, Sharpe +0.36 vs +0.68, max drawdown deeper (−57% vs −44%) | Statistically significant, economically untradable |
| Per-asset multi-signal families | 3 assets × 4 signal families × parameter grid = 24 variants per asset; after costs + DSR deflation, none passes DSR > 0.95 | No tradable signal in any family |
| Positive control | A cheating perfect-foresight timing signal scores DSR = 1.00 | The harness can detect a real signal |
Methodology: Newey-West HAC t-statistics, Deflated Sharpe Ratio (Bailey & López de Prado 2014, re-derived equation by equation), Holm correction, zero lookahead, and LLM training-cutoff probes.
Details: experiments/signal-eval/README.md · docs/verdict_accuracy.md · ADR-022 · ADR-023
Most AI investment assistants try to become better chatbots. OpenInvest instead builds a transparent, verifiable, and auditable decision engine that plugs into personal agents such as Claude Code, Codex, Hermes, and OpenClaw — every improvement in those agents automatically makes OpenInvest more capable.
The division of labor is deliberate: your agent handles long-term memory, natural conversation, and user understanding; OpenInvest handles the verifiable investment committee, evidence-based reasoning, long-horizon backtesting, and auditable decision records.
User
│
┌───────────┴───────────┐
▼ ▼
Your Agent OpenInvest
(User Understanding) (Market Understanding)
│ │
└───────────┬───────────┘
▼
Better Investment Decisions
Your agent knows you. OpenInvest knows investing.
OpenInvest intentionally avoids "owning" the user. Most AI products try to own everything—memory, persona, chat history, and workspaces. OpenInvest takes a back seat. It exposes clean APIs, CLI commands, and agent skills (Claude Code / Codex / Hermes / OpenClaw), letting your primary agent manage the conversation and context while OpenInvest powers the underlying investment intelligence.
Add the lightweight skill from your agent's plugin registry. The host agent will automatically pull the core code and align dependencies on first run:
# Claude Code
/plugin marketplace add longsizhuo/openInvest
/plugin install invest@openinvest
# Codex
codex plugin marketplace add longsizhuo/openInvest
codex plugin add invest@openinvest
# Hermes Agent (official plugin catalog)
hermes plugins install openinvest --enable
# older Hermes without the catalog: hermes plugins install longsizhuo/openInvest/plugin --enable
# OpenClaw
openclaw plugins install clawhub:openinvest
Any other MCP client: register the MCP server from step 2 below (full walkthrough in the agent tutorial).
The backend ships on PyPI; ~/openInvest holds only your data:
# MCP (any MCP client; add --http for a remote streamable-HTTP server — BETA)
claude mcp add openinvest -e INVEST_HOME=~/openInvest -- uvx openinvest-mcp
# or plain CLI
INVEST_HOME=~/openInvest uvx openinvest status
Send set up invest (or 帮我初始化 invest) to any skill-enabled AI terminal. The system will trigger an interactive bootstrap wizard to guide you through:
memory/ state storage path and .env configuration.💡 Zero-Cost Execution: In skill interactive mode, the committee's underlying reasoning relies entirely on the host agent's (e.g. Claude Code) reasoning pipeline. No third-party API Key is consumed. You only need to configure an API key when setting up automated crons or calling independent Web APIs.
For self-hosting details, see docs/QUICK_START.md. (The bundled Web GUI was retired on 2026-07-05 — all capabilities are exposed via CLI/MCP; a standalone frontend may return later.)
Run the committee automatically via GitHub Actions and receive daily digest emails.
⚠️ Fork must be set to Private: State files (holdings, verdicts) will be committed back to your fork. Public forks will leak your private financial information.
set up invest locally to generate the initial memory/ folder, then commit and push it to your private fork:
git add -f memory/ && git commit -m "chore: init memory state" && git push
LLM_API_KEY (or DEEPSEEK_API_KEY): API key to run the committee.EMAIL_SENDER / EMAIL_PASSWORD: Gmail address + App Password.DIGEST_EMAIL_TO: Recipient email address.daily-report via Run workflow.openInvest does not run a mock debate in a single LLM session. The system enforces an Information Isolation Contract at the core/committee/ layer, orchestrating 4 independent LLM processes in a directed acyclic graph (DAG):
[ Macro Data Injection ]
│
▼ 1. Macro Alignment Context
┌──────────────────────────┐
│ Macro Strategist │ (VIX / Interest rate spread / Currency momentum)
└─────────────┬────────────┘
│
▼ 2. Async Multi-Dimensional Scrutiny (Async DAG)
┌─────────────┴────────────┐
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ Quant Analyst │ │ Risk Officer │
│ (RSI / Momentum) │ │ (Concentration) │
│ │ │ │
│ 🛑 No Holdings │ │ 🛑 No Indicators │
└─────────┬────────┘ └─────────┬────────┘
│ │
└─────────────┬─────────────┘
│
▼ 3. Round 2 Rebuttal & Cross-Challenge
│ Mutual feedback loop for signal correction
▼
┌──────────────────────────────────────────────┐
│ Chief Investment Officer (CIO) │
└───────────────────────┬──────────────────────┘
│
▼ 4. Deterministic State Persistence
[ BUY / ACCUMULATE / HOLD / TRIM / SELL ]
Verdict (BUY / ACCUMULATE / HOLD / TRIM / SELL) with a confidence level. No auto-order execution occurs; final action remains strictly up to the human auditor.Key trade-offs behind this design are recorded as ADRs in docs/wiki/adr/ (24 to date), including rulings that overturned our own earlier designs — ADR-007 retired the few-shot CIO route, and ADR-009 rejected TA-style analyst agents after a pre-registered experiment.
fcntl.flock process file locks and temporary atomic file replacement, it provides a tamper-proof investment audit trail natively tracked by Git.The system defaults to DeepSeek endpoints and supports any standard OpenAI-compatible API. LLM provider setup and all tunable runtime overrides (ADR-017) are documented in docs/wiki/22-configuration.md.
scripts/backtest_runner.py) has a hardcoded safety valve: it rejects backtests for decision_date > 2024-06-30 by default (override with --allow-lookahead). Since mainstream foundation models have training cutoff dates around mid-2024, backtesting on later intervals introduces severe Lookahead Bias (model pre-training leakage). Parameter tuning, Optuna sweeps, and prompt optimization must run strictly on historical windows prior to June 30, 2024.mimo-v2.5-pro long-horizon sweeps).This project is licensed under the MIT License - see the LICENSE file for details.
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
uvx openinvestMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-longsizhuo-openinvest": {
"command": "uvx",
"args": [
"openinvest"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceopeninvestpypiopenInvest works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.