@monoes/memory 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -840
- package/dist/atomic-file.d.ts +17 -0
- package/dist/atomic-file.d.ts.map +1 -0
- package/dist/atomic-file.js +27 -0
- package/dist/atomic-file.js.map +1 -0
- package/dist/cache-manager.d.ts +0 -0
- package/dist/cache-manager.d.ts.map +1 -1
- package/dist/cache-manager.js +0 -0
- package/dist/cache-manager.js.map +1 -1
- package/dist/checkpointer.d.ts +13 -0
- package/dist/checkpointer.d.ts.map +1 -1
- package/dist/checkpointer.js +69 -6
- package/dist/checkpointer.js.map +1 -1
- package/dist/controller-registry.d.ts +2 -8
- package/dist/controller-registry.d.ts.map +1 -1
- package/dist/controller-registry.js +4 -49
- package/dist/controller-registry.js.map +1 -1
- package/dist/database-provider.d.ts +0 -0
- package/dist/database-provider.d.ts.map +0 -0
- package/dist/database-provider.js +0 -0
- package/dist/database-provider.js.map +1 -1
- package/dist/hnsw-index.d.ts +0 -0
- package/dist/hnsw-index.d.ts.map +1 -1
- package/dist/hnsw-index.js +0 -0
- package/dist/hnsw-index.js.map +1 -1
- package/dist/index.d.ts +0 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -19
- package/dist/index.js.map +1 -1
- package/dist/knowledge/document-chunker.d.ts +0 -0
- package/dist/knowledge/document-chunker.d.ts.map +0 -0
- package/dist/knowledge/document-chunker.js +0 -0
- package/dist/knowledge/document-chunker.js.map +1 -1
- package/dist/knowledge/index.d.ts +0 -0
- package/dist/knowledge/index.d.ts.map +0 -0
- package/dist/knowledge/index.js +0 -0
- package/dist/knowledge/index.js.map +0 -0
- package/dist/knowledge/knowledge-retriever.d.ts +0 -0
- package/dist/knowledge/knowledge-retriever.d.ts.map +1 -1
- package/dist/knowledge/knowledge-retriever.js +0 -0
- package/dist/knowledge/knowledge-retriever.js.map +1 -1
- package/dist/knowledge/knowledge-store.d.ts +0 -0
- package/dist/knowledge/knowledge-store.d.ts.map +1 -1
- package/dist/knowledge/knowledge-store.js +0 -0
- package/dist/knowledge/knowledge-store.js.map +0 -0
- package/dist/lancedb-backend.d.ts +5 -0
- package/dist/lancedb-backend.d.ts.map +1 -1
- package/dist/lancedb-backend.js +70 -12
- package/dist/lancedb-backend.js.map +1 -1
- package/dist/math-utils.d.ts +0 -0
- package/dist/math-utils.d.ts.map +0 -0
- package/dist/math-utils.js +0 -0
- package/dist/math-utils.js.map +0 -0
- package/dist/migration.d.ts +1 -0
- package/dist/migration.d.ts.map +1 -1
- package/dist/migration.js +50 -21
- package/dist/migration.js.map +1 -1
- package/dist/prompt-version-store.d.ts +0 -0
- package/dist/prompt-version-store.d.ts.map +1 -1
- package/dist/prompt-version-store.js +0 -0
- package/dist/prompt-version-store.js.map +0 -0
- package/dist/query-builder.d.ts +0 -0
- package/dist/query-builder.d.ts.map +1 -1
- package/dist/query-builder.js +0 -0
- package/dist/query-builder.js.map +1 -1
- package/dist/sqlite-backend.d.ts +0 -0
- package/dist/sqlite-backend.d.ts.map +1 -1
- package/dist/sqlite-backend.js +38 -9
- package/dist/sqlite-backend.js.map +1 -1
- package/dist/sqljs-backend.d.ts +1 -0
- package/dist/sqljs-backend.d.ts.map +1 -1
- package/dist/sqljs-backend.js +64 -13
- package/dist/sqljs-backend.js.map +1 -1
- package/dist/types/checkpoint.d.ts +0 -0
- package/dist/types/checkpoint.d.ts.map +0 -0
- package/dist/types/checkpoint.js +0 -0
- package/dist/types/checkpoint.js.map +0 -0
- package/dist/types.d.ts +1 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -0
- package/dist/types.js.map +1 -1
- package/package.json +12 -13
- package/dist/agent-memory-scope.d.ts +0 -131
- package/dist/agent-memory-scope.d.ts.map +0 -1
- package/dist/agent-memory-scope.js +0 -230
- package/dist/agent-memory-scope.js.map +0 -1
- package/dist/auto-memory-bridge.d.ts +0 -230
- package/dist/auto-memory-bridge.d.ts.map +0 -1
- package/dist/auto-memory-bridge.js +0 -736
- package/dist/auto-memory-bridge.js.map +0 -1
- package/dist/diskann-backend.d.ts +0 -126
- package/dist/diskann-backend.d.ts.map +0 -1
- package/dist/diskann-backend.js +0 -336
- package/dist/diskann-backend.js.map +0 -1
- package/dist/episodic-store.d.ts +0 -58
- package/dist/episodic-store.d.ts.map +0 -1
- package/dist/episodic-store.js +0 -160
- package/dist/episodic-store.js.map +0 -1
- package/dist/learning-bridge.d.ts +0 -180
- package/dist/learning-bridge.d.ts.map +0 -1
- package/dist/learning-bridge.js +0 -566
- package/dist/learning-bridge.js.map +0 -1
- package/dist/memory-graph.d.ts +0 -125
- package/dist/memory-graph.d.ts.map +0 -1
- package/dist/memory-graph.js +0 -429
- package/dist/memory-graph.js.map +0 -1
- package/dist/partitioned-hnsw.d.ts +0 -65
- package/dist/partitioned-hnsw.d.ts.map +0 -1
- package/dist/partitioned-hnsw.js +0 -209
- package/dist/partitioned-hnsw.js.map +0 -1
- package/dist/procedural/action-record.d.ts +0 -19
- package/dist/procedural/action-record.d.ts.map +0 -1
- package/dist/procedural/action-record.js +0 -51
- package/dist/procedural/action-record.js.map +0 -1
- package/dist/procedural/action-sequence-extractor.d.ts +0 -25
- package/dist/procedural/action-sequence-extractor.d.ts.map +0 -1
- package/dist/procedural/action-sequence-extractor.js +0 -91
- package/dist/procedural/action-sequence-extractor.js.map +0 -1
- package/dist/procedural/index.d.ts +0 -14
- package/dist/procedural/index.d.ts.map +0 -1
- package/dist/procedural/index.js +0 -13
- package/dist/procedural/index.js.map +0 -1
- package/dist/procedural/learned-skill.d.ts +0 -17
- package/dist/procedural/learned-skill.d.ts.map +0 -1
- package/dist/procedural/learned-skill.js +0 -73
- package/dist/procedural/learned-skill.js.map +0 -1
- package/dist/procedural/skill-registry.d.ts +0 -25
- package/dist/procedural/skill-registry.d.ts.map +0 -1
- package/dist/procedural/skill-registry.js +0 -56
- package/dist/procedural/skill-registry.js.map +0 -1
- package/dist/procedural/types.d.ts +0 -67
- package/dist/procedural/types.d.ts.map +0 -1
- package/dist/procedural/types.js +0 -15
- package/dist/procedural/types.js.map +0 -1
- package/dist/tier-manager.d.ts +0 -79
- package/dist/tier-manager.d.ts.map +0 -1
- package/dist/tier-manager.js +0 -173
- package/dist/tier-manager.js.map +0 -1
- package/dist/tiers/contextual.d.ts +0 -45
- package/dist/tiers/contextual.d.ts.map +0 -1
- package/dist/tiers/contextual.js +0 -109
- package/dist/tiers/contextual.js.map +0 -1
- package/dist/tiers/entity.d.ts +0 -46
- package/dist/tiers/entity.d.ts.map +0 -1
- package/dist/tiers/entity.js +0 -106
- package/dist/tiers/entity.js.map +0 -1
- package/dist/tiers/index.d.ts +0 -4
- package/dist/tiers/index.d.ts.map +0 -1
- package/dist/tiers/index.js +0 -4
- package/dist/tiers/index.js.map +0 -1
- package/dist/tiers/short-term.d.ts +0 -42
- package/dist/tiers/short-term.d.ts.map +0 -1
- package/dist/tiers/short-term.js +0 -90
- package/dist/tiers/short-term.js.map +0 -1
package/dist/learning-bridge.js
DELETED
|
@@ -1,566 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LearningBridge - Connects AutoMemoryBridge to NeuralLearningSystem
|
|
3
|
-
*
|
|
4
|
-
* When insights are recorded via AutoMemoryBridge, this module triggers
|
|
5
|
-
* neural learning trajectories so the system continuously improves from
|
|
6
|
-
* its own discoveries. The NeuralLearningSystem dependency is optional:
|
|
7
|
-
* when unavailable, all operations degrade gracefully to no-ops.
|
|
8
|
-
*
|
|
9
|
-
* @module @monomind/memory/learning-bridge
|
|
10
|
-
*/
|
|
11
|
-
import { EventEmitter } from 'node:events';
|
|
12
|
-
// ===== Constants =====
|
|
13
|
-
// SONA's transformer hidden dim — must match @monomind/neural SONA_HIDDEN_DIM.
|
|
14
|
-
const SONA_HIDDEN_DIM = 768;
|
|
15
|
-
const DEFAULT_CONFIG = {
|
|
16
|
-
sonaMode: 'balanced',
|
|
17
|
-
confidenceDecayRate: 0.005,
|
|
18
|
-
accessBoostAmount: 0.03,
|
|
19
|
-
maxConfidence: 1.0,
|
|
20
|
-
minConfidence: 0.1,
|
|
21
|
-
ewcLambda: 2000,
|
|
22
|
-
consolidationThreshold: 5,
|
|
23
|
-
enabled: true,
|
|
24
|
-
};
|
|
25
|
-
const MS_PER_HOUR = 3_600_000;
|
|
26
|
-
// ===== LearningBridge =====
|
|
27
|
-
/**
|
|
28
|
-
* Connects AutoMemoryBridge insights to the NeuralLearningSystem.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```typescript
|
|
32
|
-
* const bridge = new LearningBridge(memoryBackend);
|
|
33
|
-
* await bridge.onInsightRecorded(insight, entryId);
|
|
34
|
-
* await bridge.onInsightAccessed(entryId);
|
|
35
|
-
* const result = await bridge.consolidate();
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export class LearningBridge extends EventEmitter {
|
|
39
|
-
neural = null;
|
|
40
|
-
backend;
|
|
41
|
-
config;
|
|
42
|
-
activeTrajectories = new Map();
|
|
43
|
-
/**
|
|
44
|
-
* Parallel map of entryId → the insight confidence captured at record time.
|
|
45
|
-
* Used as the authoritative reward/quality in consolidate() so the LoRA update
|
|
46
|
-
* reflects the real task outcome rather than a hardcoded default. Kept separate
|
|
47
|
-
* from activeTrajectories (which stays string→string) to avoid touching every
|
|
48
|
-
* read site of that map.
|
|
49
|
-
*/
|
|
50
|
-
trajectoryConfidence = new Map();
|
|
51
|
-
stats = {
|
|
52
|
-
totalTrajectories: 0,
|
|
53
|
-
completedTrajectories: 0,
|
|
54
|
-
totalConsolidations: 0,
|
|
55
|
-
totalDecays: 0,
|
|
56
|
-
confidenceBoosts: 0,
|
|
57
|
-
totalBoostAmount: 0,
|
|
58
|
-
};
|
|
59
|
-
destroyed = false;
|
|
60
|
-
neuralInitPromise = null;
|
|
61
|
-
backfillInProgress = false;
|
|
62
|
-
_detectedEmbeddingDim = null;
|
|
63
|
-
constructor(backend, config) {
|
|
64
|
-
super();
|
|
65
|
-
this.backend = backend;
|
|
66
|
-
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
67
|
-
}
|
|
68
|
-
// ===== Public API =====
|
|
69
|
-
/**
|
|
70
|
-
* Notify the bridge that an insight has been recorded in memory backend.
|
|
71
|
-
* Creates a learning trajectory so the neural system can track the
|
|
72
|
-
* insight's lifecycle.
|
|
73
|
-
*/
|
|
74
|
-
async onInsightRecorded(insight, entryId) {
|
|
75
|
-
if (!this.config.enabled || this.destroyed)
|
|
76
|
-
return;
|
|
77
|
-
await this.initNeural();
|
|
78
|
-
if (this.neural) {
|
|
79
|
-
try {
|
|
80
|
-
const trajectoryId = this.neural.beginTask(insight.summary, 'general');
|
|
81
|
-
this.activeTrajectories.set(entryId, trajectoryId);
|
|
82
|
-
// Capture the real outcome confidence now, while we have it, so consolidate()
|
|
83
|
-
// can use it as the reward instead of defaulting to 1.0 (a failed task must
|
|
84
|
-
// produce a low reward, a succeeded one a high reward).
|
|
85
|
-
if (Number.isFinite(insight.confidence) && insight.confidence >= 0 && insight.confidence <= 1) {
|
|
86
|
-
this.trajectoryConfidence.set(entryId, insight.confidence);
|
|
87
|
-
}
|
|
88
|
-
this.stats.totalTrajectories++;
|
|
89
|
-
// V1: use real embeddings from the memory bridge rather than hash noise
|
|
90
|
-
const dim = await this.getEmbeddingDim();
|
|
91
|
-
const embedding = await this.createEmbedding(insight.summary, dim);
|
|
92
|
-
this.neural.recordStep(trajectoryId, {
|
|
93
|
-
action: `record:${insight.category}`,
|
|
94
|
-
reward: insight.confidence,
|
|
95
|
-
stateEmbedding: embedding,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
catch {
|
|
99
|
-
// Neural system failure is non-fatal
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
this.emit('insight:learning-started', { entryId, category: insight.category });
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Notify the bridge that an insight entry was accessed.
|
|
106
|
-
* Boosts confidence in the backend and records a step in the
|
|
107
|
-
* trajectory if one exists.
|
|
108
|
-
*/
|
|
109
|
-
async onInsightAccessed(entryId) {
|
|
110
|
-
if (!this.config.enabled || this.destroyed)
|
|
111
|
-
return;
|
|
112
|
-
const entry = await this.backend.get(entryId);
|
|
113
|
-
if (!entry)
|
|
114
|
-
return;
|
|
115
|
-
const currentConf = entry.metadata?.confidence ?? 0.5;
|
|
116
|
-
const newConf = Math.min(this.config.maxConfidence, currentConf + this.config.accessBoostAmount);
|
|
117
|
-
await this.backend.update(entryId, {
|
|
118
|
-
metadata: { ...entry.metadata, confidence: newConf },
|
|
119
|
-
});
|
|
120
|
-
this.stats.confidenceBoosts++;
|
|
121
|
-
this.stats.totalBoostAmount += this.config.accessBoostAmount;
|
|
122
|
-
if (this.neural && this.activeTrajectories.has(entryId)) {
|
|
123
|
-
try {
|
|
124
|
-
const trajectoryId = this.activeTrajectories.get(entryId);
|
|
125
|
-
this.neural.recordStep(trajectoryId, {
|
|
126
|
-
action: 'access',
|
|
127
|
-
reward: this.config.accessBoostAmount,
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
catch {
|
|
131
|
-
// Non-fatal
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
this.emit('insight:accessed', { entryId, newConfidence: newConf });
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Consolidate active trajectories by completing them in the neural system.
|
|
138
|
-
* Only runs when there are enough active trajectories to justify the cost.
|
|
139
|
-
*/
|
|
140
|
-
async consolidate() {
|
|
141
|
-
const startTime = Date.now();
|
|
142
|
-
const earlyResult = {
|
|
143
|
-
trajectoriesCompleted: 0,
|
|
144
|
-
patternsLearned: 0,
|
|
145
|
-
entriesUpdated: 0,
|
|
146
|
-
durationMs: 0,
|
|
147
|
-
};
|
|
148
|
-
if (!this.config.enabled || this.destroyed) {
|
|
149
|
-
return earlyResult;
|
|
150
|
-
}
|
|
151
|
-
if (!this.neural || this.activeTrajectories.size < this.config.consolidationThreshold) {
|
|
152
|
-
earlyResult.durationMs = Date.now() - startTime;
|
|
153
|
-
return earlyResult;
|
|
154
|
-
}
|
|
155
|
-
let completed = 0;
|
|
156
|
-
let patternsLearned = 0;
|
|
157
|
-
const toRemove = [];
|
|
158
|
-
const entries = Array.from(this.activeTrajectories.entries());
|
|
159
|
-
for (const [entryId, trajectoryId] of entries) {
|
|
160
|
-
try {
|
|
161
|
-
// V3: prefer the insight confidence captured at record time — it reflects
|
|
162
|
-
// the real task outcome and does not depend on a backend entry existing for
|
|
163
|
-
// this entryId (callers like bridgeRecordFeedback pass a bare taskId that has
|
|
164
|
-
// no confidence-bearing backend row, so the V2 lookup below silently fell back
|
|
165
|
-
// to 1.0). Backend lookup is kept as a fallback for trajectories populated by
|
|
166
|
-
// other paths.
|
|
167
|
-
let quality = this.trajectoryConfidence.get(entryId);
|
|
168
|
-
if (!(Number.isFinite(quality) && quality >= 0 && quality <= 1)) {
|
|
169
|
-
// V2 fallback: use the entry's stored confidence as quality
|
|
170
|
-
quality = 1.0;
|
|
171
|
-
try {
|
|
172
|
-
const entry = await this.backend.get(entryId);
|
|
173
|
-
const stored = entry?.metadata?.confidence ?? entry?.importanceScore;
|
|
174
|
-
if (Number.isFinite(stored) && stored >= 0 && stored <= 1)
|
|
175
|
-
quality = stored;
|
|
176
|
-
}
|
|
177
|
-
catch { /* use default */ }
|
|
178
|
-
}
|
|
179
|
-
await this.neural.completeTask(trajectoryId, quality);
|
|
180
|
-
completed++;
|
|
181
|
-
patternsLearned++;
|
|
182
|
-
toRemove.push(entryId);
|
|
183
|
-
}
|
|
184
|
-
catch {
|
|
185
|
-
// Skip failed completions
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
for (const key of toRemove) {
|
|
189
|
-
this.activeTrajectories.delete(key);
|
|
190
|
-
this.trajectoryConfidence.delete(key);
|
|
191
|
-
}
|
|
192
|
-
this.stats.completedTrajectories += completed;
|
|
193
|
-
this.stats.totalConsolidations++;
|
|
194
|
-
// Pipeline A→B bridge: flush PatternLearner patterns to patterns.json so
|
|
195
|
-
// intelligence.ts (the routing path) can find patterns learned by the neural
|
|
196
|
-
// package. This closes the loop between automatic session learning and routing.
|
|
197
|
-
if (completed > 0 && this.neural && typeof this.neural.getLearnedPatterns === 'function') {
|
|
198
|
-
void this.flushNeuralPatternsToFile().catch(() => { });
|
|
199
|
-
}
|
|
200
|
-
const result = {
|
|
201
|
-
trajectoriesCompleted: completed,
|
|
202
|
-
patternsLearned,
|
|
203
|
-
entriesUpdated: completed,
|
|
204
|
-
durationMs: Date.now() - startTime,
|
|
205
|
-
};
|
|
206
|
-
this.emit('consolidation:completed', result);
|
|
207
|
-
return result;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Apply time-based confidence decay to entries in the given namespace.
|
|
211
|
-
* Entries not accessed for more than one hour see their confidence reduced
|
|
212
|
-
* proportionally to the hours elapsed, down to minConfidence.
|
|
213
|
-
*
|
|
214
|
-
* @returns number of entries whose confidence was lowered
|
|
215
|
-
*/
|
|
216
|
-
async decayConfidences(namespace) {
|
|
217
|
-
if (!this.config.enabled || this.destroyed)
|
|
218
|
-
return 0;
|
|
219
|
-
let entries;
|
|
220
|
-
try {
|
|
221
|
-
entries = await this.backend.query({
|
|
222
|
-
type: 'hybrid',
|
|
223
|
-
namespace,
|
|
224
|
-
limit: 1000,
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
catch {
|
|
228
|
-
return 0;
|
|
229
|
-
}
|
|
230
|
-
const now = Date.now();
|
|
231
|
-
let decayed = 0;
|
|
232
|
-
for (const entry of entries) {
|
|
233
|
-
const hoursSinceUpdate = (now - entry.updatedAt) / MS_PER_HOUR;
|
|
234
|
-
if (hoursSinceUpdate < 1)
|
|
235
|
-
continue;
|
|
236
|
-
const currentConf = entry.metadata?.confidence ?? 0.5;
|
|
237
|
-
// FOREVER forgetting curve: exponential decay weighted by importanceScore
|
|
238
|
-
// Source: https://arxiv.org/html/2601.03938v1
|
|
239
|
-
const importanceScore = (entry.importanceScore ?? entry.metadata?.importanceScore) ?? currentConf;
|
|
240
|
-
const newConf = Math.max(this.config.minConfidence, importanceScore * Math.exp(-this.config.confidenceDecayRate * hoursSinceUpdate));
|
|
241
|
-
if (newConf < currentConf) {
|
|
242
|
-
try {
|
|
243
|
-
await this.backend.update(entry.id, {
|
|
244
|
-
metadata: { ...entry.metadata, confidence: newConf },
|
|
245
|
-
});
|
|
246
|
-
decayed++;
|
|
247
|
-
}
|
|
248
|
-
catch {
|
|
249
|
-
// Skip failed updates
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
this.stats.totalDecays += decayed;
|
|
254
|
-
return decayed;
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Find patterns similar to the given content using the neural system.
|
|
258
|
-
* Returns an empty array when the neural system is unavailable.
|
|
259
|
-
*/
|
|
260
|
-
async findSimilarPatterns(content, k = 5) {
|
|
261
|
-
if (!this.config.enabled || this.destroyed)
|
|
262
|
-
return [];
|
|
263
|
-
await this.initNeural();
|
|
264
|
-
if (!this.neural)
|
|
265
|
-
return [];
|
|
266
|
-
try {
|
|
267
|
-
const dim = await this.getEmbeddingDim();
|
|
268
|
-
const embedding = await this.createEmbedding(content, dim);
|
|
269
|
-
const results = await this.neural.findPatterns(embedding, k);
|
|
270
|
-
if (!Array.isArray(results))
|
|
271
|
-
return [];
|
|
272
|
-
return results.map((r) => ({
|
|
273
|
-
content: r.content ?? r.data ?? '',
|
|
274
|
-
similarity: r.similarity ?? r.score ?? 0,
|
|
275
|
-
category: r.category ?? 'unknown',
|
|
276
|
-
confidence: r.confidence ?? r.reward ?? 0,
|
|
277
|
-
}));
|
|
278
|
-
}
|
|
279
|
-
catch {
|
|
280
|
-
return [];
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
/** Return aggregated learning statistics */
|
|
284
|
-
getStats() {
|
|
285
|
-
const avgBoost = this.stats.confidenceBoosts > 0
|
|
286
|
-
? this.stats.totalBoostAmount / this.stats.confidenceBoosts
|
|
287
|
-
: 0;
|
|
288
|
-
return {
|
|
289
|
-
totalTrajectories: this.stats.totalTrajectories,
|
|
290
|
-
completedTrajectories: this.stats.completedTrajectories,
|
|
291
|
-
activeTrajectories: this.activeTrajectories.size,
|
|
292
|
-
totalConsolidations: this.stats.totalConsolidations,
|
|
293
|
-
totalDecays: this.stats.totalDecays,
|
|
294
|
-
avgConfidenceBoost: avgBoost,
|
|
295
|
-
neuralAvailable: this.neural !== null,
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
/** Tear down the bridge. Subsequent method calls become no-ops. */
|
|
299
|
-
destroy() {
|
|
300
|
-
this.destroyed = true;
|
|
301
|
-
this.activeTrajectories.clear();
|
|
302
|
-
this.trajectoryConfidence.clear();
|
|
303
|
-
if (this.neural && typeof this.neural.cleanup === 'function') {
|
|
304
|
-
try {
|
|
305
|
-
this.neural.cleanup();
|
|
306
|
-
}
|
|
307
|
-
catch {
|
|
308
|
-
// Best-effort cleanup
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
this.neural = null;
|
|
312
|
-
this.neuralInitPromise = null;
|
|
313
|
-
this.removeAllListeners();
|
|
314
|
-
}
|
|
315
|
-
// ===== Private =====
|
|
316
|
-
/**
|
|
317
|
-
* Detect and cache the actual output dimension of the injected embedder.
|
|
318
|
-
* On first call, probes the embedder with a short string and stores the
|
|
319
|
-
* resulting vector length. Subsequent calls return the cached value.
|
|
320
|
-
* Falls back to 768 when no embedder is configured or the probe fails.
|
|
321
|
-
*/
|
|
322
|
-
async getEmbeddingDim() {
|
|
323
|
-
if (this._detectedEmbeddingDim !== null)
|
|
324
|
-
return this._detectedEmbeddingDim;
|
|
325
|
-
if (this.config.embeddingDim) {
|
|
326
|
-
this._detectedEmbeddingDim = this.config.embeddingDim;
|
|
327
|
-
return this._detectedEmbeddingDim;
|
|
328
|
-
}
|
|
329
|
-
if (this.config.embedder) {
|
|
330
|
-
try {
|
|
331
|
-
const probe = await this.config.embedder('probe');
|
|
332
|
-
this._detectedEmbeddingDim = probe.length || SONA_HIDDEN_DIM; // guard against empty probe result
|
|
333
|
-
}
|
|
334
|
-
catch {
|
|
335
|
-
this._detectedEmbeddingDim = SONA_HIDDEN_DIM; // safe default
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
else {
|
|
339
|
-
this._detectedEmbeddingDim = SONA_HIDDEN_DIM;
|
|
340
|
-
}
|
|
341
|
-
return this._detectedEmbeddingDim;
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* Lazily attempt to load and initialize the NeuralLearningSystem.
|
|
345
|
-
* The promise is cached so that repeated calls do not re-attempt
|
|
346
|
-
* after a failure.
|
|
347
|
-
*/
|
|
348
|
-
async initNeural() {
|
|
349
|
-
if (this.neural)
|
|
350
|
-
return;
|
|
351
|
-
if (this.neuralInitPromise) {
|
|
352
|
-
await this.neuralInitPromise;
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
this.neuralInitPromise = this.loadNeural();
|
|
356
|
-
await this.neuralInitPromise;
|
|
357
|
-
}
|
|
358
|
-
async loadNeural() {
|
|
359
|
-
// Lean teardown: the SONA neural-learning backend (@monomind/neural) has been
|
|
360
|
-
// removed. The only remaining way to obtain a neural system is an explicitly
|
|
361
|
-
// injected neuralLoader (used by tests / custom integrations). Without one the
|
|
362
|
-
// bridge stays a graceful no-op — every public method short-circuits on a null
|
|
363
|
-
// `this.neural`, so insight recording, consolidation and pattern search become
|
|
364
|
-
// inert while the surrounding memory backend keeps working unchanged.
|
|
365
|
-
if (process.env.MONOMIND_DISABLE_NATIVE === '1' || process.env.MONOMIND_FORCE_JS === '1') {
|
|
366
|
-
this.neural = null;
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
try {
|
|
370
|
-
if (this.config.neuralLoader) {
|
|
371
|
-
// Use injected loader (test / custom integrations)
|
|
372
|
-
this.neural = await this.config.neuralLoader();
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
// No bundled neural backend anymore — degrade to no-op.
|
|
376
|
-
this.neural = null;
|
|
377
|
-
}
|
|
378
|
-
catch {
|
|
379
|
-
this.neural = null;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Write PatternLearner patterns to .monomind/neural/patterns.json so that
|
|
384
|
-
* intelligence.ts (Pipeline B) can find them via findSimilarPatterns / getAllPatterns.
|
|
385
|
-
* This is the Pipeline A→B bridge: automatic session learning → routing.
|
|
386
|
-
*/
|
|
387
|
-
async flushNeuralPatternsToFile() {
|
|
388
|
-
const learnedRaw = this.neural.getLearnedPatterns?.() ?? [];
|
|
389
|
-
if (learnedRaw.length === 0)
|
|
390
|
-
return;
|
|
391
|
-
const { writeFileSync, mkdirSync, existsSync, readFileSync, renameSync } = await import('node:fs');
|
|
392
|
-
const { join } = await import('node:path');
|
|
393
|
-
const dir = join(process.cwd(), '.monomind', 'neural');
|
|
394
|
-
if (!existsSync(dir))
|
|
395
|
-
mkdirSync(dir, { recursive: true });
|
|
396
|
-
const patternsPath = join(dir, 'patterns.json');
|
|
397
|
-
let existing = [];
|
|
398
|
-
try {
|
|
399
|
-
const raw = readFileSync(patternsPath, 'utf-8');
|
|
400
|
-
const parsed = JSON.parse(raw);
|
|
401
|
-
if (Array.isArray(parsed))
|
|
402
|
-
existing = parsed;
|
|
403
|
-
}
|
|
404
|
-
catch { /* start fresh */ }
|
|
405
|
-
// Map PatternLearner domains to valid monomind agent type strings.
|
|
406
|
-
// Domain values ('code', 'reasoning', 'general', etc.) are not agent names;
|
|
407
|
-
// without this mapping every flushed pattern is rejected by the VALID_AGENT_TYPES
|
|
408
|
-
// filter in suggestAgentsFromIntelligence, making the A→B bridge a no-op.
|
|
409
|
-
const DOMAIN_TO_AGENT = {
|
|
410
|
-
code: 'coder',
|
|
411
|
-
coding: 'coder',
|
|
412
|
-
reasoning: 'researcher',
|
|
413
|
-
research: 'researcher',
|
|
414
|
-
testing: 'tester',
|
|
415
|
-
review: 'reviewer',
|
|
416
|
-
security: 'security-architect',
|
|
417
|
-
performance: 'performance-engineer',
|
|
418
|
-
architecture: 'architect',
|
|
419
|
-
creative: 'researcher',
|
|
420
|
-
math: 'researcher',
|
|
421
|
-
chat: 'coder',
|
|
422
|
-
general: 'coder',
|
|
423
|
-
};
|
|
424
|
-
const existingIds = new Set(existing.map(p => p['id']));
|
|
425
|
-
const now = Date.now();
|
|
426
|
-
const newEntries = learnedRaw
|
|
427
|
-
.filter(p => !existingIds.has(`neural:${p.id}`) && p.successRate >= 0.3)
|
|
428
|
-
.map(p => ({
|
|
429
|
-
id: `neural:${p.id}`,
|
|
430
|
-
type: DOMAIN_TO_AGENT[p.domain] ?? 'coder',
|
|
431
|
-
content: p.strategy,
|
|
432
|
-
confidence: p.successRate,
|
|
433
|
-
usageCount: p.usageCount,
|
|
434
|
-
embedding: [],
|
|
435
|
-
createdAt: now,
|
|
436
|
-
lastUsedAt: now,
|
|
437
|
-
}));
|
|
438
|
-
if (newEntries.length === 0)
|
|
439
|
-
return;
|
|
440
|
-
const merged = [...existing, ...newEntries];
|
|
441
|
-
const tmp = `${patternsPath}.${process.pid}.${now}.tmp`;
|
|
442
|
-
writeFileSync(tmp, JSON.stringify(merged, null, 2), 'utf-8');
|
|
443
|
-
renameSync(tmp, patternsPath);
|
|
444
|
-
void this.backfillEmbeddings(patternsPath).catch(() => { });
|
|
445
|
-
}
|
|
446
|
-
/**
|
|
447
|
-
* Background task: generate embeddings for patterns written with empty
|
|
448
|
-
* embedding arrays. Runs fire-and-forget after flushNeuralPatternsToFile.
|
|
449
|
-
* Non-fatal — any error is silently swallowed.
|
|
450
|
-
*/
|
|
451
|
-
async backfillEmbeddings(patternsPath) {
|
|
452
|
-
if (this.backfillInProgress)
|
|
453
|
-
return;
|
|
454
|
-
this.backfillInProgress = true;
|
|
455
|
-
try {
|
|
456
|
-
const { readFileSync, writeFileSync, renameSync } = await import('node:fs');
|
|
457
|
-
const raw = readFileSync(patternsPath, 'utf-8');
|
|
458
|
-
const patterns = JSON.parse(raw);
|
|
459
|
-
if (!Array.isArray(patterns))
|
|
460
|
-
return;
|
|
461
|
-
let changed = false;
|
|
462
|
-
for (const entry of patterns) {
|
|
463
|
-
const emb = entry['embedding'];
|
|
464
|
-
if (Array.isArray(emb) && emb.length === 0) {
|
|
465
|
-
const content = typeof entry['content'] === 'string' ? entry['content'] : '';
|
|
466
|
-
const dim = await this.getEmbeddingDim();
|
|
467
|
-
const vec = await this.createEmbedding(content, dim);
|
|
468
|
-
entry['embedding'] = Array.from(vec);
|
|
469
|
-
changed = true;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
if (!changed)
|
|
473
|
-
return;
|
|
474
|
-
// M1: re-read the file just before writing so a concurrent flush that ran
|
|
475
|
-
// during our embedding computation is not silently overwritten (lost-update).
|
|
476
|
-
// We merge: apply our computed embeddings onto the freshest on-disk snapshot.
|
|
477
|
-
let finalPatterns = patterns;
|
|
478
|
-
try {
|
|
479
|
-
const freshRaw = readFileSync(patternsPath, 'utf-8');
|
|
480
|
-
const freshPatterns = JSON.parse(freshRaw);
|
|
481
|
-
if (Array.isArray(freshPatterns)) {
|
|
482
|
-
const embeddingById = new Map(patterns.map(p => [p['id'], p['embedding']]));
|
|
483
|
-
finalPatterns = freshPatterns.map(p => {
|
|
484
|
-
const backfilledEmb = embeddingById.get(p['id']);
|
|
485
|
-
if (backfilledEmb && Array.isArray(backfilledEmb) && backfilledEmb.length > 0) {
|
|
486
|
-
return { ...p, embedding: backfilledEmb };
|
|
487
|
-
}
|
|
488
|
-
return p;
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
catch { /* use original patterns on re-read failure */ }
|
|
493
|
-
const now = Date.now();
|
|
494
|
-
const tmp = `${patternsPath}.backfill.${process.pid}.${now}.tmp`;
|
|
495
|
-
writeFileSync(tmp, JSON.stringify(finalPatterns, null, 2), 'utf-8');
|
|
496
|
-
renameSync(tmp, patternsPath);
|
|
497
|
-
}
|
|
498
|
-
catch {
|
|
499
|
-
// Non-fatal: backfill failure does not affect the flush result
|
|
500
|
-
}
|
|
501
|
-
finally {
|
|
502
|
-
this.backfillInProgress = false;
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
/**
|
|
506
|
-
* Generate a real semantic embedding via the memory bridge embedder,
|
|
507
|
-
* falling back to a deterministic hash embedding when unavailable.
|
|
508
|
-
* V1: using real embeddings is critical for meaningful LoRA weight updates.
|
|
509
|
-
*/
|
|
510
|
-
async createEmbedding(text, dimensions = SONA_HIDDEN_DIM) {
|
|
511
|
-
// Prefer the injected embedder (CLI wires this in via LearningBridgeConfig.embedder)
|
|
512
|
-
// — no cross-package import needed, clean dependency boundary.
|
|
513
|
-
const embeddingSource = this.config.embedder;
|
|
514
|
-
if (embeddingSource) {
|
|
515
|
-
try {
|
|
516
|
-
const raw = await embeddingSource(text);
|
|
517
|
-
if (Array.isArray(raw) && raw.length > 0) {
|
|
518
|
-
const arr = new Float32Array(dimensions);
|
|
519
|
-
const copyLen = Math.min(raw.length, dimensions);
|
|
520
|
-
for (let i = 0; i < copyLen; i++)
|
|
521
|
-
arr[i] = raw[i];
|
|
522
|
-
let norm = 0;
|
|
523
|
-
for (let i = 0; i < dimensions; i++)
|
|
524
|
-
norm += arr[i] * arr[i];
|
|
525
|
-
norm = Math.sqrt(norm);
|
|
526
|
-
if (norm > 0)
|
|
527
|
-
for (let i = 0; i < dimensions; i++)
|
|
528
|
-
arr[i] /= norm;
|
|
529
|
-
return arr;
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
catch { /* fall through */ }
|
|
533
|
-
}
|
|
534
|
-
// CLI-layer dependencies must be injected via config (e.g., LearningBridgeConfig.embedder)
|
|
535
|
-
// @monomind/memory must never import from @monomind/cli — inverted dependency
|
|
536
|
-
return this.createHashEmbedding(text, dimensions);
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Deterministic hash-based embedding fallback.
|
|
540
|
-
* Used only when no real embedder is available.
|
|
541
|
-
*/
|
|
542
|
-
createHashEmbedding(text, dimensions = SONA_HIDDEN_DIM) {
|
|
543
|
-
const embedding = new Float32Array(dimensions);
|
|
544
|
-
const normalized = text.toLowerCase().trim();
|
|
545
|
-
for (let i = 0; i < dimensions; i++) {
|
|
546
|
-
let hash = 0;
|
|
547
|
-
for (let j = 0; j < normalized.length; j++) {
|
|
548
|
-
hash = ((hash << 5) - hash + normalized.charCodeAt(j) * (i + 1)) | 0;
|
|
549
|
-
}
|
|
550
|
-
embedding[i] = (Math.sin(hash) + 1) / 2;
|
|
551
|
-
}
|
|
552
|
-
let norm = 0;
|
|
553
|
-
for (let i = 0; i < dimensions; i++) {
|
|
554
|
-
norm += embedding[i] * embedding[i];
|
|
555
|
-
}
|
|
556
|
-
norm = Math.sqrt(norm);
|
|
557
|
-
if (norm > 0) {
|
|
558
|
-
for (let i = 0; i < dimensions; i++) {
|
|
559
|
-
embedding[i] /= norm;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
return embedding;
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
export default LearningBridge;
|
|
566
|
-
//# sourceMappingURL=learning-bridge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"learning-bridge.js","sourceRoot":"","sources":["../src/learning-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,wBAAwB;AAExB,+EAA+E;AAC/E,MAAM,eAAe,GAAG,GAAG,CAAC;AAiF5B,MAAM,cAAc,GAAmB;IACrC,QAAQ,EAAE,UAAU;IACpB,mBAAmB,EAAE,KAAK;IAC1B,iBAAiB,EAAE,IAAI;IACvB,aAAa,EAAE,GAAG;IAClB,aAAa,EAAE,GAAG;IAClB,SAAS,EAAE,IAAI;IACf,sBAAsB,EAAE,CAAC;IACzB,OAAO,EAAE,IAAI;CACd,CAAC;AAEF,MAAM,WAAW,GAA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