How faisalnwz01/ai-hedge-fund works
Project type and purpose
• This is a mono-repo containing two delivery targets:
a) A command-line AI Hedge Fund (Python CLI & backtester under src/)
b) A full-stack web application (app/frontend + app/backend)
• It’s a proof-of-concept POC for using multiple LLM-powered agents and financial data APIs to generate simulated trading decisions (educational use only).
File structure
• Top level:
• .env.example, pyproject.toml & tests/ → Python CLI project
• src/ → core CLI code: agents/, backtester.py, main.py, llm/, graph/, tools/, utils/
• app/ → full-stack web app
– app/backend/ → Python FastAPI service (Alembic migrations, SQLAlchemy models, repositories, services, routes)
– app/frontend/ → React/TypeScript SPA (Vite, Tailwind, custom UI components, data & service layers)
– app/run.sh & app/run.bat spin up both frontend & backend
• docker/ → Dockerfile, docker-compose for containerized deployment
README for additional insights
• Two modes of operation: CLI (poetry run python src/main.py or docker run backtest) vs. Web UI (app/run.sh)
• External dependencies: LLM APIs (OpenAI, Groq, Anthropic, local Ollama), financial data APIs
• Persistent state for web app stored in a SQL database (configured via Alembic + database/connection.py)
Essential details
• Every layer and major directory as a component
• Do not omit the LLM and financial-data integrations—they are central to the architecture
• Alembic migrations as part of the Database provisioning
• For the SPA, you may further group UI components vs. state/context providers vs. graph editor modules if space allows