@ryan_nookpi/pi-extension-memory-layer 0.1.0
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 +48 -0
- package/index.ts +698 -0
- package/inject.ts +49 -0
- package/package.json +42 -0
- package/project-id.ts +77 -0
- package/storage.ts +680 -0
- package/types.ts +72 -0
- package/ui.ts +480 -0
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# memory-layer
|
|
2
|
+
|
|
3
|
+
Long-term memory layer for pi — remember, recall, forget, and browse memories across sessions.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Provides persistent memory that survives across pi sessions:
|
|
8
|
+
|
|
9
|
+
- **remember** tool — save facts, rules, or lessons with `user` (global) or `project` (repo-specific) scope
|
|
10
|
+
- **recall** tool — search memories by keyword, retrieve by ID, or list the full index
|
|
11
|
+
- **forget** tool — permanently delete memories that are no longer valid
|
|
12
|
+
- **memory_list** tool — list all active memories, optionally filtered by scope
|
|
13
|
+
- `/remember` command — interactive memory save with topic selection UI
|
|
14
|
+
- `/memory` command — full-featured overlay browser with search, scope filter, view, copy, and delete
|
|
15
|
+
|
|
16
|
+
### Storage
|
|
17
|
+
|
|
18
|
+
Memories are stored as Markdown files under `~/.pi/memory/`:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
~/.pi/memory/
|
|
22
|
+
user/
|
|
23
|
+
MEMORY.md # index
|
|
24
|
+
general.md # topic file
|
|
25
|
+
coding-rules.md # topic file
|
|
26
|
+
projects/
|
|
27
|
+
<project-id>/
|
|
28
|
+
MEMORY.md
|
|
29
|
+
general.md
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Project ID resolution
|
|
33
|
+
|
|
34
|
+
Project identity is resolved automatically:
|
|
35
|
+
|
|
36
|
+
1. `git remote origin` URL → normalized slug
|
|
37
|
+
2. Root commit hash → `commit-{hash8}`
|
|
38
|
+
3. Fallback: cwd path hash → `local-{hash8}`
|
|
39
|
+
|
|
40
|
+
### System prompt injection
|
|
41
|
+
|
|
42
|
+
On each turn, the memory index is injected into the system prompt so the LLM knows what's stored without needing an explicit recall call.
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pi install npm:@ryan_nookpi/pi-extension-memory-layer
|
|
48
|
+
```
|