AI agents trained to model economic behaviors and predict interest rates in the U.S. economy using neural network policies and aggregation functions.
🚀 New to this project? → Start with QUICK_START_GUIDE.md
Choose your path:
- 👤 Project Lead →
EXECUTIVE_SUMMARY.md - 👨💻 Developer →
GETTING_STARTED.md - 📋 Task Management →
TEAM_DISTRIBUTION.md - 📅 Timeline →
TIMELINE.md - 📖 Full Plan →
PROJECT_MILESTONES.md
This project uses LLMs to emulate Person agents living across the United States, with each Person interacting with the Economy. Their interactions are based on their demographic characteristics and external stimuli. We train these agents using historical economic conditions, demographics, and interest rates to predict future economic indicators.
The Economy object provides an interface for Person agents to interact with and aggregates all interactions to predict interest rates.
Each Person can perform one of five economic actions:
- Borrow - Take loans or credit
- InvestSafe - Low-risk investments (bonds, savings)
- InvestRisky - High-risk investments (stocks, crypto)
- BuyLuxuryGoods - Non-essential purchases
- DeclareBankruptcy - Financial insolvency
We use a learned aggregator function A(action/person/tick) that processes all agent actions and returns a predicted interest rate. The model loss is computed against actual historical interest rates.
Each Person shares a single underlying policy P(demographic, stimuli) that:
- Takes demographic information and economic stimuli as input
- Outputs a probability distribution over the 5 possible actions
- Uses very low temperature to simulate discrete action selection
- Updates uniformly across all agents through backpropagation
- Encoding: Demographic and stimuli data for each
Personis encoded - Action Selection: Each
Personcomputes an action vector usingP(d, s) - Aggregation: Action vectors (# of persons × # of ticks) are passed to aggregator
A - Prediction:
Aoutputs a predicted interest rate - Loss Computation: Prediction is compared to true historical interest rate
- Training: Backpropagation updates both
PandAjointly
class Policy(nn.Module):
def __init__(self):
super().__init__()
self.fc = nn.Sequential(
nn.Linear(d_dim + s_dim, 64),
nn.ReLU(),
nn.Linear(64, 5) # 5 possible actions
)
def forward(self, d, s):
x = torch.cat([d, s], dim=-1)
logits = self.fc(x)
return F.gumbel_softmax(logits, 0.00001)class Aggregator(nn.Module):
def __init__(self, num_agents, ticks):
super().__init__()
self.net = nn.Sequential(
nn.Linear(5 * num_agents * ticks, 64),
nn.ReLU(),
nn.Linear(64, 1)
)
def forward(self, action_matrix):
flat = action_matrix.view(1, -1) # shape: (1, 5*num_agents*ticks)
return self.net(flat)agent-predictions/
├── README.md
├── requirements.txt
├── src/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ ├── policy.py # Policy neural network
│ │ └── aggregator.py # Aggregator neural network
│ ├── agents/
│ │ ├── __init__.py
│ │ ├── person.py # Person agent class
│ │ └── economy.py # Economy environment
│ ├── data/
│ │ ├── __init__.py
│ │ ├── demographics.py # Demographic data handling
│ │ └── economic_data.py # Historical economic data
│ └── training/
│ ├── __init__.py
│ ├── trainer.py # Training loop
│ └── simulation.py # Simulation pipeline
├── data/
│ └── raw/ # Raw economic and demographic data
├── experiments/
│ └── configs/ # Experiment configurations
└── tests/
└── test_*.py # Unit tests
git clone https://github.com/yourusername/agent-predictions.git
cd agent-predictions
pip install -r requirements.txtfrom src.training.simulation import EconomicSimulation
from src.data.demographics import DemographicData
from src.data.economic_data import EconomicData
# Initialize simulation
sim = EconomicSimulation(
num_agents=1000,
num_ticks=100,
demographic_data=DemographicData(),
economic_data=EconomicData()
)
# Train the model
sim.train(epochs=100)
# Make predictions
predictions = sim.predict(test_demographics, test_stimuli)- Multi-agent simulation with shared policy learning
- Demographic-aware agent behavior modeling
- Joint training of policy and aggregator networks
- Historical data integration for realistic economic modeling
- Scalable architecture supporting thousands of agents
- Historical interest rate data
- U.S. demographic statistics
- Economic indicators and stimuli data
- Census and survey data for agent initialization
📋 New to the project? Start here:
GETTING_STARTED.md- Day 1 setup guide for team membersPROJECT_MILESTONES.md- Detailed breakdown of all project phasesTEAM_DISTRIBUTION.md- Quick reference for task assignmentsTIMELINE.md- Visual timeline and Gantt charts
These documents provide a comprehensive 11-week roadmap for building this project with a team of 5-7 people.
Important: The original architecture had a critical issue where the model couldn't distinguish between different economic actions (Borrow vs InvestSafe, etc.). We recommend implementing the Aggregator with action embeddings to give each action semantic meaning. See PROJECT_MILESTONES.md Phase 2 for details.
Please read our contributing guidelines and submit pull requests for any improvements.
This project is licensed under the MIT License - see the LICENSE file for details.
Questions about this project? Contact @Krish Modi