Tingxue (dsh-tingxue): Dual-Mode QQ Conversation and Self-Built Local Memory

Preface

When performing long-term companion-style conversations or file processing in DeepSeek Harness (DSH), the common practice is to rely on hosted memory services or to mix “chat” and “work” contexts within the same Web session. The former places data with third parties, while the latter easily leads to contamination between persona, memory, and one-off tasks. Tingxue (dsh-tingxue) is a DSH plugin published by community maintainer oranskyx and categorized under “Memory.” Its primary interaction occurs in QQ (via dsh-notifier), memory is stored in a local LanceDB, and a relationship graph is built internally. It also provides disposable, isolated agent sessions for file processing. The following sections introduce its positioning, capabilities, and installation usage.

What is this

Tingxue runs on DeepSeek Harness and is a dual-mode virtual life plugin:

  • Chat Mode: Possesses a persona and long-term memory; the context structure is cache-friendly. Entered by simply sending a message in QQ by default.
  • Agent Mode: An isolated pure-file processing session. After processing ends, it is archived into the memory bank and the working copy is destroyed.

Memory does not rely on hosted services: LanceDB local files serve as the database, the relationship graph is implemented independently, and semantic reasoning uses a pluggable small LLM. The current plugin version is 0.1.0, licensed under MIT. The Node requirement is >= 22.19 (see engines in package.json).

Core Features

Dual Modes and Directives

Only two QQ commands are needed throughout the process. The plugin automatically creates sessions, binds, and re-binds, requiring no manual /bind:

Operation Effect
Send message directly Chat Mode: Persona + Memory + Four-block context assembly
/agentstart Enter Agent Mode: Create new isolated session and auto-bind
Send files, multi-round discussion Files continue to be processed as context
/agentstop Archive conversation to memory bank, delete working copy, destroy isolated session, re-bind to chat session

Self-Built Memory and Relationship Graph

  • LanceDB Embedded Vector Database: Local files act as the library, containing four tables (Memory Entries / Entities / Relationships / Latest Info).
  • Relationship Graph Pipeline: Entity Extraction → Entity Linking → Triple Relationships with time windows and provenance → Graph Traversal for enhanced retrieval.
  • Graph UI: Defaults to listening on http://127.0.0.1:8765. Open in a browser to view the force-directed graph of entity relationships; available offline.

Models and Configuration

Embedding and semantic reasoning are abstracted into a unified interface; changing models only requires configuration changes. The default model backend is sta1n, but it can be switched to local or custom OpenAI-compatible endpoints. The DSH Web GUI provides graphical configuration via two entry points: the “Tingxue” page and “Plugin Configuration” in the settings sidebar. There are currently 29 configuration items, written to $DSH_HOME/settings.yaml; cordis.patch.yml is retained as the base layer.

Push Isolation and Mode Self-Healing

  • Routing via dsh-notifier’s route:agents prevents notifications from other DSH sessions from disturbing QQ.
  • Startup self-checks and runtime reconciliation: If the mode and QQ binding are inconsistent, it automatically reverts to Chat Mode to prevent silent loss of persona and memory.

QQ Files

QQ attachments are downloaded to dataDir/workcopy/ via the [File] marker by a pre-step and injected into the context. Text files go directly into the context (single file limit 5 MB, body truncated to 8000 characters); binary files only provide the file name and size. Supported in both Chat Mode and Agent Mode.

Prerequisites

Dependency Version / Description
Node.js >= 22.19
DeepSeek Harness 0.1.1-rc.2 or higher
dsh-notifier Must be pinned to 0.9.0 and patched (not ^0.9.0); otherwise features like receiving QQ files will not work
pnpm Required to resolve native dependencies when installing @lancedb/lancedb
LLM / embedding endpoint Default sta1n, can be changed to local OpenAI-compatible endpoint

Runtime external packages are primarily @lancedb/lancedb and apache-arrow (locked at 18.1.0).

Installation and Activation

DSH plugins are loaded at process startup and do not hot-reload. Modifying source code requires syncing to the profile’s node_modules copy and restarting DSH. Changes on the browser side require a hard refresh (Ctrl + Shift + R).

You must first install and patch dsh-notifier:

cd ~/.dsh/profiles/web
pnpm add dsh-notifier@0.9.0

# Put patch in profiles/web/patches/, wire it in pnpm-workspace.yaml:
#   patchedDependencies:
#     dsh-notifier: patches/dsh-notifier.patch
pnpm install

Verify patch: node_modules/dsh-notifier/src/inbound/_qq-segment.mjs exists, and src/inbound/message.mjs contains parseQQFileAttachments.

Then install Tingxue and declare the bundle:

cd ~/.dsh/profiles/web
pnpm add file:/absolute/path/to/dsh-tingxue

Add the bundle declaration to the profile’s package.json; otherwise, you will see “Installed but not active: dsh.bundle not declared”:

"dsh": {
  "profile": {
    "bundles": [ "...", "dsh-tingxue" ]
  }
}

Restart DSH to mount the plugin.

Post-installation self-check (Requires access to the plugin repository, as install-check.mjs is not published with the npm package):

cd ~/.dsh/profiles/web
node <plugin-repo>/scripts/install-check.mjs
node <plugin-repo>/scripts/install-check.mjs --json

The script performs machine checks on bundle declarations, notifier version and patches, running copy vs. repository consistency, cordis.patch.yml structure, etc. --fix can auto-repair and supports rollback on failure; active profiles are read-only by default. It will not execute pnpm install, sync copies, or restart DSH for you.

Typical Usage

After installation and restart, in QQ:

(Send message directly)          → Chat Mode
/agentstart           → Agent Mode: Isolated file processing
(Send files, multi-round discussion)
/agentstop            → Archive and return to Chat Mode

The persona prompt is a user-written txt file, configured via the profilePath item. The default directory for memory data is dataDir (default cwd/.dsh-tingxue). Common memory-related items include memoryBudgetTokens (default 1600), latestInfoBudgetTokens (default 1000); injectRecentRounds is off by default to avoid duplicate token billing with DSH session history.

Use Cases and Notes

Who is it for

  • Developers or self-hosters already running QQ channels on DSH (dsh-notifier) who want a fixed persona, local vector memory, and a browsable relationship graph on the QQ side.
  • Those who need to occasionally switch to isolated sessions in QQ to process attachments and want automatic archiving after completion without long-term occupation of main session context.

Important Notes

  • The plugin runs with the permissions of the current DSH process. Before installation, please read the repository source code and the MIT License, and assess the security of credentials and conversation data in dataDir yourself. The README mentions active profile credential risks and SECURITY.md.
  • dsh-notifier@0.9.0 and the patch are hard dependencies; skipping them will result in silent feature loss (e.g., receiving files).
  • The community directory skillhub.cn plugin page and GitHub repository are maintained by the community and have no official affiliation with DeepSeek / High-Flyer. The DSH ecosystem philosophy is “Everything is a plugin,” and Tingxue is one such path for “Memory + QQ Dual Mode.”

Conclusion

Tingxue combines QQ chatting (Persona + LanceDB + Self-built Graph) with isolated agent file processing into a single plugin, using /agentstart and /agentstop for automatic switching. If you are already using dsh-notifier in your profile, you can follow the README to complete the notifier patch, file: installation, and bundle declaration, and use install-check.mjs to troubleshoot common pitfalls of “installed but not active.”

  • Directory Page: https://www.skillhub.cn/plugins/oranskyx/dsh-tingxue
  • Source Code & Docs: https://github.com/oranskyx/dsh-tingxue
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye