Purpose
The Memory Worker drains the pending_saves queue from each agent’s SQLite database to ensure long-term memory is indexed. It generates Voyage-4 embeddings and FTS5 keyword indices, moving data into the chunks and chunks_vec tables for retrieval across the 44-agent fleet.
Schedule
OnUnitActiveSec=5min
Runs every 5 minutes after the last activation, with a randomized jitter of 60 seconds to prevent resource spikes.
Service
Runs memory-worker.service, which executes the following script:
/usr/bin/node /home/opsadmin/.openclaw/workspace/scripts/workers/memory-worker.js --once
Resource caps enforced by the unit: MemoryHigh=384M, MemoryMax=512M, CPUQuota=50%.
Failure behavior
If the service fails, it triggers notify-crash@%p.service (via OnFailure= directive), which sends an automated alert to Discord. No automatic systemd restart is configured.
Health signal
Verify execution via systemd logs:
systemctl --user status memory-worker.servicejournalctl --user -u memory-worker
Related
- cron-timer-registry — Central registry of all system timers.
- _OSIL — Memory indexing feeds OSIL self-improvement loops.