dsh-long-memory
模型与 MCP 活跃维护

dsh-long-memory

wwskills/dsh-long-memory

轻量级会话记忆扩展插件,支持跨多轮会话自动留存、复用用户关键交互上下文,无需重复补充背景信息,部署配置门槛低,可自然保障对话连贯性与交互体验。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
174 KB
仓库大小
26 天前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:wwskills/dsh-long-memory
git clone https://github.com/wwskills/dsh-long-memory.git
git clone git@github.com:wwskills/dsh-long-memory.git
README.md main

@wwskills/dsh-long-memory

Long-term cross-session memory plugin for DeepSeek Harness.

SQLite-backed, FTS5 + optional embedding recall, append-only audit log, L7 auto-extraction. Single-bundle dual-face packaging (Node service + browser UI).

Features

  • *8 `mem_` tools** — search, record, status, stats, forget, confirm, scope list, scope set
  • FTS5 full-text search with CJK support (works out of the box, zero config)
  • Optional embedding — Ollama (local, zero cost) or any OpenAI-compatible API
  • Hybrid recall — BM25 + vector + RRF fusion when embedding is enabled
  • L7 auto-extraction — automatically extracts memories from conversations on turn/end using your DSH LLM provider (zero extra config)
  • Keyword fallback — if LLM is unavailable, regex-based keyword extraction kicks in
  • File tracksMEMORY.md session markers + memory/YYYY-MM-DD.md daily notes
  • Audit log — append-only, tracks every memory operation
  • Browser UI — settings tab + memory manager + confirm queue

Install

dsh plugin --profile web add @wwskills/dsh-long-memory

Configuration

Defaults are sensible. Override via your profile's patch layer as needed.

Embedding

Provider Use case Cost
none FTS5 keyword only (default) Zero
ollama Local Ollama service Zero (local)
openai-compatible Any OpenAI-style API Per-call
- id: long-memory
  config:
    embedding:
      provider: 'ollama'          # 'none' | 'ollama' | 'openai-compatible'
      model: 'bge-m3'
      dimension: 1024
      ollama:
        base_url: 'http://127.0.0.1:11434'

L7 Auto-extraction

L7 reads your DSH LLM provider config automatically — no extra API key needed.

- id: long-memory
  config:
    l7:
      enabled: true               # enable auto memory extraction
      auto_extract: true          # LLM-based + keyword fallback
      extractor_model: ''         # empty = use cheapest model from your DSH config
      extractor_temp: 0.2
      interval_ms: 21600000       # 6h minimum between extractions

Storage

    storage:
      path: '${DSH_HOME}/long-memory/long-memory.db'
      markdown_dir: '${DSH_HOME}/long-memory/markdown'

Tools

Tool Purpose
mem_search FTS5 + hybrid search across memories
mem_record Persist a memory; auto-detects scope
mem_status Storage + recall state
mem_stats Aggregate statistics
mem_forget Archive or delete; writes audit log
mem_confirm Approve/reject queued sensitive memory
mem_scope_list List all scopes
mem_scope_set_active Set active scope filter

Requirements

  • Node ≥ 22.5 (uses built-in node:sqlite)
  • DeepSeek Harness 0.1.0-rc.2+

License

MIT — see LICENSE.