agent-working-memory 0.17.0 → 0.18.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.
Files changed (165) hide show
  1. package/README.md +321 -319
  2. package/dist/adapters/common.d.ts +34 -0
  3. package/dist/adapters/common.d.ts.map +1 -1
  4. package/dist/adapters/common.js +528 -446
  5. package/dist/adapters/common.js.map +1 -1
  6. package/dist/api/routes.d.ts.map +1 -1
  7. package/dist/api/routes.js +19 -0
  8. package/dist/api/routes.js.map +1 -1
  9. package/dist/cli/migrate.d.ts.map +1 -1
  10. package/dist/cli/migrate.js +31 -29
  11. package/dist/cli/migrate.js.map +1 -1
  12. package/dist/core/asked-value.d.ts +37 -0
  13. package/dist/core/asked-value.d.ts.map +1 -0
  14. package/dist/core/asked-value.js +77 -0
  15. package/dist/core/asked-value.js.map +1 -0
  16. package/dist/core/conflicts.d.ts +89 -0
  17. package/dist/core/conflicts.d.ts.map +1 -0
  18. package/dist/core/conflicts.js +267 -0
  19. package/dist/core/conflicts.js.map +1 -0
  20. package/dist/core/embeddings.d.ts +14 -2
  21. package/dist/core/embeddings.d.ts.map +1 -1
  22. package/dist/core/embeddings.js +32 -10
  23. package/dist/core/embeddings.js.map +1 -1
  24. package/dist/core/format-recall.d.ts +21 -1
  25. package/dist/core/format-recall.d.ts.map +1 -1
  26. package/dist/core/format-recall.js +60 -5
  27. package/dist/core/format-recall.js.map +1 -1
  28. package/dist/core/ml-worker.d.ts +24 -1
  29. package/dist/core/ml-worker.d.ts.map +1 -1
  30. package/dist/core/ml-worker.js +165 -4
  31. package/dist/core/ml-worker.js.map +1 -1
  32. package/dist/core/model-daemon-client.d.ts +77 -0
  33. package/dist/core/model-daemon-client.d.ts.map +1 -0
  34. package/dist/core/model-daemon-client.js +383 -0
  35. package/dist/core/model-daemon-client.js.map +1 -0
  36. package/dist/core/model-daemon-server.d.ts +71 -0
  37. package/dist/core/model-daemon-server.d.ts.map +1 -0
  38. package/dist/core/model-daemon-server.js +363 -0
  39. package/dist/core/model-daemon-server.js.map +1 -0
  40. package/dist/core/model-daemon.d.ts +137 -0
  41. package/dist/core/model-daemon.d.ts.map +1 -0
  42. package/dist/core/model-daemon.js +231 -0
  43. package/dist/core/model-daemon.js.map +1 -0
  44. package/dist/core/query-expander.d.ts +5 -0
  45. package/dist/core/query-expander.d.ts.map +1 -1
  46. package/dist/core/query-expander.js +3 -2
  47. package/dist/core/query-expander.js.map +1 -1
  48. package/dist/core/recall-config.d.ts +1 -1
  49. package/dist/core/recall-config.d.ts.map +1 -1
  50. package/dist/core/recall-config.js +5 -0
  51. package/dist/core/recall-config.js.map +1 -1
  52. package/dist/core/rerank-window.d.ts +7 -2
  53. package/dist/core/rerank-window.d.ts.map +1 -1
  54. package/dist/core/rerank-window.js +9 -4
  55. package/dist/core/rerank-window.js.map +1 -1
  56. package/dist/core/rerank2.d.ts +52 -2
  57. package/dist/core/rerank2.d.ts.map +1 -1
  58. package/dist/core/rerank2.js +60 -3
  59. package/dist/core/rerank2.js.map +1 -1
  60. package/dist/core/reranker.d.ts +19 -0
  61. package/dist/core/reranker.d.ts.map +1 -1
  62. package/dist/core/reranker.js +76 -12
  63. package/dist/core/reranker.js.map +1 -1
  64. package/dist/core/trust.d.ts +32 -0
  65. package/dist/core/trust.d.ts.map +1 -0
  66. package/dist/core/trust.js +66 -0
  67. package/dist/core/trust.js.map +1 -0
  68. package/dist/core/validity.d.ts +21 -0
  69. package/dist/core/validity.d.ts.map +1 -0
  70. package/dist/core/validity.js +41 -0
  71. package/dist/core/validity.js.map +1 -0
  72. package/dist/core/whoami.d.ts +3 -0
  73. package/dist/core/whoami.d.ts.map +1 -1
  74. package/dist/core/whoami.js +14 -0
  75. package/dist/core/whoami.js.map +1 -1
  76. package/dist/core/write-pipeline.d.ts +48 -0
  77. package/dist/core/write-pipeline.d.ts.map +1 -1
  78. package/dist/core/write-pipeline.js +80 -3
  79. package/dist/core/write-pipeline.js.map +1 -1
  80. package/dist/engine/activation.d.ts.map +1 -1
  81. package/dist/engine/activation.js +27 -4
  82. package/dist/engine/activation.js.map +1 -1
  83. package/dist/engine/consolidation.d.ts.map +1 -1
  84. package/dist/engine/consolidation.js +53 -4
  85. package/dist/engine/consolidation.js.map +1 -1
  86. package/dist/hooks/prime-query.d.ts +57 -0
  87. package/dist/hooks/prime-query.d.ts.map +1 -0
  88. package/dist/hooks/prime-query.js +388 -0
  89. package/dist/hooks/prime-query.js.map +1 -0
  90. package/dist/hooks/prime.d.ts +8 -0
  91. package/dist/hooks/prime.d.ts.map +1 -1
  92. package/dist/hooks/prime.js +21 -2
  93. package/dist/hooks/prime.js.map +1 -1
  94. package/dist/hooks/sidecar.d.ts +7 -0
  95. package/dist/hooks/sidecar.d.ts.map +1 -1
  96. package/dist/hooks/sidecar.js +10 -2
  97. package/dist/hooks/sidecar.js.map +1 -1
  98. package/dist/index.js +11 -3
  99. package/dist/index.js.map +1 -1
  100. package/dist/mcp.js +148 -103
  101. package/dist/mcp.js.map +1 -1
  102. package/dist/model-daemon.d.ts +8 -0
  103. package/dist/model-daemon.d.ts.map +1 -0
  104. package/dist/model-daemon.js +45 -0
  105. package/dist/model-daemon.js.map +1 -0
  106. package/dist/storage/factory.d.ts.map +1 -1
  107. package/dist/storage/factory.js +5 -0
  108. package/dist/storage/factory.js.map +1 -1
  109. package/dist/storage/pglite-schema.d.ts.map +1 -1
  110. package/dist/storage/pglite-schema.js +176 -170
  111. package/dist/storage/pglite-schema.js.map +1 -1
  112. package/dist/storage/pglite.d.ts +5 -0
  113. package/dist/storage/pglite.d.ts.map +1 -1
  114. package/dist/storage/pglite.js +165 -153
  115. package/dist/storage/pglite.js.map +1 -1
  116. package/dist/storage/postgres.d.ts +5 -0
  117. package/dist/storage/postgres.d.ts.map +1 -1
  118. package/dist/storage/postgres.js +165 -153
  119. package/dist/storage/postgres.js.map +1 -1
  120. package/dist/storage/sqlite.d.ts +22 -0
  121. package/dist/storage/sqlite.d.ts.map +1 -1
  122. package/dist/storage/sqlite.js +400 -363
  123. package/dist/storage/sqlite.js.map +1 -1
  124. package/dist/types/engram.d.ts +33 -0
  125. package/dist/types/engram.d.ts.map +1 -1
  126. package/dist/types/engram.js.map +1 -1
  127. package/package.json +1 -1
  128. package/plugin/.claude-plugin/plugin.json +1 -1
  129. package/plugin/README.md +1 -1
  130. package/plugin/bin/awm-mcp-launcher.cjs +2 -2
  131. package/plugin/skills/awm-memory/SKILL.md +11 -2
  132. package/src/adapters/common.ts +881 -802
  133. package/src/api/routes.ts +20 -0
  134. package/src/cli/migrate.ts +309 -307
  135. package/src/core/asked-value.ts +74 -0
  136. package/src/core/conflicts.ts +280 -0
  137. package/src/core/embeddings.ts +35 -10
  138. package/src/core/format-recall.ts +83 -25
  139. package/src/core/ml-worker.ts +458 -281
  140. package/src/core/model-daemon-client.ts +374 -0
  141. package/src/core/model-daemon-server.ts +344 -0
  142. package/src/core/model-daemon.ts +243 -0
  143. package/src/core/query-expander.ts +127 -126
  144. package/src/core/recall-config.ts +5 -0
  145. package/src/core/rerank-window.ts +164 -159
  146. package/src/core/rerank2.ts +143 -82
  147. package/src/core/reranker.ts +78 -11
  148. package/src/core/trust.ts +65 -0
  149. package/src/core/validity.ts +47 -0
  150. package/src/core/whoami.ts +136 -120
  151. package/src/core/write-pipeline.ts +119 -3
  152. package/src/engine/activation.ts +27 -4
  153. package/src/engine/consolidation.ts +950 -899
  154. package/src/hooks/prime-query.ts +375 -0
  155. package/src/hooks/prime.ts +25 -2
  156. package/src/hooks/sidecar.ts +13 -3
  157. package/src/index.ts +255 -248
  158. package/src/mcp.ts +1521 -1475
  159. package/src/model-daemon.ts +48 -0
  160. package/src/storage/factory.ts +25 -19
  161. package/src/storage/pglite-schema.ts +199 -193
  162. package/src/storage/pglite.ts +1513 -1498
  163. package/src/storage/postgres.ts +1613 -1598
  164. package/src/storage/sqlite.ts +2056 -2019
  165. package/src/types/engram.ts +30 -0
