@bitbonsai/pi-memory

Small persistent memory extension for Pi.

Packages

Package details

extension

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

$ pi install npm:@bitbonsai/pi-memory
Package
@bitbonsai/pi-memory
Version
0.2.0
Published
Sep 20, 2026
Downloads
517/mo · 14/wk
Author
bitbonsai
License
MIT
Types
extension
Size
194.6 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./dist/index.js"
  ]
}

Security note

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

README

This keeps corrections, preferences, and project facts in one local SQLite database. New sessions receive one memory block, capped at 8KB. After a session, an optional cheap model extracts anything worth keeping.

Why a fork

I wanted the useful part of @samfp/pi-memory v1.3.5 without its newer direction: semantic search and a larger context stack. This fork stays with SQLite, keyword lookup, one bounded injection, and optional consolidation. No embeddings, vector store, file index, session index, watchers, or agent loops.

Install

pi install npm:@bitbonsai/pi-memory

Use

Tool What it does
memory_search Find stored facts and lessons
memory_remember Save a fact or lesson
memory_forget Remove a fact or lesson
memory_lessons List lessons
memory_stats Show memory counts

/memory-consolidate extracts memory from current session when asked. /memory-context shows exact local memory block this session receives.

Configure

Database: ~/.pi/memory/memory.db.

Automatic consolidation runs only when you set a model:

{
  "memory": {
    "consolidationModel": "opencode-go/mimo-v2.5"
  }
}

With a configured model, consolidation starts after three user messages. It sends user messages from that session to configured provider. Manual /memory-consolidate uses Pi's current default if no model is configured.

Keep one project's memory separate:

{
  "pi-memory": {
    "localPath": ".pi/memory"
  }
}

Develop

Node 24+ or Bun 1.4+.

npm test
npm run build

# or
bun test
bun run build

License

MIT.

Credits

Derived from @samfp/pi-memory v1.3.5, under MIT license.

Memory icon by Adrien Coquet from Noun Project.