DeepSeek Harness 插件

dsh-memory-connect

跨会话记忆插件 (v0.3.0):自动提取、SQLite FTS5 索引、RRF 语义召回、定时维护、LLM 智能合并(自动接入 ctx.llm)、上下文爆炸防护、全局身份 Soul(~/.dsh/soul.md)。零配置。

跳到安装方式

来源信息

GitHub 仓库
Asher-2000/dsh-memory-connect
最近更新
2026年8月20日
分类
记忆
GitHub stars
0

安装

默认先复制一段 Prompt,让 Agent 读页面和仓库;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读页面和仓库。

请先不要安装。阅读这个 DeepSeek Harness 插件,说明它解决什么问题、会访问哪些文件、网络或密钥,以及如何安装和卸载。

插件页面:https://deepseekplugins.org/zh/plugins/Asher-2000/dsh-memory-connect
GitHub:https://github.com/Asher-2000/dsh-memory-connect
插件名:dsh-memory-connect
作者:Asher-2000
安装命令:dsh plugin --profile web add github:Asher-2000/dsh-memory-connect

确认前不要执行安装命令。

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

@deepseek-ai/dsh-memory-connect

> 跨会话记忆插件 — 让 AI Agent 拥有持久记忆和全局身份 > Cross-session memory plugin for DeepSeek Harness (DSH)

