Skip to content

Repository files navigation

λ AI Investment Firm

The AI investment firm that thinks like you.

Plug in your philosophy, watch 10 agents run.

Python 3.10+ Claude API License: MIT

10 AI agents. Real market data. Your investment philosophy.

Quick Start · Architecture · Agents · Dashboard · Customize · FAQ


What is this?

An open-source multi-agent system that simulates a complete AI-powered investment firm. 10 specialized agents analyze markets, debate strategy, manage risk, and make decisions — all filtered through your personal investment philosophy.

Unlike other AI trading tools, this system doesn't just analyze markets. It creates a decisional clone of you: an AI CEO (Omega) that reads your philosophy, understands your principles, and ensures every decision aligns with how you think about investing.

Ζ Zeta scans macro conditions → Η Eta reads market sentiment →
Γ Gamma builds strategy → Α Alpha picks stocks & crypto →
Β Beta analyzes fundamentals → Θ Theta sizes positions →
Ε Epsilon backtests → Δ Delta approves or blocks →
Ι Iota audits everything → Ω Omega reviews as CEO

Disclaimer: This is an educational/research project. Not financial advice. Do not trade real money based on this system without your own due diligence.


✨ Key Features

  • 10 specialized AI agents with distinct roles, running a complete investment pipeline
  • Philosophy-driven CEO — Omega reads philosophy.md and makes decisions like you
  • Real market data — yfinance (stocks, crypto), FRED (macro), Fear & Greed Index
  • Claude AI-powered — investment memos, strategy synthesis, CEO reviews
  • Live dashboard — dark-themed HTML dashboard with D3.js charts, real-time feed
  • Dual mode — DEMO (simulated) or LIVE (real data from Python agents)
  • Fully customizable — swap the philosophy, change the stock pool, adjust risk params

🚀 Quick Start

Prerequisites

  • Python 3.10+download
  • pip — comes with Python
  • macOS, Linux, or WSL — Windows users should use WSL

Step 1 — Clone & Install

git clone https://github.com/YOUR_USERNAME/ai-investment-firm.git
cd ai-investment-firm

# Automatic setup (installs deps, creates .env, creates philosophy.md)
bash setup.sh

Or manually:

pip3 install -r requirements.txt
cp .env.example .env
cp philosophy-template.md philosophy.md
mkdir -p data/macro data/sentiment data/internal

Step 2 — Add Your API Keys

Open .env and add your keys:

nano .env   # or use any text editor
ANTHROPIC_API_KEY=sk-ant-xxxxx     # Required — powers 3 agents
FRED_API_KEY=your_key_here          # Recommended — macro data
FINNHUB_API_KEY=your_key_here       # Optional — news & social sentiment
Key Required Free? Get it at
ANTHROPIC_API_KEY Yes Paid (~$0.10/run) console.anthropic.com
FRED_API_KEY Recommended Free fred.stlouisfed.org
FINNHUB_API_KEY Optional Free finnhub.io

Without ANTHROPIC_API_KEY: Beta, Gamma, and Omega fall back to rule-based analysis (works, but less intelligent). Without FRED_API_KEY: Zeta uses yfinance only (fewer macro indicators). Without FINNHUB_API_KEY: Eta skips social sentiment and news (still calculates Fear & Greed).

Step 3 — Write Your Philosophy

This is what makes the system yours. Open philosophy.md and describe how you think about investing:

nano philosophy.md

The template guides you through: portfolio structure, core principles, decision framework, books that shaped you, and forbidden actions. Omega will read this file and filter every decision through your worldview.

Skip this step to use conservative defaults. You can always add it later.

Step 4 — Launch the Dashboard

# Load your API keys and start the server
source .env && python3 server.py

You'll see:

  ╔═══════════════════════════════════════════╗
  ║   λ AI Investment Firm — API Server       ║
  ║   http://localhost:8080                    ║
  ╚═══════════════════════════════════════════╝

Open http://localhost:8080 in your browser.

Step 5 — Run the Agents

In the dashboard:

  1. Click LIVE (top-right toggle) to switch from demo to real mode
  2. Click CONTROLS (top-right button)
  3. Click RUN PIPELINE — all 10 agents execute in sequence (~60s)
  4. Watch the feed fill with real analysis

Or run from terminal (no dashboard needed):

source .env && python3 agents/run_pipeline.py

Step 6 — Explore

  • Feed — watch agents debate in real-time
  • Sidebar — Omega CEO review, macro snapshot, sentiment gauges, strategy, backtest results
  • Reports — click any report for detailed analysis (investment memos, backtest, CEO review)
  • Toggle IT/EN — interface supports Italian and English

