Hackathon build (2026-08-13): porting monition — a trigger-shaped takeaway store that injects hard-won lessons into an agent's context only when the situation matches — from Claude Code onto the pi coding harness, running an open-weight model (Kimi K3 via OpenRouter). No Anthropic calls in the runtime conversation path.
Always-on memory files (MEMORY.md) pay their token cost every turn; RAG-style recall injects anything semantically near the prompt. Monition rows are trigger-shaped: each row owns what fires when (lexical phrases, semantic threshold, or deterministic tool-call predicates), and a scoring gate learns from helpful/noise ratings. The demo shows both sides:
- Fires: "Summarize this paper: https://arxiv.org/pdf/…" → the arXiv row
lands in context → the model fetches
/abs/instead of confabulating over PDF binary. - Fires on a silent failure: "Set up a pre-commit hook" in
fixture-repo/(which hascore.hooksPathset) → without the row the model writes.git/hooks/pre-commit, claims success, and the hook never runs. With the row it checkscore.hooksPathfirst. - Stays silent: "Which PDF library should I use for invoices?" — semantically adjacent (scores 0.61 against the arXiv row), but below the row's 0.70 threshold. A naive RAG recall would have injected it.
- (Stretch) Fires on a tool call, not the prompt: a
tool_call-triggered row guardsgit push— something prompt-similarity memory structurally cannot do, delivered via pi'stool_callextension event.
you type into pi
└─ .pi/extensions/monition.ts (pi `input` event)
└─ monition prompt-hook (same executor Claude Code's hook runs)
└─ synthetic SQLite store (monition/store.db, 4 demo rows)
└─ {action: "transform", text: prompt + fired takeaways}
└─ Kimi K3 via OpenRouter answers with the takeaway in context
The extension is ~80 lines and fail-open: if monition errors or stays silent,
the prompt passes through untouched. Debug log: /tmp/pi-monition-bridge.log;
/monition inside pi shows bridge status.
fixture-repo/ ships without its .git (nested repos don't clone). Run
./scripts/setup-fixture.sh once after cloning to init it with
core.hooksPath=.githooks — that misconfiguration is the demo.
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
pipx install monition # or: pip install monition
cd pi-monition-demo && pi # /login → OpenRouter; /model → Kimi K3The extension pins MONITION_STORE to this repo's store, so a machine-wide
monition install won't leak into (or get polluted by) the demo.