mindspace-dsh-session-memory
☆ 4Editable, session-isolated personalization memory for DeepSeek Harness
Get this plugin
Review the source, then continue to the publisher.
About this plugin
Source snapshot 8/27/2026Mindspace Session Memory for DeepSeek Harness
An installable DeepSeek Harness community plugin for editable, session-isolated personalization memory. It keeps continuity and user control in the same place:
- a roughly 300-character profile separating confirmed information from information pending confirmation;
- editable preferences and assistant instructions consolidated into at most three categorized cards each;
- a revisable current relationship state that never replaces the Harness identity or becomes a permanent mission;
- an optional roleplay preset isolated to one session;
- model-facing
get_session_memoryandupdate_session_memorytools; - read-before-write classification and deduplication for every model-owned write;
- category-based conflict replacement with stable card ids and a visible append/merge/replace/skip audit trail;
- no forced onboarding questionnaire for a new session.
- archived conversations disappear from the Memory Center selector immediately; their data is retained only for a deliberate session restore, never injected or editable while archived.
0.3.2: Explicit taxonomy and dynamic relationships
The user profile now contains only user-related information, split into confirmed
and pending-confirmation fields. Preferences hold likes, dislikes, topics, activities,
tools, and habits. Assistant requirements hold only explicit must/should/do-not rules.
Relationship memory describes current state and evidence; it may strengthen, weaken,
end, or be cleared, and never replaces the Harness identity. V1/V2 data migrates to V3;
legacy observations become pending information and legacy missions remain historical context only.
Each get_session_memory call authorizes exactly one classified mutation; another write must read the
newly persisted state again. Production acceptance on the DSH 0.1.1 Web profile verified the complete
read/write/read/write sequence with DeepSeek-V4-Flash High, 31 automated tests, package installation,
Host/Remote descriptor consistency, service restart, and the live Memory Center UI.
Session-scoped context compaction
The Memory Center now exposes a session-isolated context-compaction policy. Users can enable it, set the trigger ratio, retained recent context, and summary limit, or run a manual compaction before the threshold is reached. The policy is persisted in the session-keyed sidecar and never changes another conversation.
- The conversation surface is condensed while the summarizer still receives the current system context for cache alignment. The session identity explicitly instructs it not to copy, reinterpret, or overwrite identity, profile, relationship, or roleplay state in a checkpoint.
- The prior summary is included as input to avoid losing durable context across repeated compactions.
- The compaction prompt prioritizes facts, decisions, constraints, open work, and reusable conclusions while dropping greetings, repetition, and tool logs.
- DSH remains the compaction executor; this plugin supplies the session policy and the visible user controls.
This is a community plugin and is not an official DeepSeek project. The repository artwork is supplied by the project owner and is used only to identify this repository.
Memory-governance foundation (introduced in 0.2.0)
Version 0.2.0 turns the first editable-memory prototype into a governed, session-scoped personalization layer for DeepSeek Harness:
- the public compaction-summary override is replaced by a 300-character user profile that separates confirmed facts from information still pending confirmation;
- preferences and assistant requirements are consolidated into at most three categorized cards per section instead of growing as disconnected fragments;
- corrections replace conflicting information while preserving stable card ids;
- automatic extraction proposes a complete next state and an atom-by-atom handled/skipped ledger, so partial model output is rejected atomically;
- append, merge, replace, and skip activity records expose source message sequences, before/after values, reasons, and timestamps;
- legacy V1 and V2 session-memory events are imported once into a durable, session-keyed sidecar without rewriting the conversation log;
- repeated legacy fallback categories are repaired during replay instead of locking all later writes;
- assistant names, nicknames, self-designations, and relationship-specific titles have a dedicated identity action and are never routed into the user's profile or preferences;
- current relationship state and roleplay presets remain independently scoped to each conversation.
The contribution is deliberately tree-out: one installable dual-face DSH bundle owns the Host service, sidecar persistence, prompt/tool integration, extraction hook, Typert descriptor, Remote, and settings UI. It does not replace DSH compaction semantics or require an upstream source patch, making the memory-governance layer independently installable, auditable, and removable.
Confirmed/pending profile and categorized preferences
Session role preset and visible memory audit
The V2 acceptance run passed 10 automated tests, build and package checks, real model write/merge/replace flows, cross-session isolation, and persistence after restarting the default Web profile.
Install
This README describes current main. It does not point at a nonexistent Release
tarball: build the prebuilt package from a pulled checkout, then install it from
the official Harness checkout root.
git clone https://github.com/Spirtxiaoqi7/mindspace-dsh-session-memory.git
Set-Location .\mindspace-dsh-session-memory
corepack pnpm install
corepack pnpm run build
corepack pnpm pack --pack-destination dist
$memoryTgz = (Get-ChildItem .\dist\mindspace-dsh-session-memory-*.tgz | Sort-Object LastWriteTime -Descending | Select-Object -First 1).FullName
Set-Location C:\path\to\deepseek-harness
corepack pnpm dsh plugin --profile web add $memoryTgz
corepack pnpm dsh --profile web --dump-config
corepack pnpm dsh web
Do not run pnpm dsh in the plugin directory or require a global dsh: that
command belongs to the official Harness checkout. The repository has no
install-time build script; the commands above explicitly create and install the
tarball. Historic GitHub Releases map only to their respective tags and do not
represent the current main feature set.
How it composes
The package is one DSH bundle with one dual-face row. On the Host it mounts the memory service, sidecar persistence, prompt contribution, model tools, extraction hook, and Typert descriptor. The same package declares its Web client contribution, which self-mounts the generated Remote descriptor and registers the settings page.
It does not patch DSH source, api-remotes, the built-in bundles, or root TypeScript
projects. Removal is therefore one command:
corepack pnpm dsh plugin --profile web remove mindspace-dsh-session-memory
Data and model calls
Memory changes live in an atomic sidecar at
DSH_HOME/mindspace-session-memory/v1, keyed by session id; the canonical DSH
conversation JSONL is never modified by this package. Legacy memory events are
imported once on first access. The UI reads and replaces a whole versioned document
with optimistic revision checks. Automatic extraction is opt-in (disabled by default):
when enabled it may make one auxiliary model request after a
completed root-agent turn only while editable memory utilization is below 20%, and
skips a turn that already made a model-owned memory-tool write. Above that threshold,
the primary model alone decides whether to use the memory tools.
System prompts, RAG, compaction summaries, and event history are not counted. The
auxiliary budget defaults to 6000 tokens. A proposal must contain the complete next
state plus a handled/skipped ledger for every extracted atom; invalid or partial output
is rejected atomically. Confirmed and pending information remain separate and revisable.
Enable automatic extraction in a later profile patch only if you want the cold-start fallback in addition to model-tool/manual writes:
- id: mindspace-session-memory
name: mindspace-dsh-session-memory
config:
maxTextBytes: 4096
maxItemsPerSection: 3
maxProfileCharacters: 300
autoExtract: false
autoExtractBelowUtilization: 0.2
extractionMaxTokens: 6000
Compatibility
The initial release targets the public DeepSeek Harness 0.1.0-rc family and Node
22.19+ or Node 24+. Harness is currently a developer preview; breaking upstream
changes may require a plugin update.
Version 0.3.2 is qualified against DeepSeek Harness 0.1.1-rc.2 and declares
the stable 0.1.1 line as its compatibility floor. It owns the distinct
mindspaceSessionMemory Remote and does not patch or disable in-tree memory rows.
Because DSH owns compaction inside standing Agent presets, the plugin resolves the
stock provider through each live agent.ctx; it never revives the disabled
host-plane engine. The Harness checkout therefore remains unmodified. Do not install it together with a
legacy in-tree Mindspace memory implementation: migration keeps one owner for
each session-memory schema and Remote namespace.
Development
pnpm install
pnpm run build
pnpm test
pnpm pack --pack-destination dist
The generated Typert descriptors are committed under src/generated/. The build
rescopes their package identity and bundles the browser Remote with the UI.
Chinese documentation: README.zh-CN.md
License
MIT