dsh-plugin-immune: Preventing Agents from Repeating Past Mistakes

dsh-plugin-immune is maintained by meat-daemon-404, categorized as "Memory", holds 3 stars on GitHub, and corresponds to the npm package dsh-immune-system (v0.9.5, MIT). The plugin distills Agent "tool failure followed by success" pairs into antibodies and stores them in SQLite with FTS5, isolated per project. Upon encountering queries regarding relevant filenames or commands, it injects context using the `<immune_memory>` tag. It supports both DSH and ZCode as hosts, sharing a common `core/` directory. On the DSH side, installation is performed via npm or tarball/git; after installation, restart and run `/immune` for a self-check. It provides commands including `forget`, `export SKILL.md`, library snapshot synchronization, and `doctor` self-check. Design highlights include: failure determination based on structured signals rather than relying on single events; automatic retirement of antibodies after 3 failures; prescription-level deduplication for generic pitfalls; prioritization of human correction over model guessing; defaulting the `IMMUNE_GUARD` pre-check to off, with intercept rules written in code rather than stored in the database; injection convergence occurring in the first turn of the round; distillation attached to round boundaries; and using two independent connections for the database instead of `ATTACH DATABASE`. Before installation, please read the source code and verify the license.

Read More