# Agent Scheduler

Cron-based task scheduler for DAARION agents.

## Scheduled Tasks

| Task | Agent | Schedule | Description |
|------|-------|----------|-------------|
| daily_health_check | all | 9:00 AM daily | Health check all agents |
| helion_energy_report | helion | Monday 8:00 AM | Weekly energy report |
| agromatrix_weather | agromatrix | 6:00 AM daily | Weather forecast |
| memory_cleanup | all | Sunday 3:00 AM | Cleanup old memories |

## Usage

```bash
# Run scheduler
python agent_scheduler.py

# Or via Docker
docker compose -f docker-compose.node1.yml up -d agent-scheduler
```

## Configuration

Environment variables:
- `GATEWAY_URL` - Gateway service URL
- `MEMORY_SERVICE_URL` - Memory service URL

## Adding Tasks

Edit `SCHEDULED_TASKS` list in `agent_scheduler.py`:

```python
AgentTask(
    name="task_name",
    agent_id="agent_id",  # or "*" for all
    schedule="0 9 * * *",  # cron expression
    task_type="health_check|generate_report|web_search|memory_cleanup",
    params={"key": "value"}
)
```

## Status

Currently: **Not deployed** (requires Docker service addition)

## TODO

- [ ] Add Docker service to docker-compose.node1.yml
- [ ] Implement proper cron parsing (croniter)
- [ ] Add task status API
- [ ] Add Prometheus metrics
