Created based on Aurite AI, by Yuqi Ge, Po-Yuan Chen, Chi-Fang Cheng, Shengyun Gao, Lixuan Wei
A five-person USC team project with Aurite AI exploring a multi-agent investment-research workflow: user preferences, market analysis, portfolio construction, and structured reporting.
My contribution — Yuqi (Jeff) Ge: User Preference and Portfolio Optimization agents, connecting user goals and constraints to the portfolio workflow. Start with the user preference agent, portfolio agent, and workflow orchestrator. Other analysis components are team contributions.
Scope: An educational research prototype. Forecasts, confidence values, and allocation scenarios are illustrative outputs; they do not establish validated predictive accuracy or realized investment returns.
- 🤖 AI-Powered Analysis: Advanced machine learning models for stock predictions and macro analysis
- 📊 Real-Time Data: Integration with FRED API, Yahoo Finance, and other financial data sources
- 🎯 Personalized Portfolios: Custom portfolio construction based on user preferences and risk tolerance
- 📈 Multi-Asset Coverage: Stocks, bonds, precious metals, and alternatives analysis
- 🔄 Automated Workflows: End-to-end investment analysis pipeline
- 📋 Professional Reporting: Comprehensive markdown and JSON reports
- ⚙️ Sector Filtering: Respect user preferences for sector inclusion/exclusion
Aurite AI Investment Advisor
├── User Preference Analysis (Risk, Goals, Constraints)
├── Market & Economic Analysis
│ ├── Macro Analysis (FRED API + ML Models)
│ ├── Stock Analysis (NASDAQ-100 + Custom Scoring)
│ ├── Bond Analysis (Multiple Bond Types)
│ └── Gold/Alternatives Analysis
├── Portfolio Construction & Optimization
└── Professional Reporting (MD + JSON)
- Python 3.9 or higher
- Git
- Internet connection for API access
git clone https://github.com/JeffGe911/AIvestor-AuriteAI-Project.git
cd AIvestor-AuriteAI-Project# Create virtual environment
python -m venv .venv
# Activate virtual environment
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activatecd Aurite-AI-Project-
pip install -r requirements.txtFrom the Aurite-AI-Project- working directory, create a local .env file:
# Copy the example and edit with your API keys
cp ../.env.example .envEdit .env file:
# Required: OpenAI API Key for LLM integration
OPENAI_API_KEY=sk-your-openai-api-key-here
# Required: FRED API Key for economic data (free from https://fred.stlouisfed.org/docs/api/api_key.html)
FRED_API_KEY=your-fred-api-key-here
# Optional: Additional API keys for enhanced data
ALPHA_VANTAGE_API_KEY=your-alpha-vantage-key
QUANDL_API_KEY=your-quandl-key# Test FRED API integration
python -c "
from ai_agent.api_client import MacroAPIClient, APIConfig
from dotenv import load_dotenv
import os
load_dotenv()
config = APIConfig()
config.fred_api_key = os.getenv('FRED_API_KEY', '')
print(f'FRED API Key configured: {bool(config.fred_api_key)}')
client = MacroAPIClient(config)
health = client.health_check()
print(f'API Health: {health}')
"Run stock analysis first. The portfolio workflow reads the latest precomputed stock-analysis output in analysis_outputs/; check that the latest file is the input you intend to use.
Run the full end-to-end investment analysis:
python run_30_stock_analysis.py
python master_investment_workflow.pyThis will:
- Collect your investment preferences interactively
- Analyze macro economic conditions using real FRED data
- Perform stock analysis on NASDAQ-100 stocks
- Analyze bonds and precious metals
- Construct optimized portfolio
- Generate professional reports
After execution, inspect the generated reports in analysis_outputs/.
python run_30_stock_analysis.pypython enhanced_macro_analysis.pypython gold_analysis_agent.pyAll analysis results are saved to the analysis_outputs/ directory:
portfolio_report_YYYYMMDD_HHMMSS.md- Professional investment reportcomplete_investment_recommendation_YYYYMMDD_HHMMSS.json- Complete analysis data
user_profile_YYYYMMDD_HHMMSS.json- User preferences and risk profilemacro_analysis_YYYYMMDD_HHMMSS.json- Economic analysis with FRED datastock_analysis_30stocks_YYYYMMDD_HHMMSS.json- Stock analysis resultsbond_analysis_YYYYMMDD_HHMMSS.json- Bond market analysisgold_analysis_YYYYMMDD_HHMMSS.json- Precious metals analysis
The system supports various user preferences:
- Risk Tolerance: Conservative, Moderate, Aggressive
- Investment Goals: Retirement, Wealth, Income, Capital Preservation
- Time Horizon: 1-30+ years
- Sector Preferences: Include/exclude specific sectors
- ESG Preferences: Environmental, Social, Governance considerations
- Liquidity Needs: Short-term access requirements
Edit ai_agent/config.py or use environment variables:
# Example configuration
config = APIConfig()
config.fred_api_key = "your-key"
config.fred_enabled = True
config.yahoo_finance_enabled = True
config.cache_duration = 3600 # 1 hour cache
config.max_retries = 3The system includes several pre-trained models:
- Location:
models/enhanced_nasdaq_model.pkl - Features: 191 engineered features from economic indicators
- Target: NASDAQ-100 quarterly performance prediction
- Confidence: 91.5% for bullish Q4 2025 prediction
- Method: Multi-factor scoring combining technical and fundamental analysis
- Factors: P/E ratios, market cap, sector rotation, momentum
- Output: Buy/Hold/Sell signals with confidence scores
- Purpose: Real-time US economic indicators
- Data: Fed funds rate, unemployment, inflation, GDP, VIX, money supply
- Update Frequency: Daily/Monthly depending on indicator
- Free Tier: 1000 requests/day
- Purpose: Stock prices, company fundamentals
- Data: OHLCV data, financial statements, market cap
- Update Frequency: Real-time during market hours
- Free Tier: No API key required
- Purpose: Natural language analysis and report generation
- Models: GPT-4, GPT-3.5-turbo
- Usage: Investment reasoning, risk analysis, market commentary
# Check API key configuration
python -c "import os; from dotenv import load_dotenv; load_dotenv(); print('FRED key configured:', bool(os.getenv('FRED_API_KEY')))"
# Test API directly
curl "https://api.stlouisfed.org/fred/series/observations?series_id=GDP&api_key=YOUR_KEY&limit=1&file_type=json"# Ensure you're in the correct directory and virtual environment is activated
cd Aurite-AI-Project-
python -c "import sys; print(sys.path)"# Reinstall requirements
pip install -r requirements.txt --force-reinstallCheck the console output for detailed error messages. The system uses loguru for comprehensive logging.
The repository includes example portfolio reports and an integration summary. They demonstrate workflow outputs and component integration, rather than validated investment performance.
- Processing coverage is not predictive accuracy. The stock agent computes
success_rateas generated predictions divided by input symbols. Its error path can append a neutral fallback prediction, so that ratio may include fallback results. See the implementation. - Confidence is not measured accuracy. A model's confidence for a forecast is distinct from out-of-sample accuracy or a calibrated probability.
- Returns and allocation scenarios are illustrative. Generated scenario values are not realized investment returns.
- Further evaluation: document time-based holdouts, benchmark comparisons, fallback frequency, data freshness, and measured API availability before presenting accuracy or reliability claims.
- API Keys: Stored in
.envfile (never commit to version control) - Data: No personal financial data stored permanently
- Caching: Economic data cached for 1 hour to reduce API calls
- Output: All reports saved locally only
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Install development dependencies
pip install -r requirements.txt
pip install pytest black flake8
# A repository-level tests/ directory is not included in this snapshot.
# Inspect sample outputs and integration notes; a reproducible test suite remains future work.
# Format code
black .This project is licensed under the MIT License - see the LICENSE file for details.
- Federal Reserve Economic Data (FRED) for economic indicators
- Yahoo Finance for stock market data
- OpenAI for natural language processing
- Scikit-learn for machine learning models
- Pandas/Numpy for data processing
For questions, issues, or feature requests:
- Check the Troubleshooting section
- Search existing Issues
- Create a new issue with detailed information
- Real-time portfolio monitoring
- Options and derivatives analysis
- International market expansion
- Advanced backtesting framework
- Web-based dashboard
- Mobile app integration
Built with ❤️ by the Aurite AI Team