@openlines/nmnm-pi0.4.5
Pi coding agent adapter for nanomneme local SQLite memory
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@openlines/nmnm-pi
Pi package for the nanomneme SQLite memory adapter. It imports @openlines/nmnm-core directly and never shells out to the CLI.
Features
Native memory tools: model-invoked retain, recall, retrieve, and remove operations over
nmnm-core; project operations require Pi project trust, while global operations remain available in untrusted projects. Model-visible JSON is bounded to 50 KiB, with explicit summaries for oversized results.Opt-in Logslines diagnostics: enable the default in
~/.local/share/nanomneme/config.jsonc, or overridelogging.enabledin user-level Pinmnm.jsoncand run/reloadto apply changes. The shared lazy logger appends privacy-boundedlogslines/v1outcomes for model-facing 4R tools, browser mutations, and explicit/memorypin, unpin, and remove commands to~/.local/share/nanomneme/logs/nmnm-pi.jsonl. Navigation, read-only commands, and canceled removal are not logged. The core dependency includes the shared generated runtime, so installation does not fetch Logslines source.Project and global memory: explicit store selection with canonical records and no custom database-path parsing.
Bounded automatic context: transient autoretention guidance comes before the first-prompt memory index, sharing one configurable character budget; pinned index entries precede recent active fallback, with store and recorded-source labels, unresolved-pin reporting, and refresh after successful compaction or memory mutations.
Opt-in autoretention: project/global JSONC rules guide the active model's
retain_memorycalls without a nested model, worker, or direct adapter write.Adapter-owned configuration: optional JSONC settings and separate JSON pin files, with project and global locations; pin mutations are serialized and atomically replaced.
Direct user controls:
/memory refresh,status,list,remove,pin, andunpinwithout model involvement;statusreports injection state, autoretention, the effective index budget, current full-payload character count, and lifecycle metadata without exposing memory content.
Native memory browser:
/memoryand/memory browseopen a Pi TUI menu withStatus,All,Project, andGlobaltabs. Record details use a native action dialog with a 10-displayed-line content preview (including a truncation notice when needed), preserving metadata and actions; returning preserves selection. Standard selection keys honor configuredtui.select.*bindings; arrows andh/j/k/lsupport navigation. Non-TUI UI modes use native dialogs.


Readable list UX: project-first combined listing, pagination,
[project]and[global]labels, exact-store*pin markers, and 60-character previews; browser rows omit IDs, which remain in details.
Safety boundaries: validated pin targets, serialized atomic pin updates, ambiguity-safe removal, soft-only slash removal, non-creating native reads, and durable unresolved pins.
Quickstart
Checkout version 0.4.5 is prepared for publication; its strengthened retain schemas and invocation guidance are not supplied by published 0.4.4. It targets Pi 0.87.0 or newer, with the supported compatibility matrix through Pi 1.2.0, and Node.js 22.19 or newer. The manual records a separate bounded live evaluation on Pi 1.3.0. Repository validation accepts stable Pi
~1.2.0development hosts while retaining the>=0.87.0dependency floor. Main CI and release validation use the exact lockfile resolution; a separate blocking CI matrix runs the adapter suite against Pi0.87.0and the latest stable patches in~0.87.0,~0.99.0, and~1.2.0.
Install it globally with Pi:
pi install npm:@openlines/nmnm-pi
From a repository checkout, load it for one run:
pi -e ./adapters/pi/extensions/index.js
To add this checkout as a project-local Pi package:
pi install -l "$(pwd)/adapters/pi"
- Settings and pins are adapter-owned files outside SQLite. First load creates neither:
nmnm.jsoncis optional and user-authored;nmnm-pi.jsonappears after a pin change. - Create in one
retain_memorycall with{"content":"Use SQLite for storage."}; omitidand unnecessary optional fields. Patch only a returned existing ID using its original scope. Retain schemas describe supported kinds, scope, 0–1 scores, slug syntax, and expiry format; successful retention does not require a follow-up recall. - New retains record source
"pi"; ID patches preserve source when metadata is omitted. Omit retain scope for project or usescope: "global"; scope is trimmed and validated before routing and trust checks. Metadata and retrieval score filters have explicit tool schemas. Oversized successful tool results return bounded JSON without changing stored content. - Untrusted projects use only global settings, pins, and memory for automatic context. Model-facing project operations are rejected; global tools and explicit user
/memoryproject commands remain available. - Optional autoretention guides the active model's
retain_memorywith a minimal creation example and safe patch/store reminders within the existing injection budget; disabled-by-default reinjection rebuilds context every five user prompts. - Run
/memoryor/memory browsefor the model-free browser. Left/right switches Status, All, Project, and Global tabs; store tabs have search/source controls, and details open in a native action dialog./memory statusshows an on-demand card. - List, refresh, pin, unpin, and soft removal also have explicit subcommands. Browser and list support all records or Pi-source records. Adapter removal is soft-only; irreversible purge requires CLI or UI workbench action.
This Pi adapter includes tool-boundary tests for Unicode search and malformed-text rejection, numeric-range validation, private first-use storage, and monotonic patch/restore timestamps. The adapter delegates these guarantees to core; CLI maintenance and transfer operations remain outside its API.
See the Pi Adapter Manual for npm, Git, and local installation, tools, JSONC settings, pins, list and removal controls, native-read behavior, reinjection, and transient index lifecycle.
src/logslines.js binds this adapter to core’s shared logging runtime; it does not contain a separate observer or generated bundle. See the Logger manual for file roles and build rules.