A pi extension that gives the agent persistent memory across sessions. Automatically injects context from previous sessions and lets the LLM search through past work.
On each session start, a compact summary of recent sessions is injected into context so the LLM knows what happened before. Three tools let it dig deeper on demand:
list_sessions– browse past sessions with metadatasearch_sessions– full-text search across session contentget_session_summary– LLM-generated summary of any session (cached)
All tools support cross-project access via an optional path parameter.
Sessions are auto-summarized on shutdown (if short enough). For larger histories, run /memory-update to batch-generate summaries. Stale memory triggers a warning.
From npm (recommended):
pi install npm:@netzlabor/pi-session-memoryOr directly from GitHub:
pi install git:github.com/j-koester/pi-session-memory@v0.1.1Or clone manually:
git clone https://github.com/j-koester/pi-session-memory.git ~/.pi/agent/extensions/pi-session-memoryCompatibility: Tested with pi v1.0.0. No breaking API usage; uses registerTool, registerCommand, and the session_start / session_shutdown / before_agent_start events, all stable in the 1.0 extension API.
| Command | What it does |
|---|---|
/memory-update [n] |
Generate summaries for unsummarized sessions (Esc to cancel) |
/memory-status |
Cache stats |
/memory-clear |
Wipe cached summaries |
Session JSONL files are read from ~/.pi/agent/sessions/. Summaries and metadata are cached per project in ~/.pi/agent/session-memory/. The auto-injected context stays under ~1000 tokens.
MIT