@chendpoc/pi-memory 0.3.1 → 0.3.2
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 +1 -1
- package/doc/LAUNCH-KIT.md +229 -0
- package/doc/ROADMAP-zh.md +114 -0
- package/doc/ROADMAP.md +114 -0
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -437,7 +437,7 @@ The sidecar IPC test opens a Unix domain socket. If it fails with `listen EPERM`
|
|
|
437
437
|
|
|
438
438
|
- [Chinese README](./doc/README-zh.md)
|
|
439
439
|
- [Roadmap](./doc/ROADMAP.md)
|
|
440
|
-
- [
|
|
440
|
+
- [Launch kit](./doc/LAUNCH-KIT.md)
|
|
441
441
|
- [UBIQUITOUS_LANGUAGE.md](./UBIQUITOUS_LANGUAGE.md) - domain glossary
|
|
442
442
|
|
|
443
443
|
## 📜 License
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# @chendpoc/pi-memory Launch Kit
|
|
2
|
+
|
|
3
|
+
This document is copy-ready material for sharing `@chendpoc/pi-memory`.
|
|
4
|
+
Before each launch, re-check the package version and public links.
|
|
5
|
+
|
|
6
|
+
## Public Links
|
|
7
|
+
|
|
8
|
+
- GitHub: https://github.com/chendpoc/pi-memory
|
|
9
|
+
- npm: https://www.npmjs.com/package/@chendpoc/pi-memory
|
|
10
|
+
- Pi package page: https://pi.dev/packages/@chendpoc/pi-memory
|
|
11
|
+
- Install command:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pi install npm:@chendpoc/pi-memory
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Positioning
|
|
18
|
+
|
|
19
|
+
One-liner:
|
|
20
|
+
|
|
21
|
+
> Local-first Markdown memory for the Pi coding agent: remember preferences, project conventions, decisions, and todos across sessions without making a hosted database the source of truth.
|
|
22
|
+
|
|
23
|
+
Short pitch:
|
|
24
|
+
|
|
25
|
+
> `pi-memory` gives Pi cross-session memory that stays local and inspectable. It writes durable facts to `MEMORY.md`, recalls relevant entries before Pi answers, redacts common secrets before saving, and degrades gracefully when recall is unavailable.
|
|
26
|
+
|
|
27
|
+
Longer pitch:
|
|
28
|
+
|
|
29
|
+
> Pi compaction helps a long conversation continue, but it does not make future sessions remember stable preferences, project rules, prior decisions, or unresolved todos. `pi-memory` fills that gap with a local-first loop: explicit `/remember` notes, durable memory export from compaction and shutdown maintenance, `MEMORY.md` as the editable ground truth, and bounded pre-answer recall through a sidecar-derived index.
|
|
30
|
+
|
|
31
|
+
## Proof Points
|
|
32
|
+
|
|
33
|
+
Lead with behavior, not architecture:
|
|
34
|
+
|
|
35
|
+
- A new Pi session can answer from previously saved preferences instead of asking the user to repeat context.
|
|
36
|
+
- `/remember` writes user-authored entries that consolidation must preserve.
|
|
37
|
+
- `MEMORY.md` remains editable, greppable, copyable, and versionable.
|
|
38
|
+
- Common secrets are redacted before durable memory writes.
|
|
39
|
+
- Recall has a bounded preflight budget and falls back instead of blocking the agent turn.
|
|
40
|
+
- Maintenance runs outside ordinary interactive turns.
|
|
41
|
+
|
|
42
|
+
## Two-Minute Demo
|
|
43
|
+
|
|
44
|
+
Use a fresh memory directory for recording so the demo does not expose personal memory:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
export PI_MEMORY_AGENT_DIR="$(mktemp -d)"
|
|
48
|
+
pi install npm:@chendpoc/pi-memory
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
In Pi:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
/remember Preferences Prefer pnpm over npm in JavaScript projects.
|
|
55
|
+
/remember Conventions Public docs should be English-first, with Chinese docs under doc/.
|
|
56
|
+
/memory-status expand
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Show the ground-truth file:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
cat "$PI_MEMORY_AGENT_DIR/MEMORY.md"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Start a new Pi session and ask:
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
For this package, which package manager should I use, and where should Chinese docs live?
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The expected story is not "magic memory". The expected story is:
|
|
72
|
+
|
|
73
|
+
1. The user explicitly saved stable preferences.
|
|
74
|
+
2. The memory is visible in Markdown.
|
|
75
|
+
3. A later session can use it before answering.
|
|
76
|
+
4. If recall is unavailable, Pi still answers without memory injection.
|
|
77
|
+
|
|
78
|
+
## Demo Asset Checklist
|
|
79
|
+
|
|
80
|
+
The launch posts should link to the repo, but the repo alone is not enough for cold readers. Prepare one short visual proof before posting outside the Pi community.
|
|
81
|
+
|
|
82
|
+
Recommended asset:
|
|
83
|
+
|
|
84
|
+
- Length: 30-60 seconds.
|
|
85
|
+
- Format: GIF or short MP4.
|
|
86
|
+
- First frame: package name, install command, and the phrase "local Markdown memory for Pi".
|
|
87
|
+
- Main sequence: `/remember` -> `MEMORY.md` -> new Pi session -> recalled answer -> `/memory-status`.
|
|
88
|
+
- Final frame: GitHub URL and `pi install npm:@chendpoc/pi-memory`.
|
|
89
|
+
|
|
90
|
+
Recording script:
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
1. Open a clean terminal with PI_MEMORY_AGENT_DIR pointing at a temp directory.
|
|
94
|
+
2. Install or show the installed package.
|
|
95
|
+
3. In Pi, run two /remember commands.
|
|
96
|
+
4. Open MEMORY.md and show the exact saved bullets.
|
|
97
|
+
5. Start a new Pi session and ask a question that depends on those bullets.
|
|
98
|
+
6. Show /memory-status expand.
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Do not record a personal `MEMORY.md`. Do not show real API keys, private repo names, or private session paths.
|
|
102
|
+
|
|
103
|
+
## Copy Blocks
|
|
104
|
+
|
|
105
|
+
### X / Bluesky
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
I shipped @chendpoc/pi-memory: local-first Markdown memory for the Pi coding agent.
|
|
109
|
+
|
|
110
|
+
It keeps preferences, project conventions, decisions, and todos in MEMORY.md, recalls relevant entries before Pi answers, and redacts common secrets before saving.
|
|
111
|
+
|
|
112
|
+
Install:
|
|
113
|
+
pi install npm:@chendpoc/pi-memory
|
|
114
|
+
|
|
115
|
+
https://github.com/chendpoc/pi-memory
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Hacker News / Reddit
|
|
119
|
+
|
|
120
|
+
Title:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
Show HN: pi-memory - local Markdown memory for the Pi coding agent
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Body:
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
I built pi-memory because Pi compaction helps continue one long session, but I wanted future sessions to remember stable preferences, project conventions, decisions, and open todos.
|
|
130
|
+
|
|
131
|
+
The design is intentionally local and inspectable:
|
|
132
|
+
|
|
133
|
+
- MEMORY.md is the ground truth.
|
|
134
|
+
- /remember writes explicit user notes.
|
|
135
|
+
- compaction and shutdown maintenance can export durable facts.
|
|
136
|
+
- a sidecar builds a derived index for pre-answer recall.
|
|
137
|
+
- common secrets are redacted before durable memory writes.
|
|
138
|
+
- recall is best-effort, so the agent still runs if memory is slow or unavailable.
|
|
139
|
+
|
|
140
|
+
Install:
|
|
141
|
+
pi install npm:@chendpoc/pi-memory
|
|
142
|
+
|
|
143
|
+
GitHub:
|
|
144
|
+
https://github.com/chendpoc/pi-memory
|
|
145
|
+
|
|
146
|
+
npm:
|
|
147
|
+
https://www.npmjs.com/package/@chendpoc/pi-memory
|
|
148
|
+
|
|
149
|
+
I would especially like feedback on recall quality, memory review UX, and whether hybrid lexical + vector recall should be the next milestone.
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Pi Community
|
|
153
|
+
|
|
154
|
+
```text
|
|
155
|
+
I published @chendpoc/pi-memory for Pi.
|
|
156
|
+
|
|
157
|
+
It adds local cross-session memory: /remember, editable MEMORY.md ground truth, pre-answer recall, compaction/shutdown export, status diagnostics, and secret redaction before durable writes.
|
|
158
|
+
|
|
159
|
+
Install:
|
|
160
|
+
pi install npm:@chendpoc/pi-memory
|
|
161
|
+
|
|
162
|
+
Pi package page:
|
|
163
|
+
https://pi.dev/packages/@chendpoc/pi-memory
|
|
164
|
+
|
|
165
|
+
GitHub:
|
|
166
|
+
https://github.com/chendpoc/pi-memory
|
|
167
|
+
|
|
168
|
+
Feedback I am looking for: install friction, recall quality, and what memory review/edit commands should look like.
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Chinese Short Post
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
我做了一个 Pi 插件 @chendpoc/pi-memory:给 Pi 加 local-first 跨会话记忆。
|
|
175
|
+
|
|
176
|
+
核心不是把聊天记录塞进数据库,而是把稳定偏好、项目约定、决策和 TODO 写进可编辑的 MEMORY.md;每次回答前尽量召回相关记忆;写入前会对常见 token/secret 做脱敏;召回失败也不会阻塞正常对话。
|
|
177
|
+
|
|
178
|
+
安装:
|
|
179
|
+
pi install npm:@chendpoc/pi-memory
|
|
180
|
+
|
|
181
|
+
GitHub:
|
|
182
|
+
https://github.com/chendpoc/pi-memory
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Launch Sequence
|
|
186
|
+
|
|
187
|
+
This material can improve conversion, but it will not create demand by itself. The highest-leverage launch path is narrow first, then broader technical audiences.
|
|
188
|
+
|
|
189
|
+
| Step | Channel | Goal | Success signal |
|
|
190
|
+
| --- | --- | --- | --- |
|
|
191
|
+
| 1 | GitHub repo metadata | Make the first click understandable | Description, topics, README, and demo asset all tell the same story |
|
|
192
|
+
| 2 | Pi community / Discord | Find install friction quickly | 3-5 people try `pi install npm:@chendpoc/pi-memory` |
|
|
193
|
+
| 3 | X / Bluesky | Lightweight awareness | Clicks, stars, replies asking what Pi memory does |
|
|
194
|
+
| 4 | Reddit / HN | Technical feedback | Comments about design tradeoffs, recall quality, local-first boundary |
|
|
195
|
+
| 5 | Technical article | Durable search traffic | People arrive via "Pi agent memory", "local agent memory", or "Markdown memory" searches |
|
|
196
|
+
|
|
197
|
+
Suggested order:
|
|
198
|
+
|
|
199
|
+
1. Update the GitHub repo description to the one-liner above.
|
|
200
|
+
2. Add one demo GIF/MP4 or screenshot to the README near the top.
|
|
201
|
+
3. Share in the Pi package/community channel first, because the install path is Pi-specific.
|
|
202
|
+
4. Fix install friction reported by early users before posting broadly.
|
|
203
|
+
5. Post the Show HN / Reddit version after the README and demo are stable.
|
|
204
|
+
6. Follow up with a technical post comparing local Markdown ground truth, sidecar-derived indexes, and hosted memory APIs.
|
|
205
|
+
|
|
206
|
+
Track these numbers for one week:
|
|
207
|
+
|
|
208
|
+
- npm downloads.
|
|
209
|
+
- GitHub stars / forks.
|
|
210
|
+
- Pi community installs or replies.
|
|
211
|
+
- Issues filed about install, recall quality, or memory review UX.
|
|
212
|
+
- Number of users who complete the two-minute demo.
|
|
213
|
+
|
|
214
|
+
## Do Not Claim
|
|
215
|
+
|
|
216
|
+
- Do not call it a full session search product.
|
|
217
|
+
- Do not imply it stores or indexes full chat transcripts as memory.
|
|
218
|
+
- Do not claim perfect privacy; the accurate claim is local-first memory files plus redaction before durable memory writes.
|
|
219
|
+
- Do not pitch it as a Mem0/Zep replacement; it is a Pi-native, Markdown-first memory loop.
|
|
220
|
+
- Do not promise multi-hop graph reasoning or autonomous memory editing before those features ship.
|
|
221
|
+
- Do not lead with future cloud sync; for the current product, lead with local-first Ground Truth and optional derived indexes.
|
|
222
|
+
|
|
223
|
+
## Feedback Questions
|
|
224
|
+
|
|
225
|
+
- Did install work with `pi install npm:@chendpoc/pi-memory`?
|
|
226
|
+
- Was `MEMORY.md` created where you expected?
|
|
227
|
+
- Did `/memory-status expand` explain the state clearly?
|
|
228
|
+
- Did recall retrieve the memory you expected in a new session?
|
|
229
|
+
- Would you rather edit memory through Markdown, commands, or a TUI review panel?
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# @chendpoc/pi-memory 路线图
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="ROADMAP.md">English</a> |
|
|
5
|
+
<a href="ROADMAP-zh.md">简体中文</a>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
这是 `@chendpoc/pi-memory` 的公开产品路线图。它聚焦用户可感知的结果,不链接未随 npm 包发布的内部 `dev-doc/` 设计笔记。
|
|
9
|
+
|
|
10
|
+
## 版本规划
|
|
11
|
+
|
|
12
|
+
| 版本 | 主题 | 用户可感知结果 |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| **0.3.x** | 信任与安全 | 记忆写入更安全、有边界,也更容易诊断。 |
|
|
15
|
+
| **0.4.x** | 召回质量 | Pi 在 Preflight 预算内更常召回正确记忆。 |
|
|
16
|
+
| **0.5.x** | 记忆生命周期 | 用户能审查、淘汰、纠正长期记忆,减少手动清理。 |
|
|
17
|
+
| **0.6.x** | 可观测 + 控制面 | 用户能检查、排障、编辑、审查,并在本地迁移 Pi 记忆。 |
|
|
18
|
+
| **0.7.x** | 可选同步 | 在不强制上云的前提下,支持多 agent / 多设备协同记忆。 |
|
|
19
|
+
|
|
20
|
+
进入 **0.7** 之前,必须先完成三件事:debug/trace、memory edit/review、本地 import/export。Cloud 或多 agent 同步应保持可选,并默认 local-first。
|
|
21
|
+
|
|
22
|
+
## 产品原则
|
|
23
|
+
|
|
24
|
+
- `MEMORY.md` 继续作为可编辑的 Ground Truth。
|
|
25
|
+
- derived index、sidecar、trace、未来 sync state 都必须能从本地记忆工件重建。
|
|
26
|
+
- 召回应改善普通 agent 行为,但不能给每轮对话加入多秒级反思。
|
|
27
|
+
- 安全能力对记忆写入应 fail closed;对 agent 回答应 fail open。
|
|
28
|
+
- `pi-memory` 不应变成完整 transcript search 产品;旧会话搜索应由专门的 session-search 包负责。
|
|
29
|
+
|
|
30
|
+
## 当前基础
|
|
31
|
+
|
|
32
|
+
- 带 overflow 的 `MEMORY.md` Ground Truth。
|
|
33
|
+
- `/remember` 和 `/memory-status`。
|
|
34
|
+
- 基于 UDS JSONL 的 sidecar。
|
|
35
|
+
- `memory.vec.sqlite` 向量索引。
|
|
36
|
+
- QueryIntent + raw-query fallback。
|
|
37
|
+
- 800ms 共享 Preflight 预算,sidecar query 支持 AbortSignal 取消。
|
|
38
|
+
- sidecar warm、intent cache、query cache。
|
|
39
|
+
- dual-purpose compaction summary。
|
|
40
|
+
- Shutdown Queue + `maintenance`。
|
|
41
|
+
- Consolidate + reindex。
|
|
42
|
+
- Subagent Memory Cap + Compact Delta。
|
|
43
|
+
- Ground Truth 写入前 secret 脱敏。
|
|
44
|
+
- `MemoryRuntime` 扩展生命周期与重构后的 store/sidecar 模块。
|
|
45
|
+
|
|
46
|
+
## P0:信任与安全
|
|
47
|
+
|
|
48
|
+
**目标版本:0.3.x** · [GitHub milestone](https://github.com/chendpoc/pi-memory/milestone/1)
|
|
49
|
+
|
|
50
|
+
用户目标:记忆能力足够安全,可以默认开启。
|
|
51
|
+
|
|
52
|
+
- ✅ durable memory 写入前做 secret/token redaction — **0.3.0 已交付**。
|
|
53
|
+
- ✅ 拆小并澄清 store、ingest、status、lifecycle、sidecar 等运行模块 — **0.3.0 已交付**。
|
|
54
|
+
- 为 LLM 生成的 Memory Export 增加 prompt-injection guardrails。
|
|
55
|
+
- 针对用户明确纠正做 correction detector,优先限定在 `/remember` 链路。
|
|
56
|
+
- 为跳过写入和 fallback 决策提供轻量 reason code;完整 trace UX 放在 **0.6**。
|
|
57
|
+
|
|
58
|
+
## P1:召回质量
|
|
59
|
+
|
|
60
|
+
**目标版本:0.4.x** · [GitHub milestone](https://github.com/chendpoc/pi-memory/milestone/2)
|
|
61
|
+
|
|
62
|
+
用户目标:Pi 更常召回正确的稳定事实,同时保持交互轮次足够快。
|
|
63
|
+
|
|
64
|
+
- 对 `MEMORY.md` 条目做 lexical + vector 混合召回:SQLite FTS5 + 现有 vector chunks,RRF merge 后再 MMR。
|
|
65
|
+
- 为常见 coding-agent 问题建立 recall eval fixtures。
|
|
66
|
+
- debug metrics 拆分 intent、embed、scan、MMR、render、fallback、总 Preflight 时间。
|
|
67
|
+
- 改进 Ollama 之外的 embedding provider,在可行时支持免费/开源 embedding API。
|
|
68
|
+
- sidecar 检索优化:增量 reindex、batch embed、更清晰的 reindex/query 隔离。
|
|
69
|
+
- 只有在延迟预算允许时,才在 MMR 后加入可选 reranker。
|
|
70
|
+
|
|
71
|
+
## P2:记忆生命周期
|
|
72
|
+
|
|
73
|
+
**目标版本:0.5.x** · [GitHub milestone](https://github.com/chendpoc/pi-memory/milestone/3)
|
|
74
|
+
|
|
75
|
+
用户目标:长期记忆保持有用,而不是变成不断增长的过期事实堆。
|
|
76
|
+
|
|
77
|
+
- 增加 failure 和 tool-quirk 类别。
|
|
78
|
+
- 晋升前提供人类可审查的 memory draft 或 diary。
|
|
79
|
+
- 基于使用信号的晋升和裁剪。
|
|
80
|
+
- rewrite 前提供更安全的 consolidate preview。
|
|
81
|
+
- 显式处理 stale / superseded fact,而不是只做简单 TODO 清理。
|
|
82
|
+
- lifecycle 事件进入共享 debug/trace event schema;面向用户的 trace surface 在 **0.6** 交付。
|
|
83
|
+
|
|
84
|
+
## P3:可观测 + 控制面
|
|
85
|
+
|
|
86
|
+
**目标版本:0.6.x** · [GitHub milestone](https://github.com/chendpoc/pi-memory/milestone/4)
|
|
87
|
+
|
|
88
|
+
用户目标:当记忆行为不符合预期时,用户能看懂原因并修正,而不必阅读底层内部状态。
|
|
89
|
+
|
|
90
|
+
必须完成的出口标准:
|
|
91
|
+
|
|
92
|
+
- 本地 trace ring buffer,例如 `logs/trace.jsonl`,包含稳定 event name 和 reason code。
|
|
93
|
+
- `pi-memory status --verbose` 与 `/memory-status` 能总结最近 skip、fallback、write、reindex、recall 事件。
|
|
94
|
+
- memory edit/review 命令,并配合 **0.5** 的 stale/supersede 语义。
|
|
95
|
+
- 不同 Pi 安装之间的本地 import/export,并提供 dry-run,为未来 sync 做准备。
|
|
96
|
+
|
|
97
|
+
0.6 可选 backlog:
|
|
98
|
+
|
|
99
|
+
- 更好的 TUI status panel。
|
|
100
|
+
- 常见 Pi 配置的文档 recipes。
|
|
101
|
+
- 剩余 sidecar tuning,例如并行 raw+intent recall、MMR lambda 调参、consolidate 后 recall 抽检,由 p99 延迟和 eval 数据驱动。
|
|
102
|
+
|
|
103
|
+
## P4:可选同步
|
|
104
|
+
|
|
105
|
+
**目标版本:0.7.x**
|
|
106
|
+
|
|
107
|
+
用户目标:跨多个 Pi agent 或设备工作时,可以协同记忆,但不放弃本地控制权。
|
|
108
|
+
|
|
109
|
+
- 多 agent 跨 session 记忆协同。
|
|
110
|
+
- 可选 cloud Pi agent <-> local Pi agent session-memory sync。
|
|
111
|
+
- `MEMORY.md` 仍是 source of truth;vector index 在各设备本地 rebuild。
|
|
112
|
+
- 默认不自动上传。
|
|
113
|
+
- sync 设计必须先定义冲突处理、trust boundary、redaction guarantee、rollback,再进入实现。
|
|
114
|
+
- 前置条件:injection + redaction 闭环、stale/edit 语义、本地 import/export、debug/trace 能排障跨进程写入。
|
package/doc/ROADMAP.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# @chendpoc/pi-memory Roadmap
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="ROADMAP.md">English</a> |
|
|
5
|
+
<a href="ROADMAP-zh.md">简体中文</a>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
This is the public product roadmap for `@chendpoc/pi-memory`. It focuses on user-visible outcomes and intentionally avoids linking to internal `dev-doc/` design notes that are not shipped in the npm package.
|
|
9
|
+
|
|
10
|
+
## Version Map
|
|
11
|
+
|
|
12
|
+
| Version | Theme | User-facing outcome |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| **0.3.x** | Trust and safety | Memory writes are safer, bounded, and easier to diagnose. |
|
|
15
|
+
| **0.4.x** | Recall quality | Pi retrieves the right memory more often under the Preflight budget. |
|
|
16
|
+
| **0.5.x** | Memory lifecycle | Users can review, age out, and correct long-lived memory with less manual cleanup. |
|
|
17
|
+
| **0.6.x** | Observability + controls | Users can inspect, debug, edit, review, and locally move memory between Pi installs. |
|
|
18
|
+
| **0.7.x** | Optional sync | Local-first memory can coordinate across agents or devices without making cloud sync mandatory. |
|
|
19
|
+
|
|
20
|
+
Before **0.7**, three things must be real: debug/trace, memory edit/review, and local import/export. Cloud or multi-agent sync should remain optional and local-first by default.
|
|
21
|
+
|
|
22
|
+
## Product Principles
|
|
23
|
+
|
|
24
|
+
- `MEMORY.md` remains the editable Ground Truth.
|
|
25
|
+
- Derived indexes, sidecars, traces, and future sync state must be rebuildable from local memory artifacts.
|
|
26
|
+
- Recall should improve ordinary agent behavior without adding multi-second thinking to every turn.
|
|
27
|
+
- Safety features should fail closed for memory writes and fail open for agent turns.
|
|
28
|
+
- `pi-memory` should not become a full transcript search product; that belongs in a dedicated session-search package.
|
|
29
|
+
|
|
30
|
+
## Current Foundation
|
|
31
|
+
|
|
32
|
+
- `MEMORY.md` Ground Truth with overflow.
|
|
33
|
+
- `/remember` and `/memory-status`.
|
|
34
|
+
- Sidecar over UDS JSONL.
|
|
35
|
+
- `memory.vec.sqlite` vector index.
|
|
36
|
+
- QueryIntent with raw-query fallback.
|
|
37
|
+
- 800ms shared Preflight budget with AbortSignal-aware sidecar query.
|
|
38
|
+
- Warm sidecar, intent cache, query cache.
|
|
39
|
+
- Dual-purpose compaction summary.
|
|
40
|
+
- Shutdown Queue + `maintenance`.
|
|
41
|
+
- Consolidate + reindex.
|
|
42
|
+
- Subagent Memory Cap + Compact Delta.
|
|
43
|
+
- Secret redaction before Ground Truth writes.
|
|
44
|
+
- `MemoryRuntime` extension lifecycle and refactored store/sidecar modules.
|
|
45
|
+
|
|
46
|
+
## P0: Trust And Safety
|
|
47
|
+
|
|
48
|
+
**Target: 0.3.x** · [GitHub milestone](https://github.com/chendpoc/pi-memory/milestone/1)
|
|
49
|
+
|
|
50
|
+
User-facing goal: memory should be safe enough to keep enabled by default.
|
|
51
|
+
|
|
52
|
+
- ✅ Secret and token redaction before durable memory writes — **shipped in 0.3.0**.
|
|
53
|
+
- ✅ Smaller, clearer runtime modules for store, ingest, status, lifecycle, and sidecar behavior — **shipped in 0.3.0**.
|
|
54
|
+
- Prompt-injection guardrails for LLM-generated Memory Export.
|
|
55
|
+
- Correction detector for explicit user corrections, scoped first to the `/remember` path.
|
|
56
|
+
- Lightweight reason codes for skipped writes and fallback decisions; full trace UX is planned for **0.6**.
|
|
57
|
+
|
|
58
|
+
## P1: Recall Quality
|
|
59
|
+
|
|
60
|
+
**Target: 0.4.x** · [GitHub milestone](https://github.com/chendpoc/pi-memory/milestone/2)
|
|
61
|
+
|
|
62
|
+
User-facing goal: Pi should recall the right stable facts more often, while staying fast enough for interactive turns.
|
|
63
|
+
|
|
64
|
+
- Hybrid lexical + vector recall for `MEMORY.md` entries: SQLite FTS5 plus existing vector chunks, RRF merge, then MMR.
|
|
65
|
+
- Recall eval fixtures for common coding-agent questions.
|
|
66
|
+
- Debug metrics split by intent, embed, scan, MMR, render, fallback, and total Preflight time.
|
|
67
|
+
- Embedding provider improvements beyond Ollama, including free/open-source embedding APIs where practical.
|
|
68
|
+
- Sidecar retrieval optimizations: incremental reindex, batch embed, and clearer reindex/query isolation.
|
|
69
|
+
- Optional reranker after MMR only when it fits the latency budget.
|
|
70
|
+
|
|
71
|
+
## P2: Memory Lifecycle
|
|
72
|
+
|
|
73
|
+
**Target: 0.5.x** · [GitHub milestone](https://github.com/chendpoc/pi-memory/milestone/3)
|
|
74
|
+
|
|
75
|
+
User-facing goal: long-lived memory should stay useful instead of becoming a growing pile of stale facts.
|
|
76
|
+
|
|
77
|
+
- Failure and tool-quirk categories.
|
|
78
|
+
- Human-reviewable memory draft or diary before promotion.
|
|
79
|
+
- Usage-weighted promotion and pruning.
|
|
80
|
+
- Safer consolidate preview before rewrite.
|
|
81
|
+
- Explicit stale/superseded fact handling instead of simple TODO pruning.
|
|
82
|
+
- Lifecycle events feed the shared debug/trace event schema; the user-facing trace surfaces ship in **0.6**.
|
|
83
|
+
|
|
84
|
+
## P3: Observability + Controls
|
|
85
|
+
|
|
86
|
+
**Target: 0.6.x** · [GitHub milestone](https://github.com/chendpoc/pi-memory/milestone/4)
|
|
87
|
+
|
|
88
|
+
User-facing goal: when memory behaves unexpectedly, users can see why and fix it without reading raw internals.
|
|
89
|
+
|
|
90
|
+
Required exit criteria:
|
|
91
|
+
|
|
92
|
+
- Local trace ring buffer, for example `logs/trace.jsonl`, with stable event names and reason codes.
|
|
93
|
+
- `pi-memory status --verbose` and `/memory-status` surfaces that summarize recent skip, fallback, write, reindex, and recall events.
|
|
94
|
+
- Memory edit/review commands paired with stale/supersede semantics from **0.5**.
|
|
95
|
+
- Local import/export between Pi installations, with a dry-run mode before any future sync work.
|
|
96
|
+
|
|
97
|
+
Optional backlog for 0.6:
|
|
98
|
+
|
|
99
|
+
- Better TUI status panel.
|
|
100
|
+
- Documentation recipes for common Pi setups.
|
|
101
|
+
- Remaining sidecar tuning such as parallel raw+intent recall, MMR lambda tuning, and post-consolidate recall spot checks, driven by p99 latency and eval data.
|
|
102
|
+
|
|
103
|
+
## P4: Optional Sync
|
|
104
|
+
|
|
105
|
+
**Target: 0.7.x**
|
|
106
|
+
|
|
107
|
+
User-facing goal: users who work across multiple Pi agents or devices can coordinate memory without giving up local control.
|
|
108
|
+
|
|
109
|
+
- Multi-agent cross-session memory coordination.
|
|
110
|
+
- Optional cloud Pi agent <-> local Pi agent session-memory sync.
|
|
111
|
+
- `MEMORY.md` remains the source of truth; vector indexes are rebuilt per device.
|
|
112
|
+
- No automatic upload by default.
|
|
113
|
+
- Sync design must define conflict handling, trust boundaries, redaction guarantees, and rollback before implementation.
|
|
114
|
+
- Prerequisites: injection + redaction closed loop, stale/edit semantics, local import/export, and debug/trace for cross-process write troubleshooting.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chendpoc/pi-memory",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Cross-session episodic memory for Pi agent — MEMORY.md ground truth, JSONL sidecar retrieval, and Preflight injection",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
"files": [
|
|
40
40
|
"dist",
|
|
41
41
|
"doc/README-zh.md",
|
|
42
|
+
"doc/ROADMAP.md",
|
|
43
|
+
"doc/ROADMAP-zh.md",
|
|
44
|
+
"doc/LAUNCH-KIT.md",
|
|
42
45
|
"templates/MEMORY.md.example",
|
|
43
46
|
"templates/com.pi.memory.consolidate.plist.example",
|
|
44
47
|
"templates/consolidate.cmd.example",
|
|
@@ -60,6 +63,11 @@
|
|
|
60
63
|
"pi-extension",
|
|
61
64
|
"pi-agent",
|
|
62
65
|
"episodic-memory",
|
|
66
|
+
"agent-memory",
|
|
67
|
+
"local-memory",
|
|
68
|
+
"markdown-memory",
|
|
69
|
+
"coding-agent",
|
|
70
|
+
"ai-memory",
|
|
63
71
|
"recent-memory",
|
|
64
72
|
"memory-recall"
|
|
65
73
|
],
|