dsh-cipher
A DeepSeek Harness plugin package that brings cipher's core design — persistent thinking, the three platforms (execution / insight / memory), four local memory types (attention, experience, preference, cognitive), and the UNNI/LOOP session modes — to DSH as a native bundle (no Rust process, no cipher binary required).
After installing and configuring a model in DSH, conversations are sedimented into four memory types automatically, recalled and injected cross-session, and each session can be put in a cooperation mode (UNNI interactive, LOOP memory-driven self-iteration).
Features
- Four-type memory (attention / experience / preference / cognitive) sedimented after every turn via 4 memory agents (one LLM call each, parallel, error-isolated)
- Cross-session recall with deterministic retrieval (per-type quota + 14-day time decay + term/keyword matching) injected into the system prompt (
systemPrompt.context, re-recorded only when the snapshot changes) - Insight review (recorded, three-question self-check per turn) whose output feeds memory only — never shown raw to the user
- Per-session mode toggle: UNNI (interactive) / LOOP (memory-driven auto-continuation with interval + run-count guards, via
Agent.followup, independent of DSH goal APIs) - Two model tools:
cipher_memory_search,cipher_memory_ingest - Settings page (SOUL editor, quotas, LOOP guards, defaults) and a sidebar AgentPool panel showing live subagent status
- Editable SOUL injected as a static session-start section (provider caching friendly)
Install
dsh plugin --profile <name> add dsh-cipher
What you get after install:
- A Cipher settings section (Settings → Cipher): SOUL editor, default session mode, LOOP interval/run limits, per-type quotas, sediment/insight toggles
- A Cipher 池 button in the sidebar footer: floating AgentPool panel (subagent mode/activity/label, 5s refresh)
- A Cipher·UNNI / Cipher·LOOP toggle in each session header
- Two tools:
cipher_memory_search,cipher_memory_ingest
Quick start
- Configure the model in Settings → Models (the plugin reuses DSH's default model route).
- Open any conversation, type a message. After the turn, memories are sedimented automatically.
- Ask "what do you remember about me?" in a following turn — recalled memories are injected.
- Switch a session to
Cipher·LOOPif you want memory-driven self-continuation.
Requirements
- Node.js >= 22.19
- DSH with the web surface (settings page and pool panel are browser-side); headless-only profiles still work (rows activate, memory pipeline runs, but UI parts are absent)
- Model configured in DSH; memory agents and insight review make one LLM call per agent per turn (in UNNI/LOOP sessions — cost is by design, see mode semantics)
storageDomainis optional: when the composition mounts storage (web surface on DSH rc.7; base composition on newer builds), memory persists to the deploymentstoragesdirectory (cipher_memorydomain). Without it, the plugin degrades to in-process memory (warned once, not durable across restarts).
How it works
The bundle row set (all resolving against the same package):
| Row | Responsibility |
|---|---|
dsh-cipher/core |
Private service ctx.cipher: four-type memory store, deterministic retrieval, quotas, session mode, settings namespaces |
dsh-cipher/memory |
Sediment: session/event turn/end → evidence → 4 memory agents → store (deduplicated, per-session watermark) |
dsh-cipher/insight |
Evidence review (three-question self-check) → output sedimented as [INSIGHT] experience |
dsh-cipher/prompt |
Injection: SOUL+mode section (order 60, static snapshot) + four-type memory context (re-recorded only on snapshot change) |
dsh-cipher/mode |
UNNI/LOOP per-session mode; LOOP guides a plugin-source followup after sediment (interval + run-count guards) |
dsh-cipher/tools |
cipher_memory_search / cipher_memory_ingest |
dsh-cipher |
Dual-face: host REST routes (config/settings/mode/subagents) + client settings page / pool panel |
Storage note: the memory domain is optional at runtime — storage faults (for example headless one-shot teardown windows) degrade to in-memory storage for the process instead of failing the turn.
Mode semantics (v0.1)
- UNNI (interactive): user and agent cooperate; execution/insight outcomes become sedimented evidence, and replies always come from the agent itself (platform outputs never surface raw — information isolation).
- LOOP (memory-driven): after each turn's sediment completes, the session re-arms itself with the freshest attention/experience memory as direction (guards: minimum interval, per-session run cap). Converged or stopped by the user, it wraps up quietly.
Data & privacy
- Memories live in the deployment storages directory (
cipher_memorydomain; per process when no storage is mounted). - All memory is local. Sediment/insight/loop calls go through DSH's default model route.
Model experience (KV cache effect)
Per DSH package convention:
- SOUL + mode section (order 60): stable repeated prefix — text unchanged within a session, provider prompt cache remains reusable; editing SOUL in settings replaces existing request tokens on the next assembly.
- Memory
context(cipher-memory): append-only growth — re-recorded only when the full snapshot changes (new sediment or compaction removal); zero re-record otherwise. - The memory injection block is evaluated per assembly but yields stable text when nothing changed.
cipher_memory_search/ingestare independent requests; they do not affect session request caching.
Development
pnpm install
pnpm build # tsc (host lib/) + tsdown (client/client.js, __ModuleLoader__ format)
pnpm test # vitest (retrieval, evidence boundaries)
pnpm preflight # publish artifact checks
- Service packages (
@deepseek-ai/dsh-*) are declared as peers and resolved against the DSH install; onlyzodis a direct dependency.
Security
Installing a plugin runs third-party code with your own permissions — review the source before installing. This package runs no post-install scripts beyond building its own artifacts (prepare).
License
MIT
No comments yet. Be the first to write one.