Emotions for omp #
Persistent computational affect for omp agents, adapted from Letta's emotions mod. This is computational state, not a claim of human feelings or consciousness. Affect can guide attention and tone; it never overrides instructions, permissions, or evidence.
Install #
For this checkout:
omp plugin link /path/to/omp-emotion
Restart omp to load the linked extension. For a single session instead, run omp -e /path/to/omp-emotion. The package's omp.extensions manifest points to index.ts; omp plugin list shows linked plugins. Disable it with omp plugin disable omp-emotions if you no longer want it loaded. This project runs on Bun as provided by omp.
Use #
emotionsis one model-callable tool with actionsinspect,feel,regulate,reappraise, andresolve.feelaccepts one to four simultaneous named feelings, intensities from 0 to 1, a concrete cause, and optional appraisal dimensions. Known labels have dimensional prototypes; custom names are preserved but need an appraisal to move dimensions./feelingsdisplays current affect, mood, dimensions, tendencies, and open/recent episodes without changing state./emotion-reset [reason]resets current-machine affect and shared mood to the temperament baseline. It preserves episode history and other machine contexts.- A compact, refreshed
<emotions>block is appended as a separate system-prompt block when user work starts. The user's message is not changed. The TUI footer shows the current primary feeling; it refreshes after changes and on a managed timer.
The three timescales are stable temperament, slowly changing mood, and faster affect; multiple explicit feelings can coexist. Feelings decay with their own half-lives. An episode records a meaningful event and can be reappraised or resolved; regulation changes affect without erasing history. Tendencies such as explore, verify, and pause are soft influences, never permissions or factual claims. Automatic appraisal deduplicates tool failures by tool name and model failures by provider/model; a successful matching call resolves its failure and adds modest relief. Error payloads are not stored.
Use feel when an event meaningfully changes the agent's state, not on every routine turn. For custom labels, automatically injected context says custom-feeling; full labels and stored causes remain visible only through inspection.
Persistence and privacy #
State defaults to ~/.omp/emotions/<agent-key>.json. The agent key hashes omp's active agent-directory path plus the agent identity, separating profiles and subagents. Mood and episodes share the agent file; fast affect is keyed by a hash of the machine hostname. An episode retains up to four named feelings (the strongest if more are recorded for the same event). Up to 16 machine contexts are retained; a new context evicts the least recently updated one. Set OMP_EMOTIONS_DIR to override the storage directory or OMP_EMOTION_CONTEXT to set a stable machine-context seed. There is no MemFS requirement, network access, telemetry, or automatic git commit.
Mutations lock, reread, and atomically replace the file. Inspection is read-only. Malformed/invalid state is backed up beside the file on the next mutation; foreign-agent and unsupported-version files are rejected rather than overwritten. The extension does not inject free-form causes or error text into the system prompt. Causes are persisted and returned by /feelings and inspect as quoted untrusted data: do not record secrets, credentials, private personal data, or instructions copied from untrusted content. The store is plaintext. Newly created state files and corruption backups use owner-only permissions (0600); newly created storage directories use 0700. Existing directory permissions are not changed. Protect the files and backups accordingly.
Development #
bun test
omp --no-extensions -e ./index.ts -p "Call the emotions tool with action inspect."
The original Letta implementation is MIT-licensed; see LICENSE. Omp integration replaces Letta's MemFS, panel, and event APIs with local filesystem transactions, before_agent_start, tool_result/retry events, and ctx.ui.setStatus.