Get Memory (dsh-get-memory): Using GitHub Repository as DSH External Memory

Introduction

When engaging in long-term conversations or cross-device collaboration in DeepSeek Harness (DSH), context often exists only within the current session: restarts, switching frontends, or opening new windows all require re-explaining your persona, conventions, and “where you left off last time.” Some people write memories into local files or notes, but this becomes misaligned with DSH’s injection timing and write-back timing, resulting in high maintenance costs.

GetMemory (dsh-get-memory) binds “what to read, what to write” to a GitHub repository you specify: at the start of a conversation, it automatically pulls Markdown files from the repository to inject context; at the end of a conversation (when auto write-back is enabled), the plugin calls the model to extract information worth retaining long-term, writes it back per file, and commits. Memories live in Git, shared across devices and restarts via the same set of files. The plugin is published by community maintainer krodon998, categorized as “Memory” in the DSH plugin directory; the current npm package version is 0.5.1, licensed under MIT.

The following sections cover its purpose, capabilities, installation steps, and configuration highlights. Before installing, please review the GitHub repository source code and license yourself; the plugin runs with the current DSH process permissions.

What Is This

GetMemory is a memory-type plugin for DSH: the name corresponds to both “Get Memory” (retrieve) and “Git Memory” (stored in a GitHub repository). It is designed for the DSH desktop application; the web interface is a mirror of the desktop app, and its capabilities follow the desktop app—no independent web plugin is provided.

Before selecting a memory repository, the plugin neither injects nor writes back—under default configuration, there is no risk of unintended operations.

Core Functions

Conversation Start: Pull and Inject

Each time a new session is created or restored (agent/created), the plugin fetches repository files in parallel via the GitHub Contents API, updates both memory and disk cache (~/.dsh/cache/aire-memory/snapshot.json), and injects them when assembling the model context (default injectOrder is 100, positioned before common runtime context). Injected content undergoes brace sanitization to prevent template syntax like {{User}} in the repository from interfering with execution.

If pulling fails, the conversation is not interrupted: it falls back to the disk cache (marked as stale); if no cache exists, a “temporarily unavailable” placeholder is injected.

Conversation End: Extract and Write Back (Optional)

Auto write-back is disabled by default (writebackEnabled: false) to avoid consuming model quota. When enabled, after the turn has been idle for approximately 30 seconds (writebackDebounceMs, default 30000) or when the session is closed, the plugin uses the current session model (or a configured extraction model) to extract new information from recent conversation transcripts, generates complete content for each file marked as “read-write,” first GETs the latest SHA then PUTs to commit; 409 conflicts trigger a re-fetch and one retry. If there are no substantive changes, no commit is made. Write-back only applies to root sessions; sub-agent/workflow sessions are not written to; failures are only logged.

File Permissions and Multiple Files

The settings page allows “syncing the file list,” where each file can be checked as read-only or read-write: injection reads all files in the participating list, while write-back only processes read-write files. The default ledger filename is 长期记忆账本.md (ledgerFile). Empty repositories can be initialized via the “One-click initialize” button in the settings page, where the plugin creates 长期记忆账本.md with a template—no need to manually create files on the GitHub web interface.

Interface

The left sidebar “GetMemory” quick panel (heart icon): view pull/write-back/token status, manually pull, toggle auto write-back, and recent operation logs. The native DSH settings page provides token, repository selection, file permissions, trigger scope, check for updates, etc.; advanced options (branch, injection order, transcript limits, extraction model, etc.) can be adjusted in the plugin’s full configuration.

Security and Tokens

GitHub fine-grained PATs should only be granted read/write Contents access to the target repository. Token lookup order: DSH credentials store AIRE_MEMORY_GITHUB_TOKEN (saved via panel, recommended) → same-named environment variable → configuration item githubToken (migrated to credentials store on first load). The token is only used for the single repository you configured and is never written into repository files; before write-back, content is sanitized for secret-like patterns.

Installation and Activation

  1. Install the plugin (search for dsh-get-memory in the plugin marketplace, or run the following command):
dsh plugin --profile web add dsh-get-memory
  1. Generate a fine-grained PAT on GitHub with only read/write Contents access to the target repository.

  2. Open the left sidebar “GetMemory” panel or settings page → paste the token and save → select one memory repository from the list.

  3. If the repository is empty, click “One-click initialize” in the settings page.

  4. Chat normally to automatically read memories at the start of conversations; enable “Auto write-back” when you need long-term automatic memory consolidation.

To change tokens: generate a new PAT → save via panel or settings page (or edit AIRE_MEMORY_GITHUB_TOKEN in ~/.dsh/.credentials.yaml, restart DSH) → revoke the old token on GitHub.

Typical Usage and Configuration Summary

The daily workflow follows the README’s “Quick Start”: install → configure token and repository → optionally enable write-back. Write-back frequency is controlled by writebackEveryN (default once every 5 messages; set to 1 for every message); sessionPolicyMode can be set to all sessions, exclusion list, or allow-list only.

Common configuration defaults (see the repository README for the complete table):

Field Default Description
repo empty No injection or write-back if not configured
branch main Branch name
writebackEnabled false Auto write-back
writebackEveryN 5 Write back once every N messages
ledgerFile 长期记忆账本.md Primary ledger file

Most changes in the settings page and panel are saved as runtime overrides, taking effect immediately and persisting across restarts.

Use Cases and Notes

Suitable for: DSH desktop users who want to store memories, personas, and rules in GitHub Markdown, sharing the same “external brain” across multiple devices; those who accept the model invocation cost for write-back functionality.

Notes:

  • The plugin directory site skillhub.cn plugin page is a community ecosystem index with no official affiliation with DeepSeek/Hunyuan; DSH itself follows the “everything is a plugin” extension approach.
  • Auto write-back calls the model for extraction—enable it as needed and configure writebackEveryN appropriately.
  • Requires Node ^22.19.0 || >=24.0.0 (see package.json engines).

Conclusion

GetMemory treats GitHub repositories as DSH’s versionable memory layer: automatic reading at conversation start, optional write-back at conversation end, with configuration completed via the left sidebar and settings page. For further details, principles, and complete configuration fields, see GitHub: krodon998/dsh-get-memory; plugin directory page: https://www.skillhub.cn/plugins/krodon998/dsh-get-memory.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye