pi-diet-memory

Explicit lightweight persistent memory for Pi with no automatic context injection.

Packages

Package details

extension

Install pi-diet-memory from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-diet-memory
Package
pi-diet-memory
Version
0.1.1
Published
Jun 2, 2026
Downloads
not available
Author
probabilityengineer
License
MIT
Types
extension
Size
20 KB
Dependencies
0 dependencies · 2 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-diet-memory

Explicit lightweight persistent memory for Pi with no automatic context injection.

pi-diet-memory gives Pi agents a small, inspectable memory store for durable user preferences, project conventions, and lessons learned. Memories are saved only when explicitly requested or proposed for user approval. The extension avoids transcript scraping, vector databases, background consolidation, and automatic prompt injection, keeping prompt overhead low while still letting agents search memory when relevant.

How to use it

Use pi-diet-memory for durable context that should survive sessions:

  • user preferences
  • workflow habits
  • recurring corrections
  • stable project conventions
  • lessons learned

Do not use it for:

  • secrets
  • temporary task state
  • raw transcripts
  • one-off command output
  • facts that are better stored in repo docs

Commands

Show saved memories:

/memory

Search approved memories:

/memory-search jj workflow

Save an explicit memory:

/memory-remember I prefer concise recommendations first, then caveats.

Review proposed memories:

/memory-review

Tool

One compact tool:

  • memory — list, search, review, remember, propose, approve, update, and forget memories.

Save an explicit user-requested memory

Use remember only when the user asks to remember something.

{ "action": "remember", "text": "User prefers compact action-enum tools for small Pi extensions.", "kind": "preference", "tags": "pi,extensions,tools", "pinned": true }

Propose an inferred memory

Use propose when the agent notices a durable preference, but the user did not explicitly ask to save it.

{ "action": "propose", "text": "User prefers positive guidance phrased as desired behavior rather than negative bans.", "kind": "preference", "evidence": "User requested this style while discussing AGENTS.md guidance.", "tags": "guidance,style" }

Review pending candidates

{ "action": "review" }

Approve a candidate

{ "action": "approve", "id": "cand_..." }

Search approved memories

{ "action": "search", "query": "positive guidance" }

Update a memory

{ "action": "update", "id": "mem_...", "text": "User prefers concise positive guidance phrased as desired behavior rather than negative bans.", "pinned": true }

Forget a memory

{ "action": "forget", "id": "mem_..." }

Memory kinds

Use one of:

  • preference — user style or workflow preference
  • project — stable project convention
  • lesson — correction or mistake to avoid
  • reference — useful durable fact or link

Scopes

Default is global:

{ "scope": "global" }

Use project scope for repo-specific memory:

{ "scope": "project" }

Storage

JSON Lines under:

~/.pi/agent/pi-diet-memory/
  memories.jsonl
  candidates.jsonl

Memories are human-readable and easy to inspect or back up.

Safety

  • Memory is context, not authority; current user instructions and repo evidence win.
  • Do not store secrets.
  • Prefer concise, stable preferences and lessons over raw transcript snippets.
  • Use propose for inferred memories, review for pending candidates, and remember for explicit user requests.

Install

From npm:

pi install npm:pi-diet-memory

From GitHub:

pi install git:github.com/ProbabilityEngineer/pi-diet-memory

For project-local install, add -l:

pi install -l git:github.com/ProbabilityEngineer/pi-diet-memory

For local testing:

pi -e ./index.ts

Development

npm install
npm run lint