package/README.md CHANGED
@@ -1,319 +1,321 @@
1
- # AgentWorkingMemory (AWM)
2
-
3
- **Give your AI coding agent a memory that survives the conversation — and knows when to stay quiet.**
4
-
5
- Every session with an AI assistant starts blank. It has forgotten what your team decided last
6
- week, which approach was tried and rejected, and which table actually holds the thing it needs.
7
- So it re-derives all of it — reading files, running searches, asking you — and on a large project
8
- it will confidently rebuild something that was already decided against.
9
-
10
- AWM fixes that with one local process and one SQLite file. The agent writes short notes as it
11
- learns; AWM decides which are worth keeping, hands back the two or three that matter when asked,
12
- and says **nothing** when nothing fits.
13
-
14
- ```bash
15
- npm install -g agent-working-memory && awm setup --global
16
- ```
17
-
18
- Restart Claude Code. 19 tools appear. No cloud, no API keys, nothing leaves your machine.
19
-
20
- <p align="center">
21
- <a href="https://github.com/CompleteIdeas/agent-working-memory/blob/master/docs/for-decision-makers.md"><b>Deciding whether to adopt it? →</b></a> &nbsp;·&nbsp;
22
- <a href="https://github.com/CompleteIdeas/agent-working-memory/blob/master/docs/walkthrough.md"><b>Want the mechanism walked through? →</b></a> &nbsp;·&nbsp;
23
- <a href="https://completeideas.github.io/agent-working-memory/"><b>Docs site →</b></a> &nbsp;·&nbsp;
24
- <a href="https://github.com/CompleteIdeas/agent-working-memory/blob/master/llms.txt"><b>Are you an LLM? Read llms.txt →</b></a>
25
- </p>
26
-
27
- ---
28
-
29
- ## What it does, measured
30
-
31
- Measured against a frozen copy of a **real work store — 29,853 engrams, 11,262 of them
32
- retrievable**, which is the honest denominator for a retrieval score. Not synthetic data, and
33
- not a corpus we can publish: it is a real store with real colleagues and real decisions in it,
34
- so it is gitignored and so is everything derived from it.
35
-
36
- What you *can* run: **`npm run bench:public`** scores the same runner through the same
37
- ground-truth derivation against a synthetic corpus you rebuild yourself. It verifies the method,
38
- not the figures — a synthetic corpus scores lower. Current numbers, stamped with the commit that
39
- produced them, are in [`docs/benchmarks-current.md`](docs/benchmarks-current.md); every claim
40
- below, what produced it, and **who can reproduce it** is in [`docs/claims.md`](docs/claims.md),
41
- including the ones we think are weakest.
42
-
43
- | | |
44
- |---|---|
45
- | **Returns the right memory first** | **93.0%** of identifier queries · **92.2%** of topic queries · **97.0%** in the top five |
46
- | **Stays silent when it should** | **90.0%** correct abstention on questions about facts never stored |
47
- | **Costs the same at any scale** | Scoped recall answers in **~630 tokens flat**. Carrying the store instead: ~1.3M tokens |
48
- | **Lets a cheap model punch up** | Small model + AWM beat a frontier model on a 15-task domain workload: **14/15 vs 7/15**, at ~1/40th the cost |
49
-
50
- Two independently built fixtures agree within a point. Warm recall takes about half a second.
51
-
52
- <details>
53
- <summary>Two more, from real work rather than fixtures</summary>
54
-
55
- **Halves the digging.** Same agent, same tools, four real support tickets: with memory, 2× the
56
- specific facts the real answer needed and half the database queries (49 vs 100). On one ticket
57
- the memoryless arm ran 25 queries, exhausted its budget and answered nothing; the memory arm
58
- answered in 4.
59
-
60
- **Holds decisions for months.** On a six-month application project, recorded decisions were
61
- recalled a median of 30 days after being written — some after 167. 41% of the technical
62
- identifiers the agent used had entered the conversation *only* through a recall.
63
- </details>
64
-
65
- ---
66
-
67
- ## Is this for you?
68
-
69
- The honest version, because the overhead is real and it does not pay back for everyone.
70
-
71
- | If you are… | What you actually get | It pays back when |
72
- |---|---|---|
73
- | **A solo developer on one long-lived project** | The agent stops re-asking what you already told it, and stops re-proposing approaches you rejected | The project outgrows the context window — roughly, when you start saying "I have explained this before" |
74
- | **A team sharing conventions** | One pool where a decision written by anyone is recalled by everyone, with corrections superseding rather than accumulating | More than one person is steering agents at the same codebase |
75
- | **Running support or operations agents** | Ticket-scoped recall by real identifiers, so the second agent to touch a ticket knows what the first one did | Work arrives as a queue that several sessions or people share |
76
- | **Building multi-agent pipelines** | A shared substrate with per-agent scoping, so specialists cooperate without sharing one context window | You have specialised agents that need the same facts |
77
- | **Cost-constrained** | A small local model with good recall beats a frontier model without it on domain work | Your workload is narrow and repetitive rather than novel each time |
78
- | **Somewhere cloud memory is not allowed** | One SQLite file on the machine. No account, no telemetry, no egress | Compliance makes hosted memory a non-starter |
79
-
80
- **Skip it if:** your tasks are short and one-off with nothing worth reusing; you want a hosted
81
- service someone else operates; you need memory synced across machines out of the box; or you were
82
- hoping to replace your code, tickets and docs as the source of truth. AWM is a fast path back to
83
- what was already decided — recall first, verify against the source when it matters, supersede when
84
- reality differs.
85
-
86
- It is also **not** a chatbot, a generic vector database, or a RAG pipeline over your files.
87
-
88
- ---
89
-
90
- ## Get started
91
-
92
- ```bash
93
- npm install -g agent-working-memory
94
- awm setup --global # MCP config, CLAUDE.md guidance, hooks
95
- ```
96
-
97
- Or install it as a Claude Code plugin instead, which wires the same things without a setup
98
- step. The npm package carries the plugin, so this needs no GitHub access:
99
-
100
- ```bash
101
- awm plugin # prints the two lines to paste, with the path on your machine
102
- ```
103
-
104
- Both share one store at `~/.awm/memory.db`, so it is a preference, not a fork — the
105
- trade-offs are in [`docs/plugin.md`](docs/plugin.md). Install the npm package either way.
106
-
107
- Requires **Node.js 22+**. Restart Claude Code.
108
-
109
- **What to expect.** The first conversation takes minutes rather than seconds while three ONNX
110
- models download — **~600 MB** once, into a local cache (134 MB embedder + 92 MB reranker + 377 MB
111
- query expander; nothing is bundled in the package). After that the agent has 19 memory tools, and the hooks save state on compaction
112
- and session end without you doing anything. For the first day or two recall will be thin — it only
113
- knows what has been written. That is the normal shape of it, not a fault.
114
-
115
- **Starting on an existing project?** Warm-start the store from its own docs so recall is useful on
116
- day one:
117
-
118
- ```bash
119
- awm onboard ./docs --repo . --project <name> # review the pack, then
120
- awm import <pack> --db <path> --dedupe
121
- ```
122
-
123
- **Turn on the three retrieval improvements.** They ship default-off and belong together:
124
-
125
- ```bash
126
- AWM_RERANK2=1 AWM_RERANK_WINDOW=query AWM_RERANK_TAGS=1
127
- ```
128
-
129
- Second-stage rerank by the cross-encoder's own score; a 400-character rerank window placed on the
130
- densest query-term region rather than the prefix (**25% → 87.5%** on long memories); and tags fed
131
- into the rerank passage (**+7.4pp**). `awm setup` writes them on a fresh install. `memory_whoami`
132
- prints the active fingerprint so you can confirm a running process has them.
133
-
134
- **Check it worked:** `awm doctor claude-code` reports the live sidecars, which agent each serves,
135
- and whether anything needs a re-run of setup.
136
-
137
- | Next | |
138
- |---|---|
139
- | Install, first write, first recall | [`docs/quickstart.md`](docs/quickstart.md) |
140
- | Separate pools per project, incognito mode, hooks | [`docs/claude-code-setup.md`](docs/claude-code-setup.md) |
141
- | As a Claude Code plugin | [`docs/plugin.md`](docs/plugin.md) |
142
- | In Claude Desktop | [`docs/desktop.md`](docs/desktop.md) |
143
- | Teams and multi-agent | [`docs/team-setup-guide.md`](docs/team-setup-guide.md) |
144
- | Custom agents over HTTP | [`docs/reference.md`](docs/reference.md) |
145
-
146
- ---
147
-
148
- ## Upgrading
149
-
150
- ```bash
151
- npm install -g agent-working-memory@latest
152
- ```
153
-
154
- **That alone is not enough** — it updates the engine, not the wiring. Do the second step for
155
- however you installed it:
156
-
157
- | Installed as | Second step |
158
- |---|---|
159
- | CLI (`awm setup`) | `awm setup --global` again. It upgrades in place: your database, agent id, ports and any env you set are all preserved |
160
- | Claude Code plugin | `/plugin marketplace update agent-working-memory` then `/plugin install awm@agent-working-memory` |
161
- | Claude Desktop | Rebuild the `.mcpb` and re-install it |
162
-
163
- Then **restart Claude Code** (or Desktop). A running MCP connection keeps the code it loaded
164
- at spawn time, so nothing changes until a fresh session starts.
165
-
166
- **A plugin marketplace installed from a local directory does not refresh itself.** Measured:
167
- a GitHub-sourced marketplace on one machine refreshed on a schedule, while a directory-sourced
168
- one had not moved in 167 days. Since the npm route registers a directory marketplace, the
169
- `/plugin marketplace update` line above is required, not optional — skip it and you get new
170
- engine code with old hooks, which half-works and is confusing for it.
171
-
172
- ```
173
- memory_whoami
174
- ```
175
-
176
- reports the version, store and agent the running process **actually** has. It is the fastest
177
- way to confirm an upgrade landed, and the only one that cannot be fooled by a stale cache.
178
-
179
- Your memories are not touched by any of this. Every release so far has been backward
180
- compatible, and the store is the same SQLite file before and after.
181
-
182
- ---
183
-
184
- ## What's new — v0.17.0
185
-
186
- | | |
187
- |---|---|
188
- | **0.17.0** | `AWM_FEEDBACK_NAMES` shipped a **list of 22 real first names** as its built-in default — one deployment's staff list, published in every npm tarball because `src/` is in `files`. It now ships empty, which turns user-feedback auto-promotion off until an operator configures it; **breaking if you relied on the built-in list**, and the migration is one env var. Separately, `memory_write`'s `supersedes` argument was silently discarded whenever reinforce-on-duplicate fired — which is every correction, since a correction restates what it corrects and therefore matches on concept. The engram you asked to retire stayed live, with your correction merged into it. Re-run `awm setup` for the corrected guidance |
189
- | **0.16.1** | A tokenizer option the reranker had been passing since 0.5.2 turned out never to have existed in transformers.js — silently ignored for six months, and the library default was what the code wanted anyway, so no ranking behavior changes. Found by a dependency sweep that also clears every advisory in the published tree: an install of 0.16.0 audits at 7 (3 high), this one at **0**. Accuracy reproduced identically across two transformers majors, token spend to the token |
190
- | **0.16.0** | Two recall defaults changed, each after being measured for the first time. A pseudo-relevance feedback pass that ran on **every** query is now opt-in — it cost 7% of every recall and bought nothing measurable across 950 probes. A reranker shortcut that had never once fired on any store benchmarked here is deleted; forced on, it cost success@1 93.0% → 91.7%. Identifier recall is now **93.0%** success@1 / **97.0%** success@5. Re-run `awm setup` for the corrected agent guidance |
191
- | **0.15.9** | A memory that consolidation archived as a near-duplicate — even at high confidence — could never be reinforced again, so the same recurring fact kept spawning new copies instead of strengthening one. An archived match is now revived on reinforcement |
192
- | **0.15.6–8** | **Data-loss fix.** The default store used to sit inside the installed npm package, where `npm install -g` deletes it on upgrade. It is now `~/.awm/memory.db`; re-running `awm setup` copies an affected store to safety and `awm doctor` fails on it. 0.15.7 corrects the docs that still taught the old location |
193
- | **0.15.x** | Runs as a **Claude Code plugin** and a **Claude Desktop extension**, both sharing one store with the CLI. Installs from npm with no GitHub access — `awm plugin` prints the two lines to paste. Every write now records which client produced it (`client=claude-code`) |
194
- | **0.14.6** | `awm setup` caught up with four releases of engine changes it had silently fallen behind. Added the release checks that now block on that kind of drift |
195
- | **0.14.5** | Benchmark instrument corrected: the eval had been querying as the wrong agent, so a product feature scored as a ranking failure. The real identifier baseline is **92.7%**, not 68% |
196
- | **0.14.2** | Each session's sidecar binds the first free port instead of giving up, so several projects can run at once |
197
- | **0.14.1** | An empty recall says `RECALL ABSTAINED` with the withheld count, rather than claiming the memory is absent |
198
-
199
- Full history, including every benchmark figure that was corrected and why:
200
- [CHANGELOG.md](CHANGELOG.md).
201
-
202
- ---
203
-
204
- ## Why it works when a vector store doesn't
205
-
206
- Most "memory for AI" stores everything and retrieves by similarity. AWM makes the opposite bet:
207
- **a memory is only useful if it is selective.**
208
-
209
- **It refuses most of what it sees.** Every write is scored for importance before storage — is it
210
- new, is it a decision or a root cause, does it name its subject? About a third of what the agent
211
- offers is kept at full confidence. The rest never competes, so recall stays sharp as the store
212
- grows.
213
-
214
- **It forgets gracefully.** Memories that keep getting used stay strong; ones nobody touches fade
215
- from ranking without being deleted. The model is borrowed from cognitive science (ACT-R), and it
216
- means no one curates the store.
217
-
218
- **It tells you when it doesn't know.** When the top candidates are only marginally better than the
219
- tenth, AWM returns nothing and says how many it withheld. A confident wrong memory is more
220
- expensive than an admitted gap — the benchmark scores the silence as a win.
221
-
222
- **It knows what changed.** When a fact is corrected, the old memory is marked superseded and
223
- carries a visible warning if it ever surfaces. A notes file has two paragraphs that read with equal
224
- confidence; AWM knows which one won. One project has 108 such supersessions — an agent resuming it
225
- gets one current state, not five.
226
-
227
- **It stays local and per-person.** One SQLite file, three small ONNX models. Work and personal
228
- memories are separate pools; several sessions share a pool safely.
229
-
230
- <details>
231
- <summary>Against a typical RAG / vector store, feature by feature</summary>
232
-
233
- | | Typical vector store | AWM |
234
- |---|---|---|
235
- | Storage | Everything | Salience-filtered: active / staging / low-confidence fallback |
236
- | Retrieval | Cosine similarity | Keyword + vector candidates → liveness scoring → cross-encoder rerank → abstention gate |
237
- | Forgetting | Manual cleanup | ACT-R decay; reinforced knowledge persists |
238
- | Correction | Delete and re-insert | Supersede with a visible pointer; retract with confidence propagation to neighbours |
239
- | Duplicates | Stored again | Reinforce the existing memory instead |
240
- | Wrong answers | Best of a bad set | Returns nothing, says why |
241
- | Named things | Vocabulary-dependent | Entity index on tickets, people, tables, files |
242
- | Feedback | None | Useful / not-useful adjusts confidence and rank |
243
- | Multi-agent | Per-instance | Shared store, per-agent scoping, opt-in shared workspace |
244
- </details>
245
-
246
- ---
247
-
248
- ## How it works, in one paragraph
249
-
250
- A write is scored for salience — novelty against the existing store, event type, whether it names
251
- identifiers — and lands active, staged, or low-confidence. A recall casts a wide net with keyword
252
- and vector search, scores each candidate for relevance and liveness, lets linked memories vote,
253
- hands the shortlist to a cross-encoder that actually reads the text, then checks whether the score
254
- distribution justifies answering at all. A maintenance pass on session end clusters, decays unused
255
- links, and archives what has gone cold. Corrections supersede rather than overwrite.
256
-
257
- The whole thing, one memory followed end to end with every threshold sourced:
258
- [`docs/walkthrough.md`](docs/walkthrough.md). The mental model an engineer needs to predict its
259
- behaviour — proposers, deciders, and when it stays silent:
260
- [`How AWM decides what to say`](https://completeideas.github.io/agent-working-memory/pipeline-walkthrough.html).
261
- The theory and its citations: [`docs/cognitive-model.md`](docs/cognitive-model.md).
262
-
263
- ---
264
-
265
- ## Honest limits
266
-
267
- - No help on small one-off tasks — the overhead pays back when knowledge is reused or the project
268
- outgrows the context window.
269
- - Recall is bounded by what was written. A memory that never names its subject cannot be found by
270
- it. The writing guidance exists for this reason.
271
- - The association graph, as of this release, rarely changes a final answer; the reranker does.
272
- - It is 0.x. Benchmark figures have been corrected upward more than once after the *instrument*
273
- turned out to be wrong; every correction is documented in place rather than revised away.
274
-
275
- Everything else, with evidence and workarounds: [`docs/known-limitations.md`](docs/known-limitations.md).
276
-
277
- ---
278
-
279
- ## Reference
280
-
281
- The README points outward; it does not duplicate. Everything below is the authoritative source.
282
-
283
- | | |
284
- |---|---|
285
- | **All 19 MCP tools**, most HTTP endpoints with schemas (21 of 28 — the batch-write, checkpoint, export, agent-register and system routes are not yet written up), every environment variable with its measured effect | [`docs/reference.md`](docs/reference.md) |
286
- | Architecture, pipelines, schema, backends (SQLite · PGlite · Postgres) | [`docs/architecture.md`](docs/architecture.md) · [`docs/pglite-feature-parity.md`](docs/pglite-feature-parity.md) |
287
- | Current benchmark numbers, generated and stamped | [`docs/benchmarks-current.md`](docs/benchmarks-current.md) |
288
- | What each eval suite measures, and the measurement caveats | [`docs/benchmarks.md`](docs/benchmarks.md) |
289
- | Building an agent on AWM as a substrate (PRIME → ACT → VERIFY → LEARN) | [`docs/patterns/awm-native-harness.md`](docs/patterns/awm-native-harness.md) · [agent playbook](https://completeideas.github.io/agent-working-memory/awm-for-agents.html) |
290
- | Running it as a service; backup, restore, migration | [`docs/deployment.md`](docs/deployment.md) |
291
- | Behaviour as the store grows | [`docs/using-awm-at-scale.md`](docs/using-awm-at-scale.md) |
292
- | The vocabulary — engram, salience, activation, Hebbian, staging | [`docs/onboarding-vocabulary.md`](docs/onboarding-vocabulary.md) |
293
- | When something is wrong | [`docs/troubleshooting.md`](docs/troubleshooting.md) |
294
- | Full index | [`docs/README.md`](docs/README.md) |
295
-
296
- **Stack:** TypeScript · SQLite + FTS5 (or PGlite / Postgres) · Fastify · `@modelcontextprotocol/sdk` ·
297
- local ONNX via `@huggingface/transformers` — bge-small-en-v1.5 embeddings, ms-marco-MiniLM cross-encoder,
298
- flan-t5-small expansion. Node 22+.
299
-
300
- ```bash
301
- npx vitest run # 810 tests
302
- npm run bench # benchmark suites
303
- npm run build:plugin # regenerate the Claude Code plugin from src/
304
- npm run test:docker # clean-room install of the packed tarball
305
- npm run test:linux # build + full suite on Linux (810/810)
306
- ```
307
-
308
- ---
309
-
310
- ## Status
311
-
312
- Active development, v0.17.0. Core retrieval, consolidation, MCP integration, hooks, task
313
- management, and the HTTP API are stable and in daily production use. PGlite backend stable;
314
- networked Postgres experimental.
315
-
316
- Release notes, and every benchmark correction recorded against the release that made it:
317
- [CHANGELOG.md](CHANGELOG.md).
318
-
319
- **License:** Apache 2.0 — [LICENSE](LICENSE) · [NOTICE](NOTICE)
1
+ # AgentWorkingMemory (AWM)
2
+
3
+ **Give your AI coding agent a memory that survives the conversation — and knows when to stay quiet.**
4
+
5
+ Every session with an AI assistant starts blank. It has forgotten what your team decided last
6
+ week, which approach was tried and rejected, and which table actually holds the thing it needs.
7
+ So it re-derives all of it — reading files, running searches, asking you — and on a large project
8
+ it will confidently rebuild something that was already decided against.
9
+
10
+ AWM fixes that with one local process and one SQLite file. The agent writes short notes as it
11
+ learns; AWM decides which are worth keeping, hands back the two or three that matter when asked,
12
+ and says **nothing** when nothing fits.
13
+
14
+ ```bash
15
+ npm install -g agent-working-memory && awm setup --global
16
+ ```
17
+
18
+ Restart Claude Code. 19 tools appear. No cloud, no API keys, nothing leaves your machine.
19
+
20
+ <p align="center">
21
+ <a href="https://github.com/CompleteIdeas/agent-working-memory/blob/master/docs/for-decision-makers.md"><b>Deciding whether to adopt it? →</b></a> &nbsp;·&nbsp;
22
+ <a href="https://github.com/CompleteIdeas/agent-working-memory/blob/master/docs/walkthrough.md"><b>Want the mechanism walked through? →</b></a> &nbsp;·&nbsp;
23
+ <a href="https://completeideas.github.io/agent-working-memory/"><b>Docs site →</b></a> &nbsp;·&nbsp;
24
+ <a href="https://github.com/CompleteIdeas/agent-working-memory/blob/master/llms.txt"><b>Are you an LLM? Read llms.txt →</b></a>
25
+ </p>
26
+
27
+ ---
28
+
29
+ ## What it does, measured
30
+
31
+ Measured against a frozen copy of a **real work store — 29,853 engrams, 11,262 of them
32
+ retrievable**, which is the honest denominator for a retrieval score. Not synthetic data, and
33
+ not a corpus we can publish: it is a real store with real colleagues and real decisions in it,
34
+ so it is gitignored and so is everything derived from it.
35
+
36
+ What you *can* run: **`npm run bench:public`** scores the same runner through the same
37
+ ground-truth derivation against a synthetic corpus you rebuild yourself. It verifies the method,
38
+ not the figures — a synthetic corpus scores lower. Current numbers, stamped with the commit that
39
+ produced them, are in [`docs/benchmarks-current.md`](docs/benchmarks-current.md); every claim
40
+ below, what produced it, and **who can reproduce it** is in [`docs/claims.md`](docs/claims.md),
41
+ including the ones we think are weakest.
42
+
43
+ | | |
44
+ |---|---|
45
+ | **Returns the right memory first** | **93.0%** of identifier queries · **92.2%** of topic queries · **97.0%** in the top five |
46
+ | **Stays silent when it should** | **90.0%** correct abstention on questions about facts never stored |
47
+ | **Costs the same at any scale** | Scoped recall answers in **~630 tokens flat**. Carrying the store instead: ~1.3M tokens |
48
+ | **Lets a cheap model punch up** | Small model + AWM beat a frontier model on a 15-task domain workload: **14/15 vs 7/15**, at ~1/40th the cost |
49
+
50
+ Two independently built fixtures agree within a point. Warm recall takes about half a second.
51
+
52
+ <details>
53
+ <summary>Two more, from real work rather than fixtures</summary>
54
+
55
+ **Halves the digging.** Same agent, same tools, four real support tickets: with memory, 2× the
56
+ specific facts the real answer needed and half the database queries (49 vs 100). On one ticket
57
+ the memoryless arm ran 25 queries, exhausted its budget and answered nothing; the memory arm
58
+ answered in 4.
59
+
60
+ **Holds decisions for months.** On a six-month application project, recorded decisions were
61
+ recalled a median of 30 days after being written — some after 167. 41% of the technical
62
+ identifiers the agent used had entered the conversation *only* through a recall.
63
+ </details>
64
+
65
+ ---
66
+
67
+ ## Is this for you?
68
+
69
+ The honest version, because the overhead is real and it does not pay back for everyone.
70
+
71
+ | If you are… | What you actually get | It pays back when |
72
+ |---|---|---|
73
+ | **A solo developer on one long-lived project** | The agent stops re-asking what you already told it, and stops re-proposing approaches you rejected | The project outgrows the context window — roughly, when you start saying "I have explained this before" |
74
+ | **A team sharing conventions** | One pool where a decision written by anyone is recalled by everyone, with corrections superseding rather than accumulating | More than one person is steering agents at the same codebase |
75
+ | **Running support or operations agents** | Ticket-scoped recall by real identifiers, so the second agent to touch a ticket knows what the first one did | Work arrives as a queue that several sessions or people share |
76
+ | **Building multi-agent pipelines** | A shared substrate with per-agent scoping, so specialists cooperate without sharing one context window | You have specialised agents that need the same facts |
77
+ | **Cost-constrained** | A small local model with good recall beats a frontier model without it on domain work | Your workload is narrow and repetitive rather than novel each time |
78
+ | **Somewhere cloud memory is not allowed** | One SQLite file on the machine. No account, no telemetry, no egress | Compliance makes hosted memory a non-starter |
79
+
80
+ **Skip it if:** your tasks are short and one-off with nothing worth reusing; you want a hosted
81
+ service someone else operates; you need memory synced across machines out of the box; or you were
82
+ hoping to replace your code, tickets and docs as the source of truth. AWM is a fast path back to
83
+ what was already decided — recall first, verify against the source when it matters, supersede when
84
+ reality differs.
85
+
86
+ It is also **not** a chatbot, a generic vector database, or a RAG pipeline over your files.
87
+
88
+ ---
89
+
90
+ ## Get started
91
+
92
+ ```bash
93
+ npm install -g agent-working-memory
94
+ awm setup --global # MCP config, CLAUDE.md guidance, hooks
95
+ ```
96
+
97
+ Or install it as a Claude Code plugin instead, which wires the same things without a setup
98
+ step. The npm package carries the plugin, so this needs no GitHub access:
99
+
100
+ ```bash
101
+ awm plugin # prints the two lines to paste, with the path on your machine
102
+ ```
103
+
104
+ Both share one store at `~/.awm/memory.db`, so it is a preference, not a fork — the
105
+ trade-offs are in [`docs/plugin.md`](docs/plugin.md). Install the npm package either way.
106
+
107
+ Requires **Node.js 22+**. Restart Claude Code.
108
+
109
+ **What to expect.** The first conversation takes minutes rather than seconds while three ONNX
110
+ models download — **~600 MB** once, into a local cache (134 MB embedder + 92 MB reranker + 377 MB
111
+ query expander; nothing is bundled in the package). After that the agent has 19 memory tools, and the hooks save state on compaction
112
+ and session end without you doing anything. For the first day or two recall will be thin — it only
113
+ knows what has been written. That is the normal shape of it, not a fault.
114
+
115
+ **Starting on an existing project?** Warm-start the store from its own docs so recall is useful on
116
+ day one:
117
+
118
+ ```bash
119
+ awm onboard ./docs --repo . --project <name> # review the pack, then
120
+ awm import <pack> --db <path> --dedupe
121
+ ```
122
+
123
+ **Turn on the three retrieval improvements.** They ship default-off and belong together:
124
+
125
+ ```bash
126
+ AWM_RERANK2=1 AWM_RERANK_WINDOW=query AWM_RERANK_TAGS=1
127
+ ```
128
+
129
+ Second-stage rerank by the cross-encoder's own score; a 400-character rerank window placed on the
130
+ densest query-term region rather than the prefix (**25% → 87.5%** on long memories); and tags fed
131
+ into the rerank passage (**+7.4pp**). `awm setup` writes them on a fresh install. `memory_whoami`
132
+ prints the active fingerprint so you can confirm a running process has them.
133
+
134
+ **Check it worked:** `awm doctor claude-code` reports the live sidecars, which agent each serves,
135
+ and whether anything needs a re-run of setup.
136
+
137
+ | Next | |
138
+ |---|---|
139
+ | Install, first write, first recall | [`docs/quickstart.md`](docs/quickstart.md) |
140
+ | Separate pools per project, incognito mode, hooks | [`docs/claude-code-setup.md`](docs/claude-code-setup.md) |
141
+ | As a Claude Code plugin | [`docs/plugin.md`](docs/plugin.md) |
142
+ | In Claude Desktop | [`docs/desktop.md`](docs/desktop.md) |
143
+ | Teams and multi-agent | [`docs/team-setup-guide.md`](docs/team-setup-guide.md) |
144
+ | Custom agents over HTTP | [`docs/reference.md`](docs/reference.md) |
145
+
146
+ ---
147
+
148
+ ## Upgrading
149
+
150
+ ```bash
151
+ npm install -g agent-working-memory@latest
152
+ ```
153
+
154
+ **That alone is not enough** — it updates the engine, not the wiring. Do the second step for
155
+ however you installed it:
156
+
157
+ | Installed as | Second step |
158
+ |---|---|
159
+ | CLI (`awm setup`) | `awm setup --global` again. It upgrades in place: your database, agent id, ports and any env you set are all preserved |
160
+ | Claude Code plugin | `/plugin marketplace update agent-working-memory` then `/plugin install awm@agent-working-memory` |
161
+ | Claude Desktop | Rebuild the `.mcpb` and re-install it |
162
+
163
+ Then **restart Claude Code** (or Desktop). A running MCP connection keeps the code it loaded
164
+ at spawn time, so nothing changes until a fresh session starts.
165
+
166
+ **A plugin marketplace installed from a local directory does not refresh itself.** Measured:
167
+ a GitHub-sourced marketplace on one machine refreshed on a schedule, while a directory-sourced
168
+ one had not moved in 167 days. Since the npm route registers a directory marketplace, the
169
+ `/plugin marketplace update` line above is required, not optional — skip it and you get new
170
+ engine code with old hooks, which half-works and is confusing for it.
171
+
172
+ ```
173
+ memory_whoami
174
+ ```
175
+
176
+ reports the version, store and agent the running process **actually** has. It is the fastest
177
+ way to confirm an upgrade landed, and the only one that cannot be fooled by a stale cache.
178
+
179
+ Your memories are not touched by any of this. Every release so far has been backward
180
+ compatible, and the store is the same SQLite file before and after.
181
+
182
+ ---
183
+
184
+ ## What's new — v0.18.1
185
+
186
+ | | |
187
+ |---|---|
188
+ | **0.18.1** | Two defects MWA found within hours of the 0.18 defaults. A bare month after a preposition ("in October") now counts as a date for the conflict detector, so three versions of one fact are marked with newer/older. Two attempts to make the engine put the newest first were **measured and rejected**: a reranker-score epsilon cost identifier s@1 93.0% → 78.7%, and reordering on conflict marks cost 93.0% → 74.7% with s@5 unchanged. Marks are a cue to check the source, not a verdict on rank; `newestFirstAmongConflicts` is exported for harnesses whose policy is "newer beats older". Ranking is unchanged from 0.18.0. |
189
+ | **0.18.0** | A superseded memory could **outrank its successor** whenever `AWM_RERANK2=1` — the setting `awm setup` writes everywhere — because the second-stage re-sort ignored the supersession penalty; fixed, with the test run reranker-on. `valid_to` now actually expires (it was display-only; the live store served 482 expired memories as current). Every recall line carries its **written date**, two versions of one fact are **marked as a possible conflict** with the newer one named, recall **confidence** is printed on every reply, and when the question asks for a time, date, amount, count or status that no returned memory holds, the reply says so instead of leaving the gap. `memory_write` takes **`correction: true`** to supersede by intent without the old id. The three measured rerank wins are **code defaults** (`=0` / `=prefix` to disable). A less-trusted write (`trust=` tag) **never merges into or retires a more-trusted memory**. Also: the model-memory fixes (ONNX arena bound, optional shared model daemon), the prime hook recalls with the prompt's question rather than its paste, and seven lifecycle fixes (PR #7). |
190
+ | **0.17.0** | `AWM_FEEDBACK_NAMES` shipped a **list of 22 real first names** as its built-in default — one deployment's staff list, published in every npm tarball because `src/` is in `files`. It now ships empty, which turns user-feedback auto-promotion off until an operator configures it; **breaking if you relied on the built-in list**, and the migration is one env var. Separately, `memory_write`'s `supersedes` argument was silently discarded whenever reinforce-on-duplicate fired — which is every correction, since a correction restates what it corrects and therefore matches on concept. The engram you asked to retire stayed live, with your correction merged into it. Re-run `awm setup` for the corrected guidance |
191
+ | **0.16.1** | A tokenizer option the reranker had been passing since 0.5.2 turned out never to have existed in transformers.js — silently ignored for six months, and the library default was what the code wanted anyway, so no ranking behavior changes. Found by a dependency sweep that also clears every advisory in the published tree: an install of 0.16.0 audits at 7 (3 high), this one at **0**. Accuracy reproduced identically across two transformers majors, token spend to the token |
192
+ | **0.16.0** | Two recall defaults changed, each after being measured for the first time. A pseudo-relevance feedback pass that ran on **every** query is now opt-in — it cost 7% of every recall and bought nothing measurable across 950 probes. A reranker shortcut that had never once fired on any store benchmarked here is deleted; forced on, it cost success@1 93.0% → 91.7%. Identifier recall is now **93.0%** success@1 / **97.0%** success@5. Re-run `awm setup` for the corrected agent guidance |
193
+ | **0.15.9** | A memory that consolidation archived as a near-duplicate — even at high confidence — could never be reinforced again, so the same recurring fact kept spawning new copies instead of strengthening one. An archived match is now revived on reinforcement |
194
+ | **0.15.6–8** | **Data-loss fix.** The default store used to sit inside the installed npm package, where `npm install -g` deletes it on upgrade. It is now `~/.awm/memory.db`; re-running `awm setup` copies an affected store to safety and `awm doctor` fails on it. 0.15.7 corrects the docs that still taught the old location |
195
+ | **0.15.x** | Runs as a **Claude Code plugin** and a **Claude Desktop extension**, both sharing one store with the CLI. Installs from npm with no GitHub access — `awm plugin` prints the two lines to paste. Every write now records which client produced it (`client=claude-code`) |
196
+ | **0.14.6** | `awm setup` caught up with four releases of engine changes it had silently fallen behind. Added the release checks that now block on that kind of drift |
197
+ | **0.14.5** | Benchmark instrument corrected: the eval had been querying as the wrong agent, so a product feature scored as a ranking failure. The real identifier baseline is **92.7%**, not 68% |
198
+ | **0.14.2** | Each session's sidecar binds the first free port instead of giving up, so several projects can run at once |
199
+ | **0.14.1** | An empty recall says `RECALL ABSTAINED` with the withheld count, rather than claiming the memory is absent |
200
+
201
+ Full history, including every benchmark figure that was corrected and why:
202
+ [CHANGELOG.md](CHANGELOG.md).
203
+
204
+ ---
205
+
206
+ ## Why it works when a vector store doesn't
207
+
208
+ Most "memory for AI" stores everything and retrieves by similarity. AWM makes the opposite bet:
209
+ **a memory is only useful if it is selective.**
210
+
211
+ **It refuses most of what it sees.** Every write is scored for importance before storage — is it
212
+ new, is it a decision or a root cause, does it name its subject? About a third of what the agent
213
+ offers is kept at full confidence. The rest never competes, so recall stays sharp as the store
214
+ grows.
215
+
216
+ **It forgets gracefully.** Memories that keep getting used stay strong; ones nobody touches fade
217
+ from ranking without being deleted. The model is borrowed from cognitive science (ACT-R), and it
218
+ means no one curates the store.
219
+
220
+ **It tells you when it doesn't know.** When the top candidates are only marginally better than the
221
+ tenth, AWM returns nothing and says how many it withheld. A confident wrong memory is more
222
+ expensive than an admitted gap — the benchmark scores the silence as a win.
223
+
224
+ **It knows what changed.** When a fact is corrected, the old memory is marked superseded and
225
+ carries a visible warning if it ever surfaces. A notes file has two paragraphs that read with equal
226
+ confidence; AWM knows which one won. One project has 108 such supersessions — an agent resuming it
227
+ gets one current state, not five.
228
+
229
+ **It stays local and per-person.** One SQLite file, three small ONNX models. Work and personal
230
+ memories are separate pools; several sessions share a pool safely.
231
+
232
+ <details>
233
+ <summary>Against a typical RAG / vector store, feature by feature</summary>
234
+
235
+ | | Typical vector store | AWM |
236
+ |---|---|---|
237
+ | Storage | Everything | Salience-filtered: active / staging / low-confidence fallback |
238
+ | Retrieval | Cosine similarity | Keyword + vector candidates → liveness scoring → cross-encoder rerank → abstention gate |
239
+ | Forgetting | Manual cleanup | ACT-R decay; reinforced knowledge persists |
240
+ | Correction | Delete and re-insert | Supersede with a visible pointer; retract with confidence propagation to neighbours |
241
+ | Duplicates | Stored again | Reinforce the existing memory instead |
242
+ | Wrong answers | Best of a bad set | Returns nothing, says why |
243
+ | Named things | Vocabulary-dependent | Entity index on tickets, people, tables, files |
244
+ | Feedback | None | Useful / not-useful adjusts confidence and rank |
245
+ | Multi-agent | Per-instance | Shared store, per-agent scoping, opt-in shared workspace |
246
+ </details>
247
+
248
+ ---
249
+
250
+ ## How it works, in one paragraph
251
+
252
+ A write is scored for salience — novelty against the existing store, event type, whether it names
253
+ identifiers — and lands active, staged, or low-confidence. A recall casts a wide net with keyword
254
+ and vector search, scores each candidate for relevance and liveness, lets linked memories vote,
255
+ hands the shortlist to a cross-encoder that actually reads the text, then checks whether the score
256
+ distribution justifies answering at all. A maintenance pass on session end clusters, decays unused
257
+ links, and archives what has gone cold. Corrections supersede rather than overwrite.
258
+
259
+ The whole thing, one memory followed end to end with every threshold sourced:
260
+ [`docs/walkthrough.md`](docs/walkthrough.md). The mental model an engineer needs to predict its
261
+ behaviour — proposers, deciders, and when it stays silent:
262
+ [`How AWM decides what to say`](https://completeideas.github.io/agent-working-memory/pipeline-walkthrough.html).
263
+ The theory and its citations: [`docs/cognitive-model.md`](docs/cognitive-model.md).
264
+
265
+ ---
266
+
267
+ ## Honest limits
268
+
269
+ - No help on small one-off tasks — the overhead pays back when knowledge is reused or the project
270
+ outgrows the context window.
271
+ - Recall is bounded by what was written. A memory that never names its subject cannot be found by
272
+ it. The writing guidance exists for this reason.
273
+ - The association graph, as of this release, rarely changes a final answer; the reranker does.
274
+ - It is 0.x. Benchmark figures have been corrected upward more than once after the *instrument*
275
+ turned out to be wrong; every correction is documented in place rather than revised away.
276
+
277
+ Everything else, with evidence and workarounds: [`docs/known-limitations.md`](docs/known-limitations.md).
278
+
279
+ ---
280
+
281
+ ## Reference
282
+
283
+ The README points outward; it does not duplicate. Everything below is the authoritative source.
284
+
285
+ | | |
286
+ |---|---|
287
+ | **All 19 MCP tools**, most HTTP endpoints with schemas (21 of 28 — the batch-write, checkpoint, export, agent-register and system routes are not yet written up), every environment variable with its measured effect | [`docs/reference.md`](docs/reference.md) |
288
+ | Architecture, pipelines, schema, backends (SQLite · PGlite · Postgres) | [`docs/architecture.md`](docs/architecture.md) · [`docs/pglite-feature-parity.md`](docs/pglite-feature-parity.md) |
289
+ | Current benchmark numbers, generated and stamped | [`docs/benchmarks-current.md`](docs/benchmarks-current.md) |
290
+ | What each eval suite measures, and the measurement caveats | [`docs/benchmarks.md`](docs/benchmarks.md) |
291
+ | Building an agent on AWM as a substrate (PRIME → ACT → VERIFY → LEARN) | [`docs/patterns/awm-native-harness.md`](docs/patterns/awm-native-harness.md) · [agent playbook](https://completeideas.github.io/agent-working-memory/awm-for-agents.html) |
292
+ | Running it as a service; backup, restore, migration | [`docs/deployment.md`](docs/deployment.md) |
293
+ | Behaviour as the store grows | [`docs/using-awm-at-scale.md`](docs/using-awm-at-scale.md) |
294
+ | The vocabulary — engram, salience, activation, Hebbian, staging | [`docs/onboarding-vocabulary.md`](docs/onboarding-vocabulary.md) |
295
+ | When something is wrong | [`docs/troubleshooting.md`](docs/troubleshooting.md) |
296
+ | Full index | [`docs/README.md`](docs/README.md) |
297
+
298
+ **Stack:** TypeScript · SQLite + FTS5 (or PGlite / Postgres) · Fastify · `@modelcontextprotocol/sdk` ·
299
+ local ONNX via `@huggingface/transformers` — bge-small-en-v1.5 embeddings, ms-marco-MiniLM cross-encoder,
300
+ flan-t5-small expansion. Node 22+.
301
+
302
+ ```bash
303
+ npx vitest run # 1066 tests
304
+ npm run bench # benchmark suites
305
+ npm run build:plugin # regenerate the Claude Code plugin from src/
306
+ npm run test:docker # clean-room install of the packed tarball
307
+ npm run test:linux # build + full suite on Linux
308
+ ```
309
+
310
+ ---
311
+
312
+ ## Status
313
+
314
+ Active development, v0.18.1. Core retrieval, consolidation, MCP integration, hooks, task
315
+ management, and the HTTP API are stable and in daily production use. PGlite backend stable;
316
+ networked Postgres experimental.
317
+
318
+ Release notes, and every benchmark correction recorded against the release that made it:
319
+ [CHANGELOG.md](CHANGELOG.md).
320
+
321
+ **License:** Apache 2.0 — [LICENSE](LICENSE) · [NOTICE](NOTICE)