Foreword

Building Agents within DeepSeek Harness (DSH) commonly relies on session context or simple KEY→VALUE storage to “remember” user preferences. Such approaches work for single-turn Q&A, but across sessions, the Agent often feels like it’s rebooting each time: lacking a stable self-representation, struggling to consolidate experience into reusable knowledge, and having no auditable trail for behavioral boundaries.

Here, we introduce @furongjun1999/dsh-memory (GitHub: FuRongJun-1999/dsh-memory). Maintained by FuRongJun-1999, it positions itself as a long-term memory infrastructure for AGI research, bridging Lingshu’s (AEIS) spatiotemporal memory engine with DSH, rather than being a typical SQLite memory plugin. The project adheres to the “Theory of Intelligence v3.3” protocol. The current npm package version is 0.3.0, the GitHub repository has approximately 31 stars, and it is licensed under MIT.

What This Is

In short: dsh-memory is the Lingshu brain integration layer in DSH plugin form, providing Agents with cross-session memory, a knowledge flywheel, self-awareness, and an auditable trust mechanism.

Lingshu (AEIS) communicates with a Python subprocess on the plugin side via a handcrafted stdio MCP bridge, dynamically fetching the tool list at runtime. The Python side provides capabilities like a memory graph, white-box reasoning, and role-playing via the aeis package. The target users are developers with research needs in AGI, interpretability, and memory mechanisms, not consumers seeking a general-purpose memory tool.

The differences from traditional memory plugins can be summarized as:

Traditional Memory Plugins dsh-memory / Lingshu
Literal KEY→VALUE storage Five-layer spatiotemporal memory graph (Anchor/Structure/Knowledge/Context/Self)
Cross-session relies on manual context stitching Recall via tools like lingshu_recall, search, timeline
No introspection or evolution Knowledge flywheel (Verification → Induction → Association → Distillation → Deduction)
Behavioral boundaries hard to audit Guardrail Charter + full-chain event tracing

Core Capabilities

The following capabilities are derived from the project README and package.json, categorized by module.

Cross-Session Self-Continuity

The Agent can share a single continuous memory across different conversations, sessions, and even sub-agents via MCP tools like lingshu_recall, lingshu_search, and lingshu_timeline. Memory is organized by semantic and spatiotemporal relationships, supporting retrieval, deduplication, and association, rather than just stacking historical text.

Knowledge Flywheel and Self-Evolution

Tools like distill, flywheel, learn, and induce distill experience through verification, induction, and association into reusable patterns that evolve with use. Conversation content can be automatically deposited into the memory repository (see package.json description).

White-Box Intelligent Pipeline

Knowledge-based queries follow a deterministic white-box path, not relying on the LLM to generate answers. The process is: Contextualized Knowledge Units → Directional Reasoning & Combinatorial Generation → Three-Layer Self-Validation (Directional Consistency, Causal Chain Completeness, Factual Consistency) → Upon validation, solidified as a direct answer. The README claims a 100% white-box rate for knowledge Q&A, with the LLM only used as an external validator in a degraded capacity.

Covered domains include phase changes, density and buoyancy, heat conduction, friction, character conditions, and programming patterns. When tools: all, it can expose 71 MCP tools, including white-box family tools like wisdom_verify, wisdom_analyze, and wisdom_compose.

Self-Awareness (Brain Mode)

Under tools: 'brain' configuration, tools like cognition, cognition_report, self_reliability, emotional_bias, and recursive_reflect can be used for the Agent to reflect on its cognitive state and emotional tendencies.

Role-Playing Engine (v3.3)

Implemented based on role-playing theory: self-anchor (SELF layer no_forget), specialized values (conditional triggers), cross-session character memory, world cognition (sub-knowledge), custom translation (reality ↔ virtual glossary). From v0.2.8+, the plugin mounts /roleplay on the DSH webServer, sharing the origin with the GUI (default 127.0.0.1:3080). It can also run independently via python -m aeis.roleplay_web or connect through MCP tools like roleplay_chat.

Auditable Trust

Guardrail Charter v2 constrains external behavior; tool calls, memory writes, and self-validation judgments are all fully traceable. The protocol layer emphasizes reducing information asymmetry (D_norm), avoiding counterattacks under adversarial signals (isolation, logging, reporting), with the designer retaining final arbitration rights. Content gating performs server-side hard blocking (route=refused) for combinations of “minor-related terms + sexual content terms”.

Engineering Features

  • Zero runtime external dependencies stdio MCP bridge; automatic exponential backoff restart after Python subprocess crashes.
  • 2s polling to supplement registered tools during startup race conditions, avoiding permanent tool absence due to Python not being ready.
  • Dynamic schema: After Lingshu upgrades, the DSH side can fetch new tool lists without code changes.

