@sovorn/pi-session-memory 0.1.0 → 0.1.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/README.md +46 -154
- package/docs/DEVELOPMENT.md +74 -0
- package/docs/SETUP.md +48 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,84 +4,64 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@sovorn/pi-session-memory)
|
|
5
5
|
[](https://github.com/sovorn-c/pi-session-memory)
|
|
6
6
|
|
|
7
|
-
Session memory for [Pi](https://github.com/earendil-works/pi). It keeps
|
|
7
|
+
Session memory for [Pi](https://github.com/earendil-works/pi). It keeps short notes in your current coding session, linked to the original evidence. Local Laya decisions select which notes to keep and recall. Your Pi model writes notes only after you allow it.
|
|
8
8
|
|
|
9
|
-
Generation is off by default.
|
|
10
|
-
|
|
11
|
-
## What it does
|
|
12
|
-
|
|
13
|
-
- Stores observations and reflections in the current Pi session, linked to the original evidence.
|
|
14
|
-
- Uses local Laya decisions to select a small working set of notes for later turns.
|
|
15
|
-
- Lets the model request supporting notes or raw entries with `hydrate_session_memory`.
|
|
16
|
-
- Leaves Pi's history and compaction intact. On memory failures, Pi continues with native context.
|
|
17
|
-
|
|
18
|
-
This is an experiment, not cross-session search. No usefulness gain has been demonstrated yet. See [known limitations](#known-limitations) before enabling generation.
|
|
9
|
+
Generation is off by default. If memory fails, Pi continues with its normal context. This is experimental, with no demonstrated benefit yet and no cross-session memory.
|
|
19
10
|
|
|
20
11
|
## Install
|
|
21
12
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
### From GitHub
|
|
25
|
-
|
|
26
|
-
```sh
|
|
27
|
-
pi install git:github.com/sovorn-c/pi-session-memory
|
|
28
|
-
```
|
|
13
|
+
Choose one source. Pi loads the extension directly, with no build step.
|
|
29
14
|
|
|
30
|
-
|
|
15
|
+
### npm
|
|
31
16
|
|
|
32
17
|
```sh
|
|
33
|
-
pi
|
|
18
|
+
pi install npm:@sovorn/pi-session-memory
|
|
34
19
|
```
|
|
35
20
|
|
|
36
|
-
|
|
21
|
+
Pi handles the npm download and extension registration. `npm install` alone does not register it in Pi.
|
|
37
22
|
|
|
38
|
-
|
|
23
|
+
### GitHub
|
|
39
24
|
|
|
40
25
|
```sh
|
|
41
|
-
pi install
|
|
26
|
+
pi install git:github.com/sovorn-c/pi-session-memory
|
|
42
27
|
```
|
|
43
28
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
### From a local checkout
|
|
29
|
+
### Local checkout
|
|
47
30
|
|
|
48
31
|
```sh
|
|
49
32
|
git clone https://github.com/sovorn-c/pi-session-memory.git
|
|
50
33
|
pi install /path/to/pi-session-memory
|
|
51
34
|
```
|
|
52
35
|
|
|
53
|
-
Replace
|
|
36
|
+
Replace the path with the cloned directory. Pi records it in settings without copying the directory.
|
|
54
37
|
|
|
55
|
-
|
|
56
|
-
pi -e /path/to/pi-session-memory/src/extension.ts
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
After install, start Pi and run `/memory status`. It shows generation, config path, Python command, and token cadence. Installation does not install Python, Laya, or model weights. Complete [Laya setup](#laya-setup) before enabling generation.
|
|
38
|
+
Start Pi and run `/memory status` to check that the extension loaded. This does not start Laya or send a provider request.
|
|
60
39
|
|
|
61
40
|
## Requirements
|
|
62
41
|
|
|
63
|
-
You need Pi
|
|
42
|
+
You need Pi, Python 3.11, and a separate Laya installation with its model weights. Installation through Pi does not install Python or Laya. The tested platform is macOS on Apple Silicon, with Pi 1.0.2 and English session text.
|
|
43
|
+
|
|
44
|
+
## Laya setup
|
|
64
45
|
|
|
65
|
-
|
|
46
|
+
Complete the [Laya setup guide](docs/SETUP.md) before enabling generation. It covers the required Laya version, model files, and Python environment.
|
|
66
47
|
|
|
67
|
-
|
|
48
|
+
Point `PI_SESSION_MEMORY_PYTHON` at that environment's Python interpreter. Use `PI_SESSION_MEMORY_LAYA_CHECKPOINT` if your model files are outside the default Hugging Face cache. A setup mismatch leaves Pi running without memory.
|
|
68
49
|
|
|
69
|
-
|
|
50
|
+
## Use
|
|
70
51
|
|
|
71
|
-
|
|
52
|
+
| Command | Behavior |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `/memory` or `/memory status` | Show generation, config path, Python command, and token cadence. |
|
|
55
|
+
| `/memory on` | Enable generation for this session. Pi asks for confirmation before the first write. |
|
|
56
|
+
| `/memory off` | Disable generation and revoke the session's stored confirmation. |
|
|
72
57
|
|
|
73
|
-
|
|
74
|
-
| --- | --- | --- |
|
|
75
|
-
| `generation` | boolean | `false` |
|
|
76
|
-
| `python` | non-empty string, optional | `python3.11` |
|
|
77
|
-
| `observeAfterTokens` | integer >= 1 | `10000` |
|
|
78
|
-
| `reflectAfterTokens` | integer >= 1 | `20000` |
|
|
58
|
+
`/memory on` is not consent. A new session, fork, resume, or `/reload` clears the session switch and confirmation.
|
|
79
59
|
|
|
80
|
-
|
|
60
|
+
Notes remain in Pi's session history. Later requests may receive a small selection of notes. The model can use `hydrate_session_memory` to retrieve their supporting notes or exact linked entries. Pi's history and compaction remain intact.
|
|
81
61
|
|
|
82
|
-
|
|
62
|
+
## Configure
|
|
83
63
|
|
|
84
|
-
|
|
64
|
+
Configuration is optional. Create `~/.pi/agent/pi-session-memory/config.json` if you want to change the defaults. If you set `PI_CODING_AGENT_DIR`, use that directory instead of `~/.pi/agent`.
|
|
85
65
|
|
|
86
66
|
```json
|
|
87
67
|
{
|
|
@@ -92,133 +72,45 @@ Example, still off until you also confirm in the session:
|
|
|
92
72
|
}
|
|
93
73
|
```
|
|
94
74
|
|
|
95
|
-
|
|
75
|
+
`generation` controls the initial switch, but enabling it still requires interactive confirmation. The cadence values must be positive integers. `PI_SESSION_MEMORY_PYTHON` takes priority over `python`. Edit the file, then `/reload` or start Pi again.
|
|
96
76
|
|
|
97
|
-
|
|
77
|
+
The extension never writes this file. A missing file uses defaults. A malformed file uses defaults and warns once.
|
|
98
78
|
|
|
99
|
-
|
|
79
|
+
## What gets sent
|
|
100
80
|
|
|
101
|
-
|
|
81
|
+
Laya runs locally. When generation is enabled, Pi asks before sending session-derived text and source IDs to your configured model/provider to write notes:
|
|
102
82
|
|
|
103
|
-
|
|
83
|
+
> Session-derived text and its source entry IDs will be sent to the currently configured Pi model/provider only after a local Laya gate accepts. Laya runs locally. The Pi session remains canonical; generated memories are appended as non-context session entries. Do you allow this for the current session?
|
|
104
84
|
|
|
105
|
-
|
|
85
|
+
Declining prevents that write. Session text may include private content; the extension does not automatically redact it.
|
|
106
86
|
|
|
107
|
-
|
|
87
|
+
Projected memory reaches the normal Pi provider in a request Pi was already sending. Hydration returns linked entries from the current session without a separate provider call. Turning generation off does not disable recall of existing notes.
|
|
108
88
|
|
|
109
89
|
## Disable and remove
|
|
110
90
|
|
|
111
|
-
`/memory off`
|
|
112
|
-
|
|
113
|
-
`pi --no-extensions` disables every extension for that run, including this one if you installed it.
|
|
91
|
+
`/memory off` stops generation for the current session. Use `pi --no-extensions` to disable all extensions for a run, including memory generation and recall.
|
|
114
92
|
|
|
115
93
|
Remove the source you installed:
|
|
116
94
|
|
|
117
95
|
```sh
|
|
118
|
-
# GitHub install:
|
|
119
|
-
pi remove git:github.com/sovorn-c/pi-session-memory
|
|
120
|
-
|
|
121
|
-
# npm install:
|
|
122
96
|
pi remove npm:@sovorn/pi-session-memory
|
|
123
|
-
|
|
124
|
-
|
|
97
|
+
# Or, for a GitHub install:
|
|
98
|
+
pi remove git:github.com/sovorn-c/pi-session-memory
|
|
99
|
+
# Or, for a local checkout:
|
|
125
100
|
pi remove /path/to/pi-session-memory
|
|
126
101
|
```
|
|
127
102
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
## What gets sent
|
|
131
|
-
|
|
132
|
-
Generation is off by default. A write needs both a switch and an interactive confirmation: `generation: true` in the config, or `/memory on`, and then your answer for that session. `/memory on` is not consent. Pi shows this question:
|
|
133
|
-
|
|
134
|
-
> Session-derived text and its source entry IDs will be sent to the currently configured Pi model/provider only after a local Laya gate accepts. Laya runs locally. The Pi session remains canonical; generated memories are appended as non-context session entries. Do you allow this for the current session?
|
|
135
|
-
|
|
136
|
-
There is one provider call site, `modelRegistry.complete`. Decline, and that write does not happen. Projected memory reaches the normal Pi provider as part of a request Pi was already sending. `hydrate_session_memory` returns entries already in the session and does not call the provider.
|
|
137
|
-
|
|
138
|
-
The extension runs with Pi's permissions. Behavior lives under `src/` and `worker/`. A static scan of `src/` and `worker/` finds no telemetry client and no network client. Recorded checks set `PI_OFFLINE=1`, `PI_TELEMETRY=0`, `HF_HUB_OFFLINE=1`, and `TRANSFORMERS_OFFLINE=1`.
|
|
139
|
-
|
|
140
|
-
## What one trial showed
|
|
141
|
-
|
|
142
|
-
One synthetic trial compared a native arm with a memory arm. The native arm ran first. The result was no demonstrated benefit. The keyword oracle did not show a gain. Token usage was not recorded. The model was `openai-codex/gpt-6-luna` at thinking low, with 8 provider calls and 3 Laya decisions.
|
|
103
|
+
Removal drops the package source from Pi's settings. It does not delete session files or the Laya cache.
|
|
143
104
|
|
|
144
105
|
## Known limitations
|
|
145
106
|
|
|
146
|
-
-
|
|
147
|
-
- Provider-backed memory formation is not verified on Pi 1.0.2.
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
|
|
153
|
-
## Laya setup
|
|
154
|
-
|
|
155
|
-
Point `PI_SESSION_MEMORY_PYTHON` at a Python 3.11 interpreter that can import Laya. The pins below identify the tested dependency and model file. Pi and npm do not require these pins; this worker does. A mismatch leaves Pi running without memory.
|
|
156
|
-
|
|
157
|
-
<details>
|
|
158
|
-
<summary>Pinned Laya installation and model verification</summary>
|
|
159
|
-
|
|
160
|
-
Laya is 0.3.7 at commit `010bacef009c855ccba814b51f7c8e1d38ab5e3f`. The checkpoint revision is `f9ab0b228f0fc0f14d873dbc99038f135c2da1b2`. The `model.safetensors` SHA-256 is `4fa56de72383a9d3efa9cfa78955733c81b9fc8067a587ca4beb82c78107a24e`.
|
|
161
|
-
|
|
162
|
-
This VCS-form install is not run by this project:
|
|
163
|
-
|
|
164
|
-
```sh
|
|
165
|
-
uv pip install "laya @ git+https://github.com/NandhaKishorM/laya@010bacef009c855ccba814b51f7c8e1d38ab5e3f"
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
No download command is verified here. The checkpoint is the Hugging Face cache snapshot `models--convaiinnovations--laya-typed-decisions/snapshots/f9ab0b228f0fc0f14d873dbc99038f135c2da1b2`. The hub directory is `HF_HUB_CACHE`, otherwise `$HF_HOME/hub`, otherwise `$XDG_CACHE_HOME/huggingface/hub`, otherwise `~/.cache/huggingface/hub`. `PI_SESSION_MEMORY_LAYA_CHECKPOINT` overrides that directory. Check the weights with `shasum -a 256 model.safetensors` and compare it with the SHA-256 above. To refuse a hub fetch, set `HF_HUB_OFFLINE=1` and `TRANSFORMERS_OFFLINE=1`.
|
|
169
|
-
|
|
170
|
-
</details>
|
|
171
|
-
|
|
172
|
-
## Check your install
|
|
173
|
-
|
|
174
|
-
Start Pi and run `/memory status`. This checks that the extension loaded without starting Laya or sending a provider request. Use `/memory on` only after setup; review the confirmation before allowing generation.
|
|
175
|
-
|
|
176
|
-
<details>
|
|
177
|
-
<summary>Developer checks from a source checkout</summary>
|
|
178
|
-
|
|
179
|
-
The first block needs no Laya cache and sends no provider request. It installs the package into a temporary Pi agent directory, checks that `/memory` is listed, checks that `pi --no-extensions` hides it, then removes it. The second block needs the two environment variables. The doc test skips that block when they are absent.
|
|
180
|
-
|
|
181
|
-
<!-- verify-install:start -->
|
|
182
|
-
```sh
|
|
183
|
-
set -euo pipefail
|
|
184
|
-
agent="$(mktemp -d)"
|
|
185
|
-
trap 'rm -rf "$agent"' EXIT
|
|
186
|
-
export PI_CODING_AGENT_DIR="$agent"
|
|
187
|
-
export PI_OFFLINE=1
|
|
188
|
-
pi --version
|
|
189
|
-
node --version
|
|
190
|
-
pi install "$PWD"
|
|
191
|
-
loaded="$(printf '%s\n' '{"type":"get_commands","id":"commands"}' | pi --mode rpc --no-session)"
|
|
192
|
-
printf '%s\n' "$loaded" | grep -F '"name":"memory"' >/dev/null
|
|
193
|
-
disabled="$(printf '%s\n' '{"type":"get_commands","id":"commands"}' | pi --mode rpc --no-session --no-extensions)"
|
|
194
|
-
if printf '%s\n' "$disabled" | grep -F '"name":"memory"' >/dev/null; then
|
|
195
|
-
echo "memory listed while extensions are disabled" >&2
|
|
196
|
-
exit 1
|
|
197
|
-
fi
|
|
198
|
-
pi remove "$PWD"
|
|
199
|
-
removed="$(printf '%s\n' '{"type":"get_commands","id":"commands"}' | pi --mode rpc --no-session)"
|
|
200
|
-
if printf '%s\n' "$removed" | grep -F '"name":"memory"' >/dev/null; then
|
|
201
|
-
echo "memory still listed after remove" >&2
|
|
202
|
-
exit 1
|
|
203
|
-
fi
|
|
204
|
-
```
|
|
205
|
-
<!-- verify-install:end -->
|
|
206
|
-
|
|
207
|
-
<!-- verify-laya:start -->
|
|
208
|
-
```sh
|
|
209
|
-
set -euo pipefail
|
|
210
|
-
: "${PI_SESSION_MEMORY_PYTHON:?set PI_SESSION_MEMORY_PYTHON}"
|
|
211
|
-
: "${PI_SESSION_MEMORY_LAYA_CHECKPOINT:?set PI_SESSION_MEMORY_LAYA_CHECKPOINT}"
|
|
212
|
-
unset NODE_TEST_CONTEXT
|
|
213
|
-
"$PI_SESSION_MEMORY_PYTHON" -m unittest discover -s worker/tests -p 'test_*.py'
|
|
214
|
-
node --test test/pi/projection.test.ts
|
|
215
|
-
```
|
|
216
|
-
<!-- verify-laya:end -->
|
|
217
|
-
|
|
218
|
-
</details>
|
|
219
|
-
|
|
220
|
-
## Status
|
|
107
|
+
- Experimental, English-only, and tested on macOS arm64 within one Pi session. There is no cross-session memory.
|
|
108
|
+
- Provider-backed memory formation is not verified on Pi 1.0.2. Its current compatibility checks used generation off, in no-provider runs.
|
|
109
|
+
- Laya setup is machine-specific. The first load can take seconds, and some decisions have uncalibrated confidence.
|
|
110
|
+
- In RPC mode, confirmation waits for the client's answer.
|
|
111
|
+
- A local source security review found no blocking findings. This is not a guarantee of security.
|
|
112
|
+
- No license has been selected; publication alone does not grant permission to reuse the code.
|
|
221
113
|
|
|
222
|
-
|
|
114
|
+
See [developer notes](docs/DEVELOPMENT.md) for verification scripts, runtime limits, and the recorded trial.
|
|
223
115
|
|
|
224
|
-
Report problems
|
|
116
|
+
Report problems in [GitHub issues](https://github.com/sovorn-c/pi-session-memory/issues). Include Pi and Python versions and `/memory status` output. Do not post session text, credentials, or private paths.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Developer notes
|
|
2
|
+
|
|
3
|
+
These checks are for contributors working from a source checkout. Users only need to start Pi and run `/memory status` to check that the extension loaded.
|
|
4
|
+
|
|
5
|
+
## Package and runtime
|
|
6
|
+
|
|
7
|
+
The Pi package entry is `./src/extension.ts`. Pi loads it without a build step. No build, lint, typecheck, or CI is configured.
|
|
8
|
+
|
|
9
|
+
Candidate count and projected note length are internal limits, not user settings. The candidate count is 6, maximum 8. The projection limit is 4000 characters, maximum 6000.
|
|
10
|
+
|
|
11
|
+
## Data flow checks
|
|
12
|
+
|
|
13
|
+
There is one provider call site, `modelRegistry.complete`. Generation is off by default and needs interactive confirmation after a local Laya gate accepts. `/memory on` is not consent.
|
|
14
|
+
|
|
15
|
+
Projected memory reaches the normal Pi provider in an existing request. `hydrate_session_memory` resolves linked evidence from the active branch without a separate provider call.
|
|
16
|
+
|
|
17
|
+
The extension runs with Pi's permissions. Behavior lives under `src/` and `worker/`. A static scan finds no telemetry client and no network client in those directories. This does not audit Pi or Laya dependencies.
|
|
18
|
+
|
|
19
|
+
Recorded offline checks set `PI_OFFLINE=1`, `PI_TELEMETRY=0`, `HF_HUB_OFFLINE=1`, and `TRANSFORMERS_OFFLINE=1`. Do not run provider-backed tests without explicit consent.
|
|
20
|
+
|
|
21
|
+
## Verify installation
|
|
22
|
+
|
|
23
|
+
Run this block from the repository root. It uses a temporary Pi agent directory, checks command registration and disable behavior, then removes the package. It needs no Laya cache and sends no provider request.
|
|
24
|
+
|
|
25
|
+
<!-- verify-install:start -->
|
|
26
|
+
```sh
|
|
27
|
+
set -euo pipefail
|
|
28
|
+
agent="$(mktemp -d)"
|
|
29
|
+
trap 'rm -rf "$agent"' EXIT
|
|
30
|
+
export PI_CODING_AGENT_DIR="$agent"
|
|
31
|
+
export PI_OFFLINE=1
|
|
32
|
+
pi --version
|
|
33
|
+
node --version
|
|
34
|
+
pi install "$PWD"
|
|
35
|
+
loaded="$(printf '%s\n' '{"type":"get_commands","id":"commands"}' | pi --mode rpc --no-session)"
|
|
36
|
+
printf '%s\n' "$loaded" | grep -F '"name":"memory"' >/dev/null
|
|
37
|
+
disabled="$(printf '%s\n' '{"type":"get_commands","id":"commands"}' | pi --mode rpc --no-session --no-extensions)"
|
|
38
|
+
if printf '%s\n' "$disabled" | grep -F '"name":"memory"' >/dev/null; then
|
|
39
|
+
echo "memory listed while extensions are disabled" >&2
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
42
|
+
pi remove "$PWD"
|
|
43
|
+
removed="$(printf '%s\n' '{"type":"get_commands","id":"commands"}' | pi --mode rpc --no-session)"
|
|
44
|
+
if printf '%s\n' "$removed" | grep -F '"name":"memory"' >/dev/null; then
|
|
45
|
+
echo "memory still listed after remove" >&2
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
48
|
+
```
|
|
49
|
+
<!-- verify-install:end -->
|
|
50
|
+
|
|
51
|
+
## Verify local Laya behavior
|
|
52
|
+
|
|
53
|
+
Run this block from the repository root with both environment variables set. The documentation test skips it when the runtime is absent. It runs worker and projection tests, not provider-backed formation.
|
|
54
|
+
|
|
55
|
+
<!-- verify-laya:start -->
|
|
56
|
+
```sh
|
|
57
|
+
set -euo pipefail
|
|
58
|
+
: "${PI_SESSION_MEMORY_PYTHON:?set PI_SESSION_MEMORY_PYTHON}"
|
|
59
|
+
: "${PI_SESSION_MEMORY_LAYA_CHECKPOINT:?set PI_SESSION_MEMORY_LAYA_CHECKPOINT}"
|
|
60
|
+
unset NODE_TEST_CONTEXT
|
|
61
|
+
"$PI_SESSION_MEMORY_PYTHON" -m unittest discover -s worker/tests -p 'test_*.py'
|
|
62
|
+
node --test test/pi/projection.test.ts
|
|
63
|
+
```
|
|
64
|
+
<!-- verify-laya:end -->
|
|
65
|
+
|
|
66
|
+
## Recorded trial and compatibility
|
|
67
|
+
|
|
68
|
+
One synthetic trial compared a native arm with a memory arm. The native arm ran first. The result was no demonstrated benefit. The keyword oracle did not show a gain. Token usage was not recorded.
|
|
69
|
+
|
|
70
|
+
The model was `openai-codex/gpt-6-luna` at thinking low, with 8 provider calls and 3 Laya decisions. This is historical evidence, not proof of usefulness.
|
|
71
|
+
|
|
72
|
+
Provider-backed memory formation is not verified on Pi 1.0.2. It was last verified on Pi 0.87.1. Pi 1.0.2 checks so far used generation off, in no-provider runs. Native lifecycle and provider compatibility require separate evidence.
|
|
73
|
+
|
|
74
|
+
In RPC mode, confirmation waits for the client's answer. The first Laya load can take seconds; some choices have uncalibrated confidence. Setup is machine-specific.
|
package/docs/SETUP.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Laya setup
|
|
2
|
+
|
|
3
|
+
This guide is for users who want to enable session-memory generation or recall. These dependencies are separate from the Pi package. Installing the extension alone does not install them.
|
|
4
|
+
|
|
5
|
+
## Python environment
|
|
6
|
+
|
|
7
|
+
Use Python 3.11 in an environment that can import Laya. Set `PI_SESSION_MEMORY_PYTHON` to that environment's interpreter, or set `python` in the extension's config file. The environment variable wins over config, then the default is `python3.11`.
|
|
8
|
+
|
|
9
|
+
The extension was checked on macOS arm64 with Pi 1.0.2, Node v26.7.0, and Python 3.11.15. Other platforms are not verified.
|
|
10
|
+
|
|
11
|
+
## Required Laya source
|
|
12
|
+
|
|
13
|
+
The worker accepts Laya 0.3.7 at commit `010bacef009c855ccba814b51f7c8e1d38ab5e3f`. It accepts the pinned local checkout or a VCS installation whose package metadata records that commit. An ordinary version-only installation is not enough.
|
|
14
|
+
|
|
15
|
+
For an existing Python 3.11 environment, this VCS-form install is not run by this project:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
uv pip install --python "$PI_SESSION_MEMORY_PYTHON" "laya @ git+https://github.com/NandhaKishorM/laya@010bacef009c855ccba814b51f7c8e1d38ab5e3f"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The commit pins the tested Laya code. Pi and npm do not require it, but the current worker checks it. A mismatch disables memory instead of loading untested code.
|
|
22
|
+
|
|
23
|
+
## Model checkpoint
|
|
24
|
+
|
|
25
|
+
Use the Hugging Face `convaiinnovations/laya-typed-decisions` checkpoint at revision `f9ab0b228f0fc0f14d873dbc99038f135c2da1b2`. No download command is verified here.
|
|
26
|
+
|
|
27
|
+
The default cache snapshot is `models--convaiinnovations--laya-typed-decisions/snapshots/f9ab0b228f0fc0f14d873dbc99038f135c2da1b2`. The worker looks under these hub directories, in order:
|
|
28
|
+
|
|
29
|
+
1. `HF_HUB_CACHE`
|
|
30
|
+
2. `$HF_HOME/hub`
|
|
31
|
+
3. `$XDG_CACHE_HOME/huggingface/hub`
|
|
32
|
+
4. `~/.cache/huggingface/hub`
|
|
33
|
+
|
|
34
|
+
`PI_SESSION_MEMORY_LAYA_CHECKPOINT` overrides the snapshot directory. Its final directory name must match the required revision.
|
|
35
|
+
|
|
36
|
+
The `model.safetensors` SHA-256 must be `4fa56de72383a9d3efa9cfa78955733c81b9fc8067a587ca4beb82c78107a24e`. Check it from the snapshot directory:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
shasum -a 256 model.safetensors
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The hash checks that the weights match the tested model file. Set `HF_HUB_OFFLINE=1` and `TRANSFORMERS_OFFLINE=1` to refuse a hub fetch.
|
|
43
|
+
|
|
44
|
+
## Start using memory
|
|
45
|
+
|
|
46
|
+
Start Pi and run `/memory status`. This reports configuration, not whether Laya inference works. Once setup is complete, run `/memory on` and review the provider disclosure before confirming.
|
|
47
|
+
|
|
48
|
+
If the worker cannot load or trust a decision, Pi continues with native context and reports that memory is unavailable. Check your Python interpreter, Laya source, and checkpoint path first.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sovorn/pi-session-memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Pi extension that keeps small, source-linked memories of a coding session.",
|
|
6
6
|
"homepage": "https://github.com/sovorn-c/pi-session-memory#readme",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"url": "git+https://github.com/sovorn-c/pi-session-memory.git"
|
|
10
10
|
},
|
|
11
11
|
"bugs": { "url": "https://github.com/sovorn-c/pi-session-memory/issues" },
|
|
12
|
-
"files": ["src/", "worker/*.py"],
|
|
12
|
+
"files": ["src/", "worker/*.py", "docs/*.md"],
|
|
13
13
|
"publishConfig": { "access": "public" },
|
|
14
14
|
"keywords": ["pi-package", "pi-extension", "session-memory"],
|
|
15
15
|
"pi": { "extensions": ["./src/extension.ts"] },
|