The Overnight Chain: Workers Running While I Sleep
3 min read
Every morning I wake up to a Slack message from a worker named Amygdala telling me whether anything suspicious happened in my infrastructure overnight. Below that, a briefing. Below that, a curated tech news digest from 18 sources. Below that, code reviews of my own commits.
None of this required me to be awake.
The Problem with Manual
I run a homelab with three machines, Docker services, Home Assistant, security cameras, and a growing collection of AI tools. Checking Docker health, reviewing commits, scanning for research papers, verifying MCP server integrity — these are things I should do daily and don't because they're tedious.
Cron jobs don't solve this. They don't coordinate. They don't share context. They don't know the GPU is busy.
The Chain
The Forge Agent Runtime is a Redis-based task queue with DAG dependency support. The overnight chain runs every night:
gpu-warmup → amygdala → morning-briefing → article-scanner → arxiv-scout
└→ code-review → pr-digest
cerebellum → consolidation
Sunday: ecosystem-watch → evolution → basal-ganglia
Each step waits for its dependencies. The GPU lock ensures only one worker touches VRAM at a time. Dependencies declared in YAML, scheduler handles the rest.
The Workers
Amygdala collects data from six sources, runs a deterministic triage gate, and only escalates to LLM review if something looks wrong. Most mornings: GREEN in under 7 seconds.
Article Scanner checks 18 sources — RSS feeds, Reddit, GitHub trending. Filters for relevance via local LLM.
Code Review scans 24 hours of git commits across repos and produces LLM-generated reviews.
Cerebellum fires reinforcement signals back to Cortex — warming edges for memories that led to good outcomes, cooling edges for failures. The knowledge graph learns from experience.
Consolidation prunes and compresses memories nightly. Full LLM synthesis on Sundays.
What Makes It Work
Shared memory. Every worker reads from and writes to Cortex. The article scanner knows what the arXiv scout already found.
GPU coordination. Redis-based mutex lock. One worker at a time. No VRAM conflicts.
Task dependencies. DAG scheduler with topological sorting and cascade failure handling.
The Cost
Zero ongoing. Mac Mini M4, 24GB. Open-source models (Gemma 4, Qwen 3.5, Phi-4 Mini) via Ollama with MLX backend. No API keys. No data leaving the network. Chain completes in 7-15 minutes.
The Takeaway
The overnight chain turned my homelab from a collection of tools into a system that works for me while I'm not looking. The security review caught a real Docker configuration issue on its second night running. The article scanner surfaced a paper about quantum teleportation that became a new research direction. The code review found an unused import I'd missed in three consecutive PRs.
The gap between "I should check this daily" and "a worker checks this for me every night" is the gap between intention and infrastructure. If you're building AI tools and spending time on tasks that could run autonomously, the overnight chain pattern is worth exploring. Grain Studios builds this kind of infrastructure for teams. Reach out if you want to talk about it: reed@grainlabs.io.