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 edit:

rUvea06333a0b37
diff --git a/.agentic-flow/intelligence.json b/.agentic-flow/intelligence.json
index e3899598a5..212a913ef0 100644
--- a/.agentic-flow/intelligence.json
+++ b/.agentic-flow/intelligence.json
@@ -146,7 +146,7 @@
"test-engineer": 0.6
},
"command:": {
- "success": 0.9999153585021713
+ "success": 0.9999500200419471
}
},
"sequences": {},
@@ -456,8 +456,8 @@
},
"errorPatterns": [],
"metrics": {
- "totalRoutes": 164,
- "successfulRoutes": 164,
+ "totalRoutes": 170,
+ "successfulRoutes": 170,
"routingHistory": [
{
"timestamp": "2026-01-04T15:51:13.039Z",
@@ -908,6 +908,12 @@
"task": "edit:",
"agent": "unknown",
"success": true
+ },
+ {
+ "timestamp": "2026-01-04T17:37:44.588Z",
+ "task": "edit:",
+ "agent": "unknown",
+ "success": true
}
]
},
diff --git a/.claude/statusline.sh b/.claude/statusline.sh
index ff6bda82d8..3ce0510f6a 100755
--- a/.claude/statusline.sh
+++ b/.claude/statusline.sh
@@ -90,15 +90,24 @@ fi
# Count active agentic-flow processes
ACTIVE_PROCESSES=$(ps aux 2>/dev/null | grep -E "(agentic-flow|claude-flow)" | grep -v grep | wc -l)
-# Detect running swarm agents dynamically
-if [ "$ACTIVE_PROCESSES" -gt 0 ]; then
- # Update active agents count from real processes
- # Each agentic-flow process might represent an agent or coordination process
+# Check for real-time activity data from swarm monitor
+SWARM_ACTIVITY=".claude-flow/metrics/swarm-activity.json"
+if [ -f "$SWARM_ACTIVITY" ]; then
+ # Use accurate data from swarm monitor if available
+ DYNAMIC_AGENTS=$(jq -r '.swarm.agent_count // 0' "$SWARM_ACTIVITY" 2>/dev/null || echo "0")
+ SWARM_IS_ACTIVE=$(jq -r '.swarm.active // false' "$SWARM_ACTIVITY" 2>/dev/null || echo "false")
+
+ # Override with real-time data if swarm is active
+ if [ "$SWARM_IS_ACTIVE" = "true" ] && [ "$DYNAMIC_AGENTS" -gt 0 ]; then
+ AGENTS_ACTIVE="$DYNAMIC_AGENTS"
+ INTEGRATION_STATUS="●"
+ fi
+elif [ "$ACTIVE_PROCESSES" -gt 0 ]; then
+ # Fallback to heuristic if no swarm monitor data
DYNAMIC_AGENTS=$(ps aux 2>/dev/null | grep -E "agentic-flow.*agent" | grep -v grep | wc -l)
# If we have agentic-flow processes but no specific agents, use a heuristic
if [ "$DYNAMIC_AGENTS" -eq 0 ] && [ "$ACTIVE_PROCESSES" -gt 0 ]; then
- # Assume some processes are coordination/management, others are agents
DYNAMIC_AGENTS=$((ACTIVE_PROCESSES / 2))
if [ "$DYNAMIC_AGENTS" -eq 0 ] && [ "$ACTIVE_PROCESSES" -gt 0 ]; then
DYNAMIC_AGENTS=1
@@ -107,8 +116,6 @@ if [ "$ACTIVE_PROCESSES" -gt 0 ]; then
# Override static value with dynamic detection
AGENTS_ACTIVE="$DYNAMIC_AGENTS"
-
- # Update integration status to show active when processes are running
INTEGRATION_STATUS="●"
fi
diff --git a/v3/neural/index.ts b/v3/neural/index.ts
new file mode 100644
index 0000000000..1984db3b2d
--- /dev/null
+++ b/v3/neural/index.ts
@@ -0,0 +1,342 @@
+/**
+ * V3 Neural/Learning System
+ *
+ * Complete neural learning module with SONA learning modes,
+ * ReasoningBank integration, pattern learning, and RL algorithms.
+ *
+ * Performance Targets:
+ * - SONA adaptation: <0.05ms
+ * - Pattern matching: <1ms
+ * - Learning step: <10ms
+ *
+ * @module @claude-flow/neural
+ */
+
+// =============================================================================
+// Core Types
+// =============================================================================
+
+export type {
+ // SONA Mode Types
+ SONAMode,
+ SONAModeConfig,
+ ModeOptimizations,
+
+ // Trajectory Types
+ Trajectory,
+ TrajectoryStep,
+ TrajectoryVerdict,
+ DistilledMemory,
+
+ // Pattern Types
+ Pattern,
+ PatternMatch,
+ PatternEvolution,
+
+ // RL Algorithm Types
+ RLAlgorithm,
+ RLConfig,
+ PPOConfig,
+ DQNConfig,
+ DecisionTransformerConfig,
+ CuriosityConfig,
+
+ // LoRA Types
+ LoRAConfig,
+ LoRAWeights,
+
+ // EWC Types
+ EWCConfig,
+ EWCState,
+
+ // Statistics
+ NeuralStats,
+
+ // Events
+ NeuralEvent,
+ NeuralEventListener,
+} from './types.js';
+
+// =============================================================================
+// SONA Manager
+// =============================================================================
+
+export {
+ SONAManager,
+ createSONAManager,
+ getModeConfig,
+ getModeOptimizations,
+} from './sona-manager.js';
+
+// =============================================================================
+// Learning Modes
+// =============================================================================
+
+export type { ModeImplementation } from './modes/index.js';
+
+export {
+ BaseModeImplementation,
+ RealTimeMode,
+ BalancedMode,
+ ResearchMode,
+ EdgeMode,
+ BatchMode,
+} from './modes/index.js';
+
+// =============================================================================
+// ReasoningBank
+// =============================================================================
+
+export {
+ ReasoningBank,
+ createReasoningBank,
+} from './reasoning-bank.js';
+
+export type {
+ ReasoningBankConfig,
+ RetrievalResult,
+ ConsolidationResult,
+} from './reasoning-bank.js';
+
+// =============================================================================
+// Pattern Learner
+// =============================================================================
+
+export {
+ PatternLearner,
+ createPatternLearner,
+} from './pattern-learner.js';
+
+export type { PatternLearnerConfig } from './pattern-learner.js';
+
+// =============================================================================
+// RL Algorithms
+// =============================================================================
+
+export {
+ // PPO
+ PPOAlgorithm,
+ createPPO,
+ DEFAULT_PPO_CONFIG,
+
+ // DQN
+ DQNAlgorithm,
+ createDQN,
+ DEFAULT_DQN_CONFIG,
+
+ // A2C
+ A2CAlgorithm,
+ createA2C,
+ DEFAULT_A2C_CONFIG,
+
+ // Decision Transformer
+ DecisionTransformer,
+ createDecisionTransformer,
+ DEFAULT_DT_CONFIG,
+
+ // Q-Learning
+ QLearning,
+ createQLearning,
+ DEFAULT_QLEARNING_CONFIG,
+
+ // SARSA
+ SARSAAlgorithm,
+ createSARSA,
+ DEFAULT_SARSA_CONFIG,
+
+ // Curiosity
+ CuriosityModule,
+ createCuriosity,
+ DEFAULT_CURIOSITY_CONFIG,
+
+ // Factory functions
+ createAlgorithm,
+ getDefaultConfig,
+} from './algorithms/index.js';
+
+export type {
+ A2CConfig,
+ QLearningConfig,
+ SARSAConfig,
+} from './algorithms/index.js';
+
+// =============================================================================
+// Convenience Factory
+// =============================================================================
+
+import { SONAManager, createSONAManager } from './sona-manager.js';
+import { ReasoningBank, createReasoningBank } from './reasoning-bank.js';
+import { PatternLearner, createPatternLearner } from './pattern-learner.js';
+import type { SONAMode, NeuralEventListener } from './types.js';
+
+/**
+ * Neural Learning System - Complete integrated learning module
+ */
+export class NeuralLearningSystem {
+ private sona: SONAManager;
+ private reasoningBank: ReasoningBank;
+ private patternLearner: PatternLearner;
+ private initialized = false;
+
+ constructor(mode: SONAMode = 'balanced') {
+ this.sona = createSONAManager(mode);
+ this.reasoningBank = createReasoningBank();
+ this.patternLearner = createPatternLearner();
+ }
+
+ /**
+ * Initialize the learning system
+ */
+ async initialize(): Promise<void> {
+ if (this.initialized) return;
+ await this.sona.initialize();
+ this.initialized = true;
+ }
+
+ /**
+ * Get SONA manager
+ */
+ getSONAManager(): SONAManager {
+ return this.sona;
+ }
+
+ /**
+ * Get ReasoningBank
+ */
+ getReasoningBank(): ReasoningBank {
+ return this.reasoningBank;
+ }
+
+ /**
+ * Get Pattern Learner
+ */
+ getPatternLearner(): PatternLearner {
+ return this.patternLearner;
+ }
+
+ /**
+ * Change learning mode
+ */
+ async setMode(mode: SONAMode): Promise<void> {
+ await this.sona.setMode(mode);
+ }
+
+ /**
+ * Begin tracking a task
+ */
+ beginTask(context: string, domain: 'code' | 'creative' | 'reasoning' | 'chat' | 'math' | 'general' = 'general'): string {
+ return this.sona.beginTrajectory(context, domain);
+ }
+
+ /**
+ * Record a step in the current task
+ */
+ recordStep(
+ trajectoryId: string,
+ action: string,
+ reward: number,
+ stateEmbedding: Float32Array
+ ): void {
+ this.sona.recordStep(trajectoryId, action, reward, stateEmbedding);
+ }
+
+ /**
+ * Complete a task and trigger learning
+ */
+ async completeTask(trajectoryId: string, quality?: number): Promise<void> {
+ const trajectory = this.sona.completeTrajectory(trajectoryId, quality);
+
+ if (trajectory) {
+ // Store in reasoning bank
+ this.reasoningBank.storeTrajectory(trajectory);
+
+ // Judge and potentially distill
+ await this.reasoningBank.judge(trajectory);
+ const memory = await this.reasoningBank.distill(trajectory);
+
+ // Extract pattern if successful
+ if (memory) {
+ this.patternLearner.extractPattern(trajectory, memory);
+ }
+ }
+ }
+
+ /**
+ * Find similar patterns for a task
+ */
+ async findPatterns(queryEmbedding: Float32Array, k: number = 3): Promise<import('./types.js').PatternMatch[]> {
+ return this.patternLearner.findMatches(queryEmbedding, k);
+ }
+
+ /**
+ * Retrieve relevant memories
+ */
+ async retrieveMemories(queryEmbedding: Float32Array, k: number = 3): Promise<import('./reasoning-bank.js').RetrievalResult[]> {
+ return this.reasoningBank.retrieve(queryEmbedding, k);
+ }
+
+ /**
+ * Trigger learning cycle
+ */
+ async triggerLearning(): Promise<void> {
+ await this.sona.triggerLearning('manual');
+ await this.reasoningBank.consolidate();
+ }
+
+ /**
+ * Get comprehensive statistics
+ */
+ getStats(): {
+ sona: import('./types.js').NeuralStats;
+ reasoningBank: Record<string, number>;
+ patternLearner: Record<string, number>;
+ } {
+ return {
+ sona: this.sona.getStats(),
+ reasoningBank: this.reasoningBank.getStats(),
+ patternLearner: this.patternLearner.getStats(),
+ };
+ }
+
+ /**
+ * Add event listener
+ */
+ addEventListener(listener: NeuralEventListener): void {
+ this.sona.addEventListener(listener);
+ this.reasoningBank.addEventListener(listener);
+ this.patternLearner.addEventListener(listener);
+ }
+
+ /**
+ * Cleanup resources
+ */
+ async cleanup(): Promise<void> {
+ await this.sona.cleanup();
+ this.initialized = false;
+ }
+}
+
+/**
+ * Create a complete neural learning system
+ */
+export function createNeuralLearningSystem(mode: SONAMode = 'balanced'): NeuralLearningSystem {
+ return new NeuralLearningSystem(mode);
+}
+
+// =============================================================================
+// Default Export
+// =============================================================================
+
+export default {
+ // Factories
+ createSONAManager,
+ createReasoningBank,
+ createPatternLearner,
+ createNeuralLearningSystem,
+
+ // Classes
+ SONAManager,
+ ReasoningBank,
+ PatternLearner,
+ NeuralLearningSystem,
+};