dsh-memory-starmap: Rendering DSH session memory into a rotatable 3D nebula
dsh-memory-starmap is an experimental DSH plugin and a local microservice maintained by 1837458003-ctrl, categorized under Model Inference in the community plugin directory. It reads session records from `~/.dsh/sessions`, computes 512-dimensional semantic vectors using `bge-small-zh-v1.5` (ONNX Runtime, CPU), reduces the dimensionality to 3D using UMAP, projects them onto a sphere, and renders a nebula using Three.js: white dots represent normal dialogue, blue dots represent important memories, gold dots represent the personality core, and lines indicate semantic proximity. The plugin is only responsible for the ✦ overlay entry point in the bottom-right corner of the Web interface and keeping the local service alive. The actual data pipeline consists of several Python scripts (`extract.py`, `embed.py`, `build.py`, `server.py`) in the repository, running entirely locally without uploading data over the network. It requires Python 3.10+ and the DSH desktop or Web client, with a model size of approximately 95MB and dependencies of approximately 300MB. Installation involves two steps: first, clone the repository, install dependencies, and download the model; second, run `extract.py`, `build.py`, and `server.py 8126` to start the service. The plugin is mounted using `dsh plugin add link:<repo_path>`, and `STARMAP_HOME` must be set to point to the repository directory; otherwise, the entry point will display, but the service will not start automatically. Other configuration options include `STARMAP_PYTHON`, `STARMAP_PORT`, `STARMAP_AI_NAME`, `STARMAP_MODEL_DIR`, and `DSH_SESSIONS`. The rationale given in the README for using UMAP instead of PCA is that PCA directions naturally concentrate points, resulting in an axis ratio of approximately 2 to 5 times, causing points to be compressed into a diagonal strip. The radius of `is_core` nodes is multiplied by 0.62 and `is_longterm` nodes by 0.85 to keep core memories within the inner circle. Known limitations include dependency on the Python runtime, slow initial map building (approximately 10 to 30 seconds for a few hundred memories), Chinese optimization, the overlay only linking to the local port 8126, and read-only access to the `user/assistant` body content. The project is licensed under MIT, and the bge model copyright belongs to BAAI.
Read More