agent-working-memory 0.8.7 → 0.9.0

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 (57) hide show
  1. package/README.md +207 -46
  2. package/dist/api/routes.js +1 -1
  3. package/dist/cli/migrate.js +29 -29
  4. package/dist/cli.js +1 -1
  5. package/dist/coordination/circuit-breaker.js +23 -23
  6. package/dist/core/write-pipeline.d.ts.map +1 -1
  7. package/dist/core/write-pipeline.js +17 -0
  8. package/dist/core/write-pipeline.js.map +1 -1
  9. package/dist/engine/activation.d.ts +28 -0
  10. package/dist/engine/activation.d.ts.map +1 -1
  11. package/dist/engine/activation.js +341 -11
  12. package/dist/engine/activation.js.map +1 -1
  13. package/dist/engine/connections.d.ts +12 -0
  14. package/dist/engine/connections.d.ts.map +1 -1
  15. package/dist/engine/connections.js +95 -0
  16. package/dist/engine/connections.js.map +1 -1
  17. package/dist/mcp.js +2 -2
  18. package/dist/storage/pglite-schema.js +143 -143
  19. package/dist/storage/pglite.js +138 -138
  20. package/dist/types/engram.d.ts +1 -0
  21. package/dist/types/engram.d.ts.map +1 -1
  22. package/package.json +1 -1
  23. package/src/api/index.ts +3 -3
  24. package/src/api/routes.ts +1 -1
  25. package/src/cli/migrate.ts +307 -307
  26. package/src/cli.ts +1 -1
  27. package/src/coordination/circuit-breaker.ts +83 -83
  28. package/src/coordination/failure-modes.ts +50 -50
  29. package/src/core/decay.ts +63 -63
  30. package/src/core/embeddings.ts +110 -110
  31. package/src/core/index.ts +5 -5
  32. package/src/core/logger.ts +36 -36
  33. package/src/core/ml-worker-entry.ts +194 -194
  34. package/src/core/ml-worker.ts +281 -281
  35. package/src/core/query-expander.ts +122 -122
  36. package/src/core/reranker.ts +119 -119
  37. package/src/core/write-pipeline.ts +15 -0
  38. package/src/engine/activation.ts +328 -11
  39. package/src/engine/confidence.ts +120 -120
  40. package/src/engine/connections.ts +94 -0
  41. package/src/engine/consolidation-scheduler.ts +242 -242
  42. package/src/engine/eval.ts +102 -102
  43. package/src/engine/eviction.ts +101 -101
  44. package/src/engine/index.ts +8 -8
  45. package/src/engine/retraction.ts +366 -366
  46. package/src/engine/staging.ts +74 -74
  47. package/src/mcp.ts +2 -2
  48. package/src/storage/factory.ts +147 -147
  49. package/src/storage/index.ts +3 -3
  50. package/src/storage/pglite-schema.ts +166 -166
  51. package/src/storage/pglite.ts +1363 -1363
  52. package/src/storage/store.ts +80 -80
  53. package/src/types/agent.ts +67 -67
  54. package/src/types/checkpoint.ts +46 -46
  55. package/src/types/engram.ts +1 -0
  56. package/src/types/eval.ts +100 -100
  57. package/src/types/index.ts +6 -6
package/README.md CHANGED
@@ -84,59 +84,134 @@ Most "memory for AI" projects are vector databases with a retrieval wrapper. AWM
84
84
 
