Scheduler
WASP's scheduler runs 23 background jobs that keep the agent active, learning, and aware — even when no user is interacting.
Job Registry
| Job Name | Interval | Purpose |
|---|---|---|
health_check | 5 min | Monitor Redis, Postgres, Ollama, disk, RAM, CPU |
reflection | 6 hours | LLM-driven memory reflection and synthesis |
memory_cleanup | 24 hours | Remove old episodic memories, orphaned data |
snapshot | 24 hours | Full memory snapshot to /data/memory/ |
reminder_checker | 30 sec | Fire due reminders, trigger agent goals for recurring reminders |
monitor_checker | 5 min | Check price/RSS monitors for threshold violations |
proactive | 1 hour | Send proactive suggestions based on user context |
promotion | 12 hours | Promote frequent episodic memories to semantic |
checkin | 1 hour | Periodic user check-in messages |
custom_task_runner | 1 min | Execute user-defined scheduled tasks |
subscription_checker | 5 min | Check price/RSS subscriptions for alerts |
goal_tick | 15 sec | Advance active goal execution (up to 3 steps per tick) |
goal_meta_reflection | 5 min | Analyze goal health, detect storms, log meta-state |
agent_tick | 15 sec | Advance active sub-agent goals |
dream | 1 hour (gated) | Consolidate memories, reflect, prefetch data |
autonomous | 30 min | Evaluate system state and generate proactive goals |
digest | 24 hours | Generate daily digest for user |
cpi_monitor | 5 min | Compute Cognitive Pressure Index |
self_integrity | 6 hours | Cross-check self-model vs actual performance |
perception | 15 min | Monitor crypto prices for significant moves |
behavioral_learner | 2 min | Process user corrections into behavioral rules |
world_model | 15 min | Update entity states from world_timeline |
skill_evolution | 6 hours | Synthesize new skills from recurring patterns |
Job Architecture
Jobs implement a simple interface:
class BaseJob:
async def run(self) -> None:
"""Execute the job's logic."""
...
The Scheduler manages all jobs:
- Tracks last run time per job in Redis (
scheduler:last_run:{job}) - Logs
scheduler.job_completewith job name and duration in ms - Handles exceptions without crashing other jobs
Key Jobs Explained
health_check (5 min)
Uses HealthMonitor to check:
- Redis: PING
- PostgreSQL: simple SELECT
- Ollama:
/api/tagsendpoint - Disk: usage percentage
- RAM: percent used
- CPU: percent used
When thresholds exceeded, SelfHealer triggers remediation (disk cleanup, Ollama restart, etc.).
reminder_checker (30 sec)
Checks Redis for due reminders. For recurring reminders with an agent_id, calls agent_orchestrator.create_agent_goal() to restart the cycle. Regular reminders fire a Telegram message.
dream (1 hour, gated)
The Dream Mode job activates only when:
- User has been inactive for more than 2 hours
- Time is between 1 AM and 7 AM local, OR inactive for 4+ hours
- Has not run in the last 6 hours
When activated, Dream Mode:
- Runs the
PromotionEngine(episodic → semantic promotion) - Extracts KG entities from recent memories
- Generates an LLM reflection on recent events
- Pre-fetches crypto prices for monitored assets
- Logs to the
dream_logtable
autonomous (30 min)
The AutonomousGoalGeneratorJob evaluates system state:
- Checks critical thresholds (disk >95%, RAM >95%) — no LLM needed
- For non-critical situations, asks the LLM for proactive recommendations
- If action is warranted: calls
goal_orchestrator.create_goal()with priority=3 - Rate-limited: max 1 autonomous goal per hour, 5 per day
perception (15 min)
BackgroundPerceptionJob monitors crypto assets in the Knowledge Graph:
- Fetches current prices
- Compares vs last known price in the temporal model
- If change >4%, asks LLM whether to notify
- Sends Telegram alert if notable (max 3/day, respects quiet hours)
behavioral_learner (2 min)
Checks Redis behavioral:pending queue for user corrections:
- Correction detection patterns: "estás alucinando", "eso está mal", etc.
- LLM analyzes the correction and extracts a rule
- Rule saved to
behavioral_rulestable - Rule injected into every future system prompt
skill_evolution (6 hours)
Analyzes skill_patterns table for recurring multi-skill sequences:
- Minimum 5 occurrences required (configurable)
- LLM synthesizes a new composite skill from the pattern
- AST validation ensures generated code is safe
- New skill registered and available immediately
Scheduler State
View job status in the dashboard at /scheduler.
Query last run times:
docker exec agent-redis redis-cli KEYS "scheduler:last_run:*" | sort
Quiet Hours
Jobs that send Telegram notifications respect quiet hours:
- Default: no notifications between 11 PM and 8 AM
- Configurable via
PROACTIVE_QUIET_STARTandPROACTIVE_QUIET_END
Disabling Jobs
Individual jobs cannot be disabled without code changes, but the entire scheduler can be disabled:
# In .env
SCHEDULER_ENABLED=false
Or disable specific features to skip registration of their jobs:
SKILL_EVOLUTION_ENABLED=false # Skips skill_evolution job
WORLD_MODEL_ENABLED=false # Skips world_model job
VECTOR_MEMORY_ENABLED=false # Skips vector_index job