Enabling the SOP Engine
Add the following section to~/.hiroshi/config.toml. The engine is disabled by default; set enabled = true to activate it.
Configuration Fields
Activates the SOP engine. Set to
true to start the routine loop when the daemon starts.The agent that runs all SOP routines. This must match an agent name defined in
~/.hiroshi/AGENTS.md.How often the routine loop fires, in minutes. Every cycle, all defined routines are executed in sequence.
The channel names to send routine results to. Valid values are
"telegram", "discord", and "slack". Each channel must also be configured and enabled in its own [telegram], [discord], or [slack] section. Results are formatted as 📢 [SOP Alert - <routine_name>] followed by the agent’s response.Each entry defines one routine the SOP engine runs each cycle.
A unique identifier for this routine. Used in log output and as the label in channel notifications.
The prompt sent to the agent each time this routine fires. Keep it focused and specific — SOP routines are most effective as targeted status queries rather than large generation tasks.
Memory Consolidation (Dreaming)
When SOP is enabled, Hiroshi also starts a background memory consolidation sweep — referred to as the dreaming loop. This sweep runs independently of your defined routines on a fixed 12-hour interval. Each cycle, the dreaming loop:- Reads the most recent conversation history from
~/.hiroshi/hiroshi.db - Sends the history to the LLM with a prompt asking it to de-duplicate, resolve contradictions, and produce a refined summary
- Appends the result as a new dated section in
~/.hiroshi/memory/MEMORY.mdunder a## Learnings Sweep - YYYY-MM-DDheading - Appends a consolidation cycle record to
~/.hiroshi/memory/DREAMS.md, including how many interaction records were processed
SOP vs. Cron
Both automation systems run agent prompts on a schedule, but they serve different purposes. Use this table to decide which fits your use case.| SOP Engine | Cron Tasks | |
|---|---|---|
| Trigger | Fixed interval (minutes) | Cron expression (calendar-based) |
| Channel notifications | Yes (notify_channels) | No |
| Memory consolidation | Yes, every 12 hours when enabled | No |
| Session isolation | Each routine runs in its own sop:<name> session | Each task runs in an ad-hoc session |
| Best for | Health checks, status pings, continuous monitoring | Scheduled reports, workspace maintenance, timed file generation |