DeepSeek Harness 插件

dsh-memos-bridge

DeepSeek Harness bundle that bridges the MemOS memory service into the agent over MCP: add, search, update and manage memories as native tools (mcp__memos__*).(英文原文)

跳到安装方式

来源信息

GitHub 仓库
Swd146296/dsh-memos-bridge
最近更新
2026年8月20日
分类
自动化与任务
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/Swd146296/dsh-memos-bridge
插件名:dsh-memos-bridge
作者:Swd146296

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-memos-bridge

A DeepSeek Harness bundle that bridges the MemOS memory service into the agent over MCP. Install the bundle, run one setup script, restart the Harness, and the agent gains persistent-memory tools named mcp__memos__*.

What you get

With the bundle active, the agent can call (a subset of the MemOS MCP surface):

ToolPurpose
add_memoryadd a memory from text, a document, or conversation messages
search_memoriessemantic search across the user's memory cubes
get_memory / update_memory / delete_memoryinspect / correct / remove single memories
create_cube / register_cube / share_cubemanage memory cubes
chatmemory-enhanced chat with the MOS system
control_memory_schedulerstart/stop the async memory scheduler
16 tools total, listed by the smoke test

How it works

DeepSeek Harness (web profile)
  └─ cordis.patch.yml  ──inserts──►  @deepseek-ai/dsh-mcp-client  (ships with the dsh CLI)
                                        │  stdio
                                        ▼
                                python -m memos.api.mcp_serve   (MemOS venv)
                                        │
                                        ▼
                        MemOS MOS core: Neo4j (graph memory), Qdrant,
                        LLM + embedding gateway (e.g. Bailian-compatible)

The bundle contributes only a configuration layer (dsh.bundle + cordis.patch.yml); it mounts the stock @deepseek-ai/dsh-mcp-client plugin with a stdio server row. No Harness code is modified.

