agent-working-memory 0.10.0 → 0.12.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 (136) hide show
  1. package/README.md +118 -19
  2. package/dist/adapters/claude-code.d.ts.map +1 -1
  3. package/dist/adapters/claude-code.js +63 -3
  4. package/dist/adapters/claude-code.js.map +1 -1
  5. package/dist/adapters/common.d.ts.map +1 -1
  6. package/dist/adapters/common.js +329 -302
  7. package/dist/adapters/common.js.map +1 -1
  8. package/dist/api/routes.d.ts.map +1 -1
  9. package/dist/api/routes.js +31 -8
  10. package/dist/api/routes.js.map +1 -1
  11. package/dist/cli/migrate.js +29 -29
  12. package/dist/cli.js +82 -2
  13. package/dist/cli.js.map +1 -1
  14. package/dist/coordination/circuit-breaker.js +23 -23
  15. package/dist/coordination/routes.d.ts.map +1 -1
  16. package/dist/coordination/routes.js +174 -170
  17. package/dist/coordination/routes.js.map +1 -1
  18. package/dist/core/embeddings.d.ts.map +1 -1
  19. package/dist/core/embeddings.js +3 -0
  20. package/dist/core/embeddings.js.map +1 -1
  21. package/dist/core/entity-extract.d.ts +3 -0
  22. package/dist/core/entity-extract.d.ts.map +1 -0
  23. package/dist/core/entity-extract.js +47 -0
  24. package/dist/core/entity-extract.js.map +1 -0
  25. package/dist/core/salience.d.ts.map +1 -1
  26. package/dist/core/salience.js +14 -2
  27. package/dist/core/salience.js.map +1 -1
  28. package/dist/core/whoami.d.ts +24 -0
  29. package/dist/core/whoami.d.ts.map +1 -0
  30. package/dist/core/whoami.js +66 -0
  31. package/dist/core/whoami.js.map +1 -0
  32. package/dist/core/write-pipeline.d.ts +9 -0
  33. package/dist/core/write-pipeline.d.ts.map +1 -1
  34. package/dist/core/write-pipeline.js +109 -68
  35. package/dist/core/write-pipeline.js.map +1 -1
  36. package/dist/core/write-telemetry.d.ts +33 -0
  37. package/dist/core/write-telemetry.d.ts.map +1 -0
  38. package/dist/core/write-telemetry.js +110 -0
  39. package/dist/core/write-telemetry.js.map +1 -0
  40. package/dist/engine/activation.d.ts +22 -12
  41. package/dist/engine/activation.d.ts.map +1 -1
  42. package/dist/engine/activation.js +133 -17
  43. package/dist/engine/activation.js.map +1 -1
  44. package/dist/engine/consolidation-scheduler.d.ts +1 -1
  45. package/dist/engine/consolidation-scheduler.js +1 -1
  46. package/dist/engine/consolidation.d.ts +1 -0
  47. package/dist/engine/consolidation.d.ts.map +1 -1
  48. package/dist/engine/consolidation.js +18 -0
  49. package/dist/engine/consolidation.js.map +1 -1
  50. package/dist/engine/eval.d.ts.map +1 -1
  51. package/dist/engine/eval.js +5 -1
  52. package/dist/engine/eval.js.map +1 -1
  53. package/dist/index.js +21 -2
  54. package/dist/index.js.map +1 -1
  55. package/dist/mcp.d.ts +2 -1
  56. package/dist/mcp.d.ts.map +1 -1
  57. package/dist/mcp.js +212 -97
  58. package/dist/mcp.js.map +1 -1
  59. package/dist/onboard/index.d.ts +68 -0
  60. package/dist/onboard/index.d.ts.map +1 -0
  61. package/dist/onboard/index.js +265 -0
  62. package/dist/onboard/index.js.map +1 -0
  63. package/dist/recipes/index.d.ts +57 -0
  64. package/dist/recipes/index.d.ts.map +1 -0
  65. package/dist/recipes/index.js +81 -0
  66. package/dist/recipes/index.js.map +1 -0
  67. package/dist/storage/pglite-schema.d.ts.map +1 -1
  68. package/dist/storage/pglite-schema.js +170 -143
  69. package/dist/storage/pglite-schema.js.map +1 -1
  70. package/dist/storage/pglite.d.ts +5 -0
  71. package/dist/storage/pglite.d.ts.map +1 -1
  72. package/dist/storage/pglite.js +180 -138
  73. package/dist/storage/pglite.js.map +1 -1
  74. package/dist/storage/postgres.d.ts +5 -0
  75. package/dist/storage/postgres.d.ts.map +1 -1
  76. package/dist/storage/postgres.js +44 -2
  77. package/dist/storage/postgres.js.map +1 -1
  78. package/dist/storage/sqlite.d.ts +9 -0
  79. package/dist/storage/sqlite.d.ts.map +1 -1
  80. package/dist/storage/sqlite.js +394 -326
  81. package/dist/storage/sqlite.js.map +1 -1
  82. package/dist/types/engram.d.ts +14 -0
  83. package/dist/types/engram.d.ts.map +1 -1
  84. package/dist/types/engram.js.map +1 -1
  85. package/dist/version.d.ts +2 -0
  86. package/dist/version.d.ts.map +1 -0
  87. package/dist/version.js +27 -0
  88. package/dist/version.js.map +1 -0
  89. package/package.json +9 -1
  90. package/src/adapters/claude-code.ts +66 -3
  91. package/src/adapters/common.ts +538 -511
  92. package/src/api/index.ts +3 -3
  93. package/src/api/routes.ts +999 -970
  94. package/src/cli/migrate.ts +307 -307
  95. package/src/cli.ts +77 -2
  96. package/src/coordination/circuit-breaker.ts +83 -83
  97. package/src/coordination/failure-modes.ts +50 -50
  98. package/src/coordination/routes.ts +2155 -2150
  99. package/src/core/decay.ts +63 -63
  100. package/src/core/embeddings.ts +113 -110
  101. package/src/core/entity-extract.ts +47 -0
  102. package/src/core/index.ts +5 -5
  103. package/src/core/logger.ts +36 -36
  104. package/src/core/ml-worker-entry.ts +194 -194
  105. package/src/core/ml-worker.ts +281 -281
  106. package/src/core/query-expander.ts +122 -122
  107. package/src/core/reranker.ts +119 -119
  108. package/src/core/salience.ts +529 -514
  109. package/src/core/whoami.ts +92 -0
  110. package/src/core/write-pipeline.ts +60 -8
  111. package/src/core/write-telemetry.ts +131 -0
  112. package/src/engine/activation.ts +1468 -1369
  113. package/src/engine/confidence.ts +120 -120
  114. package/src/engine/consolidation-scheduler.ts +242 -242
  115. package/src/engine/consolidation.ts +887 -869
  116. package/src/engine/eval.ts +107 -102
  117. package/src/engine/eviction.ts +101 -101
  118. package/src/engine/index.ts +8 -8
  119. package/src/engine/retraction.ts +366 -366
  120. package/src/engine/staging.ts +74 -74
  121. package/src/index.ts +248 -226
  122. package/src/mcp.ts +1341 -1211
  123. package/src/onboard/index.ts +298 -0
  124. package/src/recipes/index.ts +125 -0
  125. package/src/storage/index.ts +3 -3
  126. package/src/storage/pglite-schema.ts +193 -166
  127. package/src/storage/pglite.ts +1420 -1372
  128. package/src/storage/postgres.ts +50 -2
  129. package/src/storage/sqlite.ts +1936 -1861
  130. package/src/storage/store.ts +80 -80
  131. package/src/types/agent.ts +67 -67
  132. package/src/types/checkpoint.ts +46 -46
  133. package/src/types/engram.ts +22 -0
  134. package/src/types/eval.ts +100 -100
  135. package/src/types/index.ts +6 -6
  136. package/src/version.ts +26 -0
@@ -1,102 +1,107 @@
1
- // Copyright 2026 Robert Winter / Complete Ideas
2
- // SPDX-License-Identifier: Apache-2.0
3
- /**
4
- * Evaluation Engine — measures whether memory actually helps.
5
- *
6
- * Four dimensions (from Codex):
7
- * 1. Retrieval quality — precision@k, latency
8
- * 2. Connection quality — edge utility, stability
9
- * 3. Staging accuracy — promotion precision, discard regret
10
- * 4. Memory health — contamination tracking, confidence distribution
11
- *
12
- * Task impact (with/without memory) is measured externally via TaskTrial records.
13
- */
14
-
15
- import type { IEngramStore as EngramStore } from '../storage/store.js';
16
- import type { EvalMetrics } from '../types/index.js';
17
-
18
- export class EvalEngine {
19
- private store: EngramStore;
20
-
21
- constructor(store: EngramStore) {
22
- this.store = store;
23
- }
24
-
25
- /**
26
- * Compute aggregate metrics for an agent over a time window.
27
- */
28
- async computeMetrics(agentId: string, windowHours: number = 24): Promise<EvalMetrics> {
29
- const window = windowHours <= 24 ? '24h' : `${Math.round(windowHours / 24)}d`;
30
-
31
- // Retrieval quality
32
- const precision = await this.store.getRetrievalPrecision(agentId, windowHours);
33
-
34
- // Staging accuracy
35
- const stagingMetrics = await this.store.getStagingMetrics(agentId);
36
- const totalStaged = stagingMetrics.promoted + stagingMetrics.discarded + stagingMetrics.expired;
37
- const promotionPrecision = totalStaged > 0 ? stagingMetrics.promoted / totalStaged : 0;
38
-
39
- // Memory health
40
- const activeEngrams = await this.store.getEngramsByAgent(agentId, 'active');
41
- const stagingEngrams = await this.store.getEngramsByAgent(agentId, 'staging');
42
- const retractedEngrams = (await this.store.getEngramsByAgent(agentId, undefined, true))
43
- .filter(e => e.retracted);
44
- const allAssociations = await this.store.getAllAssociations(agentId);
45
-
46
- const avgConfidence = activeEngrams.length > 0
47
- ? activeEngrams.reduce((sum, e) => sum + e.confidence, 0) / activeEngrams.length
48
- : 0;
49
-
50
- // Edge utility — % of edges that have been used in activation
51
- const usedEdges = allAssociations.filter(a => a.activationCount > 0);
52
- const edgeUtility = allAssociations.length > 0
53
- ? usedEdges.length / allAssociations.length
54
- : 0;
55
-
56
- // Edge survival — average age of edges that are still above minimum weight
57
- const livingEdges = allAssociations.filter(a => a.weight > 0.01);
58
- const avgSurvival = livingEdges.length > 0
59
- ? livingEdges.reduce((sum, a) =>
60
- sum + (Date.now() - a.createdAt.getTime()) / (1000 * 60 * 60 * 24), 0
61
- ) / livingEdges.length
62
- : 0;
63
-
64
- // Activation performance stats
65
- const activationStats = await this.store.getActivationStats(agentId, windowHours);
66
-
67
- // Consolidated count
68
- const consolidatedCount = await this.store.getConsolidatedCount(agentId);
69
-
70
- return {
71
- agentId,
72
- timestamp: new Date(),
73
- window,
74
-
75
- activationCount: activationStats.count,
76
- avgPrecisionAtK: precision,
77
- avgLatencyMs: activationStats.avgLatencyMs,
78
- p95LatencyMs: activationStats.p95LatencyMs,
79
-
80
- totalEdges: allAssociations.length,
81
- edgesUsedInActivation: usedEdges.length,
82
- edgeUtilityRate: edgeUtility,
83
- avgEdgeSurvivalDays: avgSurvival,
84
-
85
- totalStaged: totalStaged,
86
- promotedCount: stagingMetrics.promoted,
87
- discardedCount: stagingMetrics.discarded,
88
- promotionPrecision,
89
- discardRegret: 0, // Requires tracking discarded-then-rediscovered items
90
-
91
- activeEngramCount: activeEngrams.length,
92
- stagingEngramCount: stagingEngrams.length,
93
- retractedCount: retractedEngrams.length,
94
- consolidatedCount,
95
- avgConfidence,
96
-
97
- staleUsageCount: 0, // Requires per-activation age/confidence tracking
98
- retractionRate: retractedEngrams.length /
99
- Math.max(activeEngrams.length + retractedEngrams.length, 1),
100
- };
101
- }
102
- }
1
+ // Copyright 2026 Robert Winter / Complete Ideas
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ /**
4
+ * Evaluation Engine — measures whether memory actually helps.
5
+ *
6
+ * Four dimensions (from Codex):
7
+ * 1. Retrieval quality — precision@k, latency
8
+ * 2. Connection quality — edge utility, stability
9
+ * 3. Staging accuracy — promotion precision, discard regret
10
+ * 4. Memory health — contamination tracking, confidence distribution
11
+ *
12
+ * Task impact (with/without memory) is measured externally via TaskTrial records.
13
+ */
14
+
15
+ import type { IEngramStore as EngramStore } from '../storage/store.js';
16
+ import type { EvalMetrics } from '../types/index.js';
17
+
18
+ export class EvalEngine {
19
+ private store: EngramStore;
20
+
21
+ constructor(store: EngramStore) {
22
+ this.store = store;
23
+ }
24
+
25
+ /**
26
+ * Compute aggregate metrics for an agent over a time window.
27
+ */
28
+ async computeMetrics(agentId: string, windowHours: number = 24): Promise<EvalMetrics> {
29
+ const window = windowHours <= 24 ? '24h' : `${Math.round(windowHours / 24)}d`;
30
+
31
+ // Retrieval quality
32
+ const precision = await this.store.getRetrievalPrecision(agentId, windowHours);
33
+
34
+ // Staging accuracy
35
+ const stagingMetrics = await this.store.getStagingMetrics(agentId);
36
+ const totalStaged = stagingMetrics.promoted + stagingMetrics.discarded + stagingMetrics.expired;
37
+ const promotionPrecision = totalStaged > 0 ? stagingMetrics.promoted / totalStaged : 0;
38
+
39
+ // Memory health
40
+ const activeEngrams = await this.store.getEngramsByAgent(agentId, 'active');
41
+ const stagingEngrams = await this.store.getEngramsByAgent(agentId, 'staging');
42
+ const retractedEngrams = (await this.store.getEngramsByAgent(agentId, undefined, true))
43
+ .filter(e => e.retracted);
44
+ const allAssociations = await this.store.getAllAssociations(agentId);
45
+
46
+ const avgConfidence = activeEngrams.length > 0
47
+ ? activeEngrams.reduce((sum, e) => sum + e.confidence, 0) / activeEngrams.length
48
+ : 0;
49
+
50
+ // Edge utility — % of edges that have been used in activation
51
+ const usedEdges = allAssociations.filter(a => a.activationCount > 0);
52
+ const edgeUtility = allAssociations.length > 0
53
+ ? usedEdges.length / allAssociations.length
54
+ : 0;
55
+
56
+ // Edge survival — average age of edges that are still above minimum weight
57
+ const livingEdges = allAssociations.filter(a => a.weight > 0.01);
58
+ const avgSurvival = livingEdges.length > 0
59
+ ? livingEdges.reduce((sum, a) =>
60
+ sum + (Date.now() - a.createdAt.getTime()) / (1000 * 60 * 60 * 24), 0
61
+ ) / livingEdges.length
62
+ : 0;
63
+
64
+ // Activation performance stats
65
+ const activationStats = await this.store.getActivationStats(agentId, windowHours);
66
+
67
+ // Consolidated count
68
+ const consolidatedCount = await this.store.getConsolidatedCount(agentId);
69
+
70
+ return {
71
+ agentId,
72
+ timestamp: new Date(),
73
+ window,
74
+
75
+ activationCount: activationStats.count,
76
+ avgPrecisionAtK: precision,
77
+ avgLatencyMs: activationStats.avgLatencyMs,
78
+ p95LatencyMs: activationStats.p95LatencyMs,
79
+
80
+ totalEdges: allAssociations.length,
81
+ edgesUsedInActivation: usedEdges.length,
82
+ edgeUtilityRate: edgeUtility,
83
+ avgEdgeSurvivalDays: avgSurvival,
84
+
85
+ totalStaged: totalStaged,
86
+ promotedCount: stagingMetrics.promoted,
87
+ discardedCount: stagingMetrics.discarded,
88
+ promotionPrecision,
89
+ // D12 (2026-07-30): discarded writes persist as 'low-salience'-tagged
90
+ // engrams (confidence 0.25). Regret = the filter demoted something the
91
+ // agent later actually needed — measured as low-salience engrams that
92
+ // were subsequently accessed at least once.
93
+ discardRegret: activeEngrams.filter(e =>
94
+ e.tags.includes('low-salience') && e.accessCount > 0).length,
95
+
96
+ activeEngramCount: activeEngrams.length,
97
+ stagingEngramCount: stagingEngrams.length,
98
+ retractedCount: retractedEngrams.length,
99
+ consolidatedCount,
100
+ avgConfidence,
101
+
102
+ staleUsageCount: 0, // Requires per-activation age/confidence tracking
103
+ retractionRate: retractedEngrams.length /
104
+ Math.max(activeEngrams.length + retractedEngrams.length, 1),
105
+ };
106
+ }
107
+ }
@@ -1,101 +1,101 @@
1
- // Copyright 2026 Robert Winter / Complete Ideas
2
- // SPDX-License-Identifier: Apache-2.0
3
- /**
4
- * Eviction Engine — capacity enforcement and edge pruning.
5
- *
6
- * When memory budgets are exceeded:
7
- * 1. Archive lowest-value active engrams
8
- * 2. Delete expired staging engrams
9
- * 3. Prune weakest edges when per-engram cap exceeded
10
- * 4. Decay unused association weights over time
11
- */
12
-
13
- import type { IEngramStore as EngramStore } from '../storage/store.js';
14
- import type { AgentConfig } from '../types/agent.js';
15
- import { decayAssociation } from '../core/hebbian.js';
16
-
17
- export class EvictionEngine {
18
- private store: EngramStore;
19
-
20
- constructor(store: EngramStore) {
21
- this.store = store;
22
- }
23
-
24
- /**
25
- * Check capacity budgets and evict if needed.
26
- * Returns count of evicted engrams.
27
- */
28
- async enforceCapacity(agentId: string, config: AgentConfig): Promise<{ evicted: number; edgesPruned: number }> {
29
- let evicted = 0;
30
- let edgesPruned = 0;
31
-
32
- // Active engram budget
33
- const activeCount = await this.store.getActiveCount(agentId);
34
- if (activeCount > config.maxActiveEngrams) {
35
- const excess = activeCount - config.maxActiveEngrams;
36
- const candidates = await this.store.getEvictionCandidates(agentId, excess);
37
- for (const engram of candidates) {
38
- await this.store.updateStage(engram.id, 'archived');
39
- evicted++;
40
- }
41
- }
42
-
43
- // Staging budget
44
- const stagingCount = await this.store.getStagingCount(agentId);
45
- if (stagingCount > config.maxStagingEngrams) {
46
- const expired = await this.store.getExpiredStaging();
47
- for (const engram of expired) {
48
- await this.store.deleteEngram(engram.id);
49
- evicted++;
50
- }
51
- }
52
-
53
- // Edge pruning — cap per engram
54
- const engrams = await this.store.getEngramsByAgent(agentId, 'active');
55
- for (const engram of engrams) {
56
- const edgeCount = await this.store.countAssociationsFor(engram.id);
57
- if (edgeCount > config.maxEdgesPerEngram) {
58
- // Remove weakest edges until under cap
59
- let toRemove = edgeCount - config.maxEdgesPerEngram;
60
- while (toRemove > 0) {
61
- const weakest = await this.store.getWeakestAssociation(engram.id);
62
- if (weakest) {
63
- await this.store.deleteAssociation(weakest.id);
64
- edgesPruned++;
65
- }
66
- toRemove--;
67
- }
68
- }
69
- }
70
-
71
- return { evicted, edgesPruned };
72
- }
73
-
74
- /**
75
- * Decay all association weights based on time since last activation.
76
- * Run periodically (e.g., daily).
77
- */
78
- async decayEdges(agentId: string, halfLifeDays: number = 7): Promise<number> {
79
- const associations = await this.store.getAllAssociations(agentId);
80
- let decayed = 0;
81
-
82
- for (const assoc of associations) {
83
- const daysSince = (Date.now() - assoc.lastActivated.getTime()) / (1000 * 60 * 60 * 24);
84
- if (daysSince < 0.5) continue; // Skip recently activated
85
-
86
- const newWeight = decayAssociation(assoc.weight, daysSince, halfLifeDays);
87
- if (newWeight < 0.01) {
88
- // Below minimum useful weight — prune
89
- await this.store.deleteAssociation(assoc.id);
90
- decayed++;
91
- } else if (Math.abs(newWeight - assoc.weight) > 0.001) {
92
- await this.store.upsertAssociation(
93
- assoc.fromEngramId, assoc.toEngramId, newWeight, assoc.type, assoc.confidence
94
- );
95
- decayed++;
96
- }
97
- }
98
-
99
- return decayed;
100
- }
101
- }
1
+ // Copyright 2026 Robert Winter / Complete Ideas
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ /**
4
+ * Eviction Engine — capacity enforcement and edge pruning.
5
+ *
6
+ * When memory budgets are exceeded:
7
+ * 1. Archive lowest-value active engrams
8
+ * 2. Delete expired staging engrams
9
+ * 3. Prune weakest edges when per-engram cap exceeded
10
+ * 4. Decay unused association weights over time
11
+ */
12
+
13
+ import type { IEngramStore as EngramStore } from '../storage/store.js';
14
+ import type { AgentConfig } from '../types/agent.js';
15
+ import { decayAssociation } from '../core/hebbian.js';
16
+
17
+ export class EvictionEngine {
18
+ private store: EngramStore;
19
+
20
+ constructor(store: EngramStore) {
21
+ this.store = store;
22
+ }
23
+
24
+ /**
25
+ * Check capacity budgets and evict if needed.
26
+ * Returns count of evicted engrams.
27
+ */
28
+ async enforceCapacity(agentId: string, config: AgentConfig): Promise<{ evicted: number; edgesPruned: number }> {
29
+ let evicted = 0;
30
+ let edgesPruned = 0;
31
+
32
+ // Active engram budget
33
+ const activeCount = await this.store.getActiveCount(agentId);
34
+ if (activeCount > config.maxActiveEngrams) {
35
+ const excess = activeCount - config.maxActiveEngrams;
36
+ const candidates = await this.store.getEvictionCandidates(agentId, excess);
37
+ for (const engram of candidates) {
38
+ await this.store.updateStage(engram.id, 'archived');
39
+ evicted++;
40
+ }
41
+ }
42
+
43
+ // Staging budget
44
+ const stagingCount = await this.store.getStagingCount(agentId);
45
+ if (stagingCount > config.maxStagingEngrams) {
46
+ const expired = await this.store.getExpiredStaging();
47
+ for (const engram of expired) {
48
+ await this.store.deleteEngram(engram.id);
49
+ evicted++;
50
+ }
51
+ }
52
+
53
+ // Edge pruning — cap per engram
54
+ const engrams = await this.store.getEngramsByAgent(agentId, 'active');
55
+ for (const engram of engrams) {
56
+ const edgeCount = await this.store.countAssociationsFor(engram.id);
57
+ if (edgeCount > config.maxEdgesPerEngram) {
58
+ // Remove weakest edges until under cap
59
+ let toRemove = edgeCount - config.maxEdgesPerEngram;
60
+ while (toRemove > 0) {
61
+ const weakest = await this.store.getWeakestAssociation(engram.id);
62
+ if (weakest) {
63
+ await this.store.deleteAssociation(weakest.id);
64
+ edgesPruned++;
65
+ }
66
+ toRemove--;
67
+ }
68
+ }
69
+ }
70
+
71
+ return { evicted, edgesPruned };
72
+ }
73
+
74
+ /**
75
+ * Decay all association weights based on time since last activation.
76
+ * Run periodically (e.g., daily).
77
+ */
78
+ async decayEdges(agentId: string, halfLifeDays: number = 7): Promise<number> {
79
+ const associations = await this.store.getAllAssociations(agentId);
80
+ let decayed = 0;
81
+
82
+ for (const assoc of associations) {
83
+ const daysSince = (Date.now() - assoc.lastActivated.getTime()) / (1000 * 60 * 60 * 24);
84
+ if (daysSince < 0.5) continue; // Skip recently activated
85
+
86
+ const newWeight = decayAssociation(assoc.weight, daysSince, halfLifeDays);
87
+ if (newWeight < 0.01) {
88
+ // Below minimum useful weight — prune
89
+ await this.store.deleteAssociation(assoc.id);
90
+ decayed++;
91
+ } else if (Math.abs(newWeight - assoc.weight) > 0.001) {
92
+ await this.store.upsertAssociation(
93
+ assoc.fromEngramId, assoc.toEngramId, newWeight, assoc.type, assoc.confidence
94
+ );
95
+ decayed++;
96
+ }
97
+ }
98
+
99
+ return decayed;
100
+ }
101
+ }
@@ -1,8 +1,8 @@
1
- // Copyright 2026 Robert Winter / Complete Ideas
2
- // SPDX-License-Identifier: Apache-2.0
3
- export * from './activation.js';
4
- export * from './staging.js';
5
- export * from './connections.js';
6
- export * from './eviction.js';
7
- export * from './retraction.js';
8
- export * from './eval.js';
1
+ // Copyright 2026 Robert Winter / Complete Ideas
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export * from './activation.js';
4
+ export * from './staging.js';
5
+ export * from './connections.js';
6
+ export * from './eviction.js';
7
+ export * from './retraction.js';
8
+ export * from './eval.js';