Introduction

The plugin mechanism of DSH allows additional capabilities to be integrated into the Web profile as a profile bundle. For users who need to maintain long-term memory in DSH sessions, generate user profiles, and support dialogue and memory search, dsh-tdai-memory provides a memory layer: first capturing L0 conversations, then extracting L1 structured memories, and finally performing automatic recall injection during prompt assembly.

What is This

dsh-tdai-memory is a DeepSeek Harness plugin maintained by Scorp1o117, positioned as a port of TencentDB Agent Memory. The license is MIT, the package.json version is 0.2.14, and it requires Node >=22.18.

It primarily addresses issues related to memory consolidation, structured extraction, recall injection, and search. The plugin reuses the existing ~/.memory-tencentdb/memory-tdai data directory, so if there is already memory data in that directory, it can be continued to be used.

Core Features

Here are its capability boundaries.

  • L0 conversation capture: Each conversation turn is written to raw conversation storage, with the storage format being JSONL + SQLite + FTS + vectors.
  • L1 structured memory: A background LLM pipeline extracts facts, preferences, and events from conversations, writes them to records/, and maintains SQLite + FTS + vectors.
  • L2 scenes / L3 persona: Generates scene blocks and user profiles.
  • Automatic recall injection: During prompt assembly, related memories and user profiles are injected as dynamic context.
  • Tools: Provides tdai_memory_search (L1 structured search) and tdai_conversation_search (L0 raw-text search).
  • Configuration: Configuration is managed via the tdai-memory: settings namespace, and can also be modified in the Web UI Settings → Memory section.

Installation and Activation

First, confirm the local environment. dsh-tdai-memory requires engines.node version >=22.18. Regarding version compatibility:

  • Versions 0.2.13 and higher require DSH 0.1.0-rc.7 or higher, and have been tested with 0.1.0-rc.7, 0.1.0-rc.8, and 0.1.1-rc.1.
  • Users of DSH 0.1.0-rc.6 need to use dsh-tdai-memory@0.2.11 specifically.

Installation command:

dsh plugin --profile web add dsh-tdai-memory

This command will install the plugin as a standard profile bundle into the web profile. After installation or adjusting configuration, you need to restart dsh web:

dsh web

Configuration changes take effect after restart.

Typical Usage

LLM and embedding API keys can be placed under the tdai-memory: namespace in $DSH_HOME/settings.yaml, or set in the “Memory” section of the Web UI settings page.

Example for $DSH_HOME/settings.yaml:

tdai-memory:
  llm:
    apiKey: '<llm-api-key>'
  embedding:
    apiKey: '<embedding-api-key>'

The base layer of the profile patch can retain only the basic fields, with specific configurations placed in settings:

- id: tdai-memory
  name: 'dsh-tdai-memory'
  config: {}

If you choose a fully local embedding backend, node-llama-cpp is an optional peer dependency and is not installed by default.

Use Cases and Considerations

It is suitable for use in DSH Web profile with the following capabilities:

  • Long-term storage of conversation history with support for raw-text search.
  • Extraction of facts, preferences, and events from conversations.
  • Generation of scene blocks and user profiles.
  • Automatic injection of related memories in subsequent prompt assemblies.

Please note the following before use:

  • The plugin runs with the permissions of the current dsh process. Before installation, you should check the source code, license, and dependencies; this plugin’s license is MIT.
  • The plugin does not modify files in the host installation.
  • dedup is disabled by default due to unstable output parsing in LLM conflict detection.
  • The performance of the extraction model needs to be evaluated separately: mimo-v2.5 can extract correctly, but each call takes about 20-30s; deepseek-v4-flash produces invalid extraction JSON.
  • Configuration changes take effect after restart.

Links

  • GitHub: https://github.com/Scorp1o117/dsh-tdai-memory
  • Plugin directory page (plugin leads, independent site): https://www.skillhub.cn/plugins/Scorp1o117/dsh-tdai-memory