pi-recollect 0.3.0 → 1.0.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/CHANGELOG.md +18 -0
- package/README.md +38 -50
- package/docs/API.md +62 -0
- package/docs/COMMANDS.md +177 -0
- package/docs/CONFIG.md +108 -0
- package/docs/GUIDE.md +148 -0
- package/docs/PATTERNS.md +49 -0
- package/docs/QUICKSTART.md +69 -0
- package/{dist/index.d.ts → index.ts} +5 -2
- package/install.mjs +34 -0
- package/package.json +22 -19
- package/skills/compound-note/skill.md +32 -0
- package/skills/graph-memory/SKILL.md +132 -0
- package/skills/memory-search/skill.md +24 -0
- package/skills/memory-store/skill.md +26 -0
- package/src/categories/memory-categories.ts +97 -0
- package/src/compound/analyzer.ts +170 -0
- package/src/compound/dedup.ts +111 -0
- package/src/compound/extractor.ts +110 -0
- package/src/compound/router.ts +82 -0
- package/src/compound/writer.ts +110 -0
- package/src/config.ts +114 -0
- package/src/context/context-saver.ts +311 -0
- package/src/continuity/compaction-hook.ts +32 -0
- package/src/continuity/resumer.ts +104 -0
- package/src/continuity/tracker.ts +36 -0
- package/src/extension/register.ts +278 -0
- package/src/graph/decay.ts +139 -0
- package/src/graph/graph-store.ts +157 -0
- package/src/graph/hash-id.ts +63 -0
- package/{dist/graph/index.d.ts → src/graph/index.ts} +1 -1
- package/src/graph/memory-store.ts +284 -0
- package/src/graph/session-isolation.ts +186 -0
- package/src/index.ts +13 -0
- package/src/memory/hierarchical.ts +122 -0
- package/src/memory/mental-models.ts +141 -0
- package/src/memory/recall.ts +110 -0
- package/src/memory/reflect.ts +32 -0
- package/src/memory/retain.ts +77 -0
- package/src/store/events.ts +61 -0
- package/src/store/fts5-index.ts +32 -0
- package/{dist/store/schema.js → src/store/schema.ts} +41 -32
- package/src/store/search.ts +222 -0
- package/src/store/sqlite.ts +53 -0
- package/src/store/vocabulary.ts +34 -0
- package/src/tools/memory-recall.ts +17 -0
- package/src/tools/memory-search.ts +56 -0
- package/src/tools/memory-status.ts +113 -0
- package/src/tools/memory-store.ts +30 -0
- package/src/trace/correlation.ts +288 -0
- package/dist/categories/memory-categories.d.ts +0 -33
- package/dist/categories/memory-categories.d.ts.map +0 -1
- package/dist/categories/memory-categories.js +0 -61
- package/dist/categories/memory-categories.js.map +0 -1
- package/dist/compound/analyzer.d.ts +0 -15
- package/dist/compound/analyzer.d.ts.map +0 -1
- package/dist/compound/analyzer.js +0 -145
- package/dist/compound/analyzer.js.map +0 -1
- package/dist/compound/dedup.d.ts +0 -34
- package/dist/compound/dedup.d.ts.map +0 -1
- package/dist/compound/dedup.js +0 -80
- package/dist/compound/dedup.js.map +0 -1
- package/dist/compound/extractor.d.ts +0 -47
- package/dist/compound/extractor.d.ts.map +0 -1
- package/dist/compound/extractor.js +0 -82
- package/dist/compound/extractor.js.map +0 -1
- package/dist/compound/router.d.ts +0 -17
- package/dist/compound/router.d.ts.map +0 -1
- package/dist/compound/router.js +0 -64
- package/dist/compound/router.js.map +0 -1
- package/dist/compound/writer.d.ts +0 -21
- package/dist/compound/writer.d.ts.map +0 -1
- package/dist/compound/writer.js +0 -101
- package/dist/compound/writer.js.map +0 -1
- package/dist/config.d.ts +0 -37
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -66
- package/dist/config.js.map +0 -1
- package/dist/context/context-saver.d.ts +0 -96
- package/dist/context/context-saver.d.ts.map +0 -1
- package/dist/context/context-saver.js +0 -234
- package/dist/context/context-saver.js.map +0 -1
- package/dist/continuity/compaction-hook.d.ts +0 -12
- package/dist/continuity/compaction-hook.d.ts.map +0 -1
- package/dist/continuity/compaction-hook.js +0 -19
- package/dist/continuity/compaction-hook.js.map +0 -1
- package/dist/continuity/resumer.d.ts +0 -21
- package/dist/continuity/resumer.d.ts.map +0 -1
- package/dist/continuity/resumer.js +0 -91
- package/dist/continuity/resumer.js.map +0 -1
- package/dist/continuity/tracker.d.ts +0 -13
- package/dist/continuity/tracker.d.ts.map +0 -1
- package/dist/continuity/tracker.js +0 -24
- package/dist/continuity/tracker.js.map +0 -1
- package/dist/extension/register.d.ts +0 -3
- package/dist/extension/register.d.ts.map +0 -1
- package/dist/extension/register.js +0 -269
- package/dist/extension/register.js.map +0 -1
- package/dist/graph/decay.d.ts +0 -52
- package/dist/graph/decay.d.ts.map +0 -1
- package/dist/graph/decay.js +0 -99
- package/dist/graph/decay.js.map +0 -1
- package/dist/graph/graph-store.d.ts +0 -47
- package/dist/graph/graph-store.d.ts.map +0 -1
- package/dist/graph/graph-store.js +0 -107
- package/dist/graph/graph-store.js.map +0 -1
- package/dist/graph/hash-id.d.ts +0 -31
- package/dist/graph/hash-id.d.ts.map +0 -1
- package/dist/graph/hash-id.js +0 -51
- package/dist/graph/hash-id.js.map +0 -1
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js +0 -8
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/memory-store.d.ts +0 -55
- package/dist/graph/memory-store.d.ts.map +0 -1
- package/dist/graph/memory-store.js +0 -213
- package/dist/graph/memory-store.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -5
- package/dist/index.js.map +0 -1
- package/dist/memory/hierarchical.d.ts +0 -19
- package/dist/memory/hierarchical.d.ts.map +0 -1
- package/dist/memory/hierarchical.js +0 -103
- package/dist/memory/hierarchical.js.map +0 -1
- package/dist/memory/mental-models.d.ts +0 -32
- package/dist/memory/mental-models.d.ts.map +0 -1
- package/dist/memory/mental-models.js +0 -100
- package/dist/memory/mental-models.js.map +0 -1
- package/dist/memory/recall.d.ts +0 -19
- package/dist/memory/recall.d.ts.map +0 -1
- package/dist/memory/recall.js +0 -88
- package/dist/memory/recall.js.map +0 -1
- package/dist/memory/reflect.d.ts +0 -10
- package/dist/memory/reflect.d.ts.map +0 -1
- package/dist/memory/reflect.js +0 -21
- package/dist/memory/reflect.js.map +0 -1
- package/dist/memory/retain.d.ts +0 -23
- package/dist/memory/retain.d.ts.map +0 -1
- package/dist/memory/retain.js +0 -61
- package/dist/memory/retain.js.map +0 -1
- package/dist/store/events.d.ts +0 -29
- package/dist/store/events.d.ts.map +0 -1
- package/dist/store/events.js +0 -33
- package/dist/store/events.js.map +0 -1
- package/dist/store/fts5-index.d.ts +0 -10
- package/dist/store/fts5-index.d.ts.map +0 -1
- package/dist/store/fts5-index.js +0 -19
- package/dist/store/fts5-index.js.map +0 -1
- package/dist/store/schema.d.ts +0 -7
- package/dist/store/schema.d.ts.map +0 -1
- package/dist/store/schema.js.map +0 -1
- package/dist/store/search.d.ts +0 -21
- package/dist/store/search.d.ts.map +0 -1
- package/dist/store/search.js +0 -160
- package/dist/store/search.js.map +0 -1
- package/dist/store/sqlite.d.ts +0 -20
- package/dist/store/sqlite.d.ts.map +0 -1
- package/dist/store/sqlite.js +0 -50
- package/dist/store/sqlite.js.map +0 -1
- package/dist/store/vocabulary.d.ts +0 -15
- package/dist/store/vocabulary.d.ts.map +0 -1
- package/dist/store/vocabulary.js +0 -26
- package/dist/store/vocabulary.js.map +0 -1
- package/dist/tools/memory-recall.d.ts +0 -10
- package/dist/tools/memory-recall.d.ts.map +0 -1
- package/dist/tools/memory-recall.js +0 -11
- package/dist/tools/memory-recall.js.map +0 -1
- package/dist/tools/memory-search.d.ts +0 -21
- package/dist/tools/memory-search.d.ts.map +0 -1
- package/dist/tools/memory-search.js +0 -33
- package/dist/tools/memory-search.js.map +0 -1
- package/dist/tools/memory-status.d.ts +0 -18
- package/dist/tools/memory-status.d.ts.map +0 -1
- package/dist/tools/memory-status.js +0 -84
- package/dist/tools/memory-status.js.map +0 -1
- package/dist/tools/memory-store.d.ts +0 -16
- package/dist/tools/memory-store.d.ts.map +0 -1
- package/dist/tools/memory-store.js +0 -17
- package/dist/tools/memory-store.js.map +0 -1
- package/dist/trace/correlation.d.ts +0 -111
- package/dist/trace/correlation.d.ts.map +0 -1
- package/dist/trace/correlation.js +0 -234
- package/dist/trace/correlation.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.4.1 (2026-05-13)
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Comprehensive documentation
|
|
7
|
+
|
|
8
|
+
## 0.4.0 (2026-05-12)
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Memory Store (SQLite)
|
|
12
|
+
- Semantic Search (FTS5/BM25)
|
|
13
|
+
- Graph Memory
|
|
14
|
+
- Memory Decay
|
|
15
|
+
- Session Continuity
|
|
16
|
+
|
|
17
|
+
## 0.3.0 (Earlier)
|
|
18
|
+
- Initial release
|
package/README.md
CHANGED
|
@@ -1,72 +1,60 @@
|
|
|
1
1
|
# pi-recollect
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Persistent memory extension for Pi coding agents.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
7
|
+
- **Memory Store** - SQLite-backed persistent memory
|
|
8
|
+
- **Semantic Search** - FTS5/BM25 search across memories
|
|
9
|
+
- **Session Continuity** - Continue from where you left off
|
|
10
|
+
- **Knowledge Compounding** - Store lessons learned
|
|
11
|
+
- **Graph Memory** - Hash-based graph relationships
|
|
12
|
+
- **Memory Decay** - Age out old memories
|
|
13
|
+
- **Context Saving** - Save context between sessions
|
|
14
|
+
- **Session Isolation** - Separate memories per session
|
|
12
15
|
|
|
13
|
-
##
|
|
16
|
+
## Install
|
|
14
17
|
|
|
15
18
|
```bash
|
|
16
|
-
|
|
19
|
+
pi install npm:pi-recollect
|
|
17
20
|
```
|
|
18
21
|
|
|
19
|
-
##
|
|
22
|
+
## Quick Start
|
|
20
23
|
|
|
21
|
-
###
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- `/compact` - Compact session context
|
|
26
|
-
- `/forget [id]` - Remove from memory
|
|
27
|
-
|
|
28
|
-
### Graph Store
|
|
29
|
-
|
|
30
|
-
```typescript
|
|
31
|
-
import { createGraphStore, generateHashId } from 'pi-recollect';
|
|
24
|
+
### Store Memory
|
|
25
|
+
```bash
|
|
26
|
+
/memory store "Important: Use auth middleware for /api routes"
|
|
27
|
+
```
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
### Search Memory
|
|
30
|
+
```bash
|
|
31
|
+
/memory search authentication
|
|
32
|
+
```
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
content: '...',
|
|
40
|
-
relations: [{ type: 'relates_to', targetId: otherNode.id }],
|
|
41
|
-
});
|
|
34
|
+
### Recall Context
|
|
35
|
+
```bash
|
|
36
|
+
/memory recall
|
|
37
|
+
```
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
### List Memories
|
|
40
|
+
```bash
|
|
41
|
+
/memory list
|
|
45
42
|
```
|
|
46
43
|
|
|
47
|
-
##
|
|
44
|
+
## Commands
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
│ └── decay.ts # Memory decay
|
|
56
|
-
├── context/
|
|
57
|
-
│ └── context-saver.ts # Context management
|
|
58
|
-
├── session/
|
|
59
|
-
│ └── session-continuity.ts
|
|
60
|
-
└── index.ts
|
|
61
|
-
```
|
|
46
|
+
| Command | Description |
|
|
47
|
+
|---------|-------------|
|
|
48
|
+
| `/memory` | Memory main command |
|
|
49
|
+
| `/memory store` | Store new memory |
|
|
50
|
+
| `/memory search` | Search memories |
|
|
51
|
+
| `/memory recall` | Recall context |
|
|
62
52
|
|
|
63
|
-
##
|
|
53
|
+
## Verify
|
|
64
54
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
- Context compaction from oh-my-pi
|
|
69
|
-
- Memory decay from beads
|
|
55
|
+
```bash
|
|
56
|
+
pi list
|
|
57
|
+
```
|
|
70
58
|
|
|
71
59
|
## License
|
|
72
60
|
|
package/docs/API.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# pi-recollect API Reference
|
|
2
|
+
|
|
3
|
+
## Graph Store
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import { createGraphStore, generateHashId } from 'pi-recollect';
|
|
7
|
+
|
|
8
|
+
const store = createGraphStore();
|
|
9
|
+
|
|
10
|
+
// Add nodes
|
|
11
|
+
const issue = store.addNode({
|
|
12
|
+
type: 'issue',
|
|
13
|
+
title: 'Bug in auth',
|
|
14
|
+
content: 'Token expiry check wrong',
|
|
15
|
+
relations: [],
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const task = store.addNode({
|
|
19
|
+
type: 'task',
|
|
20
|
+
title: 'Fix auth',
|
|
21
|
+
relations: [{ type: 'blocks', targetId: issue.id }],
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// Query
|
|
25
|
+
const insights = store.query({ type: 'insight' });
|
|
26
|
+
const tasks = store.query({ type: 'task', closed: false });
|
|
27
|
+
|
|
28
|
+
// Get related
|
|
29
|
+
const related = store.getRelatedNodes(issue.id);
|
|
30
|
+
const relations = store.getRelations(issue.id);
|
|
31
|
+
|
|
32
|
+
// Close and compact
|
|
33
|
+
store.closeNode(issue.id);
|
|
34
|
+
store.compact(new Date('2024-01-01'));
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Hash IDs
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { generateHashId } from 'pi-recollect';
|
|
41
|
+
|
|
42
|
+
const id = generateHashId('issue');
|
|
43
|
+
// "issue-a1b2c3d4"
|
|
44
|
+
|
|
45
|
+
const id2 = generateHashId();
|
|
46
|
+
// "node-e5f6g7h8"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Memory Decay
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { createMemoryDecay } from 'pi-recollect';
|
|
53
|
+
|
|
54
|
+
const decay = createMemoryDecay({
|
|
55
|
+
decayThreshold: 30 * 24 * 60 * 60 * 1000, // 30 days
|
|
56
|
+
minImportance: 0.5,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
decay.record(node);
|
|
60
|
+
const shouldDecay = decay.shouldDecay(node);
|
|
61
|
+
const summary = decay.summarize(node);
|
|
62
|
+
```
|
package/docs/COMMANDS.md
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Command Reference - pi-recollect
|
|
2
|
+
|
|
3
|
+
## Slash Commands
|
|
4
|
+
|
|
5
|
+
### /memory
|
|
6
|
+
Main memory command.
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
/memory <subcommand> [options]
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### /memory store
|
|
13
|
+
Store new memory.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
/memory store <content> [options]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
#### Options
|
|
20
|
+
|
|
21
|
+
| Option | Description |
|
|
22
|
+
|--------|-------------|
|
|
23
|
+
| `--tags` | Comma-separated tags |
|
|
24
|
+
| `--priority` | high/normal/low |
|
|
25
|
+
| `--expires` | Auto-delete duration |
|
|
26
|
+
|
|
27
|
+
### /memory search
|
|
28
|
+
Search memories.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
/memory search <query> [options]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### Options
|
|
35
|
+
|
|
36
|
+
| Option | Description |
|
|
37
|
+
|--------|-------------|
|
|
38
|
+
| `--tags` | Filter by tags |
|
|
39
|
+
| `--priority` | Filter by priority |
|
|
40
|
+
| `--limit` | Max results |
|
|
41
|
+
| `--fuzzy` | Enable fuzzy matching |
|
|
42
|
+
|
|
43
|
+
### /memory recall
|
|
44
|
+
Recall session context.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
/memory recall [options]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
#### Options
|
|
51
|
+
|
|
52
|
+
| Option | Description |
|
|
53
|
+
|--------|-------------|
|
|
54
|
+
| `--session` | Specific session ID |
|
|
55
|
+
| `--recent` | Recent sessions only |
|
|
56
|
+
|
|
57
|
+
### /memory list
|
|
58
|
+
List memories.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
/memory list [options]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Options
|
|
65
|
+
|
|
66
|
+
| Option | Description |
|
|
67
|
+
|--------|-------------|
|
|
68
|
+
| `--tags` | Filter by tags |
|
|
69
|
+
| `--status` | active/archived |
|
|
70
|
+
| `--limit` | Max results |
|
|
71
|
+
|
|
72
|
+
### /memory get
|
|
73
|
+
Get specific memory.
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
/memory get <id>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### /memory update
|
|
80
|
+
Update memory.
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
/memory update <id> <content>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### /memory delete
|
|
87
|
+
Delete memory.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
/memory delete <id>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### /memory link
|
|
94
|
+
Link memories.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
/memory link <id> --to <id> --type=<type>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### /memory graph
|
|
101
|
+
Show memory graph.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
/memory graph [id]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### /memory archive
|
|
108
|
+
Archive old memories.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
/memory archive [options]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### /memory save-session
|
|
115
|
+
Save current session.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
/memory save-session
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### /memory resume
|
|
122
|
+
Resume last session.
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
/memory resume
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Tools
|
|
129
|
+
|
|
130
|
+
### memory_store
|
|
131
|
+
|
|
132
|
+
```javascript
|
|
133
|
+
memory_store({
|
|
134
|
+
content: "Memory text",
|
|
135
|
+
tags: ["tag1", "tag2"],
|
|
136
|
+
priority: "normal",
|
|
137
|
+
expires: "7d"
|
|
138
|
+
})
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### memory_search
|
|
142
|
+
|
|
143
|
+
```javascript
|
|
144
|
+
memory_search({
|
|
145
|
+
query: "authentication",
|
|
146
|
+
tags: ["security"],
|
|
147
|
+
limit: 10,
|
|
148
|
+
fuzzy: false
|
|
149
|
+
})
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### memory_recall
|
|
153
|
+
|
|
154
|
+
```javascript
|
|
155
|
+
memory_recall({
|
|
156
|
+
sessionId: "session-123"
|
|
157
|
+
})
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### memory_list
|
|
161
|
+
|
|
162
|
+
```javascript
|
|
163
|
+
memory_list({
|
|
164
|
+
status: "active",
|
|
165
|
+
tags: ["important"],
|
|
166
|
+
limit: 20
|
|
167
|
+
})
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### memory_graph
|
|
171
|
+
|
|
172
|
+
```javascript
|
|
173
|
+
memory_graph({
|
|
174
|
+
memoryId: "mem-123",
|
|
175
|
+
depth: 2
|
|
176
|
+
})
|
|
177
|
+
```
|
package/docs/CONFIG.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Configuration - pi-recollect
|
|
2
|
+
|
|
3
|
+
## Configuration File
|
|
4
|
+
|
|
5
|
+
Create `pi-recollect.config.json`:
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"storage": {
|
|
10
|
+
"type": "sqlite",
|
|
11
|
+
"path": ".pi/memory.db",
|
|
12
|
+
"fts": true,
|
|
13
|
+
"ftsAlgorithm": "bm25"
|
|
14
|
+
},
|
|
15
|
+
"memory": {
|
|
16
|
+
"maxPerSession": 1000,
|
|
17
|
+
"defaultPriority": "normal",
|
|
18
|
+
"defaultExpires": "30d",
|
|
19
|
+
"autoArchive": true,
|
|
20
|
+
"archiveAfter": "90d"
|
|
21
|
+
},
|
|
22
|
+
"search": {
|
|
23
|
+
"defaultLimit": 20,
|
|
24
|
+
"fuzzyEnabled": true,
|
|
25
|
+
"fuzzyThreshold": 0.6,
|
|
26
|
+
"relevanceThreshold": 0.3
|
|
27
|
+
},
|
|
28
|
+
"decay": {
|
|
29
|
+
"enabled": true,
|
|
30
|
+
"highImportance": "never",
|
|
31
|
+
"normalImportance": "90d",
|
|
32
|
+
"lowImportance": "30d"
|
|
33
|
+
},
|
|
34
|
+
"graph": {
|
|
35
|
+
"enabled": true,
|
|
36
|
+
"maxDepth": 3
|
|
37
|
+
},
|
|
38
|
+
"session": {
|
|
39
|
+
"autoSave": true,
|
|
40
|
+
"saveInterval": 300000,
|
|
41
|
+
"maxSessions": 50
|
|
42
|
+
},
|
|
43
|
+
"context": {
|
|
44
|
+
"autoInject": true,
|
|
45
|
+
"maxMemories": 5,
|
|
46
|
+
"relevanceThreshold": 0.5
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Environment Variables
|
|
52
|
+
|
|
53
|
+
| Variable | Description | Default |
|
|
54
|
+
|----------|-------------|---------|
|
|
55
|
+
| `PI_MEMORY_DB` | Database path | .pi/memory.db |
|
|
56
|
+
| `PI_MEMORY_LIMIT` | Max memories | 1000 |
|
|
57
|
+
|
|
58
|
+
## Storage
|
|
59
|
+
|
|
60
|
+
### SQLite (Default)
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"storage": {
|
|
65
|
+
"type": "sqlite",
|
|
66
|
+
"path": ".pi/memory.db"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Memory Only
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"storage": {
|
|
76
|
+
"type": "memory"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Search Configuration
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"search": {
|
|
86
|
+
"fuzzyEnabled": true,
|
|
87
|
+
"fuzzyThreshold": 0.6,
|
|
88
|
+
"stemming": true,
|
|
89
|
+
"stopWords": ["the", "a", "an"]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Decay Configuration
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"decay": {
|
|
99
|
+
"enabled": true,
|
|
100
|
+
"schedule": "daily",
|
|
101
|
+
"thresholds": {
|
|
102
|
+
"high": 365,
|
|
103
|
+
"normal": 90,
|
|
104
|
+
"low": 30
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
package/docs/GUIDE.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# User Guide - pi-recollect
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
pi-recollect provides persistent memory for Pi coding agents with SQLite storage and semantic search.
|
|
6
|
+
|
|
7
|
+
## Memory Types
|
|
8
|
+
|
|
9
|
+
### Simple Memory
|
|
10
|
+
Basic key-value storage:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
/memory store "Use feature flags for new features"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Tagged Memory
|
|
17
|
+
Categorized with tags:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
/memory store "Use TypeScript strict mode" --tags=typescript,quality
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Priority Memory
|
|
24
|
+
Important memories with high priority:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
/memory store "CRITICAL: Database password exposed" --priority=high
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Expiring Memory
|
|
31
|
+
Auto-delete after time:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
/memory store "Temp: Fix expires in 1 hour" --expires=1h
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Search
|
|
38
|
+
|
|
39
|
+
### Keyword Search
|
|
40
|
+
```bash
|
|
41
|
+
/memory search authentication
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Semantic Search
|
|
45
|
+
```bash
|
|
46
|
+
/memory search "user authentication best practices"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Filtered Search
|
|
50
|
+
```bash
|
|
51
|
+
/memory search auth --tags=security --priority=high
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Fuzzy Search
|
|
55
|
+
```bash
|
|
56
|
+
/memory search "authentcation" --fuzzy
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Graph Memory
|
|
60
|
+
|
|
61
|
+
### Relationships
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
/memory link mem-123 --to mem-456 --type="implements"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Graph Query
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
/memory graph mem-123
|
|
71
|
+
|
|
72
|
+
Output:
|
|
73
|
+
## Memory Graph
|
|
74
|
+
|
|
75
|
+
mem-123: "Auth middleware"
|
|
76
|
+
├── implements → mem-456: "Auth interface"
|
|
77
|
+
├── requires → mem-789: "JWT service"
|
|
78
|
+
└── used-by → mem-111: "API routes"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Memory Decay
|
|
82
|
+
|
|
83
|
+
Old memories automatically age:
|
|
84
|
+
|
|
85
|
+
| Age | Importance | Action |
|
|
86
|
+
|-----|------------|--------|
|
|
87
|
+
| < 1 week | High | Full relevance |
|
|
88
|
+
| 1-4 weeks | Medium | Reduced relevance |
|
|
89
|
+
| > 1 month | Low | Minimal relevance |
|
|
90
|
+
| > 3 months | Very low | Archived |
|
|
91
|
+
|
|
92
|
+
### Manual Decay
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Archive old memories
|
|
96
|
+
/memory archive --older-than=30d
|
|
97
|
+
|
|
98
|
+
# Restore archived
|
|
99
|
+
/memory restore mem-123
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Session Continuity
|
|
103
|
+
|
|
104
|
+
### Save Session
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
/memory save-session
|
|
108
|
+
|
|
109
|
+
Output:
|
|
110
|
+
## Session Saved
|
|
111
|
+
|
|
112
|
+
Tasks completed: 5
|
|
113
|
+
Key decisions: 3
|
|
114
|
+
Open questions: 2
|
|
115
|
+
Context size: 45KB
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Resume Session
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
/memory resume
|
|
122
|
+
|
|
123
|
+
Output:
|
|
124
|
+
## Resuming Session
|
|
125
|
+
|
|
126
|
+
Last session: 2 hours ago
|
|
127
|
+
Project: my-app
|
|
128
|
+
Resuming: Task #6 of "Implement auth"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Context Injection
|
|
132
|
+
|
|
133
|
+
Memories automatically injected:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
## Relevant Memories
|
|
137
|
+
|
|
138
|
+
1. "Use auth middleware for /api routes" (from: Session 12)
|
|
139
|
+
2. "JWT tokens in httpOnly cookie" (from: Session 8)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Best Practices
|
|
143
|
+
|
|
144
|
+
1. **Be specific** - Clear, actionable memories
|
|
145
|
+
2. **Tag properly** - Easy retrieval later
|
|
146
|
+
3. **Set priorities** - Important = high priority
|
|
147
|
+
4. **Regular review** - Clean up old memories
|
|
148
|
+
5. **Link related** - Build knowledge graph
|
package/docs/PATTERNS.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Patterns Applied to pi-recollect
|
|
2
|
+
|
|
3
|
+
This document lists all research patterns applied to this extension during development.
|
|
4
|
+
|
|
5
|
+
## Research Sources
|
|
6
|
+
|
|
7
|
+
- gstack (persistent daemon, design system, boil the lake)
|
|
8
|
+
- gsd-2 (ADR, multi-model, branchless worktree)
|
|
9
|
+
- pi-crew (hooks, metrics, correlation, UI patterns)
|
|
10
|
+
- pi-hermes-memory (memory categories, learn command)
|
|
11
|
+
- beads (hash IDs, graph memory, memory decay)
|
|
12
|
+
- context-mode (BM25 search, context sandbox)
|
|
13
|
+
- everything-claude-code (quality gates, agent shield)
|
|
14
|
+
- vetc-dev-kit (SDLC router, systematic debugging)
|
|
15
|
+
- caveman (token compression)
|
|
16
|
+
- And more...
|
|
17
|
+
|
|
18
|
+
## Patterns Implemented
|
|
19
|
+
|
|
20
|
+
### Core Patterns
|
|
21
|
+
|
|
22
|
+
| Pattern | Source | Description |
|
|
23
|
+
|---------|--------|-------------|
|
|
24
|
+
| GraphStore | beads | Hash-based ID graph with dependencies |
|
|
25
|
+
| MemoryDecay | beads | Semantic summarization of old content |
|
|
26
|
+
| ContextCompaction | oh-my-pi | Session compaction for long conversations |
|
|
27
|
+
| HashIDs | beads | Conflict-free hash IDs |
|
|
28
|
+
| MemoryCategories | pi-hermes-memory | Categorized memory storage |
|
|
29
|
+
|
|
30
|
+
## Implementation Notes
|
|
31
|
+
|
|
32
|
+
All patterns were researched from 52 source repositories and applied following the pi-crew delegation patterns skill.
|
|
33
|
+
|
|
34
|
+
### Research Process
|
|
35
|
+
|
|
36
|
+
1. Read source repositories (bare git repos in `source/`)
|
|
37
|
+
2. Extract patterns applicable to this extension
|
|
38
|
+
3. Implement patterns with tests
|
|
39
|
+
4. Verify with 100% test coverage
|
|
40
|
+
|
|
41
|
+
### Test Coverage
|
|
42
|
+
|
|
43
|
+
All new patterns include comprehensive unit tests to ensure correctness.
|
|
44
|
+
|
|
45
|
+
## References
|
|
46
|
+
|
|
47
|
+
- [Research Index](../research-findings/00-index.md)
|
|
48
|
+
- [API Reference](API.md)
|
|
49
|
+
- [Quick Start](QUICKSTART.md)
|