simple-pi-memory
A minimal one-file memory extension for pi: one memory file loaded into the system prompt every turn, with add/remove/load tools and a /memory-char-cap command.
Package details
Install simple-pi-memory from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:simple-pi-memory- Package
simple-pi-memory- Version
0.1.1- Published
- Jul 11, 2026
- Downloads
- not available
- Author
- ashx-j
- License
- MIT
- Types
- extension
- Size
- 12.9 KB
- Dependencies
- 1 dependency · 1 peer
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
simple-pi-memory
A minimal memory extension for pi. One file, one memory per line, loaded into the system prompt every turn.
How it works
Memories are stored as plain text in ~/.pi/simple-memory/memory.md, one per line with a [YYYY-MM-DD] date prefix. The file is read and injected into the system prompt on every turn through the before_agent_start hook. The full file is always injected and never truncated. The character cap is enforced on write, not on read.
pi rebuilds the system prompt each turn, so memory must be re-injected each turn to stay available. Loading once at session start would drop it after the first turn.
Install
pi install npm:simple-pi-memory
Or load a local checkout for development:
pi --no-extensions -e ./index.ts
Tools
| Tool | What it does |
|---|---|
memory_add |
Add one memory as a single line. Refuses on an exact duplicate or when the file is at the character cap. |
memory_remove |
Remove one memory by its exact line text. Returns "not found" if no line matches exactly. |
memory_load |
Read the full memory file and show the current size and cap. |
Command
/memory-char-cap [n]
No argument shows the current cap. An integer from 1 to 30000 sets it. Values outside that range are rejected. Lowering the cap below the current file size is refused; edit the memory file by hand first.
Config
~/.pi/simple-memory/config.json stores the cap:
{ "charCap": 5000 }
Default 5000. Range 1 to 30000.
Notes
- The memory file is
~/.pi/simple-memory/memory.md. Editing it by hand is supported; changes appear on the next turn. - If another memory extension is installed (such as pi-memory), both will inject into the system prompt. Run one at a time.
- Concurrent writes from multiple pi sessions are not guarded.
License
MIT.