# AGENT POOL CONFIGURATION
# Prevents memory exhaustion during multi-agent operations

agent_pool:
  # Maximum concurrent agents based on available memory
  max_concurrent_agents: 8  # Conservative: 8 × 500MB = 4GB
  
  # Memory per agent (MB) - used for calculations
  estimated_memory_per_agent: 500
  
  # Reserve memory for system (GB)
  system_reserve: 3
  
  # Batch processing
  batch_size: 4  # Process 4 agents at a time
  batch_delay: 30  # Wait 30s between batches for GC
  
  # Memory thresholds (%)
  warning_threshold: 70  # Warn when 70% RAM used
  critical_threshold: 85  # Stop spawning at 85% RAM used
  
  # Automatic scaling
  auto_scale: true
  scale_down_at: 80  # Reduce agents when 80% RAM used
  scale_up_at: 50   # Allow more agents when < 50% used

# Monitoring
monitoring:
  check_interval: 15  # Check memory every 15 seconds
  log_to_file: true
  alert_on_critical: true

# Recovery
recovery:
  auto_restart_on_oom: true
  max_restart_attempts: 3
  checkpoint_interval: 300  # Save state every 5 minutes
