mcp-adr-analysis-server 2.0.21 → 2.0.24
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/.tsbuildinfo +1 -1
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1380 -781
- package/dist/src/index.js.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.js +32 -30
- package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
- package/dist/src/tools/content-masking-tool.d.ts +4 -0
- package/dist/src/tools/content-masking-tool.d.ts.map +1 -1
- package/dist/src/tools/content-masking-tool.js +531 -28
- package/dist/src/tools/content-masking-tool.js.map +1 -1
- package/dist/src/tools/deployment-readiness-tool.d.ts +8 -5
- package/dist/src/tools/deployment-readiness-tool.d.ts.map +1 -1
- package/dist/src/tools/deployment-readiness-tool.js +741 -79
- package/dist/src/tools/deployment-readiness-tool.js.map +1 -1
- package/dist/src/tools/environment-analysis-tool.d.ts +4 -0
- package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -1
- package/dist/src/tools/environment-analysis-tool.js +568 -24
- package/dist/src/tools/environment-analysis-tool.js.map +1 -1
- package/dist/src/tools/mcp-planning-tool.d.ts.map +1 -1
- package/dist/src/tools/mcp-planning-tool.js +298 -173
- package/dist/src/tools/mcp-planning-tool.js.map +1 -1
- package/dist/src/tools/memory-loading-tool.d.ts +60 -0
- package/dist/src/tools/memory-loading-tool.d.ts.map +1 -0
- package/dist/src/tools/memory-loading-tool.js +457 -0
- package/dist/src/tools/memory-loading-tool.js.map +1 -0
- package/dist/src/tools/smart-git-push-tool.d.ts +3 -0
- package/dist/src/tools/smart-git-push-tool.d.ts.map +1 -1
- package/dist/src/tools/smart-git-push-tool.js +177 -223
- package/dist/src/tools/smart-git-push-tool.js.map +1 -1
- package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts +20 -11
- package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts.map +1 -1
- package/dist/src/tools/troubleshoot-guided-workflow-tool.js +506 -22
- package/dist/src/tools/troubleshoot-guided-workflow-tool.js.map +1 -1
- package/dist/src/types/enhanced-errors.d.ts +173 -0
- package/dist/src/types/enhanced-errors.d.ts.map +1 -0
- package/dist/src/types/enhanced-errors.js +668 -0
- package/dist/src/types/enhanced-errors.js.map +1 -0
- package/dist/src/types/knowledge-graph-schemas.d.ts +92 -0
- package/dist/src/types/knowledge-graph-schemas.d.ts.map +1 -1
- package/dist/src/types/knowledge-graph-schemas.js +45 -17
- package/dist/src/types/knowledge-graph-schemas.js.map +1 -1
- package/dist/src/types/memory-entities.d.ts +7209 -0
- package/dist/src/types/memory-entities.d.ts.map +1 -0
- package/dist/src/types/memory-entities.js +395 -0
- package/dist/src/types/memory-entities.js.map +1 -0
- package/dist/src/types/todo-json-schemas.d.ts +7 -653
- package/dist/src/types/todo-json-schemas.d.ts.map +1 -1
- package/dist/src/types/todo-json-schemas.js +6 -110
- package/dist/src/types/todo-json-schemas.js.map +1 -1
- package/dist/src/utils/enhanced-logging.d.ts +195 -0
- package/dist/src/utils/enhanced-logging.d.ts.map +1 -0
- package/dist/src/utils/enhanced-logging.js +449 -0
- package/dist/src/utils/enhanced-logging.js.map +1 -0
- package/dist/src/utils/interactive-approval.d.ts +1 -1
- package/dist/src/utils/interactive-approval.d.ts.map +1 -1
- package/dist/src/utils/interactive-approval.js +20 -16
- package/dist/src/utils/interactive-approval.js.map +1 -1
- package/dist/src/utils/knowledge-graph-manager.d.ts +23 -1
- package/dist/src/utils/knowledge-graph-manager.d.ts.map +1 -1
- package/dist/src/utils/knowledge-graph-manager.js +297 -69
- package/dist/src/utils/knowledge-graph-manager.js.map +1 -1
- package/dist/src/utils/memory-entity-manager.d.ts +134 -0
- package/dist/src/utils/memory-entity-manager.d.ts.map +1 -0
- package/dist/src/utils/memory-entity-manager.js +848 -0
- package/dist/src/utils/memory-entity-manager.js.map +1 -0
- package/dist/src/utils/memory-health-scoring.d.ts +125 -0
- package/dist/src/utils/memory-health-scoring.d.ts.map +1 -0
- package/dist/src/utils/memory-health-scoring.js +277 -0
- package/dist/src/utils/memory-health-scoring.js.map +1 -0
- package/dist/src/utils/memory-migration-manager.d.ts +93 -0
- package/dist/src/utils/memory-migration-manager.d.ts.map +1 -0
- package/dist/src/utils/memory-migration-manager.js +834 -0
- package/dist/src/utils/memory-migration-manager.js.map +1 -0
- package/dist/src/utils/memory-relationship-mapper.d.ts +87 -0
- package/dist/src/utils/memory-relationship-mapper.d.ts.map +1 -0
- package/dist/src/utils/memory-relationship-mapper.js +481 -0
- package/dist/src/utils/memory-relationship-mapper.js.map +1 -0
- package/dist/src/utils/memory-rollback-manager.d.ts +93 -0
- package/dist/src/utils/memory-rollback-manager.d.ts.map +1 -0
- package/dist/src/utils/memory-rollback-manager.js +542 -0
- package/dist/src/utils/memory-rollback-manager.js.map +1 -0
- package/dist/src/utils/memory-transformation.d.ts +59 -0
- package/dist/src/utils/memory-transformation.d.ts.map +1 -0
- package/dist/src/utils/memory-transformation.js +742 -0
- package/dist/src/utils/memory-transformation.js.map +1 -0
- package/dist/src/utils/prompt-execution.d.ts.map +1 -1
- package/dist/src/utils/prompt-execution.js +72 -51
- package/dist/src/utils/prompt-execution.js.map +1 -1
- package/dist/src/utils/todo-file-watcher.d.ts +11 -23
- package/dist/src/utils/todo-file-watcher.d.ts.map +1 -1
- package/dist/src/utils/todo-file-watcher.js +18 -156
- package/dist/src/utils/todo-file-watcher.js.map +1 -1
- package/package.json +22 -6
- package/dist/src/tools/smart-score-tool.d.ts +0 -173
- package/dist/src/tools/smart-score-tool.d.ts.map +0 -1
- package/dist/src/tools/smart-score-tool.js +0 -681
- package/dist/src/tools/smart-score-tool.js.map +0 -1
- package/dist/src/tools/todo-management-tool-v2.d.ts +0 -368
- package/dist/src/tools/todo-management-tool-v2.d.ts.map +0 -1
- package/dist/src/tools/todo-management-tool-v2.js +0 -922
- package/dist/src/tools/todo-management-tool-v2.js.map +0 -1
- package/dist/src/utils/project-health-scoring.d.ts +0 -177
- package/dist/src/utils/project-health-scoring.d.ts.map +0 -1
- package/dist/src/utils/project-health-scoring.js +0 -370
- package/dist/src/utils/project-health-scoring.js.map +0 -1
- package/dist/src/utils/todo-json-manager.d.ts +0 -71
- package/dist/src/utils/todo-json-manager.d.ts.map +0 -1
- package/dist/src/utils/todo-json-manager.js +0 -396
- package/dist/src/utils/todo-json-manager.js.map +0 -1
- package/dist/src/utils/todo-markdown-converter.d.ts +0 -16
- package/dist/src/utils/todo-markdown-converter.d.ts.map +0 -1
- package/dist/src/utils/todo-markdown-converter.js +0 -362
- package/dist/src/utils/todo-markdown-converter.js.map +0 -1
- package/dist/src/utils/todo-migration.d.ts +0 -47
- package/dist/src/utils/todo-migration.d.ts.map +0 -1
- package/dist/src/utils/todo-migration.js +0 -261
- package/dist/src/utils/todo-migration.js.map +0 -1
|
@@ -3,13 +3,15 @@ export declare class KnowledgeGraphManager {
|
|
|
3
3
|
private cacheDir;
|
|
4
4
|
private snapshotsFile;
|
|
5
5
|
private syncStateFile;
|
|
6
|
-
private
|
|
6
|
+
private memoryScoring;
|
|
7
7
|
constructor();
|
|
8
8
|
ensureCacheDirectory(): Promise<void>;
|
|
9
9
|
loadKnowledgeGraph(): Promise<KnowledgeGraphSnapshot>;
|
|
10
10
|
saveKnowledgeGraph(snapshot: KnowledgeGraphSnapshot): Promise<void>;
|
|
11
11
|
createIntent(humanRequest: string, parsedGoals: string[], priority?: 'high' | 'medium' | 'low'): Promise<string>;
|
|
12
12
|
addToolExecution(intentId: string, toolName: string, parameters: Record<string, any>, result: Record<string, any>, success: boolean, todoTasksCreated?: string[], todoTasksModified?: string[], error?: string): Promise<void>;
|
|
13
|
+
addMemoryExecution(toolName: string, action: string, entityType: string, success: boolean, details?: Record<string, any>): Promise<void>;
|
|
14
|
+
private updateMemoryAnalytics;
|
|
13
15
|
updateIntentStatus(intentId: string, status: 'planning' | 'executing' | 'completed' | 'failed'): Promise<void>;
|
|
14
16
|
updateTodoSnapshot(intentId: string, todoContent: string): Promise<void>;
|
|
15
17
|
getSyncState(): Promise<TodoSyncState>;
|
|
@@ -74,5 +76,25 @@ export declare class KnowledgeGraphManager {
|
|
|
74
76
|
timestamp: string;
|
|
75
77
|
structureData: any;
|
|
76
78
|
}): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Calculate memory-based health score from knowledge graph
|
|
81
|
+
*/
|
|
82
|
+
private calculateMemoryScore;
|
|
83
|
+
/**
|
|
84
|
+
* Extract memory representations from knowledge graph
|
|
85
|
+
*/
|
|
86
|
+
private extractMemoriesFromKG;
|
|
87
|
+
/**
|
|
88
|
+
* Calculate retrieval metrics from tool execution patterns
|
|
89
|
+
*/
|
|
90
|
+
private calculateRetrievalMetrics;
|
|
91
|
+
/**
|
|
92
|
+
* Build entity graph from knowledge graph
|
|
93
|
+
*/
|
|
94
|
+
private buildEntityGraph;
|
|
95
|
+
/**
|
|
96
|
+
* Calculate relevance score for an intent
|
|
97
|
+
*/
|
|
98
|
+
private calculateIntentRelevance;
|
|
77
99
|
}
|
|
78
100
|
//# sourceMappingURL=knowledge-graph-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-graph-manager.d.ts","sourceRoot":"","sources":["../../../src/utils/knowledge-graph-manager.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EAEd,aAAa,EACb,sBAAsB,EAGvB,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"knowledge-graph-manager.d.ts","sourceRoot":"","sources":["../../../src/utils/knowledge-graph-manager.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EAEd,aAAa,EACb,sBAAsB,EAGvB,MAAM,qCAAqC,CAAC;AAK7C,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,aAAa,CAAsB;;IAUrC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAQrC,kBAAkB,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAiCrD,kBAAkB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKnE,YAAY,CAChB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EAAE,EACrB,QAAQ,GAAE,MAAM,GAAG,QAAQ,GAAG,KAAgB,GAC7C,OAAO,CAAC,MAAM,CAAC;IA4DZ,gBAAgB,CACpB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,OAAO,EAAE,OAAO,EAChB,gBAAgB,GAAE,MAAM,EAAO,EAC/B,iBAAiB,GAAE,MAAM,EAAO,EAChC,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;IAiCV,kBAAkB,CACtB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC5B,OAAO,CAAC,IAAI,CAAC;IAoChB,OAAO,CAAC,qBAAqB;IA2CvB,kBAAkB,CACtB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,GACxD,OAAO,CAAC,IAAI,CAAC;IAaV,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYxE,YAAY,IAAI,OAAO,CAAC,aAAa,CAAC;IAUtC,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAU/D,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAK/D,gBAAgB,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAK7C,kBAAkB,CACtB,MAAM,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,GACxD,OAAO,CAAC,cAAc,EAAE,CAAC;YAKd,mBAAmB;IAWjC,OAAO,CAAC,eAAe;IA2BjB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAStD,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QACjD,UAAU,EAAE,OAAO,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IAWF;;OAEG;YACW,mBAAmB;IAkFjC;;OAEG;IACG,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QACpD,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACxC,YAAY,EAAE,KAAK,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC;YAClB,KAAK,EAAE,MAAM,CAAC;YACd,YAAY,EAAE,MAAM,CAAC;SACtB,CAAC,CAAC;KACJ,CAAC;IAuBF;;OAEG;IACG,qBAAqB,IAAI,OAAO,CAAC;QACrC,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,KAAK,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC;YAClB,KAAK,EAAE,MAAM,CAAC;YACd,YAAY,EAAE,MAAM,CAAC;YACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;SACnB,CAAC,CAAC;QACH,kBAAkB,EAAE,MAAM,CAAC;QAC3B,mBAAmB,EAAE,KAAK,CAAC;YACzB,QAAQ,EAAE,MAAM,CAAC;YACjB,YAAY,EAAE,MAAM,CAAC;YACrB,gBAAgB,EAAE,MAAM,CAAC;SAC1B,CAAC,CAAC;KACJ,CAAC;IAsCF;;OAEG;IACG,sBAAsB,CAAC,iBAAiB,EAAE;QAC9C,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,aAAa,EAAE,MAAM,EAAE,CAAC;QACxB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,GAAG,CAAC;KACpB,GAAG,OAAO,CAAC,IAAI,CAAC;IA0CjB;;OAEG;YACW,oBAAoB;IAalC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA2C7B;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAuBjC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAsDxB;;OAEG;IACH,OAAO,CAAC,wBAAwB;CAsBjC"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import * as fs from 'fs/promises';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import crypto from 'crypto';
|
|
4
|
-
import { TodoSyncStateSchema, KnowledgeGraphSnapshotSchema } from '../types/knowledge-graph-schemas.js';
|
|
4
|
+
import { TodoSyncStateSchema, KnowledgeGraphSnapshotSchema, } from '../types/knowledge-graph-schemas.js';
|
|
5
5
|
import { loadConfig } from './config.js';
|
|
6
|
-
|
|
6
|
+
// Using new MemoryHealthScoring instead of deprecated ProjectHealthScoring
|
|
7
|
+
import { MemoryHealthScoring } from './memory-health-scoring.js';
|
|
7
8
|
export class KnowledgeGraphManager {
|
|
8
9
|
cacheDir;
|
|
9
10
|
snapshotsFile;
|
|
10
11
|
syncStateFile;
|
|
11
|
-
|
|
12
|
+
memoryScoring;
|
|
12
13
|
constructor() {
|
|
13
14
|
const config = loadConfig();
|
|
14
15
|
this.cacheDir = path.join(config.projectPath, '.mcp-adr-cache');
|
|
15
16
|
this.snapshotsFile = path.join(this.cacheDir, 'knowledge-graph-snapshots.json');
|
|
16
17
|
this.syncStateFile = path.join(this.cacheDir, 'todo-sync-state.json');
|
|
17
|
-
this.
|
|
18
|
+
this.memoryScoring = new MemoryHealthScoring();
|
|
18
19
|
}
|
|
19
20
|
async ensureCacheDirectory() {
|
|
20
21
|
try {
|
|
@@ -44,9 +45,9 @@ export class KnowledgeGraphManager {
|
|
|
44
45
|
activeIntents: 0,
|
|
45
46
|
averageGoalCompletion: 0,
|
|
46
47
|
mostUsedTools: [],
|
|
47
|
-
successfulPatterns: []
|
|
48
|
+
successfulPatterns: [],
|
|
48
49
|
},
|
|
49
|
-
scoreHistory: []
|
|
50
|
+
scoreHistory: [],
|
|
50
51
|
};
|
|
51
52
|
await this.saveKnowledgeGraph(defaultSnapshot);
|
|
52
53
|
// Also create the separate sync state file
|
|
@@ -62,7 +63,9 @@ export class KnowledgeGraphManager {
|
|
|
62
63
|
const intentId = crypto.randomUUID();
|
|
63
64
|
const timestamp = new Date().toISOString();
|
|
64
65
|
// Get current score as baseline
|
|
65
|
-
|
|
66
|
+
// Calculate memory-based health score
|
|
67
|
+
const kgData = await this.loadKnowledgeGraph();
|
|
68
|
+
const currentScore = await this.calculateMemoryScore(kgData);
|
|
66
69
|
const intent = {
|
|
67
70
|
intentId,
|
|
68
71
|
humanRequest,
|
|
@@ -76,37 +79,37 @@ export class KnowledgeGraphManager {
|
|
|
76
79
|
initialScore: currentScore.overall,
|
|
77
80
|
currentScore: currentScore.overall,
|
|
78
81
|
componentScores: {
|
|
79
|
-
taskCompletion: currentScore.
|
|
80
|
-
deploymentReadiness: currentScore.
|
|
81
|
-
architectureCompliance: currentScore.
|
|
82
|
-
securityPosture: currentScore.
|
|
83
|
-
codeQuality: currentScore.
|
|
82
|
+
taskCompletion: currentScore.memoryQuality,
|
|
83
|
+
deploymentReadiness: currentScore.retrievalPerformance,
|
|
84
|
+
architectureCompliance: currentScore.entityCoherence,
|
|
85
|
+
securityPosture: currentScore.contextUtilization,
|
|
86
|
+
codeQuality: currentScore.decisionAlignment,
|
|
84
87
|
},
|
|
85
|
-
lastScoreUpdate: timestamp
|
|
86
|
-
}
|
|
88
|
+
lastScoreUpdate: timestamp,
|
|
89
|
+
},
|
|
87
90
|
};
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
const kgUpdate = await this.loadKnowledgeGraph();
|
|
92
|
+
kgUpdate.intents.push(intent);
|
|
93
|
+
kgUpdate.analytics.totalIntents = kgUpdate.intents.length;
|
|
94
|
+
kgUpdate.analytics.activeIntents = kgUpdate.intents.filter(i => i.currentStatus !== 'completed').length;
|
|
92
95
|
// Add score history entry
|
|
93
|
-
if (!
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
if (!kgUpdate.scoreHistory)
|
|
97
|
+
kgUpdate.scoreHistory = [];
|
|
98
|
+
kgUpdate.scoreHistory.push({
|
|
96
99
|
timestamp,
|
|
97
100
|
intentId,
|
|
98
101
|
overallScore: currentScore.overall,
|
|
99
102
|
componentScores: {
|
|
100
|
-
taskCompletion: currentScore.
|
|
101
|
-
deploymentReadiness: currentScore.
|
|
102
|
-
architectureCompliance: currentScore.
|
|
103
|
-
securityPosture: currentScore.
|
|
104
|
-
codeQuality: currentScore.
|
|
103
|
+
taskCompletion: currentScore.memoryQuality,
|
|
104
|
+
deploymentReadiness: currentScore.retrievalPerformance,
|
|
105
|
+
architectureCompliance: currentScore.entityCoherence,
|
|
106
|
+
securityPosture: currentScore.contextUtilization,
|
|
107
|
+
codeQuality: currentScore.decisionAlignment,
|
|
105
108
|
},
|
|
106
109
|
triggerEvent: `Intent created: ${humanRequest.substring(0, 100)}...`,
|
|
107
|
-
confidence: currentScore.confidence
|
|
110
|
+
confidence: currentScore.confidence,
|
|
108
111
|
});
|
|
109
|
-
await this.saveKnowledgeGraph(
|
|
112
|
+
await this.saveKnowledgeGraph(kgUpdate);
|
|
110
113
|
return intentId;
|
|
111
114
|
}
|
|
112
115
|
async addToolExecution(intentId, toolName, parameters, result, success, todoTasksCreated = [], todoTasksModified = [], error) {
|
|
@@ -116,7 +119,8 @@ export class KnowledgeGraphManager {
|
|
|
116
119
|
throw new Error(`Intent ${intentId} not found`);
|
|
117
120
|
}
|
|
118
121
|
// Capture before score
|
|
119
|
-
|
|
122
|
+
// ProjectHealthScoring removed - get current memory score
|
|
123
|
+
const beforeScore = await this.memoryScoring.calculateMemoryHealth([], {}, {});
|
|
120
124
|
const execution = {
|
|
121
125
|
toolName,
|
|
122
126
|
parameters,
|
|
@@ -125,7 +129,7 @@ export class KnowledgeGraphManager {
|
|
|
125
129
|
todoTasksModified,
|
|
126
130
|
executionTime: new Date().toISOString(),
|
|
127
131
|
success,
|
|
128
|
-
error
|
|
132
|
+
error,
|
|
129
133
|
};
|
|
130
134
|
intent.toolChain.push(execution);
|
|
131
135
|
intent.currentStatus = success ? 'executing' : 'failed';
|
|
@@ -134,6 +138,74 @@ export class KnowledgeGraphManager {
|
|
|
134
138
|
this.updateAnalytics(kg);
|
|
135
139
|
await this.saveKnowledgeGraph(kg);
|
|
136
140
|
}
|
|
141
|
+
async addMemoryExecution(toolName, action, entityType, success, details) {
|
|
142
|
+
try {
|
|
143
|
+
const kg = await this.loadKnowledgeGraph();
|
|
144
|
+
// Create memory execution record
|
|
145
|
+
const memoryExecution = {
|
|
146
|
+
toolName,
|
|
147
|
+
action,
|
|
148
|
+
entityType,
|
|
149
|
+
success,
|
|
150
|
+
details: details || {},
|
|
151
|
+
timestamp: new Date().toISOString(),
|
|
152
|
+
};
|
|
153
|
+
// Initialize memory operations array if it doesn't exist
|
|
154
|
+
if (!kg.memoryOperations) {
|
|
155
|
+
kg.memoryOperations = [];
|
|
156
|
+
}
|
|
157
|
+
// Add memory execution to knowledge graph
|
|
158
|
+
kg.memoryOperations.push(memoryExecution);
|
|
159
|
+
// Limit memory operations history to last 1000 entries
|
|
160
|
+
if (kg.memoryOperations.length > 1000) {
|
|
161
|
+
kg.memoryOperations = kg.memoryOperations.slice(-1000);
|
|
162
|
+
}
|
|
163
|
+
// Update analytics to include memory operation metrics
|
|
164
|
+
this.updateMemoryAnalytics(kg);
|
|
165
|
+
await this.saveKnowledgeGraph(kg);
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
console.error('[WARN] Failed to track memory execution:', error);
|
|
169
|
+
// Don't throw - memory tracking shouldn't break tool execution
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
updateMemoryAnalytics(kg) {
|
|
173
|
+
if (!kg.memoryOperations || kg.memoryOperations.length === 0) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
// Calculate memory operation statistics
|
|
177
|
+
const totalOps = kg.memoryOperations.length;
|
|
178
|
+
const successfulOps = kg.memoryOperations.filter((op) => op.success).length;
|
|
179
|
+
const successRate = totalOps > 0 ? successfulOps / totalOps : 0;
|
|
180
|
+
// Group by entity type
|
|
181
|
+
const byEntityType = {};
|
|
182
|
+
const byAction = {};
|
|
183
|
+
const byTool = {};
|
|
184
|
+
for (const op of kg.memoryOperations) {
|
|
185
|
+
byEntityType[op.entityType] = (byEntityType[op.entityType] || 0) + 1;
|
|
186
|
+
byAction[op.action] = (byAction[op.action] || 0) + 1;
|
|
187
|
+
byTool[op.toolName] = (byTool[op.toolName] || 0) + 1;
|
|
188
|
+
}
|
|
189
|
+
// Add memory analytics to knowledge graph
|
|
190
|
+
if (!kg.analytics) {
|
|
191
|
+
kg.analytics = {
|
|
192
|
+
totalIntents: 0,
|
|
193
|
+
completedIntents: 0,
|
|
194
|
+
activeIntents: 0,
|
|
195
|
+
averageGoalCompletion: 0,
|
|
196
|
+
mostUsedTools: [],
|
|
197
|
+
successfulPatterns: [],
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
kg.analytics.memoryOperations = {
|
|
201
|
+
totalOperations: totalOps,
|
|
202
|
+
successRate,
|
|
203
|
+
byEntityType,
|
|
204
|
+
byAction,
|
|
205
|
+
byTool,
|
|
206
|
+
lastMemoryOperation: kg.memoryOperations[kg.memoryOperations.length - 1]?.timestamp,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
137
209
|
async updateIntentStatus(intentId, status) {
|
|
138
210
|
const kg = await this.loadKnowledgeGraph();
|
|
139
211
|
const intent = kg.intents.find(i => i.intentId === intentId);
|
|
@@ -190,7 +262,7 @@ export class KnowledgeGraphManager {
|
|
|
190
262
|
knowledgeGraphHash: '',
|
|
191
263
|
syncStatus: 'synced',
|
|
192
264
|
lastModifiedBy: 'tool',
|
|
193
|
-
version: 1
|
|
265
|
+
version: 1,
|
|
194
266
|
};
|
|
195
267
|
}
|
|
196
268
|
updateAnalytics(kg) {
|
|
@@ -199,7 +271,8 @@ export class KnowledgeGraphManager {
|
|
|
199
271
|
kg.analytics.completedIntents = intents.filter(i => i.currentStatus === 'completed').length;
|
|
200
272
|
kg.analytics.activeIntents = intents.filter(i => i.currentStatus !== 'completed' && i.currentStatus !== 'failed').length;
|
|
201
273
|
if (kg.analytics.totalIntents > 0) {
|
|
202
|
-
kg.analytics.averageGoalCompletion =
|
|
274
|
+
kg.analytics.averageGoalCompletion =
|
|
275
|
+
kg.analytics.completedIntents / kg.analytics.totalIntents;
|
|
203
276
|
}
|
|
204
277
|
const toolUsage = new Map();
|
|
205
278
|
intents.forEach(intent => {
|
|
@@ -227,7 +300,7 @@ export class KnowledgeGraphManager {
|
|
|
227
300
|
return {
|
|
228
301
|
hasChanges: currentHash !== syncState.todoMdHash,
|
|
229
302
|
currentHash,
|
|
230
|
-
lastHash: syncState.todoMdHash
|
|
303
|
+
lastHash: syncState.todoMdHash,
|
|
231
304
|
};
|
|
232
305
|
}
|
|
233
306
|
/**
|
|
@@ -239,31 +312,31 @@ export class KnowledgeGraphManager {
|
|
|
239
312
|
if (!intent)
|
|
240
313
|
return;
|
|
241
314
|
// Get current score after tool execution
|
|
242
|
-
const afterScore = await this.
|
|
243
|
-
// Calculate score impact
|
|
315
|
+
const afterScore = await this.calculateMemoryScore(kg);
|
|
316
|
+
// Calculate score impact - map memory scores to legacy component names
|
|
244
317
|
const scoreImpact = {
|
|
245
318
|
beforeScore: beforeScore.overall,
|
|
246
319
|
afterScore: afterScore.overall,
|
|
247
320
|
componentImpacts: {
|
|
248
|
-
taskCompletion: afterScore.
|
|
249
|
-
deploymentReadiness: afterScore.
|
|
250
|
-
architectureCompliance: afterScore.
|
|
251
|
-
securityPosture: afterScore.
|
|
252
|
-
codeQuality: afterScore.
|
|
321
|
+
taskCompletion: afterScore.memoryQuality - beforeScore.memoryQuality,
|
|
322
|
+
deploymentReadiness: afterScore.retrievalPerformance - beforeScore.retrievalPerformance,
|
|
323
|
+
architectureCompliance: afterScore.entityCoherence - beforeScore.entityCoherence,
|
|
324
|
+
securityPosture: afterScore.contextUtilization - beforeScore.contextUtilization,
|
|
325
|
+
codeQuality: afterScore.decisionAlignment - beforeScore.decisionAlignment,
|
|
253
326
|
},
|
|
254
|
-
scoreConfidence: afterScore.confidence
|
|
327
|
+
scoreConfidence: afterScore.confidence,
|
|
255
328
|
};
|
|
256
329
|
// Update execution with score impact
|
|
257
330
|
execution.scoreImpact = scoreImpact;
|
|
258
|
-
// Update intent score tracking
|
|
331
|
+
// Update intent score tracking - map memory scores to legacy component names
|
|
259
332
|
if (intent.scoreTracking) {
|
|
260
333
|
intent.scoreTracking.currentScore = afterScore.overall;
|
|
261
334
|
intent.scoreTracking.componentScores = {
|
|
262
|
-
taskCompletion: afterScore.
|
|
263
|
-
deploymentReadiness: afterScore.
|
|
264
|
-
architectureCompliance: afterScore.
|
|
265
|
-
securityPosture: afterScore.
|
|
266
|
-
codeQuality: afterScore.
|
|
335
|
+
taskCompletion: afterScore.memoryQuality,
|
|
336
|
+
deploymentReadiness: afterScore.retrievalPerformance,
|
|
337
|
+
architectureCompliance: afterScore.entityCoherence,
|
|
338
|
+
securityPosture: afterScore.contextUtilization,
|
|
339
|
+
codeQuality: afterScore.decisionAlignment,
|
|
267
340
|
};
|
|
268
341
|
intent.scoreTracking.lastScoreUpdate = new Date().toISOString();
|
|
269
342
|
// Calculate progress if we have initial score
|
|
@@ -274,9 +347,10 @@ export class KnowledgeGraphManager {
|
|
|
274
347
|
// Calculate progress as percentage of improvement toward target
|
|
275
348
|
const totalPossibleImprovement = targetScore - initialScore;
|
|
276
349
|
const actualImprovement = currentScore - initialScore;
|
|
277
|
-
intent.scoreTracking.scoreProgress =
|
|
278
|
-
|
|
279
|
-
|
|
350
|
+
intent.scoreTracking.scoreProgress =
|
|
351
|
+
totalPossibleImprovement > 0
|
|
352
|
+
? Math.min(100, (actualImprovement / totalPossibleImprovement) * 100)
|
|
353
|
+
: 0;
|
|
280
354
|
}
|
|
281
355
|
}
|
|
282
356
|
// Add to score history
|
|
@@ -287,14 +361,14 @@ export class KnowledgeGraphManager {
|
|
|
287
361
|
intentId,
|
|
288
362
|
overallScore: afterScore.overall,
|
|
289
363
|
componentScores: {
|
|
290
|
-
taskCompletion: afterScore.
|
|
291
|
-
deploymentReadiness: afterScore.
|
|
292
|
-
architectureCompliance: afterScore.
|
|
293
|
-
securityPosture: afterScore.
|
|
294
|
-
codeQuality: afterScore.
|
|
364
|
+
taskCompletion: afterScore.memoryQuality,
|
|
365
|
+
deploymentReadiness: afterScore.retrievalPerformance,
|
|
366
|
+
architectureCompliance: afterScore.entityCoherence,
|
|
367
|
+
securityPosture: afterScore.contextUtilization,
|
|
368
|
+
codeQuality: afterScore.decisionAlignment,
|
|
295
369
|
},
|
|
296
370
|
triggerEvent: `Tool executed: ${toolName}`,
|
|
297
|
-
confidence: afterScore.confidence
|
|
371
|
+
confidence: afterScore.confidence,
|
|
298
372
|
});
|
|
299
373
|
// Keep only last 100 score history entries
|
|
300
374
|
if (kg.scoreHistory.length > 100) {
|
|
@@ -319,8 +393,8 @@ export class KnowledgeGraphManager {
|
|
|
319
393
|
scoreHistory: scoreHistory.map(h => ({
|
|
320
394
|
timestamp: h.timestamp,
|
|
321
395
|
score: h.overallScore,
|
|
322
|
-
triggerEvent: h.triggerEvent
|
|
323
|
-
}))
|
|
396
|
+
triggerEvent: h.triggerEvent,
|
|
397
|
+
})),
|
|
324
398
|
};
|
|
325
399
|
}
|
|
326
400
|
/**
|
|
@@ -328,14 +402,16 @@ export class KnowledgeGraphManager {
|
|
|
328
402
|
*/
|
|
329
403
|
async getProjectScoreTrends() {
|
|
330
404
|
const kg = await this.loadKnowledgeGraph();
|
|
331
|
-
|
|
405
|
+
// Calculate memory-based health score
|
|
406
|
+
const kgData = await this.loadKnowledgeGraph();
|
|
407
|
+
const currentScore = await this.calculateMemoryScore(kgData);
|
|
332
408
|
const scoreHistory = kg.scoreHistory || [];
|
|
333
409
|
const intentImpacts = kg.intents
|
|
334
410
|
.filter(i => i.scoreTracking?.initialScore !== undefined && i.scoreTracking?.currentScore !== undefined)
|
|
335
411
|
.map(i => ({
|
|
336
412
|
intentId: i.intentId,
|
|
337
413
|
humanRequest: i.humanRequest,
|
|
338
|
-
scoreImprovement:
|
|
414
|
+
scoreImprovement: i.scoreTracking.currentScore - i.scoreTracking.initialScore,
|
|
339
415
|
}))
|
|
340
416
|
.sort((a, b) => b.scoreImprovement - a.scoreImprovement)
|
|
341
417
|
.slice(0, 5);
|
|
@@ -348,10 +424,10 @@ export class KnowledgeGraphManager {
|
|
|
348
424
|
timestamp: h.timestamp,
|
|
349
425
|
score: h.overallScore,
|
|
350
426
|
triggerEvent: h.triggerEvent,
|
|
351
|
-
...(h.intentId && { intentId: h.intentId })
|
|
427
|
+
...(h.intentId && { intentId: h.intentId }),
|
|
352
428
|
})),
|
|
353
429
|
averageImprovement,
|
|
354
|
-
topImpactingIntents: intentImpacts
|
|
430
|
+
topImpactingIntents: intentImpacts,
|
|
355
431
|
};
|
|
356
432
|
}
|
|
357
433
|
/**
|
|
@@ -365,11 +441,12 @@ export class KnowledgeGraphManager {
|
|
|
365
441
|
parsedGoals: [
|
|
366
442
|
`Analyze project structure at ${structureSnapshot.projectPath}`,
|
|
367
443
|
`Record directory structure and technology patterns`,
|
|
368
|
-
`Track architectural decisions and dependencies
|
|
444
|
+
`Track architectural decisions and dependencies`,
|
|
369
445
|
],
|
|
370
446
|
priority: 'medium',
|
|
371
447
|
timestamp: structureSnapshot.timestamp,
|
|
372
|
-
toolChain: [
|
|
448
|
+
toolChain: [
|
|
449
|
+
{
|
|
373
450
|
toolName: 'analyze_project_ecosystem',
|
|
374
451
|
parameters: {
|
|
375
452
|
projectPath: structureSnapshot.projectPath,
|
|
@@ -377,22 +454,173 @@ export class KnowledgeGraphManager {
|
|
|
377
454
|
recursiveDepth: structureSnapshot.recursiveDepth,
|
|
378
455
|
technologyFocus: structureSnapshot.technologyFocus,
|
|
379
456
|
analysisScope: structureSnapshot.analysisScope,
|
|
380
|
-
includeEnvironment: structureSnapshot.includeEnvironment
|
|
457
|
+
includeEnvironment: structureSnapshot.includeEnvironment,
|
|
381
458
|
},
|
|
382
459
|
result: {
|
|
383
460
|
structureData: structureSnapshot.structureData,
|
|
384
|
-
timestamp: structureSnapshot.timestamp
|
|
461
|
+
timestamp: structureSnapshot.timestamp,
|
|
385
462
|
},
|
|
386
463
|
todoTasksCreated: [],
|
|
387
464
|
todoTasksModified: [],
|
|
388
465
|
executionTime: structureSnapshot.timestamp,
|
|
389
|
-
success: true
|
|
390
|
-
}
|
|
466
|
+
success: true,
|
|
467
|
+
},
|
|
468
|
+
],
|
|
391
469
|
currentStatus: 'completed',
|
|
392
470
|
todoMdSnapshot: '', // No specific TODO.md impact for structure analysis
|
|
393
|
-
tags: ['project-structure', 'ecosystem-analysis', 'architecture']
|
|
471
|
+
tags: ['project-structure', 'ecosystem-analysis', 'architecture'],
|
|
394
472
|
};
|
|
395
473
|
await this.createIntent(intent.humanRequest, intent.parsedGoals, intent.priority);
|
|
396
474
|
}
|
|
475
|
+
/**
|
|
476
|
+
* Calculate memory-based health score from knowledge graph
|
|
477
|
+
*/
|
|
478
|
+
async calculateMemoryScore(kg) {
|
|
479
|
+
// Extract memories from intents and their tool executions
|
|
480
|
+
const memories = this.extractMemoriesFromKG(kg);
|
|
481
|
+
// Calculate retrieval metrics from tool execution patterns
|
|
482
|
+
const retrievalMetrics = this.calculateRetrievalMetrics(kg);
|
|
483
|
+
// Build entity graph from intents and relationships
|
|
484
|
+
const entityGraph = this.buildEntityGraph(kg);
|
|
485
|
+
return this.memoryScoring.calculateMemoryHealth(memories, retrievalMetrics, entityGraph);
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Extract memory representations from knowledge graph
|
|
489
|
+
*/
|
|
490
|
+
extractMemoriesFromKG(kg) {
|
|
491
|
+
const memories = [];
|
|
492
|
+
kg.intents.forEach(intent => {
|
|
493
|
+
// Each intent is a memory
|
|
494
|
+
memories.push({
|
|
495
|
+
id: intent.intentId,
|
|
496
|
+
content: intent.humanRequest,
|
|
497
|
+
context: {
|
|
498
|
+
goals: intent.parsedGoals,
|
|
499
|
+
priority: intent.priority,
|
|
500
|
+
status: intent.currentStatus,
|
|
501
|
+
},
|
|
502
|
+
timestamp: intent.timestamp,
|
|
503
|
+
metadata: {
|
|
504
|
+
relevanceScore: this.calculateIntentRelevance(intent),
|
|
505
|
+
toolExecutions: intent.toolChain.length,
|
|
506
|
+
},
|
|
507
|
+
relatedDecisions: intent.adrsCreated || [],
|
|
508
|
+
});
|
|
509
|
+
// Each tool execution is also a memory
|
|
510
|
+
intent.toolChain.forEach(tool => {
|
|
511
|
+
memories.push({
|
|
512
|
+
id: `${intent.intentId}-${tool.toolName}`,
|
|
513
|
+
content: `${tool.toolName} execution`,
|
|
514
|
+
context: {
|
|
515
|
+
parameters: tool.parameters,
|
|
516
|
+
result: tool.result,
|
|
517
|
+
success: tool.success,
|
|
518
|
+
},
|
|
519
|
+
timestamp: tool.executionTime,
|
|
520
|
+
metadata: {
|
|
521
|
+
relevanceScore: tool.success ? 0.8 : 0.3,
|
|
522
|
+
parentIntent: intent.intentId,
|
|
523
|
+
},
|
|
524
|
+
});
|
|
525
|
+
});
|
|
526
|
+
});
|
|
527
|
+
return memories;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Calculate retrieval metrics from tool execution patterns
|
|
531
|
+
*/
|
|
532
|
+
calculateRetrievalMetrics(kg) {
|
|
533
|
+
let totalRetrievals = 0;
|
|
534
|
+
let successfulRetrievals = 0;
|
|
535
|
+
let totalTime = 0;
|
|
536
|
+
kg.intents.forEach(intent => {
|
|
537
|
+
intent.toolChain.forEach(tool => {
|
|
538
|
+
totalRetrievals++;
|
|
539
|
+
if (tool.success)
|
|
540
|
+
successfulRetrievals++;
|
|
541
|
+
// Estimate retrieval time (would be actual in production)
|
|
542
|
+
totalTime += tool.executionTime ? 50 : 100;
|
|
543
|
+
});
|
|
544
|
+
});
|
|
545
|
+
return {
|
|
546
|
+
totalRetrievals,
|
|
547
|
+
successfulRetrievals,
|
|
548
|
+
averageRetrievalTime: totalRetrievals > 0 ? totalTime / totalRetrievals : 0,
|
|
549
|
+
precisionScore: 0.8, // Placeholder - would calculate from actual retrievals
|
|
550
|
+
recallScore: 0.7, // Placeholder - would calculate from actual retrievals
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Build entity graph from knowledge graph
|
|
555
|
+
*/
|
|
556
|
+
buildEntityGraph(kg) {
|
|
557
|
+
const entities = [];
|
|
558
|
+
const relationships = [];
|
|
559
|
+
// Intents as entities
|
|
560
|
+
kg.intents.forEach(intent => {
|
|
561
|
+
entities.push({
|
|
562
|
+
id: intent.intentId,
|
|
563
|
+
type: 'intent',
|
|
564
|
+
name: intent.humanRequest.substring(0, 50),
|
|
565
|
+
});
|
|
566
|
+
// Create relationships between intents and their tools
|
|
567
|
+
intent.toolChain.forEach(tool => {
|
|
568
|
+
entities.push({
|
|
569
|
+
id: `tool-${tool.toolName}`,
|
|
570
|
+
type: 'tool',
|
|
571
|
+
name: tool.toolName,
|
|
572
|
+
});
|
|
573
|
+
relationships.push({
|
|
574
|
+
sourceId: intent.intentId,
|
|
575
|
+
targetId: `tool-${tool.toolName}`,
|
|
576
|
+
type: 'uses',
|
|
577
|
+
strength: tool.success ? 0.9 : 0.3,
|
|
578
|
+
});
|
|
579
|
+
});
|
|
580
|
+
});
|
|
581
|
+
// Add ADR entities and relationships
|
|
582
|
+
kg.intents.forEach(intent => {
|
|
583
|
+
(intent.adrsCreated || []).forEach((adrId) => {
|
|
584
|
+
entities.push({
|
|
585
|
+
id: `adr-${adrId}`,
|
|
586
|
+
type: 'decision',
|
|
587
|
+
name: `ADR ${adrId}`,
|
|
588
|
+
});
|
|
589
|
+
relationships.push({
|
|
590
|
+
sourceId: intent.intentId,
|
|
591
|
+
targetId: `adr-${adrId}`,
|
|
592
|
+
type: 'created',
|
|
593
|
+
strength: 0.95,
|
|
594
|
+
});
|
|
595
|
+
});
|
|
596
|
+
});
|
|
597
|
+
return {
|
|
598
|
+
entities,
|
|
599
|
+
relationships,
|
|
600
|
+
decisions: entities.filter(e => e.type === 'decision'),
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Calculate relevance score for an intent
|
|
605
|
+
*/
|
|
606
|
+
calculateIntentRelevance(intent) {
|
|
607
|
+
const now = new Date();
|
|
608
|
+
const age = now.getTime() - new Date(intent.timestamp).getTime();
|
|
609
|
+
const ageInDays = age / (24 * 60 * 60 * 1000);
|
|
610
|
+
// Base relevance on status and age
|
|
611
|
+
let relevance = 0.5;
|
|
612
|
+
if (intent.currentStatus === 'executing')
|
|
613
|
+
relevance = 0.9;
|
|
614
|
+
else if (intent.currentStatus === 'planning')
|
|
615
|
+
relevance = 0.8;
|
|
616
|
+
else if (intent.currentStatus === 'completed')
|
|
617
|
+
relevance = 0.6;
|
|
618
|
+
// Decay relevance over time
|
|
619
|
+
relevance *= Math.max(0.3, 1 - ageInDays / 30);
|
|
620
|
+
// Boost relevance if it has successful tool executions
|
|
621
|
+
const successRate = intent.toolChain.filter(t => t.success).length / (intent.toolChain.length || 1);
|
|
622
|
+
relevance = (relevance + successRate) / 2;
|
|
623
|
+
return relevance;
|
|
624
|
+
}
|
|
397
625
|
}
|
|
398
626
|
//# sourceMappingURL=knowledge-graph-manager.js.map
|