npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-memory

v0.1.0

Published

Durable cross-session memory for DeepSeek Harness: local SQLite FTS5 store, three model-facing tools, and a recall prompt section — no embedding service and no sidecar

Readme

dsh-memory

Durable cross-session memory for DeepSeek Harness.

The harness ships no memory plugin. Its extension-cookbook names the mechanism — a prompt section plus tools — but nothing implements it, so every session starts blank. This package fills that gap with one local SQLite file: no embedding service, no API key, no sidecar process.

Install

dsh plugin --profile web add dsh-memory

The shipped bundle row stores memories at $DSH_HOME/memory/memory.db, shared by every profile on the machine.

What it gives the model

| Tool | Purpose | |---|---| | memory_write | Store one self-contained durable fact, optionally tagged and pinned | | memory_search | Keyword search over memory text and tags | | memory_forget | Delete a memory that is now wrong or obsolete |

Plus a memory:recall prompt section that renders pinned memories first, then the most recently updated, under a character budget. Recall therefore does not depend on the model remembering to search — what it stored is already in front of it, and search is for anything older than the budget allows.

The memory_write description steers the model away from the common failure modes: transient task state (that is what the todo list is for), secrets, and facts the repository already records.

Configuration

- id: memory
  name: dsh-memory
  config:
    path: !!js dshHomePath('memory/memory.db')
    promptRecentCount: 10
    promptMaxChars: 2000
    maxTextChars: 2000
    searchLimitDefault: 10
    searchLimitMax: 50
    promptOrder: 50

| Field | Default | Meaning | |---|---|---| | path | — (required) | SQLite file, or :memory: for an ephemeral store | | promptRecentCount | 10 | Unpinned recent memories offered to the prompt section | | promptMaxChars | 2000 | Budget for the rendered section; overflow is reported as a count, and pinned memories are emitted first so they survive a tight budget | | maxTextChars | 2000 | Maximum characters accepted for one memory | | searchLimitDefault | 10 | memory_search limit when the model omits it | | searchLimitMax | 50 | Hard cap, whatever the model asks for | | promptOrder | 50 | Section order; -100 is the harness identity, 0 the persona |

path has no code-side default on purpose: a default would scatter durable user facts into whatever directory the harness happened to start in. The deployment value lives in the patch row.

Storage

One SQLite file: a memories table plus an external-content FTS5 index kept in sync by triggers. Parent directories are created on open, and the store survives process restarts.

Search compiles the query by quoting every token, so FTS5 operators a model happens to type (OR, *, -, ") are matched literally instead of changing the query's meaning or raising a syntax error mid-tool-call. Surviving tokens combine with FTS5's implicit AND: every token must appear, and a query whose tokens include a word you did not store legitimately matches nothing.

node:sqlite is still flagged experimental in Node 22/24, so running the harness prints one ExperimentalWarning. The harness's own dsh-session-query-sqlite uses the same module.

Failure behavior

Load-time misconfiguration fails loud: an empty path, a non-positive bound, or a searchLimitDefault above searchLimitMax throws at plugin load.

At call time, a blank fact or one over maxTextChars is a tool error the model can correct. A memory_forget for an id that does not exist is a successful result reporting forgotten: false — the model asked for a state that already holds, which is not an infrastructure failure.

Extension points

ctx.tools.register() for the three tools and ctx.systemPrompt.section() for recall. Every registration is a Cordis effect, so unloading the plugin removes the tools and the section together and closes the database.

Development

pnpm install --ignore-workspace
pnpm run typecheck
pnpm test
pnpm run build

Tests cover the store directly (FTS retrieval, the literal-token query contract, prompt ordering, durability across reopens) and the plugin against the real tool registry and prompt service (registration, disposal, the write→recall round trip, bounds, fail-loud config).

License

MIT

Prior art

The idea comes from pi-mentis (MIT) in the Pi ecosystem. This is an independent implementation against Harness extension points and shares no code with it. It deliberately drops pi-mentis's sidecar process, Zvec vector store, and required SiliconFlow embedding key in favour of one local FTS5 file — smaller, keyless, and offline, at the cost of lexical rather than semantic retrieval.