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

rUve80b76c6a4b5
diff --git a/v3/@claude-flow/cli/src/mcp-tools/neural-tools.ts b/v3/@claude-flow/cli/src/mcp-tools/neural-tools.ts
index c5465b1f45..884d8e5ca0 100644
--- a/v3/@claude-flow/cli/src/mcp-tools/neural-tools.ts
+++ b/v3/@claude-flow/cli/src/mcp-tools/neural-tools.ts
@@ -3,16 +3,34 @@
*
* V2 Compatibility - Neural network and ML tools
*
- * ⚠️ IMPORTANT: Training is SIMULATED for state management.
- * - No actual ML models are trained
- * - Patterns/embeddings are stored locally for coordination
- * - For real neural features, use @claude-flow/neural module
+ * ✅ HYBRID Implementation:
+ * - Uses @claude-flow/embeddings for REAL embeddings when available
+ * - Falls back to simulated embeddings when @claude-flow/embeddings not installed
+ * - Pattern storage and search with cosine similarity
+ * - Training progress tracked (actual model training requires external tools)
+ *
+ * Note: For production neural features, use @claude-flow/neural module
*/
import type { MCPTool } from './types.js';
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
import { join } from 'node:path';
+// Try to import real embeddings from @claude-flow/embeddings
+let realEmbeddings: { embed: (text: string) => Promise<number[]> } | null = null;
+try {
+ // Dynamic import to avoid hard dependency
+ const embeddingsModule = await import('@claude-flow/embeddings');
+ if (embeddingsModule.SimpleEmbeddings) {
+ const embedder = new embeddingsModule.SimpleEmbeddings();
+ realEmbeddings = {
+ embed: async (text: string) => embedder.embed(text),
+ };
+ }
+} catch {
+ // @claude-flow/embeddings not available, will use fallback
+}
+
// Storage paths
const STORAGE_DIR = '.claude-flow';
const NEURAL_DIR = 'neural';