Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"name": "agent-memory",
"source": "./",
"description": "Durable cross-repository memory for coding agents — built to survive an IT security review. Zero runtime dependencies, zero dev dependencies, no install script: nothing runs when you install it, and granting it your agents is a separate explicit command. Independently scanned, with a passing verdict. Adds /handoff, /remember and /recall over one local markdown store. Requires the CLI: npm install -g @vib795/agent-memory (Node >= 22.5).",
"version": "0.7.3",
"version": "0.7.4",
"author": {
"name": "Utkarsh Singh",
"url": "https://github.com/vib795"
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "agent-memory",
"displayName": "agent-memory",
"version": "0.7.3",
"version": "0.7.4",
"description": "Durable cross-repository memory for coding agents — built to survive an IT security review. Zero runtime dependencies, zero dev dependencies, no install script: nothing runs when you install it, and granting it your agents is a separate explicit command. Independently scanned, with a passing verdict. Adds /handoff, /remember and /recall over one local markdown store. Requires the CLI: npm install -g @vib795/agent-memory (Node >= 22.5).",
"author": {
"name": "Utkarsh Singh",
Expand Down
18 changes: 9 additions & 9 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
How agent-memory is built, and why it is built that way.

Every figure here was read from the source rather than written from memory, at
v0.6.4: 15 modules, 3,574 lines of JavaScript, zero runtime dependencies and zero
dev dependencies, 97 tests.
v0.7.4: 15 modules, 4,168 lines of JavaScript, zero runtime dependencies and zero
dev dependencies, 111 tests.

---

Expand Down Expand Up @@ -242,7 +242,7 @@ quietly ending.

---

## Two-tier routing
## Three-tier routing

The expensive resource is not disk or CPU. It is the model's context window, and the
premium request budget behind it.
Expand Down Expand Up @@ -472,22 +472,22 @@ The properties that must stay true. Each is covered by the test suite.

| Module | Lines | Responsibility |
|---|--:|---|
| `cli.js` | 980 | 13 commands; one process, one answer |
| `cli.js` | 1114 | 14 commands; one process, one answer |
| `digest.js` | 559 | tiers 1 and 2: both descriptions, tree, brief |
| `compact.js` | 372 | dedupe, supersede, decay, regenerate |
| `index-db.js` | 317 | SQLite cache: DDL, reindex, FTS5 search |
| `setup.js` | 297 | install into detected agent surfaces |
| `pii.js` | 274 | export-time disclosure control |
| `store.js` | 256 | notes as source of truth; frontmatter; atomic upsert |
| `compact.js` | 283 | dedupe, supersede, decay, regenerate |
| `setup.js` | 282 | install into detected agent surfaces |
| `staleness.js` | 213 | commit-distance staleness and capture gap |
| `digest.js` | 209 | two-tier routing: description + tree |
| `config.js` | 191 | engagement resolution; two-file config split |
| `config.js` | 197 | engagement resolution; two-file config split |
| `targets.js` | 140 | where each agent looks for instructions |
| `graph.js` | 99 | recursive CTE traversal + retrieval budget |
| `schema.js` | 98 | validate and normalize; reports every problem |
| `redact.js` | 97 | capture-time fail-closed secret redaction |
| `promptfile.js` | 78 | VS Code prompt files derived from SKILL.md |
| `atomic.js` | 57 | atomic write; imports nothing from this package |
| **total** | **3,574** | zero dependencies, 97 tests |
| **total** | **4,168** | zero dependencies, 111 tests |

`atomic.js` deliberately imports nothing from the package: `store.js` already imports
`config.js`, so putting the atomic write in either would create a cycle.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ equivalent and is not: npm links the global install to that folder rather than c
it, which shows up as an arrow in `npm list -g`:

```
`-- @vib795/agent-memory@0.6.5 -> .\..\..\..\agent-memory
`-- @vib795/agent-memory@0.7.4 -> .\..\..\..\agent-memory
```

Move or delete the clone afterwards and the global install points at nothing — the same
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vib795/agent-memory",
"version": "0.7.3",
"version": "0.7.4",
"description": "Durable cross-repo knowledge graph for GitHub Copilot and Claude Code. Markdown source of truth, disposable SQLite index, zero runtime dependencies.",
"keywords": [
"github-copilot",
Expand Down
27 changes: 15 additions & 12 deletions src/digest.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@ import { createHash } from 'node:crypto';
import { captureGap, currentRepo } from './staleness.js';

/**
* Two-tier routing.
* Tiers 1 and 2 of a three-tier ladder.
*
* Tier 1 is the `recall` skill's description, which is loaded into every chat
* whether or not memory is ever used. It is standing cost, so it has to read like
* a description rather than a document.
* Tier 1 is a skill description, loaded into every chat whether or not memory is ever
* used. It is standing cost, so it has to read like a description rather than a
* document. It has two occupants, not one: `recall`'s description advertises what the
* store knows; `remember`'s advertises what it is missing. Both are the same mechanism
* — a line of frontmatter that code regenerates and every conversation loads —
* pointed at opposite halves of the same problem.
*
* Tier 2 is the tree, printed only when `recall` actually fires. Per-invocation
* cost, paid once, and only when someone is already looking something up.
* Tier 2 is printed only when a skill actually fires: the tree for `recall`, the
* capture brief for `remember`. Per-invocation cost, paid once, and only when someone
* is already looking something up or about to write one down.
*
* Neither tier costs a premium request. A request is charged per prompt, not per
* tool call, so both of these ride inside a turn that was already paid for.
* Tier 3 — note bodies, and the colliding note that `write` hands back — lives
* outside this module, because by then the question is which note rather than which
* of them.
*
* Tier 1 has two occupants, not one. `recall`'s description advertises what the store
* knows; `remember`'s advertises what it is missing. Both are the same mechanism — a
* line of frontmatter that code regenerates and every conversation loads — pointed at
* opposite halves of the same problem.
* Neither tier here costs a premium request. A request is charged per prompt, not per
* tool call, so both of these ride inside a turn that was already paid for.
*/

// Never dropped from either tier. A constraint is what stops an agent from burning
Expand Down
Loading