Metadata-Version: 2.5
Name: openinvest
Version: 0.42.4
Summary: Investment runtime built for AI agents — 4-role LLM investment committee, portfolio ledger, decision accounting, MCP server
Project-URL: Homepage, https://github.com/longsizhuo/openInvest
Project-URL: Documentation, https://github.com/longsizhuo/openInvest/tree/main/docs/wiki
Project-URL: Repository, https://github.com/longsizhuo/openInvest
Project-URL: Issues, https://github.com/longsizhuo/openInvest/issues
Project-URL: Changelog, https://github.com/longsizhuo/openInvest/blob/main/CHANGELOG.md
License-Expression: MIT
License-File: LICENSE
Keywords: agent,claude,investing,investment-committee,llm,mcp,portfolio,trading-journal
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.13
Requires-Dist: akshare<2,>=1.18.64
Requires-Dist: apscheduler<4,>=3.11.2
Requires-Dist: beautifulsoup4<5,>=4.14.3
Requires-Dist: croniter<7,>=6.2.2
Requires-Dist: ddgs<10,>=9.10.0
Requires-Dist: fastapi<1,>=0.115
Requires-Dist: feedparser<7,>=6.0.10
Requires-Dist: lxml<7,>=6.0.2
Requires-Dist: markdown<4,>=3.11
Requires-Dist: mcp<2,>=1.28.1
Requires-Dist: nh3<1,>=0.3.7
Requires-Dist: openai<3,>=1.45
Requires-Dist: optuna<5,>=4.0
Requires-Dist: pandas-stubs~=2.3.3
Requires-Dist: pandas<3,>=2.3.3
Requires-Dist: python-dotenv<2,>=1.0.1
Requires-Dist: python-frontmatter<2,>=1.1.0
Requires-Dist: requests<3,>=2.32.5
Requires-Dist: sqlite-vec<1,>=0.1.6
Requires-Dist: urllib3<3,>=2.2
Requires-Dist: uvicorn[standard]<1,>=0.32
Requires-Dist: yfinance<2,>=0.2.66
Description-Content-Type: text/markdown

# openInvest

<!-- mcp-name: io.github.longsizhuo/openinvest -->

**An investment runtime built for AI agents.** Your agent knows you — openInvest knows investing.

openInvest runs a 4-role LLM investment committee (Macro Strategist, Quant Analyst, Risk Officer, CIO) that debates any asset and returns a BUY / ACCUMULATE / HOLD / TRIM / SELL verdict with a written memo — plus portfolio tracking, a decision ledger, and full decision-accounting (which advice you followed, what happened after).

It is **not a chatbot**. Conversation, memory, and personalization stay in your agent (Claude Code, Codex, Hermes, OpenClaw, Cursor, or any script); openInvest provides the investing capabilities behind it.

## Install & run

```bash
# no install needed — uvx fetches and caches it
INVEST_HOME=~/openInvest uvx openinvest status

# or install it
pip install openinvest
```

`INVEST_HOME` is your data directory (portfolio, ledgers, `.env`). All state lives there — the package itself is stateless.

### First-time setup

```bash
uvx openinvest init          # interactive onboarding (or `--from-stdin` for agents)
uvx openinvest doctor        # health check
```

### As an MCP server (recommended for agents)

Tools for portfolio read/write, live prices, the decision ledger, and the committee — over stdio (or `openinvest-mcp --http` for a remote streamable-HTTP server, BETA):

```bash
claude mcp add openinvest -e INVEST_HOME=~/openInvest -- uvx openinvest-mcp
```

Read tools carry `readOnlyHint`; money-moving tools (`buy`, `sell`, `deposit`, `withdraw`) carry `destructiveHint`, so MCP clients gate them behind confirmation.

### As an agent plugin (Claude Code / Codex / Hermes)

Skills (committee orchestration protocol) + MCP server, bundled:

```
# 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
hermes plugins install longsizhuo/openInvest/plugin --enable
```

## What it does

- **Investment committee** — 4 LLM roles debate any `yfinance` symbol (equities, ETFs, crypto, commodities, any currency). Two execution paths: *Coordinator* (your agent plays the roles — no API key) or *Direct* (backend LLM, needs `DEEPSEEK_API_KEY`).
- **Portfolio management** — multi-currency cash + holdings with an append-only, fcntl-locked ledger. Never places real orders.
- **Decision accounting** — every verdict is joined at read time with rule interventions, your executions (or refusals, with reasons), and post-hoc PnL. Ask it: *"How often did I actually follow the committee?"*
- **Discipline ledger** — counterfactual PnL of what the safety rules blocked.

## CLI

```bash
uvx openinvest status                    # portfolio + live P&L
uvx openinvest run_committee GC=F        # one-shot committee verdict
uvx openinvest decisions --days 90       # decision ledger + adoption rate
uvx openinvest record_execution 2026-07-03/GC=F --rejected --reason "too pricey"
uvx openinvest buy --symbol AAPL --units 10 --price 210 --currency USD
```

## Disclaimer

LLM-driven decision support — **not investment advice**. LLMs make mistakes and get overconfident. openInvest never auto-trades; its ledger is a local SQLite record with no connection to any brokerage or payment system. Past performance does not predict future returns.

## Links

- [Repository & full docs (中文)](https://github.com/longsizhuo/openInvest)
- [Wiki](https://github.com/longsizhuo/openInvest/tree/main/docs/wiki)
- [RFC: Agent-Native Investment Runtime](https://github.com/longsizhuo/openInvest/issues/133)
- License: MIT
