← Catalog

pi-memory-care

Keeps the Pi agent's long-term memory small: a consolidation skill and an idle reminder.

Package

Install

Install with PiG

pig install npm:pi-memory-care

Install with Pi

pi install npm:pi-memory-care
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "skills": [
    "./skills"
  ],
  "extensions": [
    "./extensions/memory-care.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.0 (README.md). PiG does not review it.

pi-memory-care

Keeps the Pi agent's long-term memory (<memory-dir>/MEMORY.md, managed by the pi-memory package) small and current. pi-memory injects at most 4,000 characters of <memory-dir>/MEMORY.md and cuts the middle of a longer file, so an oversized file silently loses content. This package has two parts:

  • a memory-care skill that guides one consolidation run: classify facts, show a diff, wait for your approval, edit, commit and push the memory dir;
  • an extension that reminds you when a run is due.

What the reminder does

When the agent is idle (at session start and after each run), the extension checks two things:

  • <memory-dir>/MEMORY.md is longer than the size threshold (in characters, as pi-memory counts them);
  • the interval has passed since the last consolidation (the newest commit in the memory dir whose subject starts with memory-care:; with none, the newest commit of any kind; without a Git repo of its own in the memory dir (a parent repo does not count) the interval check is skipped).

If either holds, it shows one notification per reason per session and appends one open item, Run /skill:memory-care (<reasons>), to <memory dir>/SCRATCHPAD.md, unless an open item mentioning memory-care already exists. An existing scratchpad is only appended to, and left untouched if it cannot be read.

It does not call a model, edit <memory-dir>/MEMORY.md, daily logs or recovery records, commit, or push. Any file or Git failure skips the check silently. Starting a consolidation is up to you.

Limitations

pi-memory rewrites <memory-dir>/SCRATCHPAD.md as a whole, so a write by pi-memory that lands at the same moment as the reminder can still be lost. The extension itself only appends and never truncates.

Install

Requires Pi with the pi-memory package and a Git repo in the memory dir.

pi install npm:pi-memory-care

Then run /reload or start a new session. Update with pi update npm:pi-memory-care.

The source is managed through GitHub. The repository is currently private; preparing a public repository is deferred. To try a local checkout instead, run pi install <path-to-checkout>; Pi then loads it in place and edits take effect on /reload.

Run a consolidation

When the reminder appears, run:

/skill:memory-care

The skill shows the proposed diff and the resulting size, and changes nothing until you approve. One approval covers the edit, the memory-care: commit and the push to the memory dir's origin.

Configuration

Environment variables, read at each check. Invalid or non-positive values fall back to the default.

VariableDefaultMeaning
PI_MEMORY_DIR~/.pi/agent/memoryMemory dir (same as pi-memory)
PI_MEMORY_CARE_MAX_CHARS3500Size threshold for <memory-dir>/MEMORY.md, in characters
PI_MEMORY_CARE_INTERVAL_DAYS7Days between consolidations

Host requirements

Pi is the supported host. The skill and reminder require no other coding agent or GUI. The existing defensive lifecycle fallback remains, but compatibility with other hosts is not part of the support contract. Linux deployment still needs verification on the target terminal.

Rollback

pi remove npm:pi-memory-care

Then /reload. If the reminder added a scratchpad item, delete it by hand. No other state is written.

License

MIT; see LICENSE.