@e9n/pi-memory
v0.1.0
Published
Persistent memory system for pi — long-term facts, daily logs, and search
Downloads
47
Readme
@e9n/pi-memory
Persistent memory system for pi. Long-term facts and daily session logs stored as plain Markdown, automatically injected into every agent turn.
Features
- Long-term memory —
MEMORY.mdwith section-based editing for curated facts, preferences, and decisions - Daily logs —
memory/YYYY-MM-DD.mdappend-only files with auto-timestamped entries - Full-text search — search across all memory files with surrounding context
- System prompt injection —
MEMORY.mdand recent daily logs are loaded before every agent turn - Skill included —
pi-memoryskill with usage conventions and housekeeping guidance
Setup / Settings
Optional — defaults to cwd. Override via ~/.pi/agent/settings.json (global) or .pi/settings.json (project):
{
"pi-memory": {
"path": "~/notes/memory"
}
}| Key | Default | Description |
|-----|---------|-------------|
| path | cwd | Base directory for MEMORY.md and memory/ daily logs. Supports ~. |
Memory layout
<path>/
├── MEMORY.md # Curated long-term memory (## Section headers)
└── memory/
├── 2026-02-17.md # Today's session notes
├── 2026-02-16.md
└── ...Tools
memory_read
Read from persistent memory.
| Parameter | Values | Description |
|-----------|--------|-------------|
| target | long_term | daily | list | What to read |
| date | YYYY-MM-DD (optional) | Date for daily target (defaults to today) |
long_term— readsMEMORY.mddaily— reads the daily log for the given date (defaults to today)list— lists all available daily log files
memory_write
Write to persistent memory.
| Parameter | Values | Description |
|-----------|--------|-------------|
| target | daily | long_term | Where to write |
| content | string | Content to write |
| section | string (optional) | For long_term: ## Section header to find and replace. Omit to append to end. |
daily— appends a### HH:MMtimestamped entry to today's loglong_term— replaces the named section inMEMORY.md, or appends a new section if not found
memory_search
Search across all memory files.
| Parameter | Values | Description |
|-----------|--------|-------------|
| query | string | Case-insensitive search term |
| limit | number (optional) | Max results (default: 20) |
Returns matching lines with one line of surrounding context and the source file and line number.
Install
pi install npm:@e9n/pi-memoryLicense
MIT
