universal-agent-memory 1.0.17 → 1.0.18
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/dist/benchmarks/benchmark.d.ts +6 -6
- package/dist/bin/cli.js +3 -0
- package/dist/bin/cli.js.map +1 -1
- package/dist/cli/model.d.ts +15 -0
- package/dist/cli/model.d.ts.map +1 -0
- package/dist/cli/model.js +270 -0
- package/dist/cli/model.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/models/executor.d.ts +130 -0
- package/dist/models/executor.d.ts.map +1 -0
- package/dist/models/executor.js +383 -0
- package/dist/models/executor.js.map +1 -0
- package/dist/models/index.d.ts +15 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +17 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/planner.d.ts +71 -0
- package/dist/models/planner.d.ts.map +1 -0
- package/dist/models/planner.js +344 -0
- package/dist/models/planner.js.map +1 -0
- package/dist/models/router.d.ts +75 -0
- package/dist/models/router.d.ts.map +1 -0
- package/dist/models/router.js +344 -0
- package/dist/models/router.js.map +1 -0
- package/dist/models/types.d.ts +370 -0
- package/dist/models/types.d.ts.map +1 -0
- package/dist/models/types.js +181 -0
- package/dist/models/types.js.map +1 -0
- package/dist/types/config.d.ts +598 -38
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +75 -0
- package/dist/types/config.js.map +1 -1
- package/dist/types/coordination.d.ts +7 -7
- package/package.json +1 -1
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model Router
|
|
3
|
+
*
|
|
4
|
+
* Routes tasks to appropriate models based on:
|
|
5
|
+
* - Task complexity and type
|
|
6
|
+
* - Routing rules configuration
|
|
7
|
+
* - Cost optimization strategy
|
|
8
|
+
* - Available model capabilities
|
|
9
|
+
*/
|
|
10
|
+
import { ModelPresets, DEFAULT_ROUTING_RULES, } from './types.js';
|
|
11
|
+
// Complexity keywords for classification
|
|
12
|
+
const COMPLEXITY_KEYWORDS = {
|
|
13
|
+
critical: [
|
|
14
|
+
'security', 'authentication', 'authorization', 'deployment', 'migration',
|
|
15
|
+
'production', 'database', 'encryption', 'credentials', 'secrets',
|
|
16
|
+
],
|
|
17
|
+
high: [
|
|
18
|
+
'architecture', 'design', 'refactor', 'performance', 'optimization',
|
|
19
|
+
'algorithm', 'distributed', 'concurrent', 'multi-step', 'complex',
|
|
20
|
+
],
|
|
21
|
+
medium: [
|
|
22
|
+
'feature', 'implement', 'add', 'create', 'update', 'modify',
|
|
23
|
+
'integrate', 'connect', 'api', 'endpoint',
|
|
24
|
+
],
|
|
25
|
+
low: [
|
|
26
|
+
'fix', 'typo', 'comment', 'rename', 'format', 'style',
|
|
27
|
+
'simple', 'minor', 'small', 'quick', 'documentation',
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
// Task type keywords
|
|
31
|
+
const TASK_TYPE_KEYWORDS = {
|
|
32
|
+
planning: ['plan', 'design', 'architect', 'strategy', 'approach', 'how to'],
|
|
33
|
+
coding: ['implement', 'code', 'write', 'create', 'build', 'develop'],
|
|
34
|
+
refactoring: ['refactor', 'restructure', 'reorganize', 'clean', 'improve'],
|
|
35
|
+
'bug-fix': ['fix', 'bug', 'error', 'issue', 'broken', 'not working', 'fails'],
|
|
36
|
+
review: ['review', 'check', 'audit', 'analyze', 'evaluate', 'assess'],
|
|
37
|
+
documentation: ['document', 'docs', 'readme', 'comment', 'explain', 'describe'],
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Model Router - routes tasks to appropriate models
|
|
41
|
+
*/
|
|
42
|
+
export class ModelRouter {
|
|
43
|
+
config;
|
|
44
|
+
models;
|
|
45
|
+
routingRules;
|
|
46
|
+
roleAssignments;
|
|
47
|
+
constructor(config) {
|
|
48
|
+
this.config = config;
|
|
49
|
+
this.models = new Map();
|
|
50
|
+
this.roleAssignments = new Map();
|
|
51
|
+
// Initialize models from config
|
|
52
|
+
this.initializeModels();
|
|
53
|
+
// Initialize routing rules
|
|
54
|
+
this.routingRules = config.routing || DEFAULT_ROUTING_RULES;
|
|
55
|
+
this.routingRules.sort((a, b) => (b.priority || 0) - (a.priority || 0));
|
|
56
|
+
// Initialize role assignments
|
|
57
|
+
this.initializeRoles();
|
|
58
|
+
}
|
|
59
|
+
initializeModels() {
|
|
60
|
+
for (const modelDef of this.config.models) {
|
|
61
|
+
if (typeof modelDef === 'string') {
|
|
62
|
+
// It's a preset ID
|
|
63
|
+
const preset = ModelPresets[modelDef];
|
|
64
|
+
if (preset) {
|
|
65
|
+
this.models.set(modelDef, preset);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
// It's a custom config
|
|
70
|
+
this.models.set(modelDef.id, modelDef);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Ensure we have at least the default models
|
|
74
|
+
if (this.models.size === 0) {
|
|
75
|
+
const defaultModel = ModelPresets['opus-4.5'];
|
|
76
|
+
if (defaultModel) {
|
|
77
|
+
this.models.set('opus-4.5', defaultModel);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
initializeRoles() {
|
|
82
|
+
const roles = this.config.roles || {
|
|
83
|
+
planner: 'opus-4.5',
|
|
84
|
+
executor: 'glm-4.7',
|
|
85
|
+
fallback: 'opus-4.5',
|
|
86
|
+
};
|
|
87
|
+
this.roleAssignments.set('planner', roles.planner || 'opus-4.5');
|
|
88
|
+
this.roleAssignments.set('executor', roles.executor || 'glm-4.7');
|
|
89
|
+
this.roleAssignments.set('reviewer', roles.reviewer || roles.planner || 'opus-4.5');
|
|
90
|
+
this.roleAssignments.set('fallback', roles.fallback || 'opus-4.5');
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Classify a task to determine complexity and type
|
|
94
|
+
*/
|
|
95
|
+
classifyTask(taskDescription) {
|
|
96
|
+
const lowerTask = taskDescription.toLowerCase();
|
|
97
|
+
const words = lowerTask.split(/\s+/);
|
|
98
|
+
// Detect complexity
|
|
99
|
+
let complexity = 'medium';
|
|
100
|
+
let maxComplexityScore = 0;
|
|
101
|
+
for (const [level, keywords] of Object.entries(COMPLEXITY_KEYWORDS)) {
|
|
102
|
+
const score = keywords.filter(kw => lowerTask.includes(kw)).length;
|
|
103
|
+
if (score > maxComplexityScore) {
|
|
104
|
+
maxComplexityScore = score;
|
|
105
|
+
complexity = level;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// Detect task type
|
|
109
|
+
let taskType = 'coding';
|
|
110
|
+
let maxTypeScore = 0;
|
|
111
|
+
for (const [type, keywords] of Object.entries(TASK_TYPE_KEYWORDS)) {
|
|
112
|
+
const score = keywords.filter(kw => lowerTask.includes(kw)).length;
|
|
113
|
+
if (score > maxTypeScore) {
|
|
114
|
+
maxTypeScore = score;
|
|
115
|
+
taskType = type;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// Extract matched keywords
|
|
119
|
+
const matchedKeywords = [];
|
|
120
|
+
for (const keywords of Object.values(COMPLEXITY_KEYWORDS)) {
|
|
121
|
+
matchedKeywords.push(...keywords.filter(kw => lowerTask.includes(kw)));
|
|
122
|
+
}
|
|
123
|
+
for (const keywords of Object.values(TASK_TYPE_KEYWORDS)) {
|
|
124
|
+
matchedKeywords.push(...keywords.filter(kw => lowerTask.includes(kw)));
|
|
125
|
+
}
|
|
126
|
+
// Estimate tokens (rough heuristic)
|
|
127
|
+
const estimatedTokens = Math.ceil(words.length * 1.3);
|
|
128
|
+
// Determine if planning is required
|
|
129
|
+
const complexityThreshold = this.config.plannerSettings?.complexityThreshold || 'medium';
|
|
130
|
+
const thresholdMap = {
|
|
131
|
+
low: 1,
|
|
132
|
+
medium: 2,
|
|
133
|
+
high: 3,
|
|
134
|
+
critical: 4,
|
|
135
|
+
};
|
|
136
|
+
const requiresPlanning = thresholdMap[complexity] >= thresholdMap[complexityThreshold] ||
|
|
137
|
+
taskType === 'planning';
|
|
138
|
+
// Select model based on routing
|
|
139
|
+
const selection = this.selectModel(complexity, taskType, matchedKeywords);
|
|
140
|
+
return {
|
|
141
|
+
complexity,
|
|
142
|
+
taskType,
|
|
143
|
+
keywords: [...new Set(matchedKeywords)],
|
|
144
|
+
estimatedTokens,
|
|
145
|
+
requiresPlanning,
|
|
146
|
+
suggestedModel: selection.model.id,
|
|
147
|
+
fallbackModel: selection.fallback?.id || this.roleAssignments.get('fallback') || 'opus-4.5',
|
|
148
|
+
reasoning: selection.reasoning,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Select the appropriate model for a task
|
|
153
|
+
*/
|
|
154
|
+
selectModel(complexity, taskType, keywords) {
|
|
155
|
+
// Find matching routing rule
|
|
156
|
+
for (const rule of this.routingRules) {
|
|
157
|
+
let matches = true;
|
|
158
|
+
if (rule.complexity && rule.complexity !== complexity) {
|
|
159
|
+
matches = false;
|
|
160
|
+
}
|
|
161
|
+
if (rule.taskType && rule.taskType !== taskType) {
|
|
162
|
+
matches = false;
|
|
163
|
+
}
|
|
164
|
+
if (rule.keywords && rule.keywords.length > 0) {
|
|
165
|
+
const hasKeyword = rule.keywords.some(kw => keywords.some(k => k.includes(kw) || kw.includes(k)));
|
|
166
|
+
if (!hasKeyword) {
|
|
167
|
+
matches = false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (matches) {
|
|
171
|
+
const role = rule.targetRole;
|
|
172
|
+
const modelId = this.roleAssignments.get(role);
|
|
173
|
+
const model = modelId ? this.models.get(modelId) : undefined;
|
|
174
|
+
if (model) {
|
|
175
|
+
const fallbackId = this.roleAssignments.get('fallback');
|
|
176
|
+
const fallback = fallbackId ? this.models.get(fallbackId) : undefined;
|
|
177
|
+
return {
|
|
178
|
+
model,
|
|
179
|
+
fallback: fallback !== model ? fallback : undefined,
|
|
180
|
+
role,
|
|
181
|
+
reasoning: this.buildReasoning(rule, complexity, taskType, keywords),
|
|
182
|
+
estimatedCost: this.estimateCost(model, 10000, 5000),
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// Default to executor
|
|
188
|
+
const executorId = this.roleAssignments.get('executor') || 'glm-4.7';
|
|
189
|
+
const defaultExecutor = ModelPresets['glm-4.7'];
|
|
190
|
+
const executor = this.models.get(executorId) || defaultExecutor;
|
|
191
|
+
const fallbackId = this.roleAssignments.get('fallback');
|
|
192
|
+
const fallback = fallbackId ? this.models.get(fallbackId) : undefined;
|
|
193
|
+
if (!executor) {
|
|
194
|
+
throw new Error('No executor model available');
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
model: executor,
|
|
198
|
+
fallback,
|
|
199
|
+
role: 'executor',
|
|
200
|
+
reasoning: `Default routing to executor (${executor.name}) - no specific rule matched`,
|
|
201
|
+
estimatedCost: this.estimateCost(executor, 10000, 5000),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
buildReasoning(rule, complexity, taskType, keywords) {
|
|
205
|
+
const parts = [];
|
|
206
|
+
if (rule.complexity) {
|
|
207
|
+
parts.push(`complexity=${complexity}`);
|
|
208
|
+
}
|
|
209
|
+
if (rule.taskType) {
|
|
210
|
+
parts.push(`type=${taskType}`);
|
|
211
|
+
}
|
|
212
|
+
if (rule.keywords && rule.keywords.length > 0) {
|
|
213
|
+
const matched = rule.keywords.filter(kw => keywords.some(k => k.includes(kw)));
|
|
214
|
+
if (matched.length > 0) {
|
|
215
|
+
parts.push(`keywords=[${matched.join(',')}]`);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return `Matched rule (priority=${rule.priority}): ${parts.join(', ')} → ${rule.targetRole}`;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Estimate cost for a model invocation
|
|
222
|
+
*/
|
|
223
|
+
estimateCost(model, inputTokens, outputTokens) {
|
|
224
|
+
const inputCost = (model.costPer1MInput || 0) * (inputTokens / 1_000_000);
|
|
225
|
+
const outputCost = (model.costPer1MOutput || 0) * (outputTokens / 1_000_000);
|
|
226
|
+
return inputCost + outputCost;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Get model by ID
|
|
230
|
+
*/
|
|
231
|
+
getModel(modelId) {
|
|
232
|
+
return this.models.get(modelId);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Get model for a specific role
|
|
236
|
+
*/
|
|
237
|
+
getModelForRole(role) {
|
|
238
|
+
const modelId = this.roleAssignments.get(role);
|
|
239
|
+
return modelId ? this.models.get(modelId) : undefined;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Get all configured models
|
|
243
|
+
*/
|
|
244
|
+
getAllModels() {
|
|
245
|
+
return Array.from(this.models.values());
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Get routing analysis for debugging
|
|
249
|
+
*/
|
|
250
|
+
analyzeRouting(taskDescription) {
|
|
251
|
+
const classification = this.classifyTask(taskDescription);
|
|
252
|
+
const matchedRules = this.routingRules.map(rule => {
|
|
253
|
+
let matched = true;
|
|
254
|
+
const reasons = [];
|
|
255
|
+
if (rule.complexity) {
|
|
256
|
+
if (rule.complexity !== classification.complexity) {
|
|
257
|
+
matched = false;
|
|
258
|
+
reasons.push(`complexity ${classification.complexity} != ${rule.complexity}`);
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
reasons.push(`complexity matches ${rule.complexity}`);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (rule.taskType) {
|
|
265
|
+
if (rule.taskType !== classification.taskType) {
|
|
266
|
+
matched = false;
|
|
267
|
+
reasons.push(`type ${classification.taskType} != ${rule.taskType}`);
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
reasons.push(`type matches ${rule.taskType}`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (rule.keywords && rule.keywords.length > 0) {
|
|
274
|
+
const hasKeyword = rule.keywords.some(kw => classification.keywords.some(k => k.includes(kw)));
|
|
275
|
+
if (!hasKeyword) {
|
|
276
|
+
matched = false;
|
|
277
|
+
reasons.push(`no keyword match for [${rule.keywords.join(',')}]`);
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
reasons.push(`keyword matches`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return {
|
|
284
|
+
rule,
|
|
285
|
+
matched,
|
|
286
|
+
reason: reasons.join('; '),
|
|
287
|
+
};
|
|
288
|
+
});
|
|
289
|
+
const costComparison = Array.from(this.models.values()).map(model => ({
|
|
290
|
+
model: model.name,
|
|
291
|
+
cost: this.estimateCost(model, classification.estimatedTokens * 10, classification.estimatedTokens * 5),
|
|
292
|
+
})).sort((a, b) => a.cost - b.cost);
|
|
293
|
+
return {
|
|
294
|
+
classification,
|
|
295
|
+
matchedRules,
|
|
296
|
+
costComparison,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Create a router instance from config
|
|
302
|
+
*/
|
|
303
|
+
export function createRouter(config) {
|
|
304
|
+
return new ModelRouter(config);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Default router with cost-optimized settings
|
|
308
|
+
*/
|
|
309
|
+
export function createCostOptimizedRouter() {
|
|
310
|
+
return new ModelRouter({
|
|
311
|
+
enabled: true,
|
|
312
|
+
models: ['deepseek-v3.2', 'glm-4.7', 'opus-4.5'],
|
|
313
|
+
roles: {
|
|
314
|
+
planner: 'deepseek-v3.2',
|
|
315
|
+
executor: 'glm-4.7',
|
|
316
|
+
reviewer: 'deepseek-v3.2',
|
|
317
|
+
fallback: 'opus-4.5',
|
|
318
|
+
},
|
|
319
|
+
routingStrategy: 'cost-optimized',
|
|
320
|
+
costOptimization: {
|
|
321
|
+
enabled: true,
|
|
322
|
+
targetReduction: 90,
|
|
323
|
+
maxPerformanceDegradation: 20,
|
|
324
|
+
fallbackThreshold: 3,
|
|
325
|
+
},
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Default router with performance-first settings
|
|
330
|
+
*/
|
|
331
|
+
export function createPerformanceRouter() {
|
|
332
|
+
return new ModelRouter({
|
|
333
|
+
enabled: true,
|
|
334
|
+
models: ['opus-4.5', 'gpt-5.2'],
|
|
335
|
+
roles: {
|
|
336
|
+
planner: 'opus-4.5',
|
|
337
|
+
executor: 'opus-4.5',
|
|
338
|
+
reviewer: 'opus-4.5',
|
|
339
|
+
fallback: 'opus-4.5',
|
|
340
|
+
},
|
|
341
|
+
routingStrategy: 'performance-first',
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
//# sourceMappingURL=router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/models/router.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,YAAY,EAMZ,qBAAqB,GAEtB,MAAM,YAAY,CAAC;AAEpB,yCAAyC;AACzC,MAAM,mBAAmB,GAAqC;IAC5D,QAAQ,EAAE;QACR,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW;QACxE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS;KACjE;IACD,IAAI,EAAE;QACJ,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc;QACnE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS;KAClE;IACD,MAAM,EAAE;QACN,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ;QAC3D,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU;KAC1C;IACD,GAAG,EAAE;QACH,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO;QACrD,QAA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