Skip to content
Back to search

openinvest

openInvest — self-hosted multi-asset AI investment committee. Ships the daily-use + first-time-setup agent skills plus an MCP server; backend installs from PyPI via uvx on first call.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/longsizhuo/openInvest with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/longsizhuo/openInvest'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/longsizhuo--openinvest/badge.svg)](/listings/longsizhuo--openinvest)

HTML

<a href="/listings/longsizhuo--openinvest"><img src="/api/listings/longsizhuo--openinvest/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

1. Integrate with your agent (Recommended)

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](docs/wiki/20-agent-usage-tutorial.md)).

2. Standalone — MCP server or CLI (no clone needed)

The backend ships on [PyPI](https://pypi.org/project/openinvest/); `~/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: 1. Detecting the `memory/` state storage path and `.env` configuration. 2. 5-dimensional profiling (Legal name, Risk capacity, Debt structure, Initial holdings, and optional keys). 3. Running static data migration to immediately generate your first asset exposure memo.

> 💡 **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](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.)

3. Serverless Self-Hosting (GitHub Actions)

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.

1. **Fork this repository** and change its visibility to **Private** (Settings -> Visibility). 2. Run `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

3. In your fork's **Settings -> Secrets and variables -> Actions**, add the following Secrets: * `LLM_API_KEY` (or `DEEPSEEK_API_KEY`): API key to run the committee. * `EMAIL_SENDER` / `EMAIL_PASSWORD`: Gmail address + [App Password](https://support.google.com/accounts/answer/185833). * `DIGEST_EMAIL_TO`: Recipient email address. 4. **Enable Workflows** under the **Actions** tab. The workflow runs automatically at 10:00 AM (Beijing time) daily; you can also manually trigger `daily-report` via **Run workflow**.

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 17 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. {
  2. "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
  3. "name": "openinvest",
  4. "description": "openInvest — self-hosted multi-asset AI investment committee. Ships the daily-use + first-time-setup agent skills plus an MCP server; backend installs from PyPI via uvx on first call.",
  5. "owner": {
  6. "name": "longsizhuo",
  7. "url": "https://github.com/longsizhuo"
  8. },
  9. "plugins": [
  10. {
  11. "name": "invest",
  12. "source": "./plugin",
  13. "category": "productivity",
  14. "description": "View portfolio + live prices, track any yfinance symbol, and run a 4-role LLM committee for buy/sell verdicts. Bundles an MCP server (decision accounting incl.); backend installs from PyPI via uvx — no clone, no venv."
  15. }
  16. ]
  17. }
README.md · README · 240 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <div align="center">
  2. <img width="120" height="120" alt="owl-02-lineart-gold" src="https://github.com/user-attachments/assets/e4c1efa0-026a-4777-ae62-48b9b0be435c" />
  3. # openInvest
  4. **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).**
  5. [![Python](https://img.shields.io/badge/Python-3.13+-3776AB?logo=python&logoColor=white)](https://www.python.org/)
  6. [![Agents](https://img.shields.io/badge/Agents-Claude%20Code%20%7C%20Codex%20%7C%20Hermes%20%7C%20OpenClaw-informational)](docs/wiki/20-agent-usage-tutorial.md)
  7. [![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
  8. [![Stars](https://img.shields.io/github/stars/longsizhuo/openInvest?style=social)](https://github.com/longsizhuo/openInvest)
  9. [![Glama MCP server](https://glama.ai/mcp/servers/longsizhuo/openInvest/badges/score.svg)](https://glama.ai/mcp/servers/longsizhuo/openInvest)
  10. [📚 Full Architecture Wiki](docs/wiki/README.md) · [🇨🇳 中文版](README_zh.md)
  11. </div>
  12. ---
  13. ## What is OpenInvest?
  14. OpenInvest is a self-hosted investment decision engine built for modern AI agents.
  15. 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.
  16. ---
  17. ## Account Performance & PnL
  18. <div align="center">
  19. <img src="https://raw.githubusercontent.com/longsizhuo/openInvest/pnl-data/docs/pnl_chart.svg" alt="PnL chart" width="100%"/>
  20. <sub>Client-recorded account calculations, subject to source reconciliation and publication checks. Original records are preserved for audit; this chart does not establish forecasting performance. See the <a href="https://github.com/longsizhuo/openInvest/tree/pnl-data">pnl-data branch</a>.</sub>
  21. <br/>
  22. <sub>When qualified data is available, the chart shows the account's time-weighted return and same-window benchmarks. Source validity, decision quality and economic value are assessed separately; see <a href="docs/wiki/adr/028-evidence-integrity-and-decision-objective.md">ADR-028</a>.</sub>
  23. <br/>
  24. <sub>Self-hosted instances use their own ledger. Publishing requires at least two distinct qualified calculation receipts and a matching artifact manifest. Estimated, simulated and unverified historical records remain available for audit; the public SVG contains no holdings or quantities.</sub>
  25. </div>
  26. * **Benchmark Portfolio**: The system introduces 8 standard control benchmarks across 4 quadrants (AI advisors / Mutual funds / Wealth management / Broad market index). For details on the comparison methodology and data cleaning logic, see [docs/wiki/README.md](docs/wiki/README.md).
  27. ---
  28. ## Research & Falsification
  29. **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](docs/verdict_accuracy.md).
  30. 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.
  31. | Test | Result | Verdict |
  32. |---|---|---|
  33. | Q1 cross-sectional stock picking | 6 features, mean-IC 0.025–0.067, Holm-corrected **p=0.397** | No significant stock-picking signal |
  34. | M1 multivariate GBM (out-of-sample) | mean OOS IC **+0.003**, p=0.925 | Feature combination doesn't help either — no signal |
  35. | 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 |
  36. | 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 |
  37. | Positive control | A cheating perfect-foresight timing signal scores **DSR = 1.00** | The harness can detect a real signal |
  38. 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.
  39. Details: [experiments/signal-eval/README.md](experiments/signal-eval/README.md) · [docs/verdict_accuracy.md](docs/verdict_accuracy.md) · [ADR-022](docs/wiki/adr/022-backtest-memory-contamination-and-holdout-discipline.md) · [ADR-023](docs/wiki/adr/023-honest-positioning-not-alpha.md)
  40. ---
  41. ## Product Philosophy
  42. 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.
  43. 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.
  44. ```
  45. User
  46. │
  47. ┌───────────┴───────────┐
  48. ▼ ▼
  49. Your Agent OpenInvest
  50. (User Understanding) (Market Understanding)
  51. │ │
  52. └───────────┬───────────┘
  53. ▼
  54. Better Investment Decisions
  55. ```
  56. > **Your agent knows you. OpenInvest knows investing.**
  57. ### Avoiding User Ownership
  58. 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.
  59. ---
  60. ## Features
  61. * **Multi-Agent Investment Committee**: Isolated analysis and round-rebuttal debate.
  62. * **Coordinator-Worker Architecture**: Prevents context contamination and role hallucination.
  63. * **Information Isolation**: Rigidly blocks quant and risk analysts from out-of-boundary contexts.
  64. * **Auditable Decision Trail**: Clean logs showing exactly "why" each decision was made.
  65. * **Markdown-as-a-Database**: Frontmatter (YAML) + Markdown (Body) as the single source of truth.
  66. * **Long-Horizon Backtesting**: Built-in test harness with lookahead bias protections.
  67. * **Dreaming-Based Memory Consolidation**: Nightly memory distillation to prevent context drift.
  68. * **Self-Hosted / Zero-Cost**: Powered directly by your local agent's reasoning resources.
  69. * **Agent Skill**: Lightweight plugin for Claude Code / Codex / Hermes / OpenClaw, with interactive bootstrap wizard.
  70. * **Automated Deployment**: GitHub Actions workflow to run the committee and email reports daily.
  71. ---
  72. ## Quick Start
  73. ### 1. Integrate with your agent (Recommended)
  74. 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:
  75. ```bash
  76. # Claude Code
  77. /plugin marketplace add longsizhuo/openInvest
  78. /plugin install invest@openinvest
  79. # Codex
  80. codex plugin marketplace add longsizhuo/openInvest
  81. codex plugin add invest@openinvest
  82. # Hermes Agent (official plugin catalog)
  83. hermes plugins install openinvest --enable
  84. # older Hermes without the catalog: hermes plugins install longsizhuo/openInvest/plugin --enable
  85. # OpenClaw
  86. openclaw plugins install clawhub:openinvest
  87. ```
  88. Any other MCP client: register the MCP server from step 2 below (full walkthrough in the [agent tutorial](docs/wiki/20-agent-usage-tutorial.md)).
  89. ### 2. Standalone — MCP server or CLI (no clone needed)
  90. The backend ships on [PyPI](https://pypi.org/project/openinvest/); `~/openInvest` holds only your data:
  91. ```bash
  92. # MCP (any MCP client; add --http for a remote streamable-HTTP server — BETA)
  93. claude mcp add openinvest -e INVEST_HOME=~/openInvest -- uvx openinvest-mcp
  94. # or plain CLI
  95. INVEST_HOME=~/openInvest uvx openinvest status
  96. ```
  97. Send `set up invest` (or `帮我初始化 invest`) to any skill-enabled AI terminal. The system will trigger an interactive bootstrap wizard to guide you through:
  98. 1. Detecting the `memory/` state storage path and `.env` configuration.
  99. 2. 5-dimensional profiling (Legal name, Risk capacity, Debt structure, Initial holdings, and optional keys).
  100. 3. Running static data migration to immediately generate your first asset exposure memo.
  101. > 💡 **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.
  102. For self-hosting details, see [docs/QUICK_START.md](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.)
  103. ### 3. Serverless Self-Hosting (GitHub Actions)
  104. Run the committee automatically via GitHub Actions and receive daily digest emails.
  105. > ⚠️ **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.
  106. 1. **Fork this repository** and change its visibility to **Private** (Settings -> Visibility).
  107. 2. Run `set up invest` locally to generate the initial `memory/` folder, then commit and push it to your private fork:
  108. ```bash
  109. git add -f memory/ && git commit -m "chore: init memory state" && git push
  110. ```
  111. 3. In your fork's **Settings -> Secrets and variables -> Actions**, add the following Secrets:
  112. * `LLM_API_KEY` (or `DEEPSEEK_API_KEY`): API key to run the committee.
  113. * `EMAIL_SENDER` / `EMAIL_PASSWORD`: Gmail address + [App Password](https://support.google.com/accounts/answer/185833).
  114. * `DIGEST_EMAIL_TO`: Recipient email address.
  115. 4. **Enable Workflows** under the **Actions** tab. The workflow runs automatically at 10:00 AM (Beijing time) daily; you can also manually trigger `daily-report` via **Run workflow**.
  116. ---
  117. ## Architecture & Multi-Agent Orchestration
  118. 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):
  119. ```
  120. [ Macro Data Injection ]
  121. │
  122. ▼ 1. Macro Alignment Context
  123. ┌──────────────────────────┐
  124. │ Macro Strategist │ (VIX / Interest rate spread / Currency momentum)
  125. └─────────────┬────────────┘
  126. │
  127. ▼ 2. Async Multi-Dimensional Scrutiny (Async DAG)
  128. ┌─────────────┴────────────┐
  129. ▼ ▼
  130. ┌──────────────────┐ ┌──────────────────┐
  131. │ Quant Analyst │ │ Risk Officer │
  132. │ (RSI / Momentum) │ │ (Concentration) │
  133. │ │ │ │
  134. │ 🛑 No Holdings │ │ 🛑 No Indicators │
  135. └─────────┬────────┘ └─────────┬────────┘
  136. │ │
  137. └─────────────┬─────────────┘
  138. │
  139. ▼ 3. Round 2 Rebuttal & Cross-Challenge
  140. │ Mutual feedback loop for signal correction
  141. ▼
  142. ┌──────────────────────────────────────────────┐
  143. │ Chief Investment Officer (CIO) │
  144. └───────────────────────┬──────────────────────┘
  145. │
  146. ▼ 4. Deterministic State Persistence
  147. [ BUY / ACCUMULATE / HOLD / TRIM / SELL ]
  148. ```
  149. 1. **Macro Strategist**: Assesses the global macro landscape (VIX, yield curve spread, core currency matrix) to establish the portfolio's risk threshold.
  150. 2. **Quant Analyst**: A pure mathematical momentum and technical indicator filter. **Strictly blocked from knowing portfolio holdings** to eliminate human attachment and loss-aversion biases.
  151. 3. **Risk Officer**: Focuses entirely on tail risks (drawdown buffers, concentration limits, solvency multipliers). **Strictly blocked from technical indicators** to make objective asset exposure rulings.
  152. 4. **Round 2 Rebuttal**: Quant and Risk analysts are fed each other's Round 1 reports in Round 2, challenging boundaries until signals converge or safety valves trigger.
  153. 5. **CIO (Chief Investment Officer)**: Synthesizes the audited reports and outputs a structured `Verdict` (BUY / ACCUMULATE / HOLD / TRIM / SELL) with a confidence level. **No auto-order execution occurs**; final action remains strictly up to the human auditor.
  154. Key trade-offs behind this design are recorded as ADRs in [docs/wiki/adr/](docs/wiki/adr/) (24 to date), including rulings that overturned our own earlier designs — [ADR-007](docs/wiki/adr/007-few-shot-retirement.md) retired the few-shot CIO route, and [ADR-009](docs/wiki/adr/009-no-ta-style-analyst-agents.md) rejected TA-style analyst agents after a pre-registered experiment.
  155. ---
  156. ## Core Design
  157. * **Coordinator-Worker Pattern**: Workers operate in isolated namespaces. Boundary constraints are hardcoded at the framework layer in Python to prevent attention contamination in large multi-role prompts.
  158. * **Markdown-as-a-Database**: The system uses Frontmatter (YAML) + Markdown (Body) as the single source of truth. Leveraging `fcntl.flock` process file locks and temporary atomic file replacement, it provides a tamper-proof investment audit trail natively tracked by Git.
  159. * **Three-Phase Dreaming Consolidation**: Distills daily decisions against actual market outcomes nightly (Light Sleep $\rightarrow$ REM $\rightarrow$ Deep Sleep) to consolidate long-term insights, preventing Large Language Model (LLM) context drift over long execution spans.
  160. ---
  161. ## Configuration
  162. The system defaults to DeepSeek endpoints and supports any standard OpenAI-compatible API. LLM provider setup and all tunable runtime overrides ([ADR-017](docs/wiki/adr/017-config-via-api.md)) are documented in [docs/wiki/22-configuration.md](docs/wiki/22-configuration.md).
  163. ---
  164. ## Disclaimers & Backtest Limitations
  165. 1. **No Financial Advice**: This system is a decision-support tool powered by LLMs. Output memos represent simulated reasoning based on deterministic data and do not constitute asset allocation advice.
  166. 2. **Backtest Time-Lock & Lookahead Guard**: The backtest engine (`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.
  167. ---
  168. ## Acknowledgments
  169. * **Jawz**: Thank you for supporting openInvest's continued development.
  170. * **Tencent Cloud**: Thank you for supporting openInvest's continued development.
  171. * [Equibles](https://equibles.com) — Optional data provider for A-share and Hong Kong financial statements, and a daily-price fallback when Yahoo Finance is unreachable. Yahoo Finance stays the default; set your own free `EQUIBLES_API_KEY` to turn it on ([setup](docs/wiki/22-configuration.md)).
  172. * [Xiaomi MiMo](https://mimo.mi.com/) — Special thanks to MiMo Quantitative Lab for sponsoring production-grade high-performance LLM inference (powering `mimo-v2.5-pro` long-horizon sweeps).
  173. * [OpenClaw Dreaming Guide](https://dev.to/czmilo/openclaw-dreaming-guide-2026-background-memory-consolidation-for-ai-agents-585e) — Theoretical foundation for the three-phase sleep-cycle memory distillation framework.
  174. ---
  175. ## License
  176. This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.