Skip to main content

OpenViking/examples/dsh-memory-plugin

30.8kStars2.4kForks472Issues82Watchers

Inject OpenViking long-term memory into DSH: automatically recall relevant context before each step, asynchronously persist the entire conversation to disk, and provide the mcp__openviking__* toolset with viking:// URI protection.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
Python
License
AGPL-3.0
Branch
main
agent-memoryagent-pluginsagentic-ragcontext-databasedsh-pluginself-evolving

Install

cmdweb profile
$ dsh plugin --profile web add @openviking/dsh-memory-plugin

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin volcengine/OpenViking/examples/dsh-memory-plugin for me: review the repository at https://github.com/volcengine/OpenViking first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Line Positioning

Connects OpenViking context database to DeepSeek Harness: automatically retrieves relevant memories before each step, asynchronously persists entire conversation sessions to disk, and exposes the mcp__openviking__* toolset plus an openviking-memory skill guide to the model.

Core Capabilities

  • At the agent/pre-step hook, perform semantic search using the current step's input, append hits as user messages with source attribution as background for subsequent responses
  • Listen to session/event to automatically collect user, assistant, and (optional) tool result messages and write to the OpenViking session; auto-commit when token threshold is reached
  • Register a set of bridged model tools: mcp__openviking__search / read / list / tree / grep / glob / remember / write / edit / forget / add_resource, etc. (automatically synced with server advertisement)
  • At tools/pre-execute, intercept DSH local tool's erroneous calls to viking:// URIs, redirecting the model to use the bridged OpenViking tools instead
  • Attach a separate openviking skill provider, serving only the built-in openviking-memory skill, non-interfering with DSH's built-in filesystem provider
  • When server is temporarily unreachable, automatically fall back to local pending queue (~/.openviking/pending/), replay on next session start
  • Each DSH session maps to dsh-<session-id>; actor peer is derived from working directory by default, can be explicitly overridden

Technical Implementation

  • Language: JavaScript (Node.js ESM, pure *.mjs)
  • Key Dependencies: @deepseek-ai/dsh-llm (createUserMessage for constructing injection messages), @deepseek-ai/dsh-mcp-client (attaching MCP bridge), @deepseek-ai/dsh-skill-filesystem (attaching skill provider)
  • Architecture Pattern: Cordis plugin group (@deepseek-ai/cordis-plugin-group), internally subscribes to five lifecycle events within apply(ctx, input): agent/session-start / agent/pre-step / session/event / session/flush / tools/pre-execute; MCP bridge is launched as a stdio child process via servers/mcp-proxy.mjs to avoid connection hangs when directly connecting to /mcp
  • Entry Point: examples/dsh-memory-plugin/index.mjs, declared for loading in cordis.patch.yml

Use Cases

Developers who need DSH to reuse past project knowledge and user preferences across multiple sessions and workspaces: the model automatically retrieves context from historical decisions and documents each turn, while asynchronously persisting conversations to the OpenViking server, avoiding the need to re-explain each time; you can also use add_resource to bulk-import remote repositories or documents into the viking:// virtual filesystem.

Prerequisites & Compatibility

