Vector + graph memory backend: observe/remember/search/recall tools against a local memoria server, fusing HNSW semantic recall, FTS5 keyword search, and knowledge-graph signals via RRF ranking, with automatic turn-end persistence and per-agent namespace isolation.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:jiayan-xu/dsh-memoria
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
memoria 记忆后端插件:把 memoria(向量 + 图记忆层)接入 DeepSeek Harness (dsh),让 dsh agent 会话可以记住和回忆。
- 4 个工具:
memoria_observe/memoria_remember/memoria_search/memoria_recall - 自动写入:每轮对话结束自动
observe沉淀;用户肯定反馈(不错/很好/good/赞…)自动remember(importance=5) - 配置热重载:改
~/.dsh/settings.yaml的memoria:section 免重启生效 - 命名空间隔离:所有读写强制落在配置的 namespace(默认
dsh-test),不碰其他业务数据
使用前提
⚠️ 本插件是 memoria 的前端,不是记忆存储本身。使用前需要:
- 自建并运行 memoria 服务(默认连接
http://127.0.0.1:9003):memoria 是独立的开源项目(jiayan-xu/memoria,Rust 向量 + 图记忆服务)。没有该服务时工具会报连接失败。 - 准备 badge token:memoria 工具调用要求
register_agent签发的 badge token(admin key 不能直连),见下文「获取 memoria badge token」。以环境变量MEMORIA_AGENT_KEY提供(不落盘)。
装完发现工具报 Connection refused / HTTP 200 but auth failed,先检查这两项。
安装
前置:@deepseek-ai/dsh CLI 与 pnpm。
# 安装(自动挂载,无需手动改 profile)——两种源任选
dsh plugin --profile web add github:jiayan-xu/dsh-memoria
# 或 npm 源:
dsh plugin --profile web add @jhp830901/dsh-memoria
# 启动 dsh web 即可使用
dsh web
配置
插件默认连 http://127.0.0.1:9003(本地 memoria)。可配置项:
| 项 | 默认 | 说明 |
|---|---|---|
baseURL |
http://127.0.0.1:9003 |
memoria 服务地址 |
agentId |
dsh-memoria |
memoria agent 身份(需已注册) |
apiKeyEnv |
MEMORIA_AGENT_KEY |
环境变量名,值 = memoria badge token |
namespace |
dsh-test |
记忆命名空间(隔离边界) |
autoWrite |
true |
自动写入开关 |
推荐用 settings section 覆盖(热重载):
# ~/.dsh/settings.yaml
memoria:
baseURL: http://127.0.0.1:9003
namespace: my-namespace
autoWrite: true
agentKey 不要落盘,用环境变量:
export MEMORIA_AGENT_KEY=<badge-token>
获取 memoria badge token
memoria 的工具调用要求 X-Agent-Key 为 register_agent 签发的 badge token(admin key 不能直连)。未注册时先注册:
# 用 admin key 注册 agent(示例),返回 badge 有效期 1 年
curl -X POST http://127.0.0.1:9003/mcp -H 'Content-Type: application/json' \
-H 'X-Agent-Id: dsh-memoria' -H 'X-Agent-Key: <ADMIN_KEY>' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"register_agent","arguments":{"agent_id":"dsh-memoria","display_name":"dsh-memoria plugin","namespace":"dsh-test"}}}'
使用
用户:记住一个重要事实:我的仓库密码是 42
用户:我之前记住的仓库密码是什么? → 命中回忆
验收用例
- 写入:
memoria_remember {content, namespace}→{"status":"remembered","id":...} - 召回:
memoria_search {query, namespace}→ 语义 + 关键词多信号命中 - 隔离:其他 namespace 检索本插件数据 → 授权拒绝/空结果
开发
npm install -D typescript @types/node --legacy-peer-deps
bash scripts/build.sh # 产出 lib/(Windows 下依赖 junction,见 scripts/build.sh 注释)
License
BSD-3-Clause
Links
More in this category
vectorize-io/hindsight#coding-agents★ 60140
Hindsight, agent memory that learns: long-term project memory with auto recall and retain, knowledge pages, deep reflection, and per-repo memory banks.
volcengine/OpenViking#examples/dsh-memory-plugin★ 41884
OpenViking memory and context bundle for DeepSeek Harness: pre-step auto-recall and profile injection, session capture, `viking://` URI guarding, and recall/write memory tools backed by an OpenViking server.
MemTensor/MemOS#memos-local-plugin★ 12364
Local-first memory plugin for DeepSeek Harness: layered L1/L2/L3 memory with automatic capture, manual memos_* retrieval tools, and a built-in memory viewer.
agentscope-ai/ReMe#dsh★ 3794
Connects DeepSeek Harness to ReMe's local-first, self-evolving personal knowledge base: automatically captures completed main-agent conversations as user-owned Markdown memory, searches conversations and source material through reme_search with BM25, optional embeddings, and wikilink expansion, and schedules daily memory consolidation.
zilliztech/memsearch#MemSearch★ 2849
Shared Markdown memory for DSH and other coding agents, with automatic capture, pre-step context injection, searchable recall, and memory-to-skill self-evolution through a review panel.
vshulcz/deja-vu#extensions/dsh★ 1472
Reads the session files forty-two other coding agents on this machine already wrote (Claude Code, Codex, Cursor, VS Code Copilot Chat, opencode, OpenClaw, Hermes, Kimi, Cline, Zed and more), including sessions from before it was installed: six tools (deja_recall, deja_session, deja_blame, deja_fix, deja_how, deja_remember), a /deja command, and optional automatic recall added to the runtime context. Local BM25 index, no LLM, no embeddings, no network (dsh plugin --profile web add dsh-deja).
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.