Giving an autonomous agent homeostatic sleep: fatigue from real token cost, plus REM dreaming
Dzikula · reddit · 2026-09-22
After running a 50-node autonomous companion agent for a year, a solo developer mined 5 days of logs (2,498 model calls): the reader subsystem drove 27–40% of turns, 64% of them on empty chunks, and the model's self-eval scores were nearly useless (90% within a 0.16-wide band).
He built a homeostatic layer:
- Fatigue computed from real LLM token cost (cache-miss and completion weighted higher), yielding Fwork and Fboredom (embedding-similarity satiation), fed into a classic two-process model
- Sleep state machine awake→drowsy→N1–N3→REM→waking; internal stimuli get rate-limited by state, but human messages always wake it
- REM dreaming: old distant memories are free-associated at high temperature with an unfiltered prompt; output stored in a separate sanitized dream DB, returned tagged "this was a dream, not a fact"
Changes: reader hard-capped at 20 chunks/hour (was 60), digest interval 120s→600s; fatigue scales down autonomy/exploration rewards; the module fails open within 90 seconds. The ongoing experiment: whether dream content later surfaces in daytime behavior unprompted.
More from coding & agent
- Browser agent builder says website access, not model capability, is the biggest prod blocker — aquariusacquah · 2026-09-22
- New Local-LLM Primitive: "Span" Answers Point to Snippets Instead of Enumerating — generativist · 2026-09-22
- Grok 4.7 lands in Devin at 59.4% on FrontierCode, but Xiaomi MiMo-V2.6 undercuts it — airesearch12 · 2026-09-22
- XGrammar Adds DeepSeek V4.1 Structural Tags for Fast Native Tool Calls — JiaZhihao · 2026-09-22
- Comfy Launches Official MCP to Drive ComfyUI From Any AI Agent — PurzBeats · 2026-09-22
- Foundation Capital: enterprise agents need identity, boundaries — and the web rebuilt for machines — brucemacv · 2026-09-22