Prerequisites

  • dsh CLI installed (the bundle relies on its built-in @deepseek-ai/dsh-mcp-client).
  • A MemOS checkout with its docker stack up (the compose in MemOS/docker provides Neo4j + Qdrant + the MemOS API).
  • Python ≥ 3.10 for the MemOS virtualenv.
  • The MemOS LLM and embedding gateway reachable from the machine that runs the MCP child (see [Host-run endpoint override](#host-run-endpoint-override)).

Quick start

1. Set up the MemOS side (venv + dependencies + source patches + local tokenizer):

# from the plugin checkout
.\setup.ps1 --memos C:\path\to\MemOS

On POSIX: ./setup.sh --memos /path/to/MemOS. This creates MemOS/.venv, installs MemoryOS[tree-mem] plus python-dotenv, tqdm, langchain_text_splitters, chonkie, applies the required source patches (see below), and downloads a local gpt2 tokenizer.json (HuggingFace mirror first).

2. Install the bundle into a profile:

dsh plugin --profile web add ./dsh-memos-bridge

3. Configure paths (the patch reads these at boot; all optional):

# PowerShell: setx MEMOS_PYTHON "C:\path\to\MemOS\.venv\Scripts\python.exe"
#             setx MEMOS_HOME   "C:\path\to\MemOS"
export MEMOS_PYTHON=/path/to/MemOS/.venv/bin/python
export MEMOS_HOME=/path/to/MemOS

When MEMOS_PYTHON is unset the row falls back to python on PATH; when MEMOS_HOME is unset the child inherits the Harness cwd (MemOS still reads its .env, so point MEMOS_HOME at the checkout unless MemOS is the launch directory).

4. Verify and restart:

dsh --profile web --dump-config    # expect an `id: memos-mcp` row
dsh --profile web                  # restart the GUI; tools appear as mcp__memos__*

Run the smoke test any time:

python scripts/smoke_test.py --python C:\path\to\MemOS\.venv\Scripts\python.exe --memos C:\path\to\MemOS --search

Configuration

The bundle's patch inserts one @deepseek-ai/dsh-mcp-client row (id: memos-mcp, serverName: memos). Environment knobs read by !!js at mount time:

VariableDefaultMeaning
MEMOS_PYTHONpythonpython of the MemOS venv
MEMOS_HOME'' (inherit cwd)MemOS checkout used as the child cwd
MEMOS_MCP_SERVERmemostool namespace (mcp__<name>__*)

To change any other field (e.g. toolCallTimeoutMs, failOnStartupError), override the row by id in your profile's cordis.patch.yml — later layers win, but an id-targeted patch replaces the whole config, so restate every key:

- id: memos-mcp
  config:
    transport: stdio
    serverName: memos
    command: 'C:/path/to/MemOS/.venv/Scripts/python.exe'
    args: ['-m', 'memos.api.mcp_serve']
    cwd: 'C:/path/to/MemOS'
    toolCallTimeoutMs: 60000
    failOnStartupError: false

Host-run endpoint override

MemOS's .env commonly targets host.docker.internal:18181/18182 (valid inside the MemOS docker network). When the MCP child runs on the host, those endpoints must be reachable from the host. If your gateway is published on the host loopback (or reachable only through a local proxy rule), override the endpoints with an env block on the row:

- id: memos-mcp
  config:
    transport: stdio
    serverName: memos
    command: 'C:/path/to/MemOS/.venv/Scripts/python.exe'
    args: ['-m', 'memos.api.mcp_serve']
    cwd: 'C:/path/to/MemOS'
    env:
      OPENAI_API_BASE: 'http://127.0.0.1:18181/v1'
      MOS_EMBEDDER_API_BASE: 'http://127.0.0.1:18182/compatible-mode/v1'
      MEMRADER_API_BASE: 'http://127.0.0.1:18181/v1'
      QWEN_API_BASE: 'http://127.0.0.1:18181/v1'
    failOnStartupError: false

(These values only stick because the patch script changes MemOS's load_dotenv(override=True) to override=False — ambient env then wins over .env.)

MemOS source patches

scripts/patch_memos.py applies five small, idempotent fixes to the MemOS checkout (tested against MemoryOS 2.0.30):

1. src/memos/api/config.pyload_dotenv(override=True)load_dotenv(), so host-run env overrides are not clobbered. 2. src/memos/log.py — console handler to stderr; stdout is the MCP protocol channel and log lines there corrupt the stdio stream. 3. src/memos/api/mcp_serve.py — map EMBEDDING_DIMENSION into the default config so the Neo4j vector index matches the embedder dimension. 4. src/memos/mem_os/utils/default_config.py: - env-aware embedder construction honoring MOS_EMBEDDER_BACKEND / MOS_EMBEDDER_API_BASE / MOS_EMBEDDER_API_KEY / MOS_EMBEDDER_MODEL / EMBEDDING_DIMENSION (mirrors APIConfig.get_embedder_config; the MCP default path otherwise ignores them and reuses the chat endpoint); - the sentence-chunker tokenizer points at a local gpt2 tokenizer.json — chonkie otherwise downloads gpt2 from huggingface.co, which is unreachable in some networks.

Run python scripts/patch_memos.py --list to see the patch list. If a patch fails with "not in pre-patch state", your MemOS version differs from 2.0.30 — check the diff and re-apply by hand.

Troubleshooting

SymptomCause / fix
dsh plugin add installs Gu / split packagesOn Windows, a plugin path containing spaces is split when dsh forwards it to pnpm. Use the 8.3 short path (e.g. C:\Users\GULING~1\...) or add . from a space-free directory.
Row stays pending after restartMEMOS_PYTHON/MEMOS_HOME wrong, or MemOS venv missing. Check dsh --profile web --dump-config.
Graph not found: memosdefaultuser at server startNeo4j Community Edition + MOS_NEO4J_SHARED_DB=false in .env → set it to true and NEO4J_AUTO_CREATE=false (single shared neo4j database).
Tokenizer 'gpt2' could not be loaded ... huggingface.coRun setup.py to download the local tokenizer, or set HF_ENDPOINT=https://hf-mirror.com (the patch script's tokenizer line already points at the local file).
Embeddings request ended with error: Error code: 503The LLM/embedding gateway (e.g. :18181/:18182) is down or not reachable from the host — see [Host-run endpoint override](#host-run-endpoint-override) and start the gateway.
MCP handshake fails / Failed to parse JSONRPCLogging to stdout — re-run patch_memos.py (patch #2).
pydantic serialization warnings at startupCosmetic; MemOS prints them when serializing config objects.

Security

The MCP server command runs as trusted executable code outside the agent sandbox (this is why the Harness enables no MCP server by default). Only connect to MemOS servers you run yourself.

License

MIT