![License: MIT](LICENSE) ![Node.js](https://nodejs.org) ![DSH](https://github.com/deepseek-ai/dsh) ![Version](https://github.com/Asher-2000/dsh-memory-connect/releases)

---

English | [中文](#中文)

Overview

dsh-memory-connect is a cross-session memory sharing plugin for DeepSeek Harness. It automatically extracts, stores, and recalls memories across sessions, giving your AI agent persistent, intelligent memory with context explosion prevention and global Soul identity.

Zero-config — works out of the box with SQLite FTS5 and DSH's built-in LLM.

Features

FeatureDescription
🧠 Global SoulPersistent identity across all workspaces via ~/.dsh/soul.md
🔍 Auto ExtractionExtracts facts, preferences, decisions, and context from conversations
🧠 Semantic RecallRRF (Reciprocal Rank Fusion) combines keyword and semantic search
🛡️ Context Explosion PreventionToken budget management prevents context window overflow
Scheduled MaintenanceAutomatic periodic decay and consolidation via built-in scheduler
🤖 LLM ConsolidationIntelligent memory merging using DSH's built-in ctx.llm (zero-config)
📉 Memory DecayOld, unused memories naturally fade; frequently accessed ones persist
🎯 Smart PrioritizationMemory selection based on relevance × recency × frequency
🗜️ Memory CompressionAutomatic compression when approaching token limits

🧠 Global Soul (Identity)

The Soul feature provides a persistent identity that follows you across all workspaces.

How it works

1. Create ~/.dsh/soul.md with your identity information 2. The plugin automatically loads and injects it into every session 3. Your preferences, tech stack, and coding style are always available

Example Soul file

# 🧠 Soul — Global Identity

## 👤 Identity
- GitHub: your-username
- Role: Developer/Designer/Product Manager

## 💻 Tech Stack
- TypeScript, React, Node.js, DSH/Cordis

## 🎨 Coding Style
- Functional programming
- ES Modules
- Zero-config preferred

## ⚠️ Preferences
- No class components
- No redundant comments

Installation

npm install @deepseek-ai/dsh-memory-connect

Add to your DSH composition:

# agent.cordis.yml
- id: memory
  name: '@deepseek-ai/dsh-memory-connect'
  config:
    path: ~/.dsh/memory.db
    enableSoul: true  # Enable Soul injection (default: true)

Configuration

Basic Options

OptionDefaultDescription
path(required)Path to SQLite memory database
openAtstartupWhen to open: startup, first-query, never
maxRecallCount10Max memories to recall per session
decayRate0.02Decay constant (higher = faster decay)
journalModewalSQLite journal mode

Scheduler Options

OptionDefaultDescription
schedulerEnabledtrueEnable periodic maintenance
schedulerDecayIntervalMs3600000Decay interval (ms), default 1h
schedulerConsolidateIntervalMs21600000Consolidation interval (ms), default 6h

Context Explosion Prevention Options

OptionDefaultDescription
maxContextTokens4000Max tokens for memory context injection
smartPrioritizationtrueEnable smart memory prioritization
enableCompressiontrueEnable memory compression

Soul Options

OptionDefaultDescription
enableSoultrueEnable global Soul injection
soulPath~/.dsh/soul.mdCustom Soul file path

Full configuration example:

- id: memory
  name: '@deepseek-ai/dsh-memory-connect'
  config:
    path: ~/.dsh/memory.db
    openAt: startup
    maxRecallCount: 10
    decayRate: 0.02
    journalMode: wal
    schedulerEnabled: true
    maxContextTokens: 4000
    smartPrioritization: true
    enableCompression: true
    enableSoul: true

API

Search Memories

const memories = await ctx.crossSessionMemory.searchMemories({
  query: 'TypeScript configuration',
  types: ['fact', 'decision'],
  limit: 5,
})

Recall for Session

const memories = await ctx.crossSessionMemory.recallForSession(
  'session-123',
  'Setting up a new React project',
  10
)

Store Memory

await ctx.crossSessionMemory.storeMemory({
  type: 'preference',
  content: 'User prefers functional programming style',
  sessionId: 'session-123',
  tags: ['coding-style', 'preference'],
})

Manual Maintenance

// Trigger a full maintenance cycle (decay + consolidation)
const result = await ctx.crossSessionMemory.triggerMaintenance()

// Or run individually
await ctx.crossSessionMemory.runDecay()
await ctx.crossSessionMemory.consolidate()

Context Explosion Prevention

How It Works

1. Token Counting — Estimates tokens for English, Chinese, and mixed text 2. Smart Prioritization — Ranks memories by: relevance × 50% + recency × 30% + frequency × 20% 3. Budget Management — Enforces maxContextTokens limit (default: 4000) 4. Memory Compression — Automatically truncates or summarizes when approaching limits

Output Example

## 🧠 Global Identity (Soul)

[Your Soul content here]

---

## Related Memories from Previous Sessions

- [preference] User prefers TypeScript
- [decision] Chose PostgreSQL over MySQL

> 💾 Memory: 2/10 memories + Soul | 250/4000 tokens

Memory Types

TypeDescriptionExample
factObjective information"Project uses TypeScript 5.3"
preferenceUser preferences"Prefers functional components"
contextProject context"E-commerce platform migration"
decisionDecisions made"Chose PostgreSQL over MySQL"
skillLearned patterns"How to configure ESLint"

Development

git clone https://github.com/Asher-2000/dsh-memory-connect.git
cd dsh-memory-connect
npm install
npm test

License

MIT

---

中文

概述

dsh-memory-connectDeepSeek Harness 的跨会话记忆共享插件。它自动从对话中提取、存储和检索记忆,让 AI Agent 拥有持久化的智能记忆能力,并防止上下文爆炸全局身份

零配置 — 基于 SQLite FTS5 和 DSH 内置 LLM,开箱即用。

核心功能

功能说明
🧠 全局身份 (Soul)通过 ~/.dsh/soul.md 跨所有工作区持久化身份
🔍 自动提取从对话中提取事实、偏好、决策和上下文
🧠 语义召回RRF 融合关键词和语义搜索
🛡️ 上下文爆炸防护Token 预算管理,防止上下文窗口溢出
定时维护内置调度器自动执行衰减和整合
🤖 LLM 整合使用 DSH 内置 LLM 智能合并相似记忆
📉 记忆衰减旧的、不常用的记忆自然消退
🎯 智能优先级基于相关性 × 时间 × 频率的记忆排序
🗜️ 记忆压缩接近 token 限制时自动压缩

🧠 全局身份 (Soul)

Soul 功能提供跨所有工作区的持久化身份

工作原理

1. 创建 ~/.dsh/soul.md 包含你的身份信息 2. 插件自动加载并注入到每个会话 3. 你的偏好、技术栈和编码风格始终可用

Soul 文件示例

# 🧠 Soul — 全局身份

## 👤 身份
- GitHub: your-username
- 角色: 开发者/设计师/产品经理

## 💻 技术栈
- TypeScript, React, Node.js, DSH/Cordis

## 🎨 编码风格
- 函数式编程
- ES Modules
- 零配置优先

## ⚠️ 偏好
- 不用 class 组件
- 不写冗余注释

快速开始

npm install @deepseek-ai/dsh-memory-connect

添加到 DSH 配置:

# agent.cordis.yml
- id: memory
  name: '@deepseek-ai/dsh-memory-connect'
  config:
    path: ~/.dsh/memory.db
    enableSoul: true

许可证

MIT