First, let me explain why I made this thing.
I kept installing more and more plugins on DSH, and eventually realized there were two really serious problems: the tool schema was resent with every request, making the token count shoot up; and whenever a session got disconnected, it forgot everything, so I had to retrace my steps the next day. Even worse, when a plugin went offline, it had no idea. By the time you noticed something was wrong, it had already failed silently a dozen times.
I tried cutting down the tools and adding prompt constraints to stop it from making random calls, but neither helped much. One plugin upgrade and everything fell apart again.
The current approach is to have plugins register themselves as organs: with a name, abilities, perception, and reflexes. The plugins are still the same plugins as before; they just have a layer of physiology wrapped around them.
Here are a few of the parts I find most interesting.
The heart. It beats once every second, but not at a fixed rate—when there’s a critical alert, it beats three times faster; when an organ fails repeatedly, it beats twice as fast; and if things stay quiet for too long, it slows down on its own. Every beat packages the current instruction, the status of every organ, and the alerts into a “blood” broadcast. Any plugin can connect to that cycle. The biggest benefit is that the whole system feels alive rather than looking like a pile of calls.
Memory. Two minutes of silence counts as light sleep, and five minutes as deep sleep. During deep sleep, it takes what actually happened during that period and distills it into memory cards—a pitfall if the same trap is fallen into more than three times, a playbook if a repeated workflow succeeds, and a weak link if something is called frequently but has a low success rate. Everything is based on deterministic rules: no tokens burned, and no raw text sent to the model.
Self-healing. Don’t retry failures right away; first determine the cause: is the tool missing, is a parameter wrong, is permission denied, did it time out, or is it a network problem? Parameter errors are never retried automatically—that’s a brain problem, and retrying only amplifies the mistake. Read-only operations are patched automatically, while anything with side effects is left for the brain to decide. A wound isn’t considered healed until that organ actually succeeds the next time.
I also added on-demand capability exposure: of the 26 organs and 256 abilities, only abilities relevant to the current intent are included in the tool table. In testing, this cut tool-schema tokens by 84.7%.
There were plenty of ways it fell over. A few worth noting:
The reflex arc could trigger itself—its own description contained a sensitive word, so its output was interpreted as a failure signal, causing it to fire endlessly.
I used tool calls to measure heartbeat activity, but background tasks kept saying “I’m still working,” so the body could never fall asleep. I changed it so that only session progress counts as a wakefulness signal.
Memory cards were written to disk as a side effect of being recalled, so cards deleted externally were written back again. Switching to throttled disk writes on read operations fixed it.
Clone it and you can run the regression tests without installing any dependencies; the 200-plus offline assertions are all actually executed. If you find it interesting, a star is all I ask—and you’re also welcome to come in and point out the flaws.