Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

Checkpoint: File edits

rUve67bab7375de
diff --git a/v3/@claude-flow/cli/src/ruvector/graph-analyzer.ts b/v3/@claude-flow/cli/src/ruvector/graph-analyzer.ts
index 62cb82e300..d31a48d03e 100644
--- a/v3/@claude-flow/cli/src/ruvector/graph-analyzer.ts
+++ b/v3/@claude-flow/cli/src/ruvector/graph-analyzer.ts
@@ -15,6 +15,40 @@
import { readFile, readdir, stat } from 'fs/promises';
import { join, relative, extname, dirname, basename } from 'path';
+// ============================================================================
+// Caching for Performance
+// ============================================================================
+
+/**
+ * Cache for dependency graphs (5 minute TTL)
+ */
+const graphCache = new Map<string, { graph: DependencyGraph; timestamp: number }>();
+const GRAPH_CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes
+
+/**
+ * Cache for analysis results (2 minute TTL)
+ */
+const analysisResultCache = new Map<string, { result: GraphAnalysisResult; timestamp: number }>();
+const ANALYSIS_CACHE_TTL_MS = 2 * 60 * 1000; // 2 minutes
+
+/**
+ * Clear all graph caches
+ */
+export function clearGraphCaches(): void {
+ graphCache.clear();
+ analysisResultCache.clear();
+}
+
+/**
+ * Get cache statistics
+ */
+export function getGraphCacheStats(): { graphCacheSize: number; analysisCacheSize: number } {
+ return {
+ graphCacheSize: graphCache.size,
+ analysisCacheSize: analysisResultCache.size,
+ };
+}
+
// ============================================================================
// Types
// ============================================================================