Zero-Mem for pi
A zero-token, long-term memory extension for the pi coding agent that reimplements a published Zero-Mem design, remembering prior sessions without spending extra LLM calls on retrieval.
Zero-Mem captures every finalized message in a pi coding session as a trace unit with provenance, such as session, project and time, plus extracted entities, embedded with a small local embedding model. On each new prompt, a zero-LLM pipeline routes between an entity-context graph scored by personalized PageRank and a lexical and semantic view combining BM25 and dense retrieval over units and session-adjacent turns, fuses the two views, runs evidence closure, and injects a small number of snippets as a prior-session-memory block in the system prompt.
Memory is project-scoped by default and persisted locally as a JSON store of text and metadata plus an int8-quantized embeddings sidecar, with a one-shot migration script for older full-precision stores. It installs as a pi extension, loaded either for a single run or auto-loaded from the pi extensions directory, and requires a full restart of the pi application, not just a session reload, to pick up code changes.