@vib795/agent-memory 0.1.11 → 0.1.13

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 CHANGED
@@ -322,32 +322,111 @@ A transcript summary reads fine and still leaves the next agent asking questions
322
322
 
323
323
  ## Use
324
324
 
325
- Two different jobs, and it is worth being clear about which is which.
325
+ Three commands, two different jobs. You type the slash command in your agent; the
326
+ agent runs the CLI. The terminal equivalents are shown so you can see what it did,
327
+ and drive it by hand when you want to.
326
328
 
327
- **Moving a thread between windows.** In window A:
329
+ ### `/remember` — keep what stays true
330
+
331
+ Mid-session, when something worth keeping has been established:
328
332
 
329
333
  ```
330
- /handoff
334
+ /remember
335
+ /remember the retry policy on the orders webhook
331
336
  ```
332
337
 
333
- It prints a pickup line. In window B, any repo, paste it:
338
+ Bare, it selects the durable knowledge itself. With an argument, it writes that and
339
+ nothing else. Either way it makes one terminal call, and `write` reports each id:
334
340
 
335
341
  ```
336
- Read C:\Users\you\.agents\handoffs\migrate-orders-to-result-type.md and continue this work. Follow the Next action.
342
+ created auth-service [system]
343
+ created use-sessions [decision]
344
+ warning: use-sessions: redacted 1x github-token
345
+ ```
346
+
347
+ That warning is the redactor firing before anything reached disk. The skill then
348
+ repeats the list back to you with titles attached, so you can see what was captured
349
+ without opening the files.
350
+
351
+ What it ran, which you can run yourself:
352
+
353
+ ```bash
354
+ agent-memory write --from-json - --source remember <<'JSON'
355
+ {"nodes":[
356
+ {"id":"use-sessions","type":"decision",
357
+ "title":"Chose server sessions over JWT",
358
+ "body":"Why: revocation had to take effect immediately.\nRejected: short-TTL JWT, because logout would lag by the TTL.\nImplemented in src/auth/session.js:42.",
359
+ "edges":[{"rel":"evidence-for","dst":"auth-service"}]}
360
+ ]}
361
+ JSON
337
362
  ```
338
363
 
339
- **Keeping what stays true.** `/handoff` also writes durable knowledge into the graph
340
- in the same request — same turn, no extra credit. Mid-session, when something worth
341
- keeping is established and you are not switching windows:
364
+ ### `/recall` — answer from memory before deriving again
365
+
366
+ You rarely type this one. Ask a question memory should already answer and the agent
367
+ invokes it on its own, because the skill description advertises what is in the store:
342
368
 
343
369
  ```
344
- /remember
345
- /remember the retry policy on the orders webhook
370
+ Why do we use sessions instead of JWT here?
371
+ /recall the auth decision
346
372
  ```
347
373
 
348
- And in any repo, later, ask a question that memory should already answer. The agent
349
- invokes `/recall` on its own, because the skill description tells it what is in
350
- there.
374
+ It reads the routing map first, then pulls only the notes it needs:
375
+
376
+ ```bash
377
+ agent-memory tree # what exists, scoped to this repo
378
+ agent-memory get use-sessions --depth 1 # that note plus its neighbourhood
379
+ agent-memory search "session revocation" # full text, when the tree misses
380
+ ```
381
+
382
+ A note that is still current prints clean, with its edges:
383
+
384
+ ```
385
+ ## use-sessions [decision] depth 0
386
+ Chose server sessions over JWT
387
+
388
+ Why: revocation had to take effect immediately.
389
+
390
+ -> evidence-for auth-service
391
+ ```
392
+
393
+ Once the code has moved on underneath it, the same note arrives carrying the warning.
394
+ This is the part that keeps the store honest:
395
+
396
+ ```
397
+ ## use-sessions [decision] depth 0 [captured 47 commits ago — verify before trusting]
398
+ ```
399
+
400
+ ### `/handoff` — move a thread to another window
401
+
402
+ In window A:
403
+
404
+ ```
405
+ /handoff
406
+ ```
407
+
408
+ It writes the working-state file and prints a pickup line. In window B, any repo,
409
+ paste it:
410
+
411
+ ```
412
+ Read ~/.agents/handoffs/migrate-orders-to-result-type.md and continue this work. Follow the Next action.
413
+ ```
414
+
415
+ `/handoff` also writes durable knowledge into the graph in the same request — same
416
+ turn, no extra request charged. To see what it produced:
417
+
418
+ ```bash
419
+ ls ~/.agents/handoffs/ # index.md, <thread>.md, one <thread>.prev.md
420
+ agent-memory tree # the nodes it captured on the way past
421
+ ```
422
+
423
+ ### Housekeeping
424
+
425
+ ```bash
426
+ agent-memory doctor # after install, after an upgrade, when something looks off
427
+ agent-memory compact # dedup, decay, regenerate the routing digest
428
+ agent-memory tree --repo # every repo, not just this one
429
+ ```
351
430
 
