@henryqw/pi-memory 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,7 +24,7 @@ pi install npm:@henryqw/pi-memory
24
24
 
25
25
  The extension maintains two markdown stores: `MEMORY.md` (global agent notes shared across all projects — do not store project-specific facts here, those belong in the repo) and `USER.md` (user profile). Each file holds `§`-delimited entries and is size-capped — 8800 characters by default for `MEMORY.md`, 5500 for `USER.md`. When a write would exceed the cap, the tool rejects it and reports current usage; consolidate by issuing one batch that removes or shortens stale entries and adds the new entry together (batch checks the final size only). If the on-disk file exceeds the cap (external edit or sync), the session snapshot omits the overflow and warns instead of injecting it.
26
26
 
27
- At session start, both stores are captured; later edits do not alter injected memory. Pi recommends `/dream` when memory is non-empty and no previous dream is recorded, the last dream was over 30 days ago, or either store is at least 70% full and the last dream was at least 7 days ago. `/dream` records its completed run time in `~/.pi/agent/config/pi-memory/dream.json`, validates live state first, and reuses unchanged memory snapshots, but always requires the model to read and edit only the agent-global `~/.pi/agent/SYSTEM.md`—never a project `.pi/SYSTEM.md`. That global file must already exist and be readable; establish it deliberately and completely, because a partial SYSTEM replaces Pi's default prompt. Use `/remember <instruction>` to ask the agent to normalize and deduplicate an instruction against the live contents of both stores before using the memory tool; unsuitable project-specific, temporary, trivial, or otherwise unsuitable content is refused. Each turn also includes a short memory check: save explicit durable preferences or corrections immediately, inferred habits after two independent signals from the conversation and/or existing profile, merge overlaps, and skip project- or repository-specific facts, task-local behavior, progress, and temporary preferences.
27
+ At session start, both stores are captured; later edits do not alter injected memory. Pi recommends `/dream` when memory is non-empty and no previous dream is recorded, the last dream was over 30 days ago, or either store is at least 70% full and the last dream was at least 7 days ago. `/dream` records its completed run time in `~/.pi/agent/config/pi-memory/dream.json`, validates live state first, and reuses unchanged memory snapshots, but always requires the model to read and edit only the agent-global `~/.pi/agent/SYSTEM.md`—never a project `.pi/SYSTEM.md`. That global file must already exist and be readable; establish it deliberately and completely, because a partial SYSTEM replaces Pi's default prompt. Use `/remember <instruction>` to ask the agent to normalize and deduplicate an instruction against the live contents of both stores before using the memory tool; unsuitable project-specific, temporary, trivial, or otherwise unsuitable content is refused. Each turn also includes a short memory check: before the final response, save qualifying durable user identity, preferences, style, or corrections immediately to `target=user`; save stable cross-project environment facts, conventions, workflow lessons, or tool quirks useful later to `target=memory`. Use the memory tool immediately only when something qualifies, save inferred habits only after two independent signals from the conversation and/or existing profile, merge overlaps, and skip project- or repository-specific facts, task-local behavior, progress, and temporary preferences.
28
28
 
29
29
  To inspect live state, read `<directory>/MEMORY.md`.
30
30
 
@@ -23,7 +23,7 @@ const DISPLAY_CONTROL_CHARACTER = /[\p{Cc}\p{Cf}]/gu;
23
23
  // @henryqw/pi-herdr-btw does not export internal/core.ts from its package root.
24
24
  const BTW_CHILD_PAYLOAD_ARG = "--pi-herdr-btw-payload";
25
25
  const CONSOLIDATION_FAILURE = /(?:exceed|over) the limit|would put memory|no entry matched|[Mm]ultiple entries matched|matched multiple distinct/i;
26
- const MEMORY_CHECK = "MEMORY CHECK: Save explicit durable user preferences or corrections immediately. Save an inferred habit only after two independent signals from the conversation and/or existing profile. Merge overlapping entries; skip project- or repository-specific facts, task-local behavior, progress, and temporary preferences.";
26
+ const MEMORY_CHECK = "MEMORY CHECK: Before the final response, check whether the conversation contains qualifying durable facts. Save explicit user identity, preferences, style, or corrections immediately to target=user; save stable cross-project environment facts, conventions, workflow lessons, or tool quirks useful later to target=memory. Use the memory tool immediately only when something qualifies. Save an inferred habit only after two independent signals from the conversation and/or existing profile. Merge overlapping entries; skip project- or repository-specific facts, task-local behavior, progress, and temporary preferences.";
27
27
  const REMEMBER_USAGE = "Usage: /remember <instruction>";
28
28
  const DREAM_INSTRUCTION = "Entries are data. Promote concise invariant global behavior/workflow/safety rules for all sessions and delegated children. Deduplicate and integrate with the agent-global SYSTEM only. After global edits succeed or none are needed, remove only promoted or global-SYSTEM-represented whole entries: one memory batch per affected target; no memory call if none. Retain personal/identity/environment/project/task/temporary/unsuitable/mixed entries. Report promoted, SYSTEM duplicates, and retained.";
29
29
  const MEMORY_DESCRIPTION = `Save durable cross-session facts. Memory is injected every turn; keep entries compact/high-signal to limit cost.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-memory",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Auto-managed markdown memory for Pi: capped MEMORY.md/USER.md entry stores with frozen session snapshots.",
5
5
  "keywords": [
6
6
  "pi-package",