pi-mem is an open-source memory harness and persistent context manager developed by Jo Inc for the Pi CLI coding agent. It provides a structured, file-based memory system inspired by OpenClaw to retain context across terminal sessions without requiring complex database infrastructure. Operating directly within the user's filesystem under `~/.pi/agent/memory/`, the harness injects curated long-term memories, active scratchpad notes, and recent daily logs into the Pi agent session upon startup. The agent reads and updates markdown files as it works, capturing durable architectural preferences, ongoing tasks, and daily session logs. What sets pi-mem apart from ephemeral session orchestrators is its lightweight, human-readable file layout. Developers can inspect, edit, or version-control their agent's memory files directly using standard text editors and Git, maintaining clear oversight over what the LLM remembers. pi-mem is distributed as an open-source npm package (`@askjo/pi-mem`) under the MIT license, making it free to use and modify for terminal-based development workflows.
Tags: ai agent, cli, coding agent, developer tools, memory, OpenSource
~/.pi/agent/memory/. - Configurable Storage Directory — Supports custom memory locations using the PI_MEMORY_DIR environment variable. - Automatic Daily Log Loading — Automatically ingests logs from today and yesterday at session start to preserve immediate context. - Curated Long-Term Retention — Persists project decisions, preferences, and durable facts in a dedicated MEMORY.md file. - Active Task Scratchpad — Tracks immediate checklists, reminders, and pending fixes across runs in SCRATCHPAD.md. - Agent Note Generation — Allows the LLM to create and maintain modular reference notes and self-reviews in a notes/ directory. - NPM Distribution — Easily installed and integrated into TypeScript and Node.js environments via @askjo/pi-mem.daily/YYYY-MM-DD.md) so the Pi coding agent automatically remembers yesterday's implementation details and edge cases upon startup.MEMORY.md, ensuring the Pi agent adheres to repository standards across isolated terminal sessions.SCRATCHPAD.md, allowing the session to be resumed later without losing track of pending tasks.pi-mem is intended for developers using the Pi CLI coding agent who require persistent context and memory across terminal sessions. It is ideal for programmers who prefer human-readable, file-based memory management over heavy external database solutions. It is not suitable for developers seeking a standalone coding agent or those using agents outside the Pi ecosystem without manual adaptation.
bash npm install -g @askjo/pi-mem~/.pi/agent/memory/ or customize via environment variable): bash export PI_MEMORY_DIR="$HOME/.pi/agent/memory" mkdir -p "$PI_MEMORY_DIR/daily" mkdir -p "$PI_MEMORY_DIR/notes" touch "$PI_MEMORY_DIR/MEMORY.md" touch "$PI_MEMORY_DIR/SCRATCHPAD.md"bash # Verify your memory directory configuration echo $PI_MEMORY_DIR # Run the Pi coding agent (pi-mem automatically loads recent daily logs and MEMORY.md) pi "Review the recent changes from yesterday and continue implementing the auth middleware noted in SCRATCHPAD.md"Part of CLI Coding Agents
Categories: AI Coding Agents, Developer Tools, Memory