dsh-visual-memory: Lossless Visual Memory for DSH Agents

Introduction

When running multi-turn Agents with screenshots in DSH, the common approach is to re-send the image to the vision model each turn, or write the “model’s description of the image” into text memory. The former involves repeated uploads and high cost; the latter loses pixel information, and descriptions may change when switching models. If you need “the exact color of a cell in a particular screenshot,” “pixel-by-pixel comparison of two UI states,” or “retrieving the original image by turn or tag,” neither text memory nor secondary vision inspection is sufficiently reliable.

Below is an introduction to the community plugin dsh-visual-memory (maintainer: xiciyang, category: memory). It stores original image bytes locally using content-addressing, indexes them with sha256 for retrieval, reads pixels, assembles comparison images, and recalls by text/tag/turn—without relying on a second vision model loop.

What Is This

dsh-visual-memory is a bundle plugin for DeepSeek Harness (DSH): store an image once, and subsequent questions are answered based on the original bytes—exact pixels, exact replay, retrievable by text, tag, sha256, turn range, or near-duplicate image.

Compared with “having the vision model look again” or “stuffing base64 into a text memory entry,” this plugin hands the bytes to the host’s ctx.attachments for verbatim, content-addressed storage, while the index and combined views are maintained by the plugin itself.

Core Features

The README benchmarks its capabilities against lossless visual memory and spatiotemporal inspection in VISTA-class harnesses; in this repository, this is realized as a bundle layer with seven tools (see the “Tools” section of the GitHub README for the full list). The verified main capabilities are as follows.

Requirement Tool Description
Lossless storage with easy retrieval visual_remember Writes original files verbatim to attachment storage; index includes turn/step, sha256, dHash, tags, text, etc.
Retrieve historical screenshots visual_recall Supports query, id, sha256, tags, turn ranges, chronological order, perceptual near-duplicates (dHash)
Read exact pixels in a region visual_read_pixels Returns #rrggbb center-sampled matrix to avoid visual model rounding of color values
Assemble an inspection image from multiple frames/regions visual_inspect Crops views from archived observations; supports layout (e.g., side-by-side)
State comparison and replay visual_compare Labeled side-by-side/grid/stacked comparisons
Route and multimodal capability detection visual_memory_status Detects whether the current route declares native image input; pure-text routes can still access stored images via sha256:… handles issued by DSH

Cropping, pixel differencing, palettes, and other numerical/image operations belong to dsh-vision-toolkit (e.g., vision_crop, vision_pixel_diff); byte storage belongs to the host attachments; indexing, attention ledger, multi-view assembly, capability detection belong to this plugin, avoiding forks between two implementations.

Not suitable scenarios (README “30-second decision”): needing a cloud image host (this plugin uses a local file backend), Android (the pixel engine will spawn python3), or a one-time “describe this image”—DSH’s native image input already covers the observation path.

Installation and Activation

The plugin runs with the permissions of the current DSH process; before installing, please read the repository source code and MIT license to confirm compliance with your environment policies.

The recommended installation method parses from GitHub (facilitates use of various registry mirrors):

dsh plugin --profile <name> add github:xiciyang/dsh-visual-memory

You can also install via the npm short name:

dsh plugin --profile <name> add @xiciyang/dsh-visual-memory
dsh --profile <name> --dump-config      # A "# == @xiciyang/dsh-visual-memory" layer should appear

If installation errors mention 0.0.0-stage, this is usually caused by residual pnpm metadata cache; you can clean the cache and retry as described in the README. Uninstallation:

dsh plugin --profile <name> remove @xiciyang/dsh-visual-memory

Dependency preparation:

python3 -m pip install pillow

Verification status (README): node verify.mjs within the repository shows 17/17; end-to-end real invocation was recorded as 11/11 on DSH 0.2.0-rc.2.

Typical Usage

There is no standalone configuration file; the storage root varies with the session workspace. The logical locations are as follows (excerpted from the README):

Content Path Description
Session index <session workspace>/.dsh-visual-memory/ index.jsonl append writes
Multi-workspace registration $DSH_HOME/visual-memory-roots.json Gallery routing, recent ~20 workspaces
Original image bytes $DSH_HOME/attachments/v1/files/<sha>/ Content-addressed; deleting the index does not delete the original file

The invocation order in the Quick start can be reproduced as:

// 1. Store the current screenshot with a searchable description
visual_remember({ path: "./shot.png", text: "checkout page, CNY 199, two buttons", tags: ["ui","checkout"] })

// 2. Retrieve without re-uploading
visual_recall({ query: "checkout" })            // or sha256 / id / tags / turn range / near-dup

// 3. Read exact colors within a region (vision models tend to round)
visual_read_pixels({ id: "VM-…", region: "120,40,200,80", rows: 2, cols: 4 })

// 4. Assemble multiple archived frames into a labeled comparison image
visual_inspect({ views: [{ id: "VM-…", region: "0,0,800,600" }, { id: "VM-…" }], layout: "side-by-side" })

To clear the memory of a workspace, delete .dsh-visual-memory/; the original images under attachments/ require separate space reclamation.

Applicable Scenarios and Notes

Suitable for: Long-running UI automation or debugging Agents that need to reference exact pixels of the same screenshot across turns; comparing interfaces before and after; retrieving historical frames by turn, tag, or hash, with answers that do not drift when “switching to a different vision model.”

Notes:

  1. Desktop/server environment; the pixel engine depends on python3 subprocesses, Android is not in the current scope.
  2. It is recommended to configure a model route that declares image input on the observation path; the plugin detects routeCapability, pure-text routes can still store images, but access is via sha256 handles.
  3. DSH < 0.2.0 will be rejected for installation due to engines.dsh; >= 0.3.0 is not verified in the materials.
  4. The community directory SkillHub and GitHub are independent ecosystem entries, with no official affiliation with DeepSeek / HFQ; DSH itself adheres to “everything is a plugin,” and whether to install is up to your evaluation.

Conclusion

dsh-visual-memory separates “description” from “bytes”: images are stored once, addressed by sha256, and tools are used to read pixels, assemble inspections, perform comparisons, and recall by multiple keys—reducing repeated uploads and dependence on vision model transcription. For details, the complete tool table, and boundary descriptions, please refer to the repository README.

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

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

Xiaoye