Installation and Enabling

Installation involves two steps: first install the Lingshu Python package, then install the plugin via the DSH profile command. The README emphasizes using dsh plugin --profile for installation, not bare npm install into the profile’s node_modules, which could introduce incorrect versions of @deepseek-ai peer packages.

① Install Lingshu Brain (Python)

pip install aeis-0.3.0-py3-none-any.whl

Alternatively, you can use git+ for online installation as per the README; specific wheel or repository addresses are based on the GitHub release page.

② Install DSH Plugin (Example: web profile)

dsh plugin --profile web add @furongjun1999/dsh-memory

③ Enable in cordis.yml

- id: lingshu-memory
  name: '@furongjun1999/dsh-memory'
  config:
    dbPath: 'data/lingshu.db'
    identity: '灵枢'
    tools: 'brain'      # 'brain' full mind | 'core' selected | 'all' includes all wisdom_* tools

Requirements: package.json specifies Node >=22.19; peer dependencies include @deepseek-ai/cordis ^4.0.1, etc., resolved and coordinated by the profile’s pnpm.

If you need to modify the source code: Clone the repository and run npm install && npm run build, then deploy using dsh plugin add <local path>.

Typical Usage

Memory Recall

After the plugin loads, the Agent can call Lingshu-exposed MCP tools during conversations. Common entry points include:

  • lingshu_recall: Recall historical memories by semantics.
  • lingshu_search: Search the memory graph.
  • lingshu_timeline: Browse events by timeline.

Specific parameters are based on the runtime dynamic schema; the tool list updates automatically after Lingshu upgrades.

Knowledge Learning and Distillation

To solidify conversational experience into reusable knowledge, you can call tools like learn, induce, distill, and flywheel, following the verification → induction → association → distillation chain.

Role-Playing Web

After enabling the plugin in the DSH web profile, visit the same-origin /roleplay (there’s a “role-playing” entry in the top-right of the GUI homepage). Features include character selection/creation, full conversation transcription (JSONL persistence), a bidirectional translation panel, and UIs for importing memory/anchors/values.

Example of standalone deployment:

python -m aeis.roleplay_web --port 8793 --data-dir roleplay_data

For edit-type write interfaces, set the environment variable ROLEPLAY_EDIT_KEY and include the x-edit-key header in requests; when not set, it defaults to open for local development.

White-Box Knowledge Query

With tools: 'all' configured, the Agent can directly call tools like wisdom_verify, wisdom_analyze, wisdom_predict, wisdom_compose, and wisdom_respond to perform conditional routing, combinatorial generation, and self-validation without invoking the LLM to generate answers.

Applicable Scenarios and Notes

Who is it for?

  • AGI researchers building Agents in DSH that require cross-session, searchable, and associative memory.
  • Developers focusing on white-box reasoning, protocol engineering, role-playing consistency, or auditable trust mechanisms.
  • Scenarios requiring long role-playing dialogues without崩, and where memory and settings need to be importable/auditable.

Pre-usage Notes

  1. Permissions: The plugin runs with the current dsh process permissions, capable of reading/writing the configured dbPath and starting Python subprocesses. Before installation, review the source code and MIT license to confirm data storage location and network behavior align with your environment policies.
  2. Installation Method: Always use dsh plugin --profile <name> add to avoid peer dependency version conflicts.
  3. Positioning: The README clearly states this is research-oriented infrastructure, based on “Theory of Intelligence v3.3”; if you only need simple KV memory, the complexity may be excessive.
  4. Python Dependencies: Besides the npm plugin, the aeis package must also be installed. Versions for both need to align with the README/release notes.
  5. Content Gating: The open-source version does not perform authentication; the server only hard-blocks specific keyword combinations, and adult content relies on frontend local confirmation pop-ups.

Conclusion

dsh-memory connects Lingshu’s spatiotemporal memory, white-box reasoning, and guardrail mechanisms to DSH, addressing issues like Agent cross-session self-continuity, experience evolution, and behavioral auditability, rather than just creating another literal memory table.

  • SkillHub Directory: https://www.skillhub.cn/plugins/FuRongJun-1999/dsh-memory
  • GitHub Repository: https://github.com/FuRongJun-1999/dsh-memory
  • npm Package: @furongjun1999/dsh-memory (currently 0.3.0)

SkillHub is an independent community directory with no official affiliation with DeepSeek / High-Flyer. Whether to include this plugin in your DSH environment is recommended to be judged based on the source code, license, and the links provided above.