DependencyMin VersionDescription
DSH (@deepseek-ai/dsh-llm, dsh-mcp-client, dsh-skill-filesystem)>=0.1.0-rc.6 <0.2.0peerDependencies locked to 0.1.x range, won't load on 0.2.x
Node.js`^22.19.0
PlatformCross-platformNo os / cpu restrictions declared in source
Native ModulesNoneBundle has no runtime npm dependencies; only uses Node built-ins fs/os/crypto/url

Installation

dsh plugin --profile web add github:volcengine/OpenViking/examples/dsh-memory-plugin

Configuration Options

ConfigTypeDescriptionDefault
endpointstringOpenViking server addresshttp://127.0.0.1:1933
apiKeystringBearer credential (also supports OPENVIKING_API_KEY / OPENVIKING_BEARER_TOKEN, or in ~/.openviking/ovcli.conf)""
accountstringtrusted-mode account (request header X-OpenViking-Account)""
userstringtrusted-mode user (request header X-OpenViking-User)""
peerIdstringExplicit actor peer, overrides default derived from workspace""
workspacePeerbooleanWhether to automatically derive actor peer from current directorytrue
recallPeerScope"all" | "actor"Whether to limit recall to current peerall
recallQueryExpansion"auto" | "off"Whether to rewrite queriesauto
recallTokenBudgetnumber (200–50000)Max tokens allowed for recall context2000
recallMaxContentCharsnumber (100–5000)Truncation length for recall entry abstracts500
recallLimitnumber (1–50)Number of recall entries10
scoreThresholdnumber (0–1)Recall score threshold, hits below this are discarded0.35
minQueryLengthnumber (1–64)Minimum query length to trigger recall3
profileTokenBudgetnumber (500–50000)Token limit for one-time profile injection at startup10000
commitTokenThresholdnumber (1000–1000000)Triggers session commit when accumulated pending tokens reach this value20000
commitKeepRecentCountnumber (0–1000)Number of recent messages to keep on commit10
captureMode"semantic" | "keyword"Auto-capture modesemantic
captureAssistantTurnsbooleanWhether to capture assistant replies as welltrue
captureToolResultsbooleanWhether to capture tool execution resultsfalse
captureMaxLengthnumber (200–100000)Max length per captured message24000
captureToolMaxCharsnumber (200–1000000)Max characters allowed for tool results1000000
requestTimeoutMsnumber (1000–120000)Timeout for OpenViking HTTP API calls10000
mcpToolCallTimeoutMsnumber (1000–600000)Bridged MCP tool call timeout60000

Credential lookup order: environment variables (OPENVIKING_URL / OPENVIKING_API_KEY / OPENVIKING_BEARER_TOKEN / OPENVIKING_ACCOUNT / OPENVIKING_USER / OPENVIKING_PEER_ID / OPENVIKING_CREDENTIAL_SOURCE / OPENVIKING_CONFIG_FILE / OPENVIKING_CLI_CONFIG_FILE) → ~/.openviking/ovcli.conf → ~/.openviking/ov.conf → built-in defaults (http://127.0.0.1:1933). Pending queue environment variables: OPENVIKING_PENDING_DIR (default ~/.openviking/pending/, directory permissions 0o700, files 0o600), OPENVIKING_PENDING_MAX_RETRIES (default 3), OPENVIKING_PENDING_TTL_DAYS (default 7), OPENVIKING_PENDING_REPLAY_LIMIT (default 50).

FAQ

Q: Which OpenViking server does it connect to by default after installation?

A: Connects to localhost http://127.0.0.1:1933 by default. Can be overridden via OPENVIKING_URL environment variable, ~/.openviking/ovcli.conf config file, or explicitly via config.endpoint field in cordis.patch.yml.

Q: Which DSH version is required?

A: Requires DSH 0.1.0-rc.6 or higher within the 0.1.x range. package.json locks core peer packages to >=0.1.0-rc.6 <0.2.0; crossing to 0.2.x will fail to load due to peerDependencies mismatch.

Q: Will conversations be lost when offline?

A: No. When OpenViking server is unreachable or writes fail (HTTP 408 / 429 / 5xx, or returns retryable: true), messages are serialized to ~/.openviking/pending/ (directory permissions 0o700, files 0o600), and automatically replayed on next session start; max 3 retries or cleaned up after 7 days.

Q: What is viking://? Can DSH's built-in read tool open it directly?

A: viking:// is OpenViking's virtual database URI, not a local file path. The plugin intercepts DSH's erroneous calls to viking:// from read / glob / grep / bash / edit / write / str_replace_editor at the tools/pre-execute stage, redirecting the model to bridged tools like mcp__openviking__read / mcp__openviking__list / mcp__openviking__grep.

Q: Will memories be cleared after uninstalling the plugin?

A: No. Memories are stored on the OpenViking server; uninstalling the plugin only stops automatic recall and capture, won't delete persisted data; to fully delete, call mcp__openviking__forget with the accurate viking:// URI.

Q: Do I need to install the OpenViking server?

A: Yes. The plugin is just a client bridge; a reachable OpenViking server is required for recall and writes to work; when the server is unreachable, all writes fall back to the local pending queue.

Q: Is API Key configuration required?

A: Not mandatory. With default local config, empty key can connect to local service; when connecting to remote service or trusted-mode deployment, set OPENVIKING_API_KEY (or OPENVIKING_BEARER_TOKEN), and optionally configure OPENVIKING_ACCOUNT / OPENVIKING_USER.

Difficulty Level

Advanced — installation is just a single dsh plugin add command, but to actually use it you need a reachable OpenViking server running locally or remotely, plus understanding of concepts like viking:// URI, actor peer isolation, and recall budgets; just reading the README and tweaking config items without actually integrating with the server will get you blocked by the default 127.0.0.1:1933.

Known Issues & Limitations

  • Strongly bound to DSH 0.1.x: peerDependencies locks dsh-llm / dsh-mcp-client / dsh-skill-filesystem all to >=0.1.0-rc.6 <0.2.0, overrides further fixes the entire dsh family to 0.1.0-rc.6; when DSH upgrades to 0.2.x, this plugin won't load due to peer mismatch.
  • Strongly bound to Node engine: engines.node is hardcoded to ^22.19.0 || >=24; earlier Node versions reject installation outright.
  • Actor peer scope is process-level only: MCP tool calls carry the peer resolved at process startup, not re-resolved per request; when one process serves multiple workspaces, explicit override via OPENVIKING_PEER_ID is needed.
  • mcp__openviking__remember doesn't bind to current DSH session: server writes remember to its own short-term session, not dsh-<session-id> real-time stream; auto-capture will still persist this conversation.
  • Injection point is agent/pre-step not system prompt: design intent is to avoid the issue where complete: true preset wipes out other prompt sections; if DSH adds a strip-plugin-source filter after pre-step in the future, recall context will be stripped too.
  • mcp__openviking__forget is an irreversible hard delete; README explicitly requires the model to only call it when user explicitly requests.
  • Offline pending queue has no background worker: replay only triggers on next session-start, max 50 items per replay; if service is unreachable for extended time, entries are cleaned up after TTL (default 7 days) or retry limit (default 3) is reached.
  • live-recall.test.mjs end-to-end test is skipped by default: only runs when OPENVIKE_E2E=1 is set and real server credentials are provided; currently not enabled in CI.

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/volcengine/OpenViking/examples/dsh-memory-plugin)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory