Install
Install with PiG
pig install npm:@openlines/nmnm-piInstall with Pi
pi install npm:@openlines/nmnm-piPackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./extensions/index.js"
]
}README
Written by the package's publisher, shown as published in version 0.5.0 (README.md). PiG does not review it.
@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. Store-tab selection scrolls with navigation and terminal resizing and remains valid after concurrent removals; native dialogs number rows to distinguish identical previews. Rows omit IDs, which remain in details. Both browser modes stop at offset 1,000 (the page covering records 1,001–1,020) and prompt you to narrow search, source, or store when more results remain.
Safety boundaries: terminal-safe display of stored text, validated pin targets, serialized atomic pin updates, ambiguity-safe removal, soft-only slash removal, non-creating native reads, and durable unresolved pins.
Project summaries and briefs
Pi passes completed session_compact text directly to core as a bounded nanomneme/native-compaction-summary project note. It adds no structured work/authorization claims or model call. Core renders shared historical briefs.
| Capability | Pi behavior |
|---|---|
| Manual summaries | Use shared CLI JSON add/update/remove commands in the project |
| Compaction autosummaries | Default-off summary.autocapture.enabled authorizes unattended capture, including headless use, independently of ordinary autoretention rules; trust, validation and replay checks remain |
| Briefs | Independently enable brief.enabled for startup and existing refresh/cadence delivery within context budgets |
See the overview and matrix, native capture contract and manual JSON/lifecycle.
Quickstart
Requires Pi 0.87.0 or newer and Node.js 22.19 or newer. The adapter includes self-describing retain schemas and invocation guidance. Locked-host validation and a separate blocking compatibility matrix cover loading, tool schemas, and host argument validation. See the manual's compatibility boundaries for tested hosts and the separate bounded live evaluation.
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.
Project startup briefs
Set brief.enabled to true in the existing user/project nmnm.jsonc to include a deterministic project handoff through existing context delivery. Default is off; project false overrides user enablement. Use explicit summaries saved with nmnm summary add --file summary.json or eligible compaction autosummaries already saved in the project, then preview nmnm brief. No transcript ingestion, global brief store or separate model is involved. The brief uses space left by ordinary context. See configuration, timing and limits.
To remove a brief source, use nmnm summary remove <id> --json with its project summary UUID. Briefs have no separate stored ID; the next configured refresh/reinjection or new session renders the remaining eligible summaries, or no brief when none remain. Already-injected context is unchanged.
Opt-in summary.autocapture.enabled automatically saves eligible completed native compaction text, including headless operation, independently of ordinary autoretention rules. Trusted project routing, current capture enablement and the normalized 8192-byte payload limit are required; invalid, oversized or ineligible captures save nothing. No extra model call is made. See native checkpoints.