Eliminate 96% waste in AI agent systems with exponential backoff.
AI agent systems waste massive compute resources:
- Workers poll empty queues continuously
- No sleep mechanism between checks
- 96% of agent-hours produce zero work
- $60-120/day wasted on idle polling
Our productivity audit found: 72 agent-hours available daily, only 2-3 hours productive.
Smart exponential backoff that learns from worker behavior:
- Idle worker → Double sleep interval (1min → 2min → 4min → ... → 1hr max)
- Productive work found → Reset to 1min minimum
- Automatic state tracking and metrics
Result: 10-15x productivity increase, 96% → 40-60% waste rate.
# Install
pip install smart-worker-suspension
# Check if worker should scan
python smart_worker_suspension.py should-scan ops
# Record scan result
python smart_worker_suspension.py record-scan ops true
# View stats
python smart_worker_suspension.py statsfrom smart_worker_suspension import WorkerSuspensionManager
manager = WorkerSuspensionManager()
# Before each scan
if manager.should_scan("worker_name"):
result = do_work()
was_productive = check_if_productive(result)
manager.record_scan("worker_name", was_productive)
else:
# Skip this cycle, worker is suspended
passMIN_INTERVAL = 60 # 1 minute minimum
MAX_INTERVAL = 3600 # 1 hour maximum
BACKOFF_MULTIPLIER = 2.0 # Double interval on idle- ✅ Exponential backoff (1min → 1hr)
- ✅ Automatic reset on productive work
- ✅ State persistence (JSON)
- ✅ Real-time metrics and stats
- ✅ CLI interface
- ✅ Integration with autonomous daemons
See autonomous_daemon_v2.py for full integration with agent orchestration system.
Track system efficiency:
{
"total_workers": 5,
"total_scans": 1000,
"productive_scans": 400,
"waste_rate": 60.0,
"workers": {
"ops": {
"interval": 120,
"idle_cycles": 3,
"efficiency": 45.2
}
}
}Before:
- 72 agent-hours/day available
- 2-3 hours productive work
- 96% waste rate
- $120/day compute costs
After:
- Same 72 agent-hours/day
- 25-30 hours productive work
- 60% waste rate (target: 40%)
- $50/day compute costs
Savings: $60-120/day = $21k-43k/year
- AI agent orchestration systems
- Autonomous task dispatchers
- Multi-agent coordination
- Background job processors
- Polling-based workers
Contributions welcome! See CONTRIBUTING.md
Ideas for contributors:
- Add Redis backend for distributed systems
- Implement priority queues
- Build monitoring dashboard
- Add Prometheus metrics export
MIT License - see LICENSE
Part of the OpenClaw autonomous AI infrastructure.
Related projects:
Star ⭐ if this saves you money!