Troubleshooting

Problem Solution
ModuleNotFoundError: flask Run pip3 install -r requirements.txt
Port 8080 in use Kill the old process: lsof -ti :8080 | xargs kill
Dashboard shows "Server not reachable" Make sure server.py is running in another terminal
Pipeline hangs for >3 minutes yfinance can be slow — wait, or check your internet
NaN or undefined in dashboard Restart the server — it sanitizes NaN values automatically
Omega says "No philosophy file" Create philosophy.md in the project root

🏗 Architecture

                        ◆ FOUNDER (Human)
                        │ philosophy.md
                        ▼
                   ┌─────────┐
                   │ Ω Omega │ ← CEO — decisional clone
                   │   CEO   │   reads philosophy, reviews everything
                   └────┬────┘
                        │
    ┌───────────────────┼───────────────────┐
    ▼                   ▼                   ▼
┌────────┐      ┌──────────┐       ┌────────────┐
│ Ζ Zeta │      │ Η Eta    │       │ Γ Gamma    │
│ Macro  │      │Sentiment │       │ Strategist │
└───┬────┘      └────┬─────┘       └──────┬─────┘
    │                │                    │
    └────────────────┼────────────────────┘
                     ▼
              ┌──────────┐
              │ Α Alpha  │ ← picks stocks & crypto
              │  Picker  │
              └────┬─────┘
                   ▼
              ┌──────────┐
              │ Β Beta   │ ← deep analysis (Claude AI)
              │ Analyst  │
              └────┬─────┘
                   ▼
         ┌─────────┼──────────┐
         ▼                    ▼
   ┌──────────┐        ┌───────────┐
   │ Θ Theta  │        │ Ε Epsilon │
   │Allocator │        │ Simulator │
   └────┬─────┘        └─────┬─────┘
        │                    │
        └────────┬───────────┘
                 ▼
           ┌──────────┐
           │ Δ Delta  │ ← APPROVES or BLOCKS
           │   Risk   │   (has veto power)
           └────┬─────┘
                ▼
           ┌──────────┐
           │ Ι Iota   │ ← audit trail
           │ Auditor  │
           └──────────┘

Event-Driven, Not Linear

Agents communicate through JSON files. Each agent reads the outputs of previous agents and produces its own. Feedback loops exist:

  • Rejection Cascade — Delta blocks → agents revise
  • Regime Change — Zeta shifts macro → all agents recalibrate
  • Contrarian Mode — Eta detects extreme sentiment → Omega activates

🤖 The 10 Agents

# Agent Role Data Sources Output
1 Ζ Zeta Macro Sentinel FRED API, yfinance Regime classification, market snapshot
2 Η Eta Sentiment Analyst Crypto F&G, VIX proxy, Finnhub Sentiment score, contrarian signals
3 Γ Gamma Strategist All inputs + Claude AI Strategy document, sector allocation
4 Α Alpha Stock Picker yfinance (20 stocks + 15 crypto) Ranked candidates with scores
5 Β Beta Analyst yfinance fundamentals + Claude AI Investment memos (bull/bear/conviction)
6 Θ Theta Allocator Kelly criterion, correlations Position sizing, rebalance plan
7 Ε Epsilon Simulator Historical replay, Monte Carlo Backtest pass rate, stress tests
8 Δ Delta Risk Manager 9 risk checks, veto power APPROVED / REDUCED / BLOCKED
9 Ι Iota Auditor All agent outputs Audit log, meeting minutes, scores
10 Ω Omega CEO philosophy.md + all data + Claude Executive review, fortress compliance

📊 Dashboard

The live dashboard shows all agents working in real-time.

Overview

Dashboard Overview Full dashboard: live feed (left), intelligence sidebar (right)

Live Feed — Agents Working

Live Feed Real-time feed: each agent speaks with its Greek letter and color

Intelligence Sidebar

Sidebar Omega CEO review, macro dashboard, sentiment gauges, strategy card

Investment Memo (Report)

Investment Memo Claude AI-generated investment memo with thesis, bull/bear case, risk factors

CEO Executive Review (Report)

CEO Review Omega reviews every decision through the Founder's philosophy

Pipeline Terminal Output

Pipeline 10 agents running in sequence — from macro analysis to CEO review

DEMO Mode

Demo Mode DEMO mode: simulated agents making decisions with mock data (works offline)

Sections:

  • Feed Live — real-time messages from all 10 agents
  • Sidebar Intelligence — Omega CEO, Macro, Sentiment, Strategy, Backtest, Portfolio, Allocation, Positions
  • Report Library — clickable detailed reports (8 types: Briefing, Sentiment, Strategy, Investment Memo, Allocation, Backtest, CEO Review)
  • Meeting Room — investment committee records with voting
  • Yield Chart — portfolio performance with D3.js

