@aeondave/pi-persona-mind 0.9.6 → 0.9.8
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 +137 -135
- package/CHANGELOG.md +287 -270
- package/LICENSE +24 -24
- package/README.md +84 -171
- package/docs/DESIGN.md +605 -573
- package/docs/MEMORY-RESEARCH.md +163 -163
- package/package.json +15 -6
- package/src/core/auto-optimize.ts +323 -249
- package/src/core/backlog.ts +228 -228
- package/src/core/blocked.ts +38 -38
- package/src/core/capture.ts +155 -154
- package/src/core/context-budget.ts +74 -74
- package/src/core/handoff-store.ts +111 -111
- package/src/core/handoff.ts +70 -70
- package/src/core/host-compat.ts +16 -16
- package/src/core/ids.ts +59 -59
- package/src/core/inject.ts +247 -247
- package/src/core/knowledge-review.ts +107 -107
- package/src/core/memory-read.ts +34 -34
- package/src/core/memory.ts +321 -321
- package/src/core/migrate.ts +713 -713
- package/src/core/mind-settings.ts +54 -54
- package/src/core/optimize-history.ts +163 -163
- package/src/core/optimize-service.ts +189 -180
- package/src/core/optimize.ts +127 -127
- package/src/core/retrieval.ts +164 -164
- package/src/core/scanner.ts +146 -146
- package/src/core/scope.ts +201 -205
- package/src/core/service.ts +720 -720
- package/src/core/session-memory.ts +71 -71
- package/src/core/store.ts +1002 -1002
- package/src/extension/activity.ts +79 -79
- package/src/extension/auto-optimize-session.ts +143 -143
- package/src/extension/auto-optimize.ts +565 -569
- package/src/extension/handoff.ts +23 -23
- package/src/extension/knowledge-review.ts +229 -229
- package/src/extension/memory-inspector.ts +82 -82
- package/src/extension/mind-actions.ts +38 -38
- package/src/extension/mind-worker.ts +32 -32
- package/src/extension/persona-dependency.ts +76 -76
- package/src/extension/reference-anchor.ts +48 -0
- package/src/extension/review-evidence.ts +222 -222
- package/src/extension/worker-memory-anchor.ts +28 -28
- package/src/index.ts +1357 -1310
- package/src/session-memory.ts +127 -122
- package/src/tools/backlog.ts +126 -126
- package/src/tools/memory-handoff.ts +30 -30
- package/src/tools/memory-history.ts +46 -46
- package/src/tools/memory.ts +6 -4
- package/src/ui/card-frame.ts +161 -161
- package/src/ui/inspector-frame.ts +44 -44
- package/src/ui/memory-inspector.ts +464 -464
- package/src/ui/mind-result-card.ts +48 -48
- package/src/ui/presentation.ts +87 -87
- package/src/ui/session-note-card.ts +58 -56
package/LICENSE
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 AeonDave
|
|
4
|
-
|
|
5
|
-
Portions of src/core/store.ts adapt the durable atomic-store pattern from
|
|
6
|
-
OpenLore (clay-good/openlore), also MIT-licensed.
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
in the Software without restriction, including without limitation the rights
|
|
11
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
furnished to do so, subject to the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be included in all
|
|
16
|
-
copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AeonDave
|
|
4
|
+
|
|
5
|
+
Portions of src/core/store.ts adapt the durable atomic-store pattern from
|
|
6
|
+
OpenLore (clay-good/openlore), also MIT-licensed.
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
in the Software without restriction, including without limitation the rights
|
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,171 +1,84 @@
|
|
|
1
|
-
<h1 align="center">pi-persona-mind</h1>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## Features
|
|
16
|
-
|
|
17
|
-
| What you
|
|
18
|
-
|---|---|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
pi install npm:@aeondave/pi-persona
|
|
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
|
-
Mind selects relevant excerpts each turn within one shared context budget. Exact words and paths
|
|
87
|
-
receive more weight than matches across code identifiers (`HTTPResponseParser` → “HTTP response parser”)
|
|
88
|
-
and vowel accents (`café` → “cafe”). Unicode text remains searchable. This is lexical retrieval;
|
|
89
|
-
it can miss paraphrases or conflicting facts. Use `memory recall`
|
|
90
|
-
to search and `memory read` to inspect a complete record. The budget is an estimate, not a billing counter.
|
|
91
|
-
|
|
92
|
-
**F10** toggles the read-only inspector in the interactive TUI:
|
|
93
|
-
|
|
94
|
-
- **Memories** browses scoped facts, full text, dates, tags and available recording provenance.
|
|
95
|
-
- **Context** shows the last block prepared by Mind, including omissions—not the final provider payload.
|
|
96
|
-
- **Timeline** shows bounded user/assistant text and session-note events on the active branch.
|
|
97
|
-
|
|
98
|
-
Open a record for detail and press **s** for its recording source, when available. Recording provenance
|
|
99
|
-
shows how a fact was saved; it does not verify the assertion. Timeline and source lookup cover a
|
|
100
|
-
bounded active-branch window.
|
|
101
|
-
|
|
102
|
-
In Memories, **a** opens maintenance actions; `/mind browse`, `/mind browse context` and `/mind timeline`
|
|
103
|
-
are command alternatives. Browsing alone is read-only and makes no model calls.
|
|
104
|
-
|
|
105
|
-
F10 shares Persona's F9 window frame and theme. **PageUp/PageDown** follow visible rows, narrow
|
|
106
|
-
windows keep the selection visible, and **?** opens help. See the
|
|
107
|
-
[inspector design](docs/DESIGN.md#read-only-memory-inspector) for navigation, sources and coverage.
|
|
108
|
-
|
|
109
|
-
## Maintain knowledge deliberately
|
|
110
|
-
|
|
111
|
-
**Decision history** keeps the previous fact when an explicit replacement retires it. Use
|
|
112
|
-
`/mind history project-long` to find a receipt and `/mind history show <receiptId> project-long`
|
|
113
|
-
to inspect its before/after records. Old facts stay out of active recall and injected context.
|
|
114
|
-
History is bounded; ordinary replacements are inspectable, while guarded undo applies to consolidation.
|
|
115
|
-
[History and retention →](docs/DESIGN.md#replacement-history)
|
|
116
|
-
|
|
117
|
-
**Consolidation** merges compatible saved facts and applies validated changes. `/mind optimize`
|
|
118
|
-
reviews one bounded window per allowed project/persona tier; `/mind optimize project-long` selects
|
|
119
|
-
durable project memory alone. Inspect changes with `/mind optimize history`; `/mind optimize undo`
|
|
120
|
-
restores affected facts only when its conflict checks pass. This reorganizes saved knowledge; it does
|
|
121
|
-
not verify it against your repository. [Consolidation and undo details →](docs/DESIGN.md#explicit-consolidation)
|
|
122
|
-
|
|
123
|
-
**Knowledge review** runs in the interactive terminal and checks selected facts against repository
|
|
124
|
-
files you choose and bounded active-branch user-role text. Repository evidence requires project trust.
|
|
125
|
-
The worker proposes corrections, conflicts, insufficient-evidence findings or retirement
|
|
126
|
-
recommendations for your review.
|
|
127
|
-
|
|
128
|
-
1. Choose **F10 → Memories → a**, or run `/mind review project-long` (also `project` or `persona`).
|
|
129
|
-
2. Select evidence and confirm the model call. Inspect the proposal with `/mind review show`.
|
|
130
|
-
3. Use `/mind review apply` to separately approve corrections, or `/mind review discard` to discard them.
|
|
131
|
-
Application rechecks evidence and memory freshness. Retirement is a recommendation; forgetting a
|
|
132
|
-
fact is a separate deliberate action.
|
|
133
|
-
|
|
134
|
-
Both workflows use a **visible Persona-hosted Mind worker on the current session model** and incur
|
|
135
|
-
model usage. Choose a model with `/model` before starting. New input or model, branch, session and
|
|
136
|
-
owner changes invalidate pending review work. Shared memory and session notes are excluded from
|
|
137
|
-
these model-driven mutations. Reviews and undo history are bounded; a reviewed window is not a
|
|
138
|
-
whole-archive audit or a guarantee of truth.
|
|
139
|
-
|
|
140
|
-
### Quiet automatic maintenance
|
|
141
|
-
|
|
142
|
-
Automatic consolidation is on by default. After eligible saves, it waits for the foreground to become
|
|
143
|
-
idle and respects usage, cooldown and ownership limits. A real worker is visible in Persona;
|
|
144
|
-
successful changes produce one small **mind** notification, while routine no-ops stay quiet.
|
|
145
|
-
Failures and important warnings remain visible, and applied changes retain history for guarded undo.
|
|
146
|
-
|
|
147
|
-
Use `/mind optimize auto status`, `/mind optimize auto off` or `/mind optimize auto on` for the current
|
|
148
|
-
session. `PI_PERSONA_MIND_OPTIMIZE=off` disables automatic optimization at startup. Capture can be set
|
|
149
|
-
with `PI_PERSONA_MIND_CAPTURE=auto|prompt|off`, and `PI_PERSONA_MIND_NUDGE=off` disables suggestions.
|
|
150
|
-
See [automatic review](docs/DESIGN.md#automatic-semantic-review) for admission and cost details.
|
|
151
|
-
|
|
152
|
-
## Hand off a long task
|
|
153
|
-
|
|
154
|
-
Ask the agent to save a handoff before switching sessions. It records the goal, completed work,
|
|
155
|
-
pending work, next step and references, together with the originating session and branch.
|
|
156
|
-
In a new session with the same project and persona, use **`/mind handoff list`** and
|
|
157
|
-
**`/mind handoff show <id>`** to consult it.
|
|
158
|
-
|
|
159
|
-
A handoff is an explicit work snapshot, not proof that a task is complete. It is never injected or
|
|
160
|
-
executed automatically. Completion requires a resolution; forgetting is explicit. Each persona can hold
|
|
161
|
-
up to 32 handoffs in a bounded project file (128 KiB for the whole file), with no automatic expiry or
|
|
162
|
-
eviction.
|
|
163
|
-
[Commands, ownership and limits →](docs/DESIGN.md#cross-session-handoffs)
|
|
164
|
-
|
|
165
|
-
## Learn more
|
|
166
|
-
|
|
167
|
-
- [Design: lifetimes, storage, limits, commands and safeguards](docs/DESIGN.md)
|
|
168
|
-
- [Evidence-grounded review and approval](docs/DESIGN.md#evidence-grounded-knowledge-review)
|
|
169
|
-
- [Storage recovery and concurrent writes](docs/DESIGN.md#durable-files-and-recovery)
|
|
170
|
-
- [Architecture decisions and evaluation boundaries](docs/MEMORY-RESEARCH.md)
|
|
171
|
-
- [Release history](CHANGELOG.md) · [MIT license](LICENSE)
|
|
1
|
+
<h1 align="center">pi-persona-mind</h1>
|
|
2
|
+
|
|
3
|
+
**Local memory for Pi and pi-persona.** Save a decision once and recall it the next time you open
|
|
4
|
+
the repository. Keep temporary constraints on the current session branch and carry personal
|
|
5
|
+
preferences across projects with the same persona.
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="https://raw.githubusercontent.com/AeonDave/pi-persona-mind/v0.9.8/assets/banner.png" width="540" alt="pi-persona-mind — durable memory for Pi">
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
[](https://github.com/AeonDave/pi-persona-mind/actions/workflows/test.yml)
|
|
12
|
+
[](https://www.npmjs.com/package/@aeondave/pi-persona-mind)
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
| What you can do | How it works |
|
|
18
|
+
|---|---|
|
|
19
|
+
| Choose who remembers | Save a fact for one session branch, one repository, one persona across projects, or explicitly share it across personas. |
|
|
20
|
+
| Recover context after compaction | After Pi compacts a tool loop, Mind refreshes the supervisor’s reference from the active branch and scoped stores. It can include a fact saved moments earlier. |
|
|
21
|
+
| Find and inspect a decision | Search by words, code identifiers, tags or paths. Press **F10** to browse complete records, see the last context Mind prepared, or read the active-branch timeline. |
|
|
22
|
+
| Give workers relevant context | Delegated workers get a short memory selection alongside their assigned skills. The supervisor keeps the session notes and memory-writing tools. |
|
|
23
|
+
| Pick up unfinished work | Save a handoff with the goal, progress, next step and references. Open it in a later session with the same project and persona. |
|
|
24
|
+
| Defer a task | Add it to the project backlog with a reminder. Pi notifies you while it is open without waking the model. |
|
|
25
|
+
| Maintain saved knowledge | Consolidate related facts, inspect the history of a changed decision, or review a fact against evidence you select. |
|
|
26
|
+
|
|
27
|
+
## Quick start
|
|
28
|
+
|
|
29
|
+
Mind requires **Pi 1.7.0**, **Node.js 22.19.0+** and a compatible **pi-persona 1.18.1+** release
|
|
30
|
+
loaded in the same Pi instance. Install the current companion release for this Pi version.
|
|
31
|
+
[pi-persona releases](https://github.com/AeonDave/pi-persona/releases)
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pi install npm:@aeondave/pi-persona
|
|
35
|
+
pi install npm:@aeondave/pi-persona-mind
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Restart Pi or run **`/reload`**. For an existing installation, run `pi update <source>` for each
|
|
39
|
+
package, using the same `npm:` sources shown above. Mind stores project, persona and shared facts
|
|
40
|
+
in the active Pi profile, selected by `pi --agent-dir <dir>` or `PI_CODING_AGENT_DIR`.
|
|
41
|
+
|
|
42
|
+
Try this in a repository:
|
|
43
|
+
|
|
44
|
+
1. Ask **“Save this as a durable project decision: every database schema change needs a migration.”**
|
|
45
|
+
2. Open a fresh Pi session in the same repository and ask **“What did we decide about schema changes?”**
|
|
46
|
+
3. Press **F10 → Memories** to read the full saved record. **Context** shows which excerpts Mind
|
|
47
|
+
selected for the turn. Use **`/mind doctor`** to inspect the active settings or a storage warning.
|
|
48
|
+
|
|
49
|
+
## Choose what persists
|
|
50
|
+
|
|
51
|
+
Automatic capture turns strong cues such as “remember this” into provisional **session notes**.
|
|
52
|
+
Repeating the same capture reuses the existing note on that branch. Session notes survive compaction
|
|
53
|
+
and resuming the saved branch. A new session starts with its own notes.
|
|
54
|
+
|
|
55
|
+
For **durable memory**, name the destination when asking the agent to save a fact. **Project** keeps
|
|
56
|
+
a repository decision available across personas. **Persona** carries a preference across projects.
|
|
57
|
+
**Shared** makes a fact available across personas. These facts have no automatic expiry. Mind
|
|
58
|
+
selects relevant excerpts within a context budget and sends them to the session model. Ask for
|
|
59
|
+
the complete record when you need an exact command or the conditions under which a workaround applies.
|
|
60
|
+
|
|
61
|
+
**Working project memory** and **backlog items** expire after 48 hours by default. A reminder set
|
|
62
|
+
for a later date extends the item's expiry. For longer work, ask the agent to save a handoff.
|
|
63
|
+
Use `/mind handoff list` and `/mind handoff show <id>` to consult it when you return.
|
|
64
|
+
|
|
65
|
+
## Maintenance and model usage
|
|
66
|
+
|
|
67
|
+
Browsing, recall and full-record reads use local data and need no additional model call.
|
|
68
|
+
Automatic consolidation is on by default. After eligible saves and once the foreground settles,
|
|
69
|
+
a visible Persona worker can use the **current session model** to consolidate saved facts.
|
|
70
|
+
Use `/mind optimize auto status` to check or `/mind optimize auto off` to disable it for this session.
|
|
71
|
+
Set `PI_PERSONA_MIND_OPTIMIZE=off` to start with it disabled.
|
|
72
|
+
|
|
73
|
+
Explicit consolidation and evidence-grounded review also use the current model. Use
|
|
74
|
+
`/mind optimize history` to inspect consolidation changes. Guarded undo restores them when conflict
|
|
75
|
+
checks pass. Explicit fact replacements retain a before/after history for inspection. To check
|
|
76
|
+
a fact against trusted repository files or recent user messages, start `/mind review` in the TUI,
|
|
77
|
+
choose the evidence and approve any proposed correction before it is applied.
|
|
78
|
+
|
|
79
|
+
## Learn more
|
|
80
|
+
|
|
81
|
+
- [Storage, scopes and companion integration](docs/DESIGN.md#scope-and-companion-integration) · [Session notes](docs/DESIGN.md#session-notes) · [Handoffs](docs/DESIGN.md#cross-session-handoffs)
|
|
82
|
+
- [F10 inspector and recording sources](docs/DESIGN.md#read-only-memory-inspector)
|
|
83
|
+
- [Automatic consolidation and usage limits](docs/DESIGN.md#automatic-semantic-review) · [Replacement history](docs/DESIGN.md#replacement-history) · [Knowledge review](docs/DESIGN.md#evidence-grounded-knowledge-review)
|
|
84
|
+
- [Design decisions and evaluation](docs/MEMORY-RESEARCH.md) · [Release history](CHANGELOG.md)
|