352
431
  ## Where things live
353
432
 
@@ -386,11 +465,27 @@ that drifts as the work progresses does not create a duplicate.
386
465
 
387
466
  ## Status
388
467
 
389
- Capture is **explicit**. You invoke it, or `/handoff` does; nothing fires on its own.
468
+ Capture is **judged, not scheduled.** You invoke it, `/handoff` does, or the agent
469
+ does on its own when a juncture has just passed — a decision settled, a constraint
470
+ found, a root cause identified, a convention agreed. It says so in one line and
471
+ carries on with what you actually asked:
472
+
473
+ ```
474
+ captured 2 notes [decision, constraint]
475
+ ```
476
+
477
+ Nothing fires on a timer, on a tool count, or on every reply. That distinction is the
478
+ whole design: a store full of task chatter is worse than an empty one, because it
479
+ buries the four notes that mattered. The judgment of what is durable belongs to the
480
+ model, in the turn where the context still exists; there is no keyword list deciding
481
+ it. And because a request is charged per prompt rather than per tool call, capture
482
+ that rides inside a turn you already paid for is free — which is why it can afford to
483
+ happen at the moment the knowledge is fresh instead of whenever someone remembers.
390
484
 
391
485
  Not built yet, by choice:
392
486
 
393
- - Automatic or ambient capture
487
+ - A capture-gap signal — the store knows when a note has gone stale, but not yet when
488
+ a repo has moved a hundred commits with nothing captured at all
394
489
  - Team sharing, multi-machine sync
395
490
  - An MCP server. It would read this same store, so it is an addition, not a rewrite.
396
491
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vib795/agent-memory",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
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",
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: remember
3
3
  version: 0.1.0
4
- description: Capture durable project knowledge from the current conversation into the shared memory graph, so a later conversation in any window or repository already knows it. Use when the user says remember this, save this, note this for later, or /remember.
4
+ description: Capture durable project knowledge from this conversation into a cross-repo memory graph, so a later conversation anywhere already knows it. Use when the user says remember this, save this, note this for later, or /remember. Also invoke it unasked when a juncture passes - a decision settled, a constraint found, a root cause identified, a convention agreed - then say so in one line and carry on.
5
5
  license: MIT
6
6
  allowed-tools: Bash Read Write
7
7
  triggers:
@@ -25,11 +25,51 @@ call. Do not ask the user to confirm each node.
25
25
 
26
26
  ---
27
27
 
28
- ## Two forms
28
+ ## Three forms
29
29
 
30
30
  - **`/remember`** — you select the durable knowledge from the conversation so far.
31
31
  - **`/remember <what>`** — the user named the thing. Write that, with full context
32
32
  from the conversation, and write nothing unrelated to it.
33
+ - **Unasked** — you noticed a juncture pass and captured it without being told.
34
+
35
+ ### Capturing unasked
36
+
37
+ A memory that only grows when someone remembers to grow it stays thin, and thin is
38
+ how it dies: the one fact worth having is the one nobody stopped to write down.
39
+
40
+ Invoke this yourself the moment one of these has just happened, in the same turn:
41
+
42
+ - a **decision** was settled, and the reasons and rejected options are still in view
43
+ - a **constraint** surfaced — a blocked tool, a policy, an environment restriction
44
+ - a **root cause** was found, as opposed to a symptom worked around
45
+ - a **convention** was agreed, or discovered by reading the code
46
+
47
+ Do not capture on a timer, on a tool count, or at every reply. Those produce volume,
48
+ and volume is what makes a graph useless — a store full of task chatter is worse than
49
+ an empty one, because it buries the four notes that mattered.
50
+
51
+ Never capture: task status, what you are about to do next, anything already in the
52
+ graph, or anything that will be false next month. If you captured a juncture earlier
53
+ in this conversation, do not capture it again because it came up a second time.
54
+
55
+ **It is free, and that is the point.** A request is charged per prompt, not per tool
56
+ call, so capturing inside a turn you were already answering costs nothing. Only a
57
+ user typing `/remember` spends a request. That is the whole reason to do this
58
+ yourself rather than wait to be asked.
59
+
60
+ **Report it in one line, then carry on:**
61
+
62
+ ```
63
+ captured 2 notes [decision, constraint]
64
+ ```
65
+
66
+ At the end of the answer you were already giving. Do not print the JSON, do not
67
+ summarize what you wrote, and do not make it the subject of the reply — the user
68
+ asked you about something else and is still waiting for it. One line is enough for
69
+ them to know it happened and to run `/recall` if they want the detail.
70
+
71
+ If nothing durable happened, say nothing at all. Silence is the correct output for
72
+ most turns.
33
73
 
34
74
  ---
35
75