85
85
  The design is based on cognitive science — ACT-R activation decay, Hebbian learning, complementary learning systems, synaptic homeostasis, and synaptic tagging — rather than ad-hoc heuristics. See [How It Works](#how-it-works) and [docs/cognitive-model.md](docs/cognitive-model.md) for details.
86
86
 
87
+ > **New to AWM?** [`docs/pipeline-walkthrough.html`](docs/pipeline-walkthrough.html) is a visual, plain-language walkthrough (no background required) — what happens when AWM learns and recalls a fact, why it's built this way, and how it differs from a plain vector store. Open it in a browser.
88
+
89
+ > **Build an agent on it:** the [AWM-Native Agent Harness pattern](docs/patterns/awm-native-harness.md) shows how to use AWM as an always-on cognitive *substrate* (not a tool the model calls) so the agent learns automatically by working — letting a cheap model perform at a high level and get cheaper + better over time. Measured: gpt-5.4-mini + AWM beat a frontier model on a domain workload at ~1/40th the cost.
90
+
91
+ > **For builders & researchers:** [`docs/awm-for-agents.html`](docs/awm-for-agents.html) is the agent playbook — why AWM exists (the context-window wall), the PRIME→ACT→VERIFY→LEARN harness, the full agent feature surface (workspace, session IDs, bearer-token hooks, supersede/feedback), how multi-hop is solved in the harness, and the honest gauntlet findings (where AWM wins, ties, and what isn't measured yet). Open it in a browser.
92
+
87
93
  ---
88
94
 
89
- ## Benchmarks
95
+ ## Why it matters at scale
90
96
 
91
- ### Eval Harness
97
+ The reason AWM exists: **past roughly half a million tokens, you can no longer keep a large project's context alive by carrying it.** The codebase, the docs, the decision history, and the meeting/work transcripts outgrow every model's window — and summarizing to fit silently drops the fact you needed next.
92
98
 
93
- | Suite | Score (v0.8.5) | Score (v0.6.0 baseline) | Threshold | What it tests |
94
- |-------|---|---|-----------|---------------|
95
- | Retrieval | **Recall@5 = 0.980** | 0.800 | >= 0.80 | 200 facts, 50 queries — BM25 + vector + reranker pipeline precision |
96
- | Associative | **success@10 = 1.000** | 1.000 | >= 0.70 | 20 multi-hop causal chains — graph walk finds non-obvious connections |
97
- | Redundancy | **dedup F1 = 0.966** | 0.966 | >= 0.80 | 50 clusters × 4 paraphrases — consolidation removes duplicates correctly |
98
- | Temporal | **Spearman = 0.932** | 0.932 | >= 0.75 | 25 facts with controlled age/access — ACT-R decay ranking accuracy |
99
+ These figures come from real-world use on a large software platform project, where a single work agent has accumulated **20,000+ memories** over a multi-million-token codebase and documentation set:
99
100
 
100
- > **v0.8.5 recall fix:** A regression intermediate-step had Recall@5 drop to
101
- > 0.46. Root cause: the entity-bridge boost (Phase 3.7) inverted top-1 in
102
- > dense same-concept corpora it rewarded clones that shared tags with
103
- > the anchor while excluding the anchor itself. Fix: proportional gating
104
- > so the boost scales with the textMatch gap between candidate and anchor.
105
- > Clones near the anchor get near-zero boost; genuine lateral candidates
106
- > (low textMatch, shared entities) still get the full boost.
107
- > Result: Recall@5 0.46 → 0.980 with all 4 eval suites green.
101
+ | To answer one question, carry… | tokens | AWM scoped recall |
102
+ |---|---|---|
103
+ | the accumulated memory (~20K memories) | ~1.3M | **~630, flat** |
104
+ | the project's notes & transcript docs | ~2M | **~630, flat** |
105
+ | the whole system (code + docs) | ~29M fits in no window, any tier | **~630, flat** |
108
106
 
109
- ### Full Test Suite
107
+ A scoped recall answers from the relevant *slice*, independent of how large the store grows. Measured consequences on real questions against the real project:
108
+
109
+ - **~2,000× fewer tokens per query** than carrying the memory store — and **~5× fewer** than opening the single best-matching documentation file (a floor; agents usually open several and still miss cross-file facts).
110
+ - **At scale, "carry everything" isn't an option.** At ~20K memories no context window holds it, so retrieval is not an optimization — it is the only door. A static notes file or long-context approach is forced to truncate, which silently drops facts.
110
111
 
111
- | Command | Score | What it tests |
112
- |---------|-------|---------------|
113
- | `npm run eval` | **4/4 suites pass** | Retrieval, associative, redundancy, temporal benchmarks with ablation support |
114
- | `npm run test:run` | **77/77 tests** | Unit tests: salience, decay, hebbian, supersession, coordination |
115
- | `npm run test:mcp` | **5/5 pass** | MCP protocol: write, recall, feedback, retract, stats |
116
- | `npm run test:self` | **94.1% EXCELLENT** | Pipeline component checks across all cognitive subsystems |
117
- | `npm run test:edge` | **All pass** | 9 failure modes: narcissistic interference, identity collision, contradiction trapping, bridge overshoot, noise forgetting |
118
- | `npm run test:stress` | **96.2% (50/52)** | 500 memories, 100 sleep cycles, catastrophic forgetting, adversarial spam, recovery |
119
- | `npm run test:workday` | **93.3% EXCELLENT** | 43 memories across 4 projects, cross-cutting queries, noise filtering |
120
- | `npm run test:ab` | **AWM 20/22 vs Baseline 18/22** | AWM outperforms keyword baseline on architecture + testing topics |
121
- | `npm run test:sleep` | **71.4%** | 60 memories, 4 topic clusters, consolidation impact across 3 cycles |
122
- | `npm run test:tokens` | **56.3% savings, 2.3x efficiency** | Memory-guided context vs full history, keyword accuracy 72.5% |
123
- | `scripts/measure-claude-vs-awm.ts` | **9.8× lower aggregate cost vs file_retrieval** | Real Claude Code session audit: AWM recall vs Read/Grep/Glob workflows |
124
- | `npm run test:pilot` | **14/15 pass** | Production-like queries with noise rejection (5/5 noise rejected) |
125
- | `npm run test:locomo` | **28.2%** | Industry-standard LoCoMo conversational memory benchmark (1,986 QA pairs) |
126
-
127
- ### Consolidation Health (v0.6.0)
128
-
129
- | Metric | Value |
130
- |--------|-------|
131
- | Topic clusters formed | **10** per consolidation cycle |
132
- | Cross-topic bridges | **20** in first cycle |
133
- | Edges strengthened | **135** per cycle (access-weighted) |
134
- | Graph size at scale | **3,000-4,500 edges** (500 memories) |
135
- | Recall after 100 cycles | **90%** stable |
136
- | Catastrophic forgetting survival | **5/5** (100%) |
137
- | Post-dedup retrieval | **0.950** (consolidation improves recall) |
138
-
139
- All evals are reproducible. See [Testing & Evaluation](#testing--evaluation).
112
+ Two structural advantages a file or a flat vector store cannot match:
113
+
114
+ - **Staleness is tracked.** When a fact changes, `memory_supersede` retires the old value and recall stops returning it the system *knows* what changed. A notes file or repo goes stale silently; you would re-scan everything to find out. (This work agent has superseded and retracted dozens of facts as the project moved.)
115
+ - **Dead weight costs nothing.** ~90% of accumulated memories are never recalled for a given task — a notes file pays for all of them in every prompt; recall pays for ≈zero.
116
+
117
+ ### Honest about the trade-offs
118
+
119
+ - AWM does **not** win on small, one-shot tasks — write/recall overhead exceeds the savings until knowledge is reused or the corpus grows past what fits in context.
120
+ - Recall is not free: a few seconds of latency per query buys the token reduction.
121
+ - Recall accuracy is bounded by what was written write quality matters (lead with the fact; tag with identifiers like file, table, ticket).
122
+ - It does not replace your source of truth. The intended pattern is: **recall first, read/grep the code for ground truth on a miss, and supersede when reality differs.**
123
+
124
+ ---
125
+
126
+ ## Benchmarks
127
+
128
+ Two kinds of tests, both reproducible (see [Testing & Evaluation](#testing--evaluation)).
129
+ First, **recall quality** — does the pipeline return the right memory? Second,
130
+ **behavior under stress** does it stay honest, filter noise, and hold up as the
131
+ store grows and ages? Numbers below were re-run on the 0.9-staged line (2026-06-17).
132
+
133
+ ### 1 · Recall quality (eval harness)
134
+
135
+ Each suite has a pass threshold; all four pass.
136
+
137
+ | Suite | Score | Threshold | What it measures |
138
+ |-------|-------|-----------|------------------|
139
+ | Retrieval | **Recall@5 = 0.980** | ≥ 0.80 | 200 facts, 50 queries — does the BM25 + vector + reranker pipeline surface the right fact in the top 5? |
140
+ | Associative | **success@10 = 1.000** | 0.70 | 20 multi-hop causal chains — does the graph walk find non-obvious connections? |
141
+ | Redundancy | **dedup F1 = 0.966** | ≥ 0.80 | 50 clusters × 4 paraphrases — does consolidation merge duplicates without losing the original? |
142
+ | Temporal | **Spearman = 0.932** | ≥ 0.75 | 25 facts with controlled age/access — does ACT-R decay rank recent/used memories ahead of stale ones? |
143
+
144
+ ### 2 · Behavior under stress & adversarial conditions
145
+
146
+ These are graded suites (not pass/fail). The headline risk they guard against is a
147
+ memory system that confidently returns the *wrong* thing — so the weakest area is
148
+ called out, not hidden.
149
+
150
+ | Suite | Score | What it measures |
151
+ |-------|-------|------------------|
152
+ | `test:run` (unit) | **569 / 569** | Salience, decay, Hebbian, supersession, coordination, scheduler |
153
+ | `test:self` | **93.9% (EXCELLENT)** | Every cognitive subsystem end-to-end; weakest = exact-topic retrieval |
154
+ | `test:workday` | **85.4% (GOOD)** | A realistic mixed day — 43 memories across 4 projects, cross-cutting queries; weakest = noise filtering |
155
+ | `test:edge` | **~32 / 34** | Named failure modes: identity collision, contradiction trapping, bridge overshoot, false generalization |
156
+ | `test:ab` | **AWM 10 / 11 vs keyword baseline 8 / 11** | Where the cognitive pipeline beats plain keyword search |
157
+ | `test:pilot` | **14 / 15** (5/5 noise rejected) | Production-like queries that must reject planted distractors |
158
+ | `test:locomo` | **25.7%** | LoCoMo conversational-memory benchmark (a *chatbot* benchmark — see note) |
159
+ | `test:mcp` | **5 / 5** | MCP protocol smoke: write, recall, feedback, retract, stats |
160
+
161
+ > **On LoCoMo (25.7%):** LoCoMo measures *chatbot* recall ("what did we say about X"
162
+ > across long conversations). It is not the workload AWM is tuned for (productivity /
163
+ > engineering, staying on topic, rejecting noise), and ~66% of AWM's misses there are
164
+ > retriever-coverage (the gold turn isn't in the top-10), not extraction. The 0.9 recall
165
+ > work lifted it from 22.7% with every category up. We report it for comparability, not
166
+ > as the headline.
167
+
168
+ ### 3 · The sleep cycle (consolidation)
169
+
170
+ The **sleep cycle** is AWM's offline maintenance pass (the term is borrowed from how
171
+ human memory consolidates during sleep). On each cycle it **clusters** related
172
+ memories, builds **cross-topic bridges**, **strengthens** co-used edges, **decays**
173
+ unused ones, and **prunes** duplicates. You run it so the association graph stays
174
+ *healthy and navigable* as the store grows — without it, edges accumulate into noise.
175
+
176
+ > **Reading the score:** `test:sleep` = **78.6%** is a *consolidation-quality* score —
177
+ > it asks "after the maintenance pass, is recall at least as good and is the structure
178
+ > better?" **It is not recall falling to 78.6%.** In this fixture recall is held flat
179
+ > across three cycles (78.6% before = 78.6% after) while the graph reorganizes. The
180
+ > scaling picture is the real proof:
181
+
182
+ | Under a 100-cycle stress run | Observed |
183
+ |---|---|
184
+ | Recall across cycles | **holds 90–100%** (no catastrophic forgetting) |
185
+ | Cross-topic recall | **~80%**, stable |
186
+ | Graph self-pruning | edges grow to ~2,300 then prune back to ~1,500 as unused links decay |
187
+ | Clusters / bridges per cycle | ~10 clusters, bridges formed early then settle |
188
+
189
+ So consolidation *protects* recall over the long run — the per-cycle score measures the
190
+ health of the maintenance, and the stress run shows recall doesn't degrade.
191
+
192
+ ### 4 · Token economics — honest
193
+
194
+ The win that matters is **structural**: at the scale AWM targets you can't carry the
195
+ project at all (see [Why it matters at scale](#why-it-matters-at-scale)). On real coding
196
+ sessions, scoped recall costs **9.8× less in aggregate** than the Read/Grep/Glob
197
+ rediscovery it replaces (`scripts/measure-claude-vs-awm.ts`).
198
+
199
+ The per-turn micro-benchmark (`test:tokens`) reports against **two** baselines, because the
200
+ baseline you pick *is* the result:
201
+
202
+ - **vs carrying the full history** (what a memoryless agent must actually do — it can't know
203
+ which past turn matters): **+67% savings at 97.5% recall accuracy.** This is the honest,
204
+ apples-to-apples number.
205
+ - **vs an oracle that pre-scoped context to the exactly-relevant task**: **≈ −13%.** A
206
+ deliberately brutal bar — it gives the baseline the very scoping that retrieval exists to do —
207
+ and on a tiny 6–8-turn task a fixed top-5 recall is break-even-to-negative *by construction*.
208
+
209
+ An earlier build reported ~56% on the oracle bar, but that was an **artifact**: pre-v0.8.5,
210
+ reinforce-on-duplicate silently *discarded* memory content, so recalls were artificially tiny.
211
+ v0.8.5 fixed the data loss (accuracy ~72% → 97.5%); better recall now fills all five slots,
212
+ which *lowers* the oracle-bar number while *raising* correctness. Net: the at-scale structural
213
+ win above is the real story; the oracle bar shows AWM roughly matches perfect manual scoping
214
+ even on a corpus far too small to play to its strengths.
140
215
 
141
216
  ---
142
217
 
@@ -475,6 +550,49 @@ npm run test:locomo # LoCoMo industry benchmark (28.2%)
475
550
 
476
551
  All three ML models run locally via ONNX. No external API calls for retrieval. The entire system is a single SQLite file + a Node.js process.
477
552
 
553
+ ## What's New in v0.9.0
554
+
555
+ A recall-quality default + new tuning knobs + a builder/researcher doc set.
556
+ Every change is an **env-revertible default** with no API changes — existing
557
+ callers keep working unmodified. Validated: official LoCoMo **22.7% → 25.7%**
558
+ (every category up) **and** adversarial precision **73.4 → 74.9** (strictly
559
+ better on each axis); recall latency ~35 → ~77ms (sub-100ms, tunable); zero
560
+ regression across the standard suite (eval 4-suite identical, 569/569 unit,
561
+ edge 32/34, workday = old config).
562
+
563
+ - **Wide rerank pool + top-K abstention (the win).** A pipeline-attribution
564
+ study (new tracer, `tests/locomo-eval/trace.ts`) found the dominant recall
565
+ loss wasn't candidate generation *or* the reranker — it was the stage between:
566
+ ~50% of answerable queries had gold that *cleared the candidate floor* but was
567
+ squeezed out of the rerank pool by the decay-compressed composite **before the
568
+ high-lift (+3.29) reranker saw it**. Fix: the composite becomes a cheap **wide
569
+ pre-filter** (`AWM_TOPN_MULT=8`, was 3×), the reranker discriminates on a wider
570
+ pool (`AWM_RERANK_POOL=max(limit*4,40)`, was `max(limit*2,15)`), and the
571
+ out-of-domain abstention gate judges only the **post-rerank top-K**
572
+ (`AWM_ABSTAIN_GATE_K=5`) so widening for recall doesn't inflate the in-domain
573
+ signal. Reverses the v0.7.13 "pool reduction" change. See
574
+ [reference.md → Recall tuning](docs/reference.md#recall-tuning-env-overrides).
575
+
576
+ - **Tunable similarity floors.** `AWM_SIM_FLOOR_TARGETED` / `_EXPLORATORY`
577
+ (defaults 0.50 / 0.35, unchanged) and the candidate-entry floors are now env
578
+ overrides for retuning against a different embedder.
579
+
580
+ - **Opt-in / experimental flags (default-off).** `AWM_QUERY_BRIDGE`
581
+ (query-named-entity boost — lifts attribution "what does X think" 36% → 92% on
582
+ a controlled eval; small adversarial cost, so opt-in), `AWM_AUTOTAG`
583
+ (write-time `entity:`/`cat:` meta-tags), `AWM_BROAD_EDGES`. `AWM_SPREAD`
584
+ (in-engine spreading activation) is **parked** — it regressed recall by
585
+ displacing gold; multi-hop is solved harness-side instead (see the playbook).
586
+
587
+ - **New docs for builders & researchers.** [`docs/awm-for-agents.html`](docs/awm-for-agents.html)
588
+ — the agent playbook (why AWM exists, the PRIME→ACT→VERIFY→LEARN harness, the
589
+ full agent feature surface, how multi-hop is solved, and the honest gauntlet
590
+ findings). [`docs/pipeline-walkthrough.html`](docs/pipeline-walkthrough.html)
591
+ redesigned for devs/researchers. Both are published on GitHub Pages. A new
592
+ **Storage Backends + Postgres roadmap** section in
593
+ [architecture.md](docs/architecture.md) documents SQLite (default) vs PGlite
594
+ and the path to a networked-Postgres backend (v1 target).
595
+
478
596
  ## What's New in v0.8.5
479
597
 
480
598
  A research-grounded hardening pass on recall quality, retraction propagation,
@@ -582,6 +700,7 @@ callers keep working without modification. Full validation at the milestone:
582
700
  ## What's New in v0.7.13
583
701
 
584
702
  - **Reranker pool size reduction** — cross-encoder pool dropped from `max(limit*3, 30)` to `max(limit*2, 15)`. For typical agent queries (limit=5 or 10), that's 15-20 candidates reranked instead of 30, halving the cross-encoder cost. Top-K quality preserved (8/8 top-1, identical top-5/top-10 overlap) — reranking the 21st-30th candidates was wasted when the user only wants top-5 anyway.
703
+ > **⚠️ Superseded in 0.9.0 — this reduction was reversed.** A pipeline-attribution study found that "wasted" tail was actually where ~50% of retrievable answers were being squeezed out *before* the reranker saw them (the small 8-query A/B above missed it). 0.9.0 widens the pool back to `max(limit*4, 40)` and adds a top-K abstention gate — lifting LoCoMo recall 22.7%→25.7% **and** adversarial precision 73.4→74.9, with no regression. See the CHANGELOG and `docs/reference.md` → "Recall tuning."
585
704
 
586
705
  ## What's New in v0.7.12
587
706
 
@@ -659,6 +778,47 @@ callers keep working without modification. Full validation at the milestone:
659
778
 
660
779
  See [CHANGELOG.md](CHANGELOG.md) for full details.
661
780
 
781
+ ## Integrations
782
+
783
+ AWM is a standard MCP server, so it plugs into any MCP-capable agent host with
784
+ **no adapter code** — the same server Claude Code uses. Point two hosts at the
785
+ same `AWM_DB_PATH` (with a shared `AWM_AGENT_ID`/`AWM_WORKSPACE`) and they share
786
+ one cognitive memory.
787
+
788
+ ### Hermes Agent (Nous Research)
789
+
790
+ 1. Make AWM available where Hermes runs (e.g. a derived Docker image — the
791
+ Hermes image already bundles Node):
792
+
793
+ ```dockerfile
794
+ FROM hermes-agent:local
795
+ USER root
796
+ RUN npm install -g agent-working-memory@latest
797
+ ENV HF_HOME=/opt/data/.cache/huggingface
798
+ ```
799
+
800
+ 2. Register it in `~/.hermes/config.yaml`:
801
+
802
+ ```yaml
803
+ mcp_servers:
804
+ awm:
805
+ command: node
806
+ args: ["/usr/local/lib/node_modules/agent-working-memory/dist/mcp.js"]
807
+ env:
808
+ AWM_AGENT_ID: hermes
809
+ AWM_DB_PATH: /opt/data/awm/hermes.db # on a persistent volume
810
+ HF_HOME: /opt/data/.cache/huggingface
811
+ timeout: 600 # first call downloads the embedder
812
+ ```
813
+
814
+ 3. AWM's tools appear to the agent as `mcp_awm_memory_write`,
815
+ `mcp_awm_memory_recall`, etc. Works with any Hermes model provider
816
+ (verified on Anthropic and Azure `gpt-5-4-mini`).
817
+
818
+ Full recipe — model-provider examples, the Azure GPT-5.x `/openai/v1` note, and
819
+ gotchas (incl. the Windows CRLF/s6 clone fix) — is in
820
+ [docs/integrations/hermes.md](docs/integrations/hermes.md).
821
+
662
822
  ## Project Status
663
823
 
664
824
  AWM is in active development (v0.8.5). The core memory pipeline, consolidation
@@ -667,6 +827,7 @@ daily in production coding workflows.
667
827
 
668
828
  - Core retrieval and consolidation: **stable**
669
829
  - MCP tools and Claude Code integration: **stable**
830
+ - Other MCP hosts (e.g. [Hermes Agent](docs/integrations/hermes.md)): **supported** — AWM drops in as an MCP memory server with no adapter code
670
831
  - Multi-agent coordination: **stable** (v0.8.1 hardening)
671
832
  - Task management: **stable**
672
833
  - Hook sidecar and auto-checkpoint: **stable**
@@ -694,7 +694,7 @@ export function registerRoutes(app, deps) {
694
694
  const base = {
695
695
  status: 'ok',
696
696
  timestamp: new Date().toISOString(),
697
- version: '0.8.7',
697
+ version: '0.8.8',
698
698
  coordination: coordEnabled,
699
699
  };
700
700
  if (coordEnabled && typeof deps.store.getDb === 'function') {
@@ -72,17 +72,17 @@ export async function migrate(opts) {
72
72
  const embedding = r.embedding
73
73
  ? vectorLiteral(Array.from(bufferToFloat32Array(r.embedding)))
74
74
  : null;
75
- await dst.query(`INSERT INTO engrams (
76
- id, agent_id, concept, content, embedding, embedding_model,
77
- confidence, salience, access_count, last_accessed, created_at,
78
- salience_features, reason_codes, stage, ttl,
79
- retracted, retracted_by, retracted_at, tags, memory_type,
80
- memory_class, superseded_by, supersedes, episode_id,
81
- task_status, task_priority, blocked_by, sequence, references_json
82
- ) VALUES (
83
- $1, $2, $3, $4, $5::vector, $6, $7, $8, $9, $10, $11,
84
- $12, $13, $14, $15, $16, $17, $18, $19, $20,
85
- $21, $22, $23, $24, $25, $26, $27, $28, $29
75
+ await dst.query(`INSERT INTO engrams (
76
+ id, agent_id, concept, content, embedding, embedding_model,
77
+ confidence, salience, access_count, last_accessed, created_at,
78
+ salience_features, reason_codes, stage, ttl,
79
+ retracted, retracted_by, retracted_at, tags, memory_type,
80
+ memory_class, superseded_by, supersedes, episode_id,
81
+ task_status, task_priority, blocked_by, sequence, references_json
82
+ ) VALUES (
83
+ $1, $2, $3, $4, $5::vector, $6, $7, $8, $9, $10, $11,
84
+ $12, $13, $14, $15, $16, $17, $18, $19, $20,
85
+ $21, $22, $23, $24, $25, $26, $27, $28, $29
86
86
  )`, [
87
87
  r.id, r.agent_id, r.concept, r.content, embedding, r.embedding_model,
88
88
  r.confidence, r.salience, r.access_count, r.last_accessed, r.created_at,
@@ -112,9 +112,9 @@ export async function migrate(opts) {
112
112
  for (let i = 0; i < assocRows.length; i += batchSize) {
113
113
  const batch = assocRows.slice(i, i + batchSize);
114
114
  for (const r of batch) {
115
- await dst.query(`INSERT INTO associations (
116
- id, from_engram_id, to_engram_id, weight, confidence, type,
117
- activation_count, created_at, last_activated
115
+ await dst.query(`INSERT INTO associations (
116
+ id, from_engram_id, to_engram_id, weight, confidence, type,
117
+ activation_count, created_at, last_activated
118
118
  ) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9)`, [
119
119
  r.id, r.from_engram_id, r.to_engram_id, r.weight, r.confidence,
120
120
  r.type ?? 'hebbian', r.activation_count ?? 0,
@@ -133,7 +133,7 @@ export async function migrate(opts) {
133
133
  console.log(`agents: ${agentRows.length} rows`);
134
134
  if (dst && agentRows.length > 0) {
135
135
  for (const r of agentRows) {
136
- await dst.query(`INSERT INTO agents (id, name, created_at, config) VALUES ($1,$2,$3,$4)
136
+ await dst.query(`INSERT INTO agents (id, name, created_at, config) VALUES ($1,$2,$3,$4)
137
137
  ON CONFLICT (id) DO NOTHING`, [r.id, r.name, r.created_at, r.config ?? '{}']);
138
138
  stats.agents++;
139
139
  }
@@ -148,8 +148,8 @@ export async function migrate(opts) {
148
148
  if (dst && aeRows.length > 0) {
149
149
  for (let i = 0; i < aeRows.length; i += batchSize) {
150
150
  for (const r of aeRows.slice(i, i + batchSize)) {
151
- await dst.query(`INSERT INTO activation_events
152
- (id, agent_id, timestamp, context, results_returned, top_score, latency_ms, engram_ids)
151
+ await dst.query(`INSERT INTO activation_events
152
+ (id, agent_id, timestamp, context, results_returned, top_score, latency_ms, engram_ids)
153
153
  VALUES ($1,$2,$3,$4,$5,$6,$7,$8)`, [r.id, r.agent_id, r.timestamp, r.context, r.results_returned,
154
154
  r.top_score, r.latency_ms, r.engram_ids ?? '[]']);
155
155
  stats.activationEvents++;
@@ -165,7 +165,7 @@ export async function migrate(opts) {
165
165
  console.log(`staging_events: ${seRows.length} rows`);
166
166
  if (dst && seRows.length > 0) {
167
167
  for (const r of seRows) {
168
- await dst.query(`INSERT INTO staging_events (engram_id, agent_id, action, resonance_score, timestamp, age_ms)
168
+ await dst.query(`INSERT INTO staging_events (engram_id, agent_id, action, resonance_score, timestamp, age_ms)
169
169
  VALUES ($1,$2,$3,$4,$5,$6)`, [r.engram_id, r.agent_id, r.action, r.resonance_score, r.timestamp, r.age_ms]);
170
170
  stats.stagingEvents++;
171
171
  }
@@ -179,8 +179,8 @@ export async function migrate(opts) {
179
179
  console.log(`retrieval_feedback: ${rfRows.length} rows`);
180
180
  if (dst && rfRows.length > 0) {
181
181
  for (const r of rfRows) {
182
- await dst.query(`INSERT INTO retrieval_feedback
183
- (id, activation_event_id, engram_id, useful, context, timestamp)
182
+ await dst.query(`INSERT INTO retrieval_feedback
183
+ (id, activation_event_id, engram_id, useful, context, timestamp)
184
184
  VALUES ($1,$2,$3,$4,$5,$6)`, [r.id, r.activation_event_id, r.engram_id, intToBool(r.useful), r.context, r.timestamp]);
185
185
  stats.retrievalFeedback++;
186
186
  }
@@ -199,8 +199,8 @@ export async function migrate(opts) {
199
199
  const embedding = r.embedding
200
200
  ? vectorLiteral(Array.from(bufferToFloat32Array(r.embedding)))
201
201
  : null;
202
- await dst.query(`INSERT INTO episodes
203
- (id, agent_id, label, embedding, engram_count, start_time, end_time, created_at)
202
+ await dst.query(`INSERT INTO episodes
203
+ (id, agent_id, label, embedding, engram_count, start_time, end_time, created_at)
204
204
  VALUES ($1,$2,$3,$4::vector,$5,$6,$7,$8)`, [r.id, r.agent_id, r.label, embedding, r.engram_count ?? 0,
205
205
  r.start_time, r.end_time, r.created_at]);
206
206
  stats.episodes++;
@@ -221,13 +221,13 @@ export async function migrate(opts) {
221
221
  console.log(`conscious_state: ${csRows.length} rows`);
222
222
  if (dst && csRows.length > 0) {
223
223
  for (const r of csRows) {
224
- await dst.query(`INSERT INTO conscious_state (
225
- agent_id, last_write_id, last_recall_context, last_recall_ids,
226
- last_activity_at, write_count_since_consolidation,
227
- recall_count_since_consolidation, execution_state, checkpoint_at,
228
- last_consolidation_at, last_mini_consolidation_at,
229
- consolidation_cycle_count, updated_at
230
- ) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)
224
+ await dst.query(`INSERT INTO conscious_state (
225
+ agent_id, last_write_id, last_recall_context, last_recall_ids,
226
+ last_activity_at, write_count_since_consolidation,
227
+ recall_count_since_consolidation, execution_state, checkpoint_at,
228
+ last_consolidation_at, last_mini_consolidation_at,
229
+ consolidation_cycle_count, updated_at
230
+ ) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)
231
231
  ON CONFLICT (agent_id) DO NOTHING`, [
232
232
  r.agent_id, r.last_write_id, r.last_recall_context,
233
233
  r.last_recall_ids ?? '[]', r.last_activity_at,
package/dist/cli.js CHANGED
@@ -309,7 +309,7 @@ async function exportMemories() {
309
309
  // Collect unique agents
310
310
  const agents = [...new Set(memories.map((m) => m.agent_id))];
311
311
  const exportData = {
312
- version: '0.8.7',
312
+ version: '0.8.8',
313
313
  exported_at: new Date().toISOString(),
314
314
  source_db: dbPath,
315
315
  agent_filter: agentFilter,
@@ -14,33 +14,33 @@ const FAILURE_THRESHOLD = 5;
14
14
  const HALF_OPEN_DELAY_MS = 30_000;
15
15
  /** Record a worker failure. Opens the circuit when consecutive failures hit the threshold. */
16
16
  export function recordFailure(db, agentId) {
17
- db.prepare(`
18
- INSERT INTO coord_circuit_state (agent_id, consecutive_failures, last_transition_at)
19
- VALUES (?, 1, datetime('now'))
20
- ON CONFLICT(agent_id) DO UPDATE SET
21
- consecutive_failures = consecutive_failures + 1,
22
- state = CASE
23
- WHEN consecutive_failures + 1 >= ${FAILURE_THRESHOLD} THEN 'open'
24
- ELSE state
25
- END,
26
- opened_at = CASE
27
- WHEN consecutive_failures + 1 >= ${FAILURE_THRESHOLD} AND (state != 'open' OR opened_at IS NULL)
28
- THEN datetime('now')
29
- ELSE opened_at
30
- END,
31
- last_transition_at = datetime('now')
17
+ db.prepare(`
18
+ INSERT INTO coord_circuit_state (agent_id, consecutive_failures, last_transition_at)
19
+ VALUES (?, 1, datetime('now'))
20
+ ON CONFLICT(agent_id) DO UPDATE SET
21
+ consecutive_failures = consecutive_failures + 1,
22
+ state = CASE
23
+ WHEN consecutive_failures + 1 >= ${FAILURE_THRESHOLD} THEN 'open'
24
+ ELSE state
25
+ END,
26
+ opened_at = CASE
27
+ WHEN consecutive_failures + 1 >= ${FAILURE_THRESHOLD} AND (state != 'open' OR opened_at IS NULL)
28
+ THEN datetime('now')
29
+ ELSE opened_at
30
+ END,
31
+ last_transition_at = datetime('now')
32
32
  `).run(agentId);
33
33
  }
34
34
  /** Record a worker success. Resets to closed regardless of prior state. */
35
35
  export function recordSuccess(db, agentId) {
36
- db.prepare(`
37
- INSERT INTO coord_circuit_state (agent_id, state, consecutive_failures, last_transition_at)
38
- VALUES (?, 'closed', 0, datetime('now'))
39
- ON CONFLICT(agent_id) DO UPDATE SET
40
- state = 'closed',
41
- consecutive_failures = 0,
42
- opened_at = NULL,
43
- last_transition_at = datetime('now')
36
+ db.prepare(`
37
+ INSERT INTO coord_circuit_state (agent_id, state, consecutive_failures, last_transition_at)
38
+ VALUES (?, 'closed', 0, datetime('now'))
39
+ ON CONFLICT(agent_id) DO UPDATE SET
40
+ state = 'closed',
41
+ consecutive_failures = 0,
42
+ opened_at = NULL,
43
+ last_transition_at = datetime('now')
44
44
  `).run(agentId);
45
45
  }
46
46
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"write-pipeline.d.ts","sourceRoot":"","sources":["../../src/core/write-pipeline.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,YAAY,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvE,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,EAAE;QACV,kBAAkB,EAAE,MAAM,CAAC;QAC3B,aAAa,EAAE,MAAM,CAAC;QACtB,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC;IACF,iEAAiE;IACjE,WAAW,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,WAAW,CAAC;IACnB,gBAAgB,EAAE,gBAAgB,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,WAAW,CAAC,CA2ItB"}
@@ -36,6 +36,7 @@
36
36
  */
37
37
  import { evaluateSalience, computeNoveltyWithMatch, detectUserFeedback, } from './salience.js';
38
38
  import { embed } from './embeddings.js';
39
+ import { extractMetaTags } from './auto-tagger.js';
39
40
  import { DEFAULT_AGENT_CONFIG } from '../types/agent.js';
40
41
  /** Confidence floor below which a matched engram is treated as "decaying out". */
41
42
  export const HEALTHY_CONFIDENCE_FLOOR = 0.3;
@@ -325,6 +326,22 @@ prewriteEmbedding = null) {
325
326
  const tags = [...(input.tags ?? [])];
326
327
  if (isLowSalience && !tags.includes('low-salience'))
327
328
  tags.push('low-salience');
329
+ // Auto-tag meta-tags (default-OFF, AWM_AUTOTAG=1). extractMetaTags emits
330
+ // `entity:<ProperNoun>` and `cat:<category>` tags from concept+content. These
331
+ // are indexed in FTS5 (→ BM25 recall boost on entity/category terms) AND feed
332
+ // the Phase 3.7 entity-bridge boost, which is otherwise STARVED: that boost
333
+ // explicitly skips session/speaker/turn tags, so without `entity:` tags it has
334
+ // nothing to bridge on (inert on LoCoMo and underfed in real use). Gated +
335
+ // additive so existing callers' tags are untouched when off.
336
+ if (process.env.AWM_AUTOTAG === '1') {
337
+ const existing = new Set(tags.map(t => t.toLowerCase()));
338
+ for (const mt of extractMetaTags(input.concept, input.content)) {
339
+ if (!existing.has(mt.toLowerCase())) {
340
+ tags.push(mt);
341
+ existing.add(mt.toLowerCase());
342
+ }
343
+ }
344
+ }
328
345
  const engram = await store.createEngram({
329
346
  agentId: input.agentId,
330
347
  concept: input.concept,
@@ -1 +1 @@
1
- {"version":3,"file":"write-pipeline.js","sourceRoot":"","sources":["../../src/core/write-pipeline.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,sCAAsC;AACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKH,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,GAInB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,kFAAkF;AAClF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C,uFAAuF;AACvF,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAC/C,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAE9C,gFAAgF;AAChF,MAAM,iBAAiB,GAA2B;IAChD,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,IAAI;CAClB,CAAC;AA8DF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA6B,EAC7B,KAAiB;IAEjB,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC;IAC5C,MAAM,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,KAAK,KAAK;WAC1D,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,KAAK,CAAC;IAE9C,uEAAuE;IACvE,wCAAwC;IACxC,MAAM,OAAO,GAAG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ClE,qEAAqE;IACrE,wDAAwD;IACxD,MAAM,eAAe,GAAG,iBAAiB,IAAI,IAAI,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC;IAClF,MAAM,WAAW,GAAG,CAAC,CAAC,YAAY,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC;IAChF,IAAI,WAAW,EAAE,CAAC;QAChB,KAAK,CAAC,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;aACvC,IAAI,CAAC,KAAK,EAAC,GAAG,EAAC,EAAE;YAChB,IAAI,CAAC;gBAAC,MAAM,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,2BAA2B,CAAC,CAAC;QAC5F,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE,GAAiC,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,MAAM,GAAgB,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvE,OAAO;QACL,MAAM;QACN,MAAM;QACN,QAAQ;QACR,aAAa;QACb,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS;KACvE,CAAC;AACJ,CAAC"}
@@ -45,6 +45,34 @@ export declare class ActivationEngine {
45
45
  */
46
46
  private static readonly GRAPH_WEIGHTS;
47
47
  private graphWalk;
48
+ /**
49
+ * R2 — bounded iterative spreading activation (PPR / SYNAPSE-style).
50
+ *
51
+ * Default-OFF (`AWM_SPREAD=1`). The principled, in-AWM successor to the
52
+ * fixed depth-2 beam `graphWalk` and the MWA harness bridge: it runs T
53
+ * iterations of **fan-normalized** spreading with **lateral inhibition** and
54
+ * a **restart** term (Personalized PageRank) over the association graph —
55
+ * richest when R1's `AWM_BROAD_EDGES` entity edges are present.
56
+ *
57
+ * Two effects, both precision-guarded:
58
+ * - **Boost** existing pool candidates by the *graph evidence* they receive
59
+ * (convergent multi-path activation, not a single spurious hop).
60
+ * - **Inject** (`AWM_SPREAD_INJECT=1`) strongly-reached *out-of-pool*
61
+ * engrams as recall-only candidates so the reranker can see true
62
+ * multi-hop bridges that BM25/vector missed. Their composite carries the
63
+ * graph-activation signal (blended with rerank), which is what lets a
64
+ * vocab-mismatched bridge surface where the prior `AWM_ENTITY_FETCH`
65
+ * recall-only injection (rerank-only) could not.
66
+ *
67
+ * Precision is preserved because spreading is **seeded by the initial
68
+ * retrieval**: adversarial "is this even in memory?" queries have weak/empty
69
+ * seeds, so nothing meaningful propagates and abstention is unaffected.
70
+ * Fan-normalization stops hubs from flooding; lateral inhibition keeps only
71
+ * the top-M activated nodes per step; a node budget bounds cost; injected
72
+ * candidates stay rerank-gated and the pool-level OOD agreement gate is
73
+ * unaffected (seeds still supply the BM25/vector channels).
74
+ */
75
+ private spreadActivation;
48
76
  /**
49
77
  * Resolve validation-gated Hebbian update for a specific engram.
50
78
  * Called by memory_feedback — only strengthens when retrieval was useful.
@@ -1 +1 @@
1
- {"version":3,"file":"activation.d.ts","sourceRoot":"","sources":["../../src/engine/activation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,EAA6C,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAKtG,OAAO,KAAK,EACF,gBAAgB,EAAE,eAAe,EAC1C,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAoIvE,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,QAAQ,CAAC,cAAc,EAAE,qBAAqB,CAAC;gBAEnC,KAAK,EAAE,WAAW;IAM9B;;OAEG;IAC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