app/backend/README.md
This project is currently a work in progress. To track progress, please get updates here.
This is the backend server for the AI Hedge Fund project. It provides a simple REST API to interact with the AI Hedge Fund system, allowing you to run the hedge fund through a web interface.
This backend project is a FastAPI application that serves as the server-side component of the AI Hedge Fund system. It exposes endpoints for running the hedge fund trading system and backtester.
This backend is designed to work with a future frontend application that will allow users to interact with the AI Hedge Fund system through their browser.
git clone https://github.com/virattt/ai-hedge-fund.git
cd ai-hedge-fund
curl -sSL https://install.python-poetry.org | python3 -
# From the root directory
poetry install
# Create .env file for your API keys (in the root directory)
cp .env.example .env
# For running LLMs hosted by openai (gpt-4o, gpt-4o-mini, etc.)
OPENAI_API_KEY=your-openai-api-key
# For running LLMs hosted by groq (deepseek, llama3, etc.)
GROQ_API_KEY=your-groq-api-key
# For getting financial data to power the hedge fund
FINANCIAL_DATASETS_API_KEY=your-financial-datasets-api-key
To run the development server:
# Navigate to the backend directory
cd app/backend
# Start the FastAPI server with uvicorn
poetry run uvicorn main:app --reload
This will start the FastAPI server with hot-reloading enabled.
The API will be available at:
POST /hedge-fund/run: Run the AI Hedge Fund with specified parametersGET /ping: Simple endpoint to test server connectivityapp/backend/
āāā api/ # API layer (future expansion)
āāā models/ # Domain models
ā āāā __init__.py
ā āāā schemas.py # Pydantic schema definitions
āāā routes/ # API routes
ā āāā __init__.py # Router registry
ā āāā hedge_fund.py # Hedge fund endpoints
ā āāā health.py # Health check endpoints
āāā services/ # Business logic
ā āāā graph.py # Agent graph functionality
ā āāā portfolio.py # Portfolio management
āāā __init__.py # Package initialization
āāā main.py # FastAPI application entry point
This project is for educational and research purposes only.
By using this software, you agree to use it solely for learning purposes.