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

@yandy0725/pi-memory

v4.4.1

Published

File-system driven persistent memory layer for pi coding agent

Readme

pi-memory

English | 中文

Persistent memory for the pi coding agent: project knowledge (facts, preferences, debugging history) kept as plain Markdown files, available across sessions and across harnesses. Memory lives on disk, not in the conversation.

Install

pi install npm:@yandy0725/pi-memory

Requires pi 1.5.0 or newer (@earendil-works/pi-coding-agent peer range is >=1.5.0).

Or add it to ~/.pi/agent/settings.json:

{ "packages": ["npm:@yandy0725/pi-memory"] }

Configure a model first

// ~/.pi/agent/memory.json
{ "defaults": { "model": "provider/model-id" } }

There is no bundled default model, and it does not fall back to the parent session's model: defaults.model must resolve in your registry. dream always needs it; autoSurfacing / extractMemories need it when enabled. A missing model makes session_start report a config error and initialise nothing.

What it does

  • One memory tool — add / replace / remove / list / search. One memory per file, name is the lookup key, and add with an existing name overwrites it.
  • MEMORY.md in the system prompt — the memory_index section is frozen for the whole session, so pi's section diff appends nothing per turn and the provider prefix cache keeps hitting.
  • Auto-surfacing — one lightweight side query per turn picks relevant memories and injects their bodies inside <relevant_memories>.
  • Automatic extraction (off by default) — after each turn a sub-session picks out what is worth remembering and writes it through the same tool.
  • /dream — a headless tidy-up: merge duplicates, resolve contradictions, rebuild the index.
  • /deep-dream — manual cross-project pass: reads the memory of every project (full entry bodies go to the configured model), never modifies the sources, and writes a candidate report you copy into your global AGENTS.md yourself. See the reference.
  • Cross-device sync (on by default) — push this project's memory to a git remote and share it with another machine working on the same repository (see below).
  • Runs natively on Windows; no WSL needed.

Cross-device sync (enabled by default)

Set sync.remote to push this project's memory entries to a git remote so another machine working on the same repository shares them:

// ~/.pi/agent/memory.json
{ "sync": { "remote": "[email protected]:you/project-memory.git" } }
  • No configured or initialized remote: in a git project startup reports a non-fatal sync configuration error and does not contact a remote; local memory keeps working. A non-git project only gets the unsupported-environment notice. To disable sync, set { "sync": { "enabled": false } } in memory.json.
  • There is no init command: the next session start with this config clones into <memoryDir>/.sync/repo and records a baseline.
  • Prepare the remote yourself (an empty repository is fine) and make sure git can clone/push it non-interactively — pi-memory stores no credentials.
  • Only entry *.md files sync: MEMORY.md, .lock, .backups/ and sessions/ stay local.
  • If both sides rewrite the same memory, both are kept: the other becomes a deterministic conflict copy that /dream merges later.
  • On the first sync of a project that already has local entries, expect one info notice (pi-memory sync notice: …) that same-named entries may land as conflict copies. It is not a failure and it does not repeat for that baseline.
  • Manual convergence: /memory sync pull / push / status (strict dry-run) / remote <url>.

Full semantics: cross-device sync.

Commands

| Command | What it does | |---|---| | /memory | Memory dir, index capacity, entry count, module status, lock holder | | /memory unlock | Clear a .lock left behind by a crash | | /memory sync [status\|pull\|push\|remote <url>\|unlock] | Sync status and manual convergence | | /dream | Tidy the memory (confirms first, then snapshots the whole directory) | | /deep-dream | Analyze every project's memory into a candidate report (confirms first; sources stay read-only) |

Full tool and argument reference: tool reference.

Where memory lives

<memoryDir>/<git|local>/<project>/

The default root is $XDG_DATA_HOME/simple-memory on Linux and macOS (~/.local/share/simple-memory when XDG_DATA_HOME is unset or relative) and %LOCALAPPDATA%\simple-memory on Windows. The disk format (entry frontmatter, MEMORY.md, .lock, .backups/) is defined by memory-core; memoryDir overrides the root, but it is per-harness configuration — with dsh, override it to the same value on that side too.

The index is frozen for the whole session: memories written this session appear in the system prompt only after a compaction or in the next session. The tool's return value is the confirmation that the write happened.

Docs

  • Reference (in Chinese): full configuration, cross-device sync, internals, tool and command reference
  • Repository: memory-core / dsh-memory and how to develop

MIT