# dsh-memory [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/FuRongJun-1999/dsh-memory  
**GitHub Stars:** 772  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/dsh-memory

## Description
灵枢 LINGSHU · 为 AI Agent 提供可追溯、可复核的本地长期记忆，建立可信的自我。以 Markdown 保存记忆，支持分层写入复核与带证据的召回，适配 DeepSeek Harness 和其他 MCP 宿主。

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/FuRongJun-1999/dsh-memory), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Add to your MCP client:

```sh
dsh plugin --profile web add @furongjun1999/dsh-memory@0.11.3
```

## Documentation

## What dsh-memory does

dsh-memory provides local long-term memory for AI agents through the Model Context Protocol. It saves memories as Markdown on the user's computer, making the stored content readable, inspectable, and independently backuppable. Agents can record details from a conversation, then retrieve them in a later session with supporting evidence.

The memory model separates information into layers. The contextual layer is intended for ordinary conversation-specific facts and is normally readable and writable. Knowledge, structural, and self or anchor layers receive stricter treatment. The self layer can hold information about who the agent is, how it communicates, and persistent agreements, but saving or changing it requires user authorization.

## How it works

The main memory interface uses `cg` operations. A read operation can retrieve stored content, while a write operation accepts a layer and Markdown-formatted content. `mdcg_recall` provides a recall path for searching across prior memories; DeepSeek Harness also automatically recalls recent memories for the current session by default.

Memory writes are governed by a write gate. The default is `MDCG_WRITE_GATE=enforce`. Contextual entries can be committed directly, while knowledge and higher layers require review evidence. Structural entries require reflection and verification, and self or anchor entries additionally require an authorization decision. A successful write returns `committed`; a rejected write has not been persisted.

On startup, the server attempts to issue write credentials. If credential issuance is unavailable, it falls back to a read-only guest mode, allowing existing memories to be queried without accepting new writes.

## Setup and configuration

The package requires Node.js 22.19 or newer. DeepSeek Harness users can add the plugin to the web profile with:

```bash
dsh plugin --profile web add @furongjun1999/dsh-memory@latest
```

After installation, test both sides of the workflow: ask the agent to save a clearly defined memory, confirm that the operation was committed, then start a new conversation and request that memory by describing the earlier fact. If startup produces a read-only state, configure the write permissions described by the deployment's operations guidance before trying to save data.

`MDCG_REVIEW_CHANNELS` can declare available review channels such as `hive` and `subagent`, but declaring a channel does not itself satisfy the write gate. Higher-layer writes still need verifiable proof, such as an accepted signature or qualifying decision record.

## Tools and capabilities

- Store Markdown memories with `cg(op='write', layer=..., content=...)`.
- Read memory through `cg(op='read')`.
- Recall prior content with `mdcg_recall`.
- Keep memories organized across contextual, knowledge, structural, and self or anchor layers.
- Return evidence-backed results for memory retrieval.
- Preserve agent identity and long-term behavioral settings separately from ordinary context.

Memory content is expected to use a structured format covering the feature or fact, its activation conditions, subfeatures, execution, verification method, and exclusions. This structure supports later review and validation.

## Limitations and notes

Local persistence makes the files inspectable, but it also means deployment permissions determine whether the process can write them. Read-only fallback is useful for retrieval but cannot create new memories. Review-channel configuration alone does not unlock protected layers; the write gate checks appropriate proof and authorization.

The server's documented compatibility baseline is DeepSeek Harness. Its broader design targets other MCP hosts, but host-specific setup may differ. The package is MIT licensed.

_Full upstream README: https://allmcps.com/mcp/dsh-memory/readme_

