@vib795/agent-memory 0.7.4 → 0.8.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/HOWTO.md +3 -3
- package/README.md +38 -6
- package/package.json +3 -3
- package/skills/handoff/SKILL.md +16 -0
- package/skills/recall/SKILL.md +9 -2
- package/skills/remember/SKILL.md +8 -1
- package/src/bin.js +33 -0
- package/src/cli.js +2 -2
package/HOWTO.md
CHANGED
|
@@ -49,14 +49,14 @@ somebody else does the filing.
|
|
|
49
49
|
|
|
50
50
|
## 3. Install it (about 60 seconds)
|
|
51
51
|
|
|
52
|
-
You will need **Node.js version 22.
|
|
52
|
+
You will need **Node.js version 22.16 or newer**. To check, open a terminal —
|
|
53
53
|
on Windows that's **PowerShell**, on a Mac it's **Terminal** — and type:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
56
|
node --version
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
If that prints something like `v22.
|
|
59
|
+
If that prints something like `v22.16.0` or higher, you are set. If it prints an error or
|
|
60
60
|
a smaller number, install Node from [nodejs.org](https://nodejs.org) first.
|
|
61
61
|
|
|
62
62
|
Now run these two lines:
|
|
@@ -402,7 +402,7 @@ text, and deleting them is your decision to make, not the uninstaller's.
|
|
|
402
402
|
## Cheat sheet
|
|
403
403
|
|
|
404
404
|
```bash
|
|
405
|
-
node --version # must be 22.
|
|
405
|
+
node --version # must be 22.16+
|
|
406
406
|
npm install -g @vib795/agent-memory # 1. download
|
|
407
407
|
agent-memory setup # 2. install into your AI tools
|
|
408
408
|
agent-memory doctor # is everything OK?
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ npm install -g @vib795/agent-memory
|
|
|
21
21
|
agent-memory setup
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Node >= 22.
|
|
24
|
+
Node >= 22.16, and nothing else.
|
|
25
25
|
|
|
26
26
|
In Claude Code you can take the three skills as a plugin instead of letting `setup`
|
|
27
27
|
link them:
|
|
@@ -61,7 +61,7 @@ the write and read paths, the tiered context cost, and the invariants underneath
|
|
|
61
61
|
[](https://github.com/vib795/agent-memory/actions/workflows/test.yml)
|
|
62
62
|
[](https://github.com/vib795/agent-memory/actions/workflows/release.yml)
|
|
63
63
|
[](https://www.npmjs.com/package/@vib795/agent-memory)
|
|
64
|
-
[](https://nodejs.org)
|
|
65
65
|
[](package.json)
|
|
66
66
|
[](LICENSE)
|
|
67
67
|
|
|
@@ -82,11 +82,43 @@ Nothing in the platform closes the gap:
|
|
|
82
82
|
|
|
83
83
|
## Zero runtime dependencies
|
|
84
84
|
|
|
85
|
-
`node:sqlite`
|
|
85
|
+
`node:sqlite` is built into Node core — no package, no addon — so the graph index needs no
|
|
86
86
|
package, no service, and no network. `npm ls -g --depth 0` shows nothing under it.
|
|
87
87
|
On a locked-down desktop that is the difference between "a Node script" and "a new
|
|
88
88
|
database", which is the entire argument you will have to make to get this approved.
|
|
89
89
|
|
|
90
|
+
**Why that is not just a smaller dependency count.** The usual way to reach SQLite
|
|
91
|
+
from Node is `better-sqlite3`, and it is a *native addon*: npm fetches it, then either
|
|
92
|
+
downloads a per-platform prebuilt `.node` binary or compiles C++ on the machine at
|
|
93
|
+
install time. That adds a package to the allowlist, a compiler or a prebuilt artefact
|
|
94
|
+
to every desktop, and a transitive tree behind both. `node:sqlite` is the same engine,
|
|
95
|
+
already inside the Node binary your organisation approved. Nothing is fetched and
|
|
96
|
+
nothing compiles.
|
|
97
|
+
|
|
98
|
+
So "zero dependencies" here does not mean *vendored*, and it does not mean *only small
|
|
99
|
+
ones*. Every import in `src/` is a Node built-in:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
node:child_process node:crypto node:fs node:os
|
|
103
|
+
node:path node:sqlite node:url
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`package.json` has no `dependencies` key at all, and no `devDependencies` either. A
|
|
107
|
+
reviewer has nothing to audit but this repository. It is enforced rather than promised
|
|
108
|
+
— `.github/workflows/test.yml` fails the build if a dependency is ever added:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
n=$(node -p "Object.keys(require('./package.json').dependencies||{}).length")
|
|
112
|
+
test "$n" -eq 0 || { echo "::error::$n runtime dependencies; this package must have none"; exit 1; }
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The price of this is the Node floor: **22.16 or newer**, and it took three steps to get
|
|
116
|
+
there. `node:sqlite` first appeared in 22.5 behind `--experimental-sqlite`; it was
|
|
117
|
+
unflagged in 22.13; and the bundled SQLite only gained the **FTS5** extension in 22.16.
|
|
118
|
+
`search` is built on FTS5, so 22.16 is the first version where this package runs rather
|
|
119
|
+
than merely imports. That is the one real cost, and it is why `doctor` reports the Node
|
|
120
|
+
version and `fts5: available` as two separate lines.
|
|
121
|
+
|
|
90
122
|
- **Markdown is the source of truth.** `index.db` is a disposable cache; delete it
|
|
91
123
|
and `agent-memory index` rebuilds it byte-identically.
|
|
92
124
|
- **Nothing leaves the machine.** No daemon, no scheduled task, no telemetry.
|
|
@@ -440,7 +472,7 @@ equivalent and is not: npm links the global install to that folder rather than c
|
|
|
440
472
|
it, which shows up as an arrow in `npm list -g`:
|
|
441
473
|
|
|
442
474
|
```
|
|
443
|
-
`-- @vib795/agent-memory@0.
|
|
475
|
+
`-- @vib795/agent-memory@0.8.1 -> .\..\..\..\agent-memory
|
|
444
476
|
```
|
|
445
477
|
|
|
446
478
|
Move or delete the clone afterwards and the global install points at nothing — the same
|
|
@@ -559,9 +591,9 @@ there — `skills/recall/SKILL.md` and `skills/remember/SKILL.md` are tracked fi
|
|
|
559
591
|
their committed descriptions are deliberately generic placeholders. `compact` prints
|
|
560
592
|
them as skipped, which is the intended outcome, not a failure.
|
|
561
593
|
|
|
562
|
-
Needs Node 22.
|
|
594
|
+
Needs Node 22.16 or newer; `doctor` says so plainly if the version is too old.
|
|
563
595
|
|
|
564
|
-
Run `npm test` for the suite (
|
|
596
|
+
Run `npm test` for the suite (113 tests, no dependencies). CI runs it on Linux,
|
|
565
597
|
macOS and Windows across Node 22 and 24, and separately installs the packed tarball
|
|
566
598
|
and exercises it end to end on all three.
|
|
567
599
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vib795/agent-memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Durable cross-repo knowledge graph for GitHub Copilot and Claude Code. Markdown source of truth, disposable SQLite index, zero runtime dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github-copilot",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"author": "Utkarsh Singh (https://github.com/vib795)",
|
|
21
21
|
"type": "module",
|
|
22
22
|
"bin": {
|
|
23
|
-
"agent-memory": "src/
|
|
23
|
+
"agent-memory": "src/bin.js"
|
|
24
24
|
},
|
|
25
25
|
"engines": {
|
|
26
|
-
"node": ">=22.
|
|
26
|
+
"node": ">=22.16.0"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"test": "node --test",
|
package/skills/handoff/SKILL.md
CHANGED
|
@@ -26,6 +26,22 @@ Every extra request costs the user credits, which is the reason this skill exist
|
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
+
## Scope
|
|
30
|
+
|
|
31
|
+
Bare `/handoff`: you decide what the working state is.
|
|
32
|
+
|
|
33
|
+
`/handoff <focus>` — "just the auth work", "the migration, skip the CI detour" — names
|
|
34
|
+
which thread of a braided conversation to carry forward. Treat it as a filter on Step 2
|
|
35
|
+
and Step 3, not as a title. Work outside that focus stays out of Orientation, Decisions
|
|
36
|
+
and Current task state even when it was the more recent work: a long conversation
|
|
37
|
+
usually holds more than one thread, and carrying both is how a handoff becomes the
|
|
38
|
+
transcript summary this skill exists to avoid.
|
|
39
|
+
|
|
40
|
+
If the focus names a thread you cannot find in the conversation, say so in one line and
|
|
41
|
+
hand off what you did find. Do not invent a thread to match the words.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
29
45
|
## Step 0 — Resolve the store path
|
|
30
46
|
|
|
31
47
|
| Platform | Store |
|
package/skills/recall/SKILL.md
CHANGED
|
@@ -59,6 +59,10 @@ are the router. There is no keyword matching underneath this and there should no
|
|
|
59
59
|
be: a title is a sentence, and matching sentences to a question is what you do well
|
|
60
60
|
and what a regex does badly.
|
|
61
61
|
|
|
62
|
+
When the user typed `/recall <topic>`, `<topic>` is the question. Route on it, and carry
|
|
63
|
+
it into Step 5 — a cold `/recall deploy ordering` is someone asking what the store knows
|
|
64
|
+
about deploy ordering, not asking for a tour of the store.
|
|
65
|
+
|
|
62
66
|
- Pick 1 to 3 ids. More than 3 means the question is really several questions.
|
|
63
67
|
- Always include a `constraint` that touches the subject, even when the user did not
|
|
64
68
|
ask about limits. Constraints are what stop an approach that cannot ship.
|
|
@@ -115,7 +119,10 @@ Rules that separate a useful recall from a confident wrong one:
|
|
|
115
119
|
right now, trust the repository, say which note is wrong, and suggest
|
|
116
120
|
`/remember` to correct it. A store that quietly rots is worse than no store.
|
|
117
121
|
4. **Never present an `inferred` note as established.** The note says which it is.
|
|
118
|
-
5. Answer the question
|
|
122
|
+
5. **Answer the question.** An explicit `/recall <topic>` is the target whenever one
|
|
123
|
+
was given, and it wins over a different question already in the conversation —
|
|
124
|
+
the user narrowed it on purpose. Fall back to the conversation's own question only
|
|
125
|
+
for a bare `/recall`. Either way, do not summarize the store.
|
|
119
126
|
|
|
120
127
|
---
|
|
121
128
|
|
|
@@ -124,7 +131,7 @@ Rules that separate a useful recall from a confident wrong one:
|
|
|
124
131
|
- **`agent-memory: command not found`.** The package is not installed or not on
|
|
125
132
|
PATH. This is the expected state when the skill was installed on its own, with
|
|
126
133
|
`gh skill install`, rather than with the package. Answer from the code, then say
|
|
127
|
-
once that the store needs `npm install -g @vib795/agent-memory` (Node >= 22.
|
|
134
|
+
once that the store needs `npm install -g @vib795/agent-memory` (Node >= 22.16).
|
|
128
135
|
Do not run it yourself: installing a global package is the user's decision, and on
|
|
129
136
|
a managed desktop it is one they may not be free to make.
|
|
130
137
|
- **Empty store.** Answer from the code, then mention `/remember` once.
|
package/skills/remember/SKILL.md
CHANGED
|
@@ -107,6 +107,13 @@ Skip this step only when the user named exactly what to write and it is plainly
|
|
|
107
107
|
|
|
108
108
|
## Step 1 — Select what is durable
|
|
109
109
|
|
|
110
|
+
When the user typed `/remember <what>`, `<what>` is both a filter and a mandate: select
|
|
111
|
+
only what bears on it, and select that even if you would otherwise have ranked something
|
|
112
|
+
else higher. It does not suspend the durability test below. If the named thing is task
|
|
113
|
+
state, write nothing and say so in one line — `that reads as task state, not durable;
|
|
114
|
+
nothing written`. Writing nothing *silently* after an explicit request is the failure
|
|
115
|
+
that matters here, because the user leaves believing it was captured.
|
|
116
|
+
|
|
110
117
|
<!-- extraction-rules:start -->
|
|
111
118
|
- A node is durable only if it will still be true next month. Task state is not
|
|
112
119
|
durable and belongs in a handoff file, not in the graph.
|
|
@@ -243,7 +250,7 @@ Warnings from `write` are worth surfacing verbatim:
|
|
|
243
250
|
once. If it fails again, print the errors and stop; do not guess at the schema.
|
|
244
251
|
- **`agent-memory: command not found`.** Print the JSON in the chat first, so the
|
|
245
252
|
work is not lost, then say the store needs `npm install -g @vib795/agent-memory`
|
|
246
|
-
(Node >= 22.
|
|
253
|
+
(Node >= 22.16). Do not run it yourself. This is the expected state when the skill
|
|
247
254
|
was installed on its own with `gh skill install` rather than with the package.
|
|
248
255
|
- **Nothing durable in the conversation.** Say so in one line. That is a correct
|
|
249
256
|
outcome, not a failure.
|
package/src/bin.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* The version gate, ahead of the module graph.
|
|
4
|
+
*
|
|
5
|
+
* `cli.js` statically imports `index-db.js`, which imports `node:sqlite`. ESM imports
|
|
6
|
+
* hoist, so on a Node without that module the entire graph fails to load with
|
|
7
|
+
* `ERR_UNKNOWN_BUILTIN_MODULE` before one line of our code runs — including `doctor`,
|
|
8
|
+
* whose whole job is to say the version is wrong. A user on Node 20 got an internal
|
|
9
|
+
* stack trace instead of a sentence telling them what to do.
|
|
10
|
+
*
|
|
11
|
+
* So the check lives here, in the one file that imports nothing, and `cli.js` is
|
|
12
|
+
* loaded dynamically only once the runtime is known to be capable. This is the same
|
|
13
|
+
* reasoning as `atomic.js` importing nothing from the package: a guard that depends on
|
|
14
|
+
* what it guards is not a guard.
|
|
15
|
+
*
|
|
16
|
+
* MIN_NODE is stated twice, here and in `cli.js`, because this file cannot import from
|
|
17
|
+
* a module that pulls in the database. The test suite asserts the two agree.
|
|
18
|
+
*/
|
|
19
|
+
const MIN_NODE = [22, 16];
|
|
20
|
+
|
|
21
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
22
|
+
|
|
23
|
+
if (major < MIN_NODE[0] || (major === MIN_NODE[0] && minor < MIN_NODE[1])) {
|
|
24
|
+
process.stderr.write(
|
|
25
|
+
`agent-memory needs Node >= ${MIN_NODE.join('.')}; this process is ${process.versions.node}.\n` +
|
|
26
|
+
'The store is SQLite via node:sqlite, which carries the FTS5 extension only from\n' +
|
|
27
|
+
'22.16 onward, and search is built on FTS5. There is no dependency to install —\n' +
|
|
28
|
+
'upgrade Node and run the same command again.\n',
|
|
29
|
+
);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
await import('./cli.js');
|
package/src/cli.js
CHANGED
|
@@ -30,7 +30,7 @@ import { redactNodeForExport, buildReceipt, renderReceipt } from './pii.js';
|
|
|
30
30
|
* run and the first thing that breaks after a reboot.
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
-
const MIN_NODE = [22,
|
|
33
|
+
const MIN_NODE = [22, 16];
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Where this process is actually running from, and what version it is.
|
|
@@ -589,7 +589,7 @@ function cmdDoctor() {
|
|
|
589
589
|
checks,
|
|
590
590
|
text:
|
|
591
591
|
`FAIL node version: ${process.versions.node}, need >= ${MIN_NODE.join('.')}.\n` +
|
|
592
|
-
'node:sqlite
|
|
592
|
+
'node:sqlite carries FTS5 in Node core from 22.16 onward; there is no dependency to install.',
|
|
593
593
|
};
|
|
594
594
|
}
|
|
595
595
|
|