@yandy0725/pi-memory 0.3.0 → 0.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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.3.0",
6
+ "version": "0.3.1",
7
7
  "description": "File-system driven persistent memory layer for pi coding agent",
8
8
  "license": "MIT",
9
9
  "repository": {
package/src/dream.ts CHANGED
@@ -18,6 +18,7 @@ Rules:
18
18
  - Deduplicate entries: if two entries in the same topic contain the same info, merge them.
19
19
  - If entries across different topics overlap, move the content to the more appropriate topic.
20
20
  - Rebuild MEMORY.md index: list entries you deem valuable (not necessarily every entry). Each line: - [Entry Title](topic.md). Accuracy matters more than completeness.
21
+ - CRITICAL for entry titles: Only the MEMORY.md index is injected into future coding sessions (topic file content is NOT seen). Every entry title must be self-descriptive and convey enough context to be useful at a glance. Prefer specific, actionable titles like "use uv instead of pip for Python package management" over vague ones like "python tools" or "workflow rules". If an existing title is too vague, rewrite it — keep the original ## heading in the topic file for full context.
21
22
  - When done, output a concise summary of changes (merged N, removed N, moved N, updated N).`;
22
23
 
23
24
  export function buildDreamTask(memoryDir: string, maxLines: number): string {
@@ -27,6 +28,7 @@ export function buildDreamTask(memoryDir: string, maxLines: number): string {
27
28
  3. Update outdated information.
28
29
  4. Move entries to more appropriate topic files when needed.
29
30
  5. Rebuild MEMORY.md (max ${maxLines} lines): - [Entry Title](topic.md) per entry you deem valuable (not necessarily every entry). Entries use ## Entry Title format.
31
+ IMPORTANT: Only MEMORY.md index lines are injected into future coding sessions (topic file content is NOT seen by the coding agent). Rewrite every entry title to be self-contained and descriptive — like "always use uv instead of pip for Python" instead of just "python tools". The title alone must tell the model what the entry is about.
30
32
  Only edit files under ${memoryDir}. When finished, print a one-line summary of changes.`;
31
33
  }
32
34
 
@@ -167,11 +167,11 @@ export function createMemoryTool(deps: MemoryToolDeps) {
167
167
  name: "memory",
168
168
  label: "Memory",
169
169
  description:
170
- "Read/write project memory across sessions. action 'add' appends content under a topic (auto-created) as an entry; 'remove' deletes an entry by title; 'read' loads a topic or entry; 'search' queries memory files or history sessions.",
171
- promptSnippet: "Read/write project memory across sessions (add/remove/search/read).",
170
+ "Read/write project memory across sessions. action 'add' appends content under a topic (auto-created) as an entry; 'remove' deletes an entry by title; 'read' loads a topic or entry; 'search' queries memory files or history sessions. IMPORTANT: only MEMORY.md index lines are injected into system prompts — entry titles must be self-contained and descriptive (topic file content is NOT injected).",
171
+ promptSnippet: "Read/write project memory across sessions (add/remove/search/read). Only index titles are injected — make titles self-descriptive.",
172
172
  promptGuidelines: [
173
173
  "Use memory to persist project facts, user preferences, and lessons learned across sessions.",
174
- "Use memory action 'add' with an explicit topic filename and entry title when you discover something worth remembering long-term.",
174
+ "Use memory action 'add' with an explicit topic filename and a descriptive, self-contained entry title — only the index line (title + topic) is injected into future prompts, NOT the topic file content. The title alone must convey what was learned.",
175
175
  "Use memory action 'search' with scope='sessions' to find past work in history sessions.",
176
176
  "Use memory action 'read' with topic or entry to load stored knowledge.",
177
177
  ],
@@ -180,7 +180,7 @@ export function createMemoryTool(deps: MemoryToolDeps) {
180
180
  // add
181
181
  content: Type.Optional(Type.String({ description: "Knowledge text to store (add)." })),
182
182
  topic: Type.Optional(Type.String({ description: "Target topic filename, e.g. 'debugging.md'. Auto-created if new (add/read)." })),
183
- title: Type.Optional(Type.String({ description: "Short title for the MEMORY.md index line (add). Required for add." })),
183
+ title: Type.Optional(Type.String({ description: "Descriptive, self-contained title for the MEMORY.md index line. Only index lines are injected into future prompts (NOT topic file content), so the title must convey enough context on its own. Required for add." })),
184
184
  // remove
185
185
  entry: Type.Optional(Type.String({ description: "Entry title to remove. Exact match on MEMORY.md index line (remove/read)." })),
186
186
  // search