面向 DeepSeek Harness 的 OpenViking 记忆与上下文插件:pre-step 自动召回与画像注入、会话捕获、`viking://` URI 防护,以及对接 OpenViking 服务端的 recall/write 记忆工具。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:volcengine/OpenViking#path:/examples/dsh-memory-plugin
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本。请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
An installable DeepSeek Harness bundle that adds OpenViking auto-recall, session capture, viking:// URI protection, and model-invocable memory tools.
Requirements
@deepseek-ai/dsh0.1.0-rc.6- Node.js
^22.19.0or>=24 - A reachable OpenViking server
The bundle has no runtime npm dependencies. Its tool and message structures
come from the DSH constructors (defineTool from @deepseek-ai/dsh-tools,
createUserMessage from @deepseek-ai/dsh-llm) behind exact-pinned
peerDependencies that DSH exposes through its profile fallback at boot time, so
the definitions track DSH's contracts instead of hand-built object shapes.
It is tested against 0.1.0-rc.6; install that exact DSH release because
prerelease package dist-tags are not synchronized across the package family.
Why injection uses pre-step user messages, not the system prompt
Recall and profile context enter through the agent/pre-step waterfall as
durable, source-attributed user messages (source: { kind: 'plugin', … }).
They are deliberately not added to the system prompt: a DSH preset whose
persona declares complete: true (the stock minimal preset does) restores
that persona as the sole prompt section after assembly, silently discarding
every other contribution — a system-prompt-based memory plugin loses its
context under such presets with no error. Pre-step injection also makes each
injection a session event that replays, is visible to compaction, and never
reaches request/header.
Install
From the OpenViking repository:
dsh plugin --profile default add ./examples/dsh-memory-plugin
Or install the published package:
dsh plugin --profile default add @openviking/dsh-memory-plugin
Confirm that the profile includes the bundle:
dsh --profile default --dump-config
The package patch mounts the runtime inside a Cordis group with an isolated openvikingMemory service.
Configuration
OpenViking credentials use the same resolution order as the other memory plugins:
OPENVIKING_*environment variables~/.openviking/ovcli.conf~/.openviking/ov.conf
Common environment variables:
| Variable | Purpose |
|---|---|
OPENVIKING_URL / OPENVIKING_BASE_URL |
OpenViking server endpoint |
OPENVIKING_API_KEY / OPENVIKING_BEARER_TOKEN |
Bearer credential |
OPENVIKING_ACCOUNT |
Trusted-mode account |
OPENVIKING_USER |
Trusted-mode user |
OPENVIKING_PEER_ID |
Explicit actor peer |
OPENVIKING_WORKSPACE_PEER |
Derive a peer from each DSH session workspace by default |
OPENVIKING_RECALL_PEER_SCOPE |
all for cross-workspace recall or actor for isolation |
The patch can also carry plugin config:
- insert:
- id: openviking-memory
name: '@deepseek-ai/cordis-plugin-group'
group: true
isolate:
openvikingMemory: true
config:
- id: openviking-memory-runtime
name: '@openviking/dsh-memory-plugin'
config:
endpoint: http://127.0.0.1:1933
recallTokenBudget: 2000
scoreThreshold: 0.35
captureToolResults: false
commitTokenThreshold: 20000
Behavior
agent/session-startinjects the OpenViking profile and available-memory index throughagent.inject().agent/pre-stepretrieves with the current step input and appends a durable plugin message to that same step.session/eventcaptures user, assistant, and optionally tool-result messages without scraping a transcript.turn/endchecks the OpenViking pending-token threshold and commits when required.- Failed writes enter the shared OpenViking pending queue for replay at the next session start.
tools/pre-executeblocks DSH filesystem and shell tools from treatingviking://URIs as local paths.
Each DSH session maps to dsh-<session-id> in OpenViking. Workspace-derived actor peers are resolved per session and sent on every session-specific request.
Tools
The bundle registers:
viking_searchviking_readviking_browseviking_rememberviking_forgetviking_add_resourceviking_archive_expand
viking_forget performs permanent deletion. The calling model should use it only when the user explicitly requests deletion.
Testing
npm ci # installs the exact-pinned dsh devDependencies the tests exercise
npm test # node --test *.test.mjs — runs in the repo's PR workflow
live-recall.test.mjs is an opt-in end-to-end gate against a real OpenViking
server: it stores a sentinel memory through a session commit, waits for
extraction, and asserts recall returns that sentinel — the property no stub
can certify. Enable it with OPENVIKING_E2E=1 plus the normal credential
chain; it skips otherwise (including in CI until a server secret exists).
链接
同类插件
vectorize-io/hindsight#coding-agents★ 20019
Hindsight:会学习的 Agent 长期记忆系统,自动召回/保存、知识页、深度反思与按仓库隔离的记忆银行。
dsh-engramory★ 154
把 Engramory 策展式记忆纪律做成可安装插件([npm: dsh-engramory](https://www.npmjs.com/package/dsh-engramory)):通过 `ctx.tools.guard()` 对 `MEMORY.md` 索引施加确定性的 200 行 / 25KB 上限(增长即拒、缩小的重写一律放行),并把协议注册为运行时 skill。记忆库是纯 markdown、一条事实一个文件,与 Claude Code、Codex、Kiro、OpenClaw 共用。
omdsh-dev/dsh-mnemon★ 40
由 Mnemon 驱动的 DeepSeek Harness(DSH)跨 Agent、本地优先的持久记忆插件。它可在支持 Mnemon 的 Agent 之间共享长期记忆,并提供运行时记忆、可检索项目档案、语义召回、知识图谱和 Sidebar UI。
LoserFox/distill★ 19
自动对话蒸馏:后台 subagent 反省 + 技能 create/update。
Tyan66666/billion-context-dsh★ 16
模型驱动的上下文压缩(Active Context Pruning):由模型决定何时压缩、压缩什么。
Aik358/dsh-auto-memory★ 15
DSH 自动记忆插件:三层记忆自动注入与检索、每轮对话自动沉淀、AI 时段问候与三级抽屉、智能检索、日历视图与设置页,支持继承其他 AI 工具的记忆。