pi-agents-memory
v0.1.1
Published
Cross-session persistent memory for Pi agents. Loads project context at session start and auto-saves conversation memory at session end.
Maintainers
Readme
pi-agents-memory
Pi extension for agents-memory — cross-session persistent memory for AI coding agents.
When you open a project, the agent knows what it is, what you did last time, your standards for that stack, and how your team works — without you repeating anything.
Install
# From npm (once published)
pi install npm:pi-agents-memory
# From a local checkout
pi install ./path/to/pi-agents-memoryUninstall with pi remove pi-agents-memory.
Requires an agents-memory instance
at ~/agents-memory/ (or $AGENT_MEMORY_DIR).
What it does
Session start
Reads your project memory and injects it as context:
- Project index, latest sessions, open threads
- Stack standards (python, typescript, etc.)
- Team conventions
- Global preferences
New projects are auto-detected and scaffolded.
Auto-save
Extracts memory from the conversation automatically:
| Trigger | Event | Behavior |
| ----------- | ------------------------- | ----------------------------------------- |
| Session end | session_shutdown (quit) | Always saves |
| Compaction | session_before_compact | Always saves |
| Periodic | agent_end | Only when threshold reached (default: 10) |
The threshold is configurable in ~/agents-memory/config.json:
{ "auto_save_threshold": 10 }Background consolidation
At session start, checks if a consolidation cycle is due and launches it
in the background via pi -p.
Configuration
The extension reads ~/agents-memory/config.json (shared with Claude Code
and Cursor hooks). No Pi-specific configuration needed.
Projects with a .skip file in their memory directory are excluded.
Requirements
- agents-memory instance
piCLI available in PATH (for auto-save and consolidation subprocesses)
License
MIT — see LICENSE.
Author
Juanje Ojeda
