Multi-agent investment advisor that reads a bank statement and builds a portfolio around your actual cash flow.
Most retail investors get generic advice that ignores what their money is actually doing. InvestAI reads a raw bank statement, pulls out income and spending patterns, and builds a portfolio that respects the user's real constraints.
It runs as a multi-agent pipeline: separate agents handle extraction, analysis, and allocation, and they validate each other's output before anything reaches the user. The final allocation comes with the reasoning behind it, so it's explainable instead of a black box.
Hosted on Render's free tier, so the first request may take ~30 seconds to wake the service.
- Statement parsing — extracts transactions, income, and recurring spend from an uploaded statement.
- Profile agent — turns raw transactions into a cash-flow profile and risk envelope.
- Allocation agent — proposes an allocation that fits the available surplus and constraints.
- Validation agent — checks the allocation against the profile and flags anything inconsistent before it's shown.
Python · LangGraph (agent orchestration) · LangChain · an LLM backend (Hugging Face / API) · PyTorch.
This is a working demonstration, not a benchmarked system — it hasn't been evaluated on a labelled held-out set, so I'm not reporting an accuracy figure I can't yet stand behind. What's verifiable from the code:
- Deterministic safety rails. Halal screening and final portfolio validation run with zero LLM calls. Every allocation must sum to 100% (±0.5%) and stay within per-risk-band caps (e.g. a moderate profile allows max 60% equity / min 5% cash). If the LLM's proposal violates a constraint the system auto-repairs it, and if that fails it falls back to a precomputed heuristic portfolio — the model cannot bypass these checks.
- 4-agent pipeline. Profiler → Researcher → Halal Screener → Builder, each with a single responsibility and validated data contracts between them.
- End-to-end latency of roughly 15–45 seconds per recommendation, dominated by LLM response time.
Next step: a labelled evaluation (statement-parsing accuracy and validation catch-rate on a held-out set). Those numbers will be added here once measured.
git clone https://github.com/oa07610/InvestAI.git
cd InvestAI
pip install -r requirements.txt
cp .env.example .env # add your model/API keys here — never commit the real .env
python app.pyBuilt as a demonstration of multi-agent design, not financial advice. MIT licensed.