@aeondave/pi-persona-mind 0.9.1 → 0.9.3
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/AGENTS.md +131 -123
- package/CHANGELOG.md +224 -198
- package/README.md +169 -145
- package/docs/DESIGN.md +533 -475
- package/docs/MEMORY-RESEARCH.md +25 -1
- package/package.json +90 -90
- package/src/core/handoff-store.ts +70 -0
- package/src/core/handoff.ts +70 -0
- package/src/core/host-compat.ts +2 -2
- package/src/core/memory.ts +7 -0
- package/src/core/optimize-history.ts +48 -6
- package/src/core/optimize-service.ts +18 -24
- package/src/core/retrieval.ts +70 -22
- package/src/core/service.ts +69 -27
- package/src/extension/handoff.ts +23 -0
- package/src/extension/mind-command.ts +449 -404
- package/src/index.ts +14 -3
- package/src/tools/memory-handoff.ts +30 -0
- package/src/tools/memory-history.ts +46 -0
- package/src/tools/memory-optimize.ts +121 -133
- package/src/tools/memory.ts +466 -427
- package/src/ui/memory-inspector.ts +449 -445
package/README.md
CHANGED
|
@@ -1,145 +1,169 @@
|
|
|
1
|
-
<h1 align="center">pi-persona-mind</h1>
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<img src="https://raw.githubusercontent.com/AeonDave/pi-persona-mind/v0.9.
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
[](https://github.com/AeonDave/pi-persona-mind/actions/workflows/test.yml)
|
|
8
|
-
[](https://www.npmjs.com/package/@aeondave/pi-persona-mind)
|
|
9
|
-
[](LICENSE)
|
|
10
|
-
|
|
11
|
-
**Local, scoped memory for Pi.** Keep useful project decisions, persona preferences, session notes
|
|
12
|
-
and deferred work without turning every conversation into permanent memory.
|
|
13
|
-
Mind complements Pi's native conversation history and compaction; it does not replace them.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
pi
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- “
|
|
51
|
-
- “
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
|
65
|
-
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
**
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
1
|
+
<h1 align="center">pi-persona-mind</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/AeonDave/pi-persona-mind/v0.9.3/assets/banner.png" alt="pi-persona-mind — durable memory for Pi">
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
[](https://github.com/AeonDave/pi-persona-mind/actions/workflows/test.yml)
|
|
8
|
+
[](https://www.npmjs.com/package/@aeondave/pi-persona-mind)
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
|
|
11
|
+
**Local, scoped memory for Pi.** Keep useful project decisions, persona preferences, session notes
|
|
12
|
+
and deferred work without turning every conversation into permanent memory.
|
|
13
|
+
Mind complements Pi's native conversation history and compaction; it does not replace them.
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
| What you need | What Mind provides |
|
|
18
|
+
|---|---|
|
|
19
|
+
| Continue a long project | Durable repository decisions, session notes and explicit handoffs for the next session |
|
|
20
|
+
| Keep context focused | Bounded retrieval by words, code identifiers, tags and paths, with explicit full-record reads |
|
|
21
|
+
| See what the agent remembers | **F10**: saved facts, prepared context and an active-branch timeline |
|
|
22
|
+
| Maintain a growing archive | Bounded consolidation, evidence-grounded review, change history and guarded undo |
|
|
23
|
+
| Understand a changed decision | Retained before/after records for explicit replacements, kept out of active recall |
|
|
24
|
+
|
|
25
|
+
Memory is stored in local files and Pi's native session history. Recall and browsing need no model
|
|
26
|
+
call. [Automatic consolidation](#quiet-automatic-maintenance) is on by default; it and explicit
|
|
27
|
+
knowledge reviews use the current session model and incur model usage.
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
Mind 0.9.3 requires **Pi 1.6.0**, **Node.js 22.19.0+**, and
|
|
32
|
+
[**pi-persona 1.18.1+**](https://github.com/AeonDave/pi-persona) loaded in the same instance.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pi install npm:@aeondave/pi-persona
|
|
36
|
+
pi install npm:@aeondave/pi-persona-mind
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
For existing installations, use `pi update npm:@aeondave/pi-persona` and
|
|
40
|
+
`pi update npm:@aeondave/pi-persona-mind`. Restart Pi or run **`/reload`** after installing or
|
|
41
|
+
updating; `/persona reload` alone does not reload extension code. Keep only one installation source
|
|
42
|
+
per extension and remove the old source before switching between npm and Git.
|
|
43
|
+
|
|
44
|
+
Mind needs a **compatible, running Persona**, not just an installed package or settings file.
|
|
45
|
+
Without that companion and its current session owner, memory operations and background activity stay
|
|
46
|
+
inactive. See [host and companion integration](docs/DESIGN.md#scope-and-companion-integration).
|
|
47
|
+
|
|
48
|
+
Try asking your agent:
|
|
49
|
+
|
|
50
|
+
- “Save this as a durable project decision: schema changes require a migration.”
|
|
51
|
+
- “Keep this constraint only for the current session.”
|
|
52
|
+
- “Remember this preference across projects for this persona.”
|
|
53
|
+
- “Put the blocked migration in the backlog and remind me tomorrow.”
|
|
54
|
+
- “Recall the decision about retries and show the complete saved record.”
|
|
55
|
+
- “Save a handoff with the goal, completed work, remaining work, next step and references.”
|
|
56
|
+
|
|
57
|
+
Press **F10** to inspect what Mind has saved and prepared. Use **`/mind`** for a snapshot,
|
|
58
|
+
**`/mind help`** for commands and **`/mind doctor`** for effective settings and storage warnings.
|
|
59
|
+
|
|
60
|
+
## Memory that fits the work
|
|
61
|
+
|
|
62
|
+
Choose the lifetime and scope that match your intent:
|
|
63
|
+
|
|
64
|
+
| Memory | Where it belongs | Lifetime |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| Session notes | The active native session branch | Survive compaction and persisted resume; stay out of new sessions and workers |
|
|
67
|
+
| Project working memory | Temporary repository context | 48 hours by default |
|
|
68
|
+
| Durable project memory | Repository decisions | Until changed or forgotten |
|
|
69
|
+
| Persona memory | One persona across projects | Until changed or forgotten |
|
|
70
|
+
| Shared memory | Deliberately shared across personas | Until changed or forgotten |
|
|
71
|
+
| Backlog | Deferred project work and reminders | 48 hours by default; later reminders extend expiry |
|
|
72
|
+
|
|
73
|
+
The agent chooses scope from your intent; durable saves require an explicit `project`, `persona`
|
|
74
|
+
or `shared` destination. Strong direct-user cues may be captured automatically, but
|
|
75
|
+
**automatic capture creates provisional session notes only**, even for “remember” or “from now on”.
|
|
76
|
+
Broader retention requires a separate deliberate `memory` call with an explicit durable scope.
|
|
77
|
+
|
|
78
|
+
Reminders notify you while Pi is open; they do not wake the model. Delegated workers receive a lean
|
|
79
|
+
memory selection, without session notes or memory/backlog write tools. Home-directory sessions skip
|
|
80
|
+
project injection and reminders. See [lifetimes and scope](docs/DESIGN.md#four-lifetimes) and
|
|
81
|
+
[session notes](docs/DESIGN.md#session-notes) for persistence, branch-local forgetting and expiry.
|
|
82
|
+
|
|
83
|
+
## Retrieval and inspection
|
|
84
|
+
|
|
85
|
+
Mind selects relevant excerpts each turn within one shared context budget. Exact words and paths
|
|
86
|
+
receive more weight than matches across code identifiers (`HTTPResponseParser` → “HTTP response parser”)
|
|
87
|
+
and vowel accents (`café` → “cafe”). Unicode text remains searchable. This is lexical retrieval;
|
|
88
|
+
it can miss paraphrases or conflicting facts. Use `memory recall`
|
|
89
|
+
to search and `memory read` to inspect a complete record. The budget is an estimate, not a billing counter.
|
|
90
|
+
|
|
91
|
+
**F10** toggles the read-only inspector in the interactive TUI:
|
|
92
|
+
|
|
93
|
+
- **Memories** browses scoped facts, full text, dates, tags and available recording provenance.
|
|
94
|
+
- **Context** shows the last block prepared by Mind, including omissions—not the final provider payload.
|
|
95
|
+
- **Timeline** shows bounded user/assistant text and session-note events on the active branch.
|
|
96
|
+
|
|
97
|
+
Open a record for detail and press **s** for its recording source, when available. Recording provenance
|
|
98
|
+
shows how a fact was saved; it does not verify the assertion. Timeline and source lookup cover a
|
|
99
|
+
bounded active-branch window.
|
|
100
|
+
|
|
101
|
+
In Memories, **a** opens maintenance actions; `/mind browse`, `/mind browse context` and `/mind timeline`
|
|
102
|
+
are command alternatives. Browsing alone is read-only and makes no model calls.
|
|
103
|
+
|
|
104
|
+
F10 shares Persona's F9 window frame and theme. **PageUp/PageDown** follow visible rows, narrow
|
|
105
|
+
windows keep the selection visible, and **?** opens help. See the
|
|
106
|
+
[inspector design](docs/DESIGN.md#read-only-memory-inspector) for navigation, sources and coverage.
|
|
107
|
+
|
|
108
|
+
## Maintain knowledge deliberately
|
|
109
|
+
|
|
110
|
+
**Decision history** keeps the previous fact when an explicit replacement retires it. Use
|
|
111
|
+
`/mind history project-long` to find a receipt and `/mind history show <receiptId> project-long`
|
|
112
|
+
to inspect its before/after records. Old facts stay out of active recall and injected context.
|
|
113
|
+
History is bounded; ordinary replacements are inspectable, while guarded undo applies to consolidation.
|
|
114
|
+
[History and retention →](docs/DESIGN.md#replacement-history)
|
|
115
|
+
|
|
116
|
+
**Consolidation** merges compatible saved facts and applies validated changes. `/mind optimize`
|
|
117
|
+
reviews one bounded window per allowed project/persona tier; `/mind optimize project-long` selects
|
|
118
|
+
durable project memory alone. Inspect changes with `/mind optimize history`; `/mind optimize undo`
|
|
119
|
+
restores affected facts only when its conflict checks pass. This reorganizes saved knowledge; it does
|
|
120
|
+
not verify it against your repository. [Consolidation and undo details →](docs/DESIGN.md#explicit-consolidation)
|
|
121
|
+
|
|
122
|
+
**Knowledge review** runs in the interactive terminal and checks selected facts against repository
|
|
123
|
+
files you choose and bounded active-branch user-role text. Repository evidence requires project trust.
|
|
124
|
+
The worker proposes corrections, conflicts, insufficient-evidence findings or retirement
|
|
125
|
+
recommendations for your review.
|
|
126
|
+
|
|
127
|
+
1. Choose **F10 → Memories → a**, or run `/mind review project-long` (also `project` or `persona`).
|
|
128
|
+
2. Select evidence and confirm the model call. Inspect the proposal with `/mind review show`.
|
|
129
|
+
3. Use `/mind review apply` to separately approve corrections, or `/mind review discard` to discard them.
|
|
130
|
+
Application rechecks evidence and memory freshness. Retirement is a recommendation; forgetting a
|
|
131
|
+
fact is a separate deliberate action.
|
|
132
|
+
|
|
133
|
+
Both workflows use a **visible Persona-hosted Mind worker on the current session model** and incur
|
|
134
|
+
model usage. Choose a model with `/model` before starting. New input or model, branch, session and
|
|
135
|
+
owner changes invalidate pending review work. Shared memory and session notes are excluded from
|
|
136
|
+
these model-driven mutations. Reviews and undo history are bounded; a reviewed window is not a
|
|
137
|
+
whole-archive audit or a guarantee of truth.
|
|
138
|
+
|
|
139
|
+
### Quiet automatic maintenance
|
|
140
|
+
|
|
141
|
+
Automatic consolidation is on by default. After eligible saves, it waits for the foreground to become
|
|
142
|
+
idle and respects usage, cooldown and ownership limits. A real worker is visible in Persona;
|
|
143
|
+
successful changes produce one small **mind** notification, while routine no-ops stay quiet.
|
|
144
|
+
Failures and important warnings remain visible, and applied changes retain history for guarded undo.
|
|
145
|
+
|
|
146
|
+
Use `/mind optimize auto status`, `/mind optimize auto off` or `/mind optimize auto on` for the current
|
|
147
|
+
session. `PI_PERSONA_MIND_OPTIMIZE=off` disables automatic optimization at startup. Capture can be set
|
|
148
|
+
with `PI_PERSONA_MIND_CAPTURE=auto|prompt|off`, and `PI_PERSONA_MIND_NUDGE=off` disables suggestions.
|
|
149
|
+
See [automatic review](docs/DESIGN.md#automatic-semantic-review) for admission and cost details.
|
|
150
|
+
|
|
151
|
+
## Hand off a long task
|
|
152
|
+
|
|
153
|
+
Ask the agent to save a handoff before switching sessions. It records the goal, completed work,
|
|
154
|
+
pending work, next step and references, together with the originating session and branch.
|
|
155
|
+
In a new session with the same project and persona, use **`/mind handoff list`** and
|
|
156
|
+
**`/mind handoff show <id>`** to consult it.
|
|
157
|
+
|
|
158
|
+
A handoff is an explicit work snapshot, not proof that a task is complete. It is never injected or
|
|
159
|
+
executed automatically. Completion requires a resolution; forgetting is explicit. Up to 32 handoffs
|
|
160
|
+
share a bounded project file, with no automatic expiry or eviction.
|
|
161
|
+
[Commands, ownership and limits →](docs/DESIGN.md#cross-session-handoffs)
|
|
162
|
+
|
|
163
|
+
## Learn more
|
|
164
|
+
|
|
165
|
+
- [Design: lifetimes, storage, limits, commands and safeguards](docs/DESIGN.md)
|
|
166
|
+
- [Evidence-grounded review and approval](docs/DESIGN.md#evidence-grounded-knowledge-review)
|
|
167
|
+
- [Storage recovery and concurrent writes](docs/DESIGN.md#durable-files-and-recovery)
|
|
168
|
+
- [Architecture decisions and evaluation boundaries](docs/MEMORY-RESEARCH.md)
|
|
169
|
+
- [Release history](CHANGELOG.md) · [MIT license](LICENSE)
|