$ cat ~/map/pi-mm.md
pi-mm
Persistent long-term memory for pi: recall before each turn, judged capture after it settles.
extensions✓ Oct 20
Facts
- repository
- github.com/tty-pt/pi-mm ↗
- GitHub Stars
- ★ 0
- Forks
- 0
- license
- BSD-2-Clause
- npm / mo
- —
- last push
- Nov 29, 2026
install
git clone https://github.com/tty-pt/site .pi/extensions/pi-mm## TL;DR
Persistent memory extension for the pi coding agent: a hybrid lexical and vector search injects relevant memories before each turn, an agent-settled judge decides what to remember, update, or skip, and storage, indexing, and optional embeddings all run locally.
## Key points
- $Memories survive context compaction and cross-session restarts, giving pi long-term recall of decisions, bug fixes, and project invariants.
- $At before_agent_start, a hybrid search fuses keyword matches (libstoma) with vector similarity (libsepal) through Reciprocal Rank Fusion and injects the relevant memories into the prompt context.
- $At agent_settled, a judge evaluates the exchange and decides whether to remember, update, or skip it; meaningful conclusions are summarized and persisted to disk.
- $Only three tools are exposed by default — memory_recall, memory_record, and memory_review — keeping the model's context window clean; nine low-level diagnostic tools exist behind an advancedTools flag.
- $Lexical search, temporal indexing, and storage run locally in compiled C (libcorm); dense semantic search over 384-dimensional BGE embeddings is opt-in via semanticSearch.
- $If the judge or embedding endpoint is unreachable, pi-mm marks the session degraded and falls back to deterministic local sentence heuristics instead of crashing pi.
- $Explicit remember this and forget that directives bypass the judge entirely; automated records stay at tested confidence until backed by real test-execution evidence.
- $Pair it with a local axil-qllm daemon to run the judge and embeddings on private GGUF models — the quickstart pairs Qwen2.5-0.5B for chat and judging with bge-small-en-v1.5 for embeddings.
## FAQ
Q How is pi-mm installed?
The README documents cloning the tty-pt/site monorepo into the project .pi/extensions/pi-mm directory or the global ~/.pi/agent/extensions/pi-mm directory, or loading a checkout for one run with pi --extension.
Q What happens when the judge endpoint is offline?
pi-mm marks the session degraded and falls back to deterministic local sentence heuristics rather than crashing pi; judgeMode can also be set to heuristic or off outright.
Q Where do memories live?
Under the directory configured by memDir, .pi/mm by default, as local memory databases and logs written by the compiled-C storage layer.
## References
## Related entries
$ big-pi
Model-driven compression that summarizes completed phases into tiered blocks while Pi's JSONL transcript stays authoritative and untouched.
$ inception
A curator LLM replaces pi's compaction, rewriting old history every few turns to keep the context dense.
$ motus
Redacts exact secret values from pi tool output, blocks the commands and files that print them, and fails closed.
Last updated: Nov 29, 2026