@taylorsatula/pi-durable-memory

Proper long-term memory for Pi. These are not crude MEMORY.md files. Each memory is stored individually and the agent curates them. Memories are injected into the context window for just-in-time recall. Local SQLite, embedding search.

Packages

Package details

extension

Install @taylorsatula/pi-durable-memory from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@taylorsatula/pi-durable-memory
Package
@taylorsatula/pi-durable-memory
Version
0.4.1
Published
Oct 21, 2026
Downloads
359/mo · 359/wk
Author
taylorsatula
License
MIT
Types
extension
Size
65.7 KB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-durable-memory

Long-term memory for pi, retrieved by embedding similarity. It stores short notes from past sessions and surfaces the relevant ones when you start new work.

Memories are stored unencrypted by default; AES-256-GCM encryption is one menu choice away. Embeddings are never encrypted, because encrypted content cannot be searched.

Install

pi install npm:@taylorsatula/pi-durable-memory

No configuration. The store is created on first use in ~/.pi/agent/durable-memory/, which follows PI_CODING_AGENT_DIR if you have set it.

How it works

The extension adds one tool, durable_memory, and one command, /durable-memory.

  • surface looks up memories related to a query and returns the best matches.
  • checkpoint returns a reminder to store what you learned and rate what you saw.
  • create, edit, delete manage memories.
  • helpful rates memories so more useful ones rank higher.

Memories live in memory.db, outside the package directory, so they survive pi update.

Settings

Run /durable-memory with no arguments for an interactive menu. You can configure the embedding endpoint, model, auth key, database location, and whether the local store is encrypted. Settings are saved to ~/.pi/agent/durable-memory/config.json. /durable-memory status prints the same information without a menu.

Environment variables override settings when present:

Variable Purpose
DURABLE_MEMORY_EMBED_URL Embedding endpoint URL
DURABLE_MEMORY_EMBED_MODEL Embedding model name
DURABLE_MEMORY_EMBED_KEY Auth key
DURABLE_MEMORY_DIR Database directory
DURABLE_MEMORY_GLOBAL_DIR Read-only shared store, merged into surface

Shared stores

A second, read-only store can be mounted next to your own — a team corpus everyone searches while each person still writes privately to their local store. Mounting one, seeding it, and what happens when its vectors were built with a different embedding model are covered in docs/global-store.md.

Verification

The probe and the retrieval benchmark live in the repository, not in the published package:

git clone https://github.com/taylorsatula/pi-durable-memory
cd pi-durable-memory
node bench/probe.mjs   # functional witness: every code path, end to end
node bench/run.mjs     # retrieval benchmark behind the cosine floor and K

Both need an embedding credential (DURABLE_MEMORY_EMBED_KEY, the apiKey in ~/.pi/agent/durable-memory/config.json, or a lunaroute entry in ~/.pi/agent/auth.json) and run against a scratch store, never your own. npm publish runs the probe first.

Known limits

  • No decay: old memories stay until deleted or down-rated.
  • Embeddings are stored in cleartext.
  • Search scans all memories in memory; fine up to a few thousand.
  • Memories are global, not scoped per project.
  • A shared store is read-only: it can be searched, never written or re-embedded from here.