Two modes:

  • DEMO — simulated agents with mock data (works fully offline, no API keys needed)
  • LIVE — real market data from Python agents via Flask API server

🎯 Make It Yours

The Philosophy System

The philosophy.md file is the heart of the system. It's what makes Omega (the CEO) think like you.

cp philosophy-template.md philosophy.md
nano philosophy.md

Fill in:

  • Your portfolio structure (e.g., 60/40, barbell, 33/33/33)
  • Core principles (never sell X, max drawdown Y%)
  • Decision framework (what questions to ask for every trade)
  • Books/mentors that shaped your investing
  • Forbidden actions (what Omega should NEVER do)

Without a philosophy: Omega uses conservative defaults. With your philosophy: Omega becomes your decisional clone.

Stock Pool

Edit agents/config.json to change the 20 stocks and 15 crypto assets that Alpha screens.

Risk Parameters

Delta's risk limits are configurable in agents/delta_risk.py and can be overridden by Zeta's regime-based directives.


📁 Project Structure

ai-investment-firm/
├── server.py                 ← API server (Flask)
├── index.html                ← Live dashboard
├── philosophy.md             ← YOUR investment philosophy
├── philosophy-template.md    ← Template to get started
├── setup.sh                  ← One-click setup
├── requirements.txt          ← Python dependencies
├── .env.example              ← API keys template
│
├── agents/
│   ├── zeta_macro.py         ← Ζ Macro Sentinel
│   ├── eta_sentiment.py      ← Η Sentiment Analyst
│   ├── gamma_strategist.py   ← Γ Strategist
│   ├── alpha_picker.py       ← Α Stock Picker
│   ├── beta_analyst.py       ← Β Analyst
│   ├── theta_allocator.py    ← Θ Portfolio Allocator
│   ├── epsilon_simulator.py  ← Ε Market Simulator
│   ├── delta_risk.py         ← Δ Risk Manager
│   ├── iota_auditor.py       ← Ι Auditor
│   ├── omega_ceo.py          ← Ω CEO
│   ├── run_pipeline.py       ← Full pipeline orchestrator
│   ├── run_*.py              ← Individual agent runners
│   └── config.json           ← Asset universe config
│
└── data/                     ← Generated by agents (gitignored)
    ├── macro/briefing.json
    ├── sentiment/sentiment.json
    └── internal/
        ├── strategy.json
        ├── picks.json
        ├── analyses.json
        ├── allocation.json
        ├── backtest.json
        ├── decisions.json
        ├── portfolio.json
        └── ceo_review.json

🔧 API Endpoints

When running server.py, these endpoints are available:

Method Endpoint Description
GET / Dashboard
GET /api/briefing Zeta macro data
GET /api/sentiment Eta sentiment data
GET /api/strategy Gamma strategy
GET /api/picks Alpha picks
GET /api/analyses Beta analyses
GET /api/allocation Theta allocation
GET /api/backtest Epsilon backtest
GET /api/decisions Delta decisions
GET /api/portfolio Portfolio state
GET /api/all-data Everything in one call
GET /api/status System status + API key check
POST /api/run-pipeline Run full 10-agent pipeline
POST /api/run-agent/<name> Run single agent

❓ FAQ

Does this make real trades? No. It analyzes and recommends. There's no exchange integration. You make the final call.

How much does Claude API cost per pipeline run? ~$0.05-0.15 per run (3 Claude calls: Beta memos, Gamma strategy, Omega review).

Can I use OpenAI instead of Claude? Not yet. The prompts are optimized for Claude. PRs welcome for multi-LLM support.

Does it work without API keys? Partially. Without Claude, Beta/Gamma/Omega fall back to local rule-based analysis. Without FRED, Zeta uses yfinance only. The dashboard DEMO mode works fully offline.

How often should I run the pipeline? Once a day (market hours) is ideal. The agents analyze current market conditions each run.


🤝 Contributing

PRs welcome! Some ideas:

  • Multi-LLM support (OpenAI, Gemini, Ollama)
  • Real broker integration (Alpaca, Interactive Brokers)
  • More sentiment sources (Reddit, Twitter)
  • Mobile-responsive dashboard improvements
  • Backtesting framework improvements

📜 License

MIT License. See LICENSE.


Built with discipline, structure, and AI.

The best time to build your fortress was yesterday. The second best time is now.

About

10 AI agents that think like you. Plug in your investment philosophy, watch them analyze markets, debate strategy, and make decisions. Live dashboard + Claude API + real market data.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages