Skip to main content

MemOS/apps/memos-local-plugin

10.8kStars999Forks74Issues45Watchers

Provides local four-layer long-term memory for DeepSeek Harness (L1 trajectory / L2 strategy / L3 world model / skills), with automatic retrieval each user turn and support for registering six memory tools.

Categories◆ Memory
Evidence4/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
TypeScript
License
Apache-2.0
Branch
main
agentagentic-aiaiai-agentschatgptclaudedeepseek-harnessdsh-plugin

Install

cmdweb profile
$ dsh plugin --profile web add @memtensor/memos-local-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 MemTensor/MemOS/apps/memos-local-plugin for me: review the repository at https://github.com/MemTensor/MemOS 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 Pitch

MemOS injects local-first long-term memory capabilities into DeepSeek Harness: it deposits each conversation round, tool results, and user feedback into a retrievable four-layer memory via SQLite, and automatically backfills relevant history into the context at each user turn, giving DSH cross-session continuity.

Core Capabilities

  • Executes a bounded automatic retrieval once at the start of each accepted non-empty user turn, injecting relevant history into the model prompt in <memos_context> format
  • Asynchronously captures conversation rounds, tool calls, and code execution results, writing to local SQLite database
  • Registers six memory tools for model invocation (memos_search / memos_get / memos_timeline / memos_environment / memos_skill_list / memos_skill_get), enabling the model to proactively query or load more detailed history
  • Provides a local HTTP/SSE-based Viewer panel (default 127.0.0.1:18801) for visual browsing and editing of memory data
  • Automatically reuses the host DSH's configured models and credentials as auxiliary LLMs (e.g., for summarization, reflection), eliminating the need for duplicate API Key configuration
  • Through the four-layer structure of L1 Trajectory / L2 Strategy / L3 World Model / Skills, extracts reusable subtask strategies from history and solidifies them into callable skills

Technical Implementation

  • Language: TypeScript (ESM modules)
  • Key Dependencies: @deepseek-ai/cordis (Cordis injection container), better-sqlite3 (local storage), @huggingface/transformers (local vector embeddings), @preact/signals + Vite Viewer (panel UI)
  • Architecture Pattern: Injected into host process as a Cordis bundle; does not start a separate daemon or use JSON-RPC sidecar; chains automatic retrieval and background capture through host event hooks such as agent/pre-step / session/event / session/disposed, and registers memory tools through DSH's tools service
  • Entry File: apps/memos-local-plugin/adapters/deepseek-harness/index.ts (apply hook), injected into the Cordis bundle stack via cordis.patch.yml

Use Cases

Used when users want DeepSeek Harness conversations to maintain contextual continuity across multiple sessions, or want to deposit project knowledge and tool call results into reusable private memory. It is particularly suitable for long-cycle project collaboration, personal knowledge base accumulation, and workflows requiring the model to remember user preferences and historical decisions.

Prerequisites & Compatibility

DependencyMinimum VersionDescription
DeepSeek Harness>=0.1.0-rc.5 <0.2.0Host platform; DSH is still in developer preview, cross-preview version changes may require adapter adjustments
Node.js^22.19.0
pnpm11.7.0Used for native dependency build script approval; one-click installer temporarily downloads if missing, then cleans up
PlatformmacOS / LinuxOne-click install script only supports macOS+Linux; Windows users can use DSH native dsh plugin flow
Native Modulesbetter-sqlite3, onnxruntime-node, esbuild, sharpAll require explicit allowBuilds in pnpm-workspace.yaml for pnpm 11

Installation

dsh plugin --profile web add github:MemTensor/MemOS/apps/memos-local-plugin

After installation, restart the current DSH profile (Ctrl+C/SIGINT or SIGTERM then start again) for the new bundle to take effect.

Configuration Options

The plugin receives configuration via Cordis's memos-local-memory line; you can directly modify $DSH_HOME/profiles/<profile>/cordis.patch.yml to override defaults. Note: DSH's patch layer replaces the entire config, so you need to preserve all fields when overriding.

ConfigTypeDescriptionDefault
enabledbooleanWhether to mount this adapter; when disabled, the plugin has no effecttrue
profileIdstringNamespace fallback identifier; sessions with agentPreset use the session valuedefault
homestringRuntime root directory; defaults to $DSH_HOME/memos-plugin/ (typically ~/.dsh/memos-plugin/)""
recallEnabledbooleanWhether to execute automatic retrieval for each accepted non-empty user turn; duplicate entries in same round are deduplicatedtrue
captureEnabledbooleanWhether to asynchronously write to database after rounds and tools completetrue
toolsEnabledbooleanWhether to register six memos_* tools for model invocation; when disabled, only automatic retrieval is availabletrue
hostLlmEnabledbooleanWhether to reuse DSH's configured models and credentials when MemOS has no explicit LLM configuredtrue
viewerEnabledbooleanWhether to enable local HTTP/SSE Viewer; when disabled, only headless memory runtime is availabletrue
viewerPortnumberViewer listening port (1–65535); different ports required for multiple profiles coexisting18801
recallTimeoutMsnumberRequest timeout shared by automatic retrieval and memos_search (milliseconds, minimum 100); actual effective cap is 3000ms3000
contextMaxCharsnumberMaximum characters for <memos_context> content injected into the model (minimum 256)6000
toolResultMaxCharsnumberMaximum characters for memory tool result body returned to the model (minimum 128)1200
failOnStartupErrorbooleanWhether to interrupt DSH profile startup on failure; defaults to logging warning and continuingfalse

FAQ

Q: Does uninstalling the plugin also delete memory data?

A: No. dsh plugin remove only removes dependencies and the bundle layer. The data/, skills/, and config.yaml in the runtime directory ($DSH_HOME/memos-plugin/) are preserved for reuse upon reinstallation; only manually deleting the directory will clear the memory.

Q: Do I need to configure a separate API Key after installation?

A: By default, MemOS reuses the host DSH's configured model credentials, no need to fill them in again in MemOS; only when llm.provider is explicitly set to a non-empty value in config.yaml will that provider's own credentials be used.

Q: What do I need to do after upgrading the plugin version or adjusting config.yaml?

A: You need to restart the current DSH profile for changes to take effect; DSH does not automatically discover newly installed packages during runtime, and imported modules are also cached within the process lifecycle. Saving Settings in Viewer to config.yaml will also prompt for manual restart of the host.

Q: Does automatic retrieval trigger every time? Are greetings skipped?

A: No skipping. All accepted non-empty user turns (including hello and other greetings, as well as resumed sessions and forks) trigger one automatic retrieval; duplicate entries in the same round are deduplicated, and messages generated by the plugin or tools do not trigger retrieval.

Q: Can the Viewer panel be accessed remotely?

A: No. Viewer only binds to loopback addresses 127.0.0.1 or localhost; setting viewer.bindHost to a non-loopback address in the config file will be rejected; do not put the loopback port behind a reverse proxy or tunnel. Viewer has no built-in identity authentication; enabling password protection requires writing .auth.json.

Q: Will multiple DSH profiles enabling Viewer simultaneously cause conflicts?

A: Yes. Multiple profiles cannot share the same Viewer port; you need to assign different viewerPort or enable Viewer in only one profile; different profiles sharing the same runtime directory share underlying memory, and browser cookies are shared across different ports on the same host, so be aware that login states can overwrite each other.

Getting Started Difficulty

Beginner — only need a single dsh plugin install command to get automatic retrieval capability, no manual API Key or database configuration required; advanced users can adjust Cordis configuration options or LLM, embedder, viewer settings in config.yaml as needed.

Known Issues & Limitations

  • DSH is still in developer preview: Adapter validated against DSH 0.1.0-rc.5/rc.6; breaking changes across preview versions may break the plugin
  • Capture gaps between background queue and restart window: Automatic retrieval never waits for the previous round's capture, relationship classification, or intent classification; during normal SIGINT/SIGTERM Cordis attempts bounded drain, but SIGKILL, crashes, or budget exhaustion may leave one round unpersisted
  • Viewer is local-only: Defaults to listening on 127.0.0.1:18801, no remote access support; multiple profiles cannot share the same port, browser cookies shared across ports on the same host will overwrite each other's login state
  • JSON output is prompt engineering, not enforced schema: DSH currently has no provider-neutral enforced JSON/Schema output; MemOS provides JSON contracts in prompts and parses locally, timeout/truncation/format errors trigger fallback
  • Routing boundary in pre-request phase: Each round's automatic retrieval runs before DSH closes that round's agent/request, so it can only read the last persisted request route; if none exists, the agent's public default is used
  • Background recovery has no attributed route: In full mode with L2/L3/Skill crystallization enabled, startup stale recovery and 10-minute dirty-episode rescore do not belong to any DSH request; these two background tasks are disabled when MemOS provider is host
  • Build scripts require approval: When installing versions like 2.0.16-beta.1 for the first time, pnpm 11 intercepts native module build scripts, requiring explicit allowance of better-sqlite3, esbuild, onnxruntime-node, sharp in pnpm-workspace.yaml; protobufjs and MemOS's own postinstall hint script should not be allowed
  • Do not downgrade Transformers.js: The 3.x / ONNX Runtime 1.21 combination before 4.x has a destructor crash on macOS when DSH calls process.exit(); profiles using local embeddings cannot downgrade this combination

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/MemTensor/MemOS/apps/memos-local-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