A real-time macroeconomic analytics platform with AI-powered insights and alerts.
MacroMind is a FastAPI-based application that provides real-time economic data analysis and AI-generated insights. The platform fetches economic indicators from the Federal Reserve, analyzes market conditions, and delivers intelligent alerts to help users understand macroeconomic trends.
- ๐ Real-time Economic Data : Automatic fetching and updating of key economic indicators from FRED API
- ๐ค AI-Powered Insights : Intelligent analysis of economic conditions using advanced algorithms
- ๐จ Alert System : Automated alerts for significant economic events and trends
- ๐ RESTful API : Clean, well-documented API endpoints for easy integration
- ๐ Health Monitoring : Built-in health checks and system status monitoring
- ๐ Trading Signals : Basic trading recommendations based on economic conditions
macromind/
โโโ macromind-backend/ # Backend API server
โ โโโ api/ # API endpoints
โ โ โโโ __init__.py
โ โ โโโ health.py # Health check endpoints
โ โ โโโ indicators.py # Economic indicators API
โ โ โโโ insights.py # AI insights and alerts API
โ โโโ app/ # Core application logic
โ โ โโโ __init__.py
โ โ โโโ agent.py # Economic Intelligence Agent
โ โ โโโ config.py # Configuration settings
โ โ โโโ data_fetcher.py # FRED API data fetching
โ โ โโโ models.py # Pydantic data models
โ โ โโโ utils.py # Helper functions
โ โโโ tests/ # Test suite
โ โ โโโ __init__.py
โ โ โโโ test_api.py
โ โ โโโ test_agent.py
โ โโโ .env.example # Environment variables template
โ โโโ .gitignore # Git ignore rules
โ โโโ main.py # Application entry point
โ โโโ requirements.txt # Python dependencies
โ โโโ README.md # This file
โโโ macromind-frontend/ # Frontend application (planned)
GET /api/indicators- Get all economic indicatorsGET /api/indicators/{indicator_name}- Get specific indicator (GDP, UNEMPLOYMENT, INFLATION, FED_FUNDS, CONSUMER_SENTIMENT)
GET /api/insights- Get AI-generated economic insights and analysisGET /api/alerts- Get current economic alerts and warnings
GET /api/health- System health check and statusGET /- API information and available endpoints
- Python 3.8+
- pip or conda
- FRED API key (free from St. Louis Fed)
- Clone the repository:
git clone <repository-url>
cd macromind/macromind-backend- Install dependencies:
pip install -r requirements.txt- Configure environment:
cp .env.example .env
# Edit .env and add your FRED API key- Run the application:
python main.pyThe API will be available at http://localhost:8000
- Visit FRED API Key Registration
- Sign up for a free account
- Request an API key
- Add it to your
.envfile:
FRED_API_KEY=your_actual_api_key_hereOnce the server is running, you can access:
- Interactive API docs :
http://localhost:8000/docs - ReDoc documentation :
http://localhost:8000/redoc - API endpoints :
http://localhost:8000/api/
curl http://localhost:8000/api/indicatorscurl http://localhost:8000/api/insightscurl http://localhost:8000/api/alertscurl http://localhost:8000/api/healthcd macromind-backend
pytest tests/Create a .env file with the following variables:
# Required
FRED_API_KEY=your_fred_api_key_here
# Optional
API_HOST=0.0.0.0
API_PORT=8000
DEBUG=true
LOG_LEVEL=INFOmain.py: FastAPI application entry pointapp/config.py: Configuration and settings managementapp/models.py: Pydantic data models for API responsesapp/agent.py: Economic Intelligence Agent with analysis logicapp/data_fetcher.py: FRED API integration and data fetchingapi/: API endpoint definitions organized by functionality
The AI agent provides:
- Economic Health Assessment : Scores overall economic conditions (strong/moderate/weak)
- Multi-factor Analysis : Evaluates employment, inflation, growth, sentiment, and monetary policy
- Automated Insights : Generates natural language summaries of economic conditions
- Risk Detection : Identifies economic concerns and opportunities
- Alert Generation : Creates warnings for significant economic changes
- Trading Signals : Basic recommendations for bonds, equities, and USD
| Indicator | FRED Series ID | Description |
|---|---|---|
| GDP | GDP | Gross Domestic Product |
| UNEMPLOYMENT | UNRATE | Unemployment Rate |
| INFLATION | CPIAUCSL | Consumer Price Index |
| FED_FUNDS | FEDFUNDS | Federal Funds Rate |
| CONSUMER_SENTIMENT | UMCSENT | University of Michigan Consumer Sentiment |
- Backend : FastAPI, Python 3.8+
- Data Processing : Pandas, NumPy
- HTTP Client : HTTPX for async API calls
- Data Models : Pydantic for validation
- Server : Uvicorn ASGI server
- Testing : Pytest
- Environment : python-dotenv
- Frontend web application (React.js)
- Enhanced AI models with ML forecasting
- Additional economic indicators (10Y Treasury, VIX, etc.)
- Real-time WebSocket notifications
- Historical data analysis and backtesting
- Custom alert configuration
- Data visualization charts
- Multi-country economic analysis
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for new functionality
- Ensure tests pass (
pytest tests/) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Federal Reserve Economic Data (FRED) for providing free economic data APIs
- FastAPI for the excellent web framework
- Pydantic for data validation
- Author : Chanakya Vasantha
- Email : [[email protected]]
- LinkedIn : [your-linkedin-profile]
- GitHub : [your-github-username]
โญ Star this repository if you found it helpful!