ruflo

🏗️ Architecture

/docs/architecture--modules/architecture

Domain-Driven Design with bounded contexts, clean architecture, and measured performance across all topologies.

V3 Module Structure

ModulePurposeKey Features
@claude-flow/hooksEvent-driven lifecycleReasoningBank, 27 hooks, pattern learning
@claude-flow/memoryUnified vector storageAgentDB, RVF binary format, HnswLite, RvfMigrator, SONA persistence, LearningBridge, MemoryGraph
@claude-flow/securityCVE remediationInput validation, path security, AIDefence
@claude-flow/swarmMulti-agent coordination6 topologies, Byzantine consensus, auto-scaling
@claude-flow/pluginsWASM extensionsRuVector plugins, semantic search, intent routing
@claude-flow/cliCommand interface26 commands, 140+ subcommands, shell completions
@claude-flow/neuralSelf-learningSONA, 9 RL algorithms, EWC++ memory preservation
@claude-flow/testingQuality assuranceLondon School TDD, Vitest, fixtures, mocks
@claude-flow/deploymentRelease automationVersioning, changelogs, NPM publishing
@claude-flow/sharedCommon utilitiesTypes, validation schemas, RvfEventLog, constants
@claude-flow/browserBrowser automation59 MCP tools, element refs, trajectory learning

Architecture Principles

PrincipleImplementationBenefit
Bounded ContextsEach module owns its domainNo cross-module coupling
Dependency InjectionConstructor-based DITestable, mockable components
Event SourcingAll state changes as eventsFull audit trail, replay capability
CQRSSeparate read/write pathsOptimized queries, scalable writes
Clean ArchitectureDomain → Application → InfrastructureBusiness logic isolation

Performance Benchmarks

Benchmarks measured on Node.js 20+ with local SQLite. Results vary by hardware and workload.

CategoryMetricTargetStatus
StartupCLI cold start<500ms✅ Met
StartupMCP server init<400ms✅ Met
MemoryHNSW search<1ms✅ Sub-ms
MemoryPattern retrieval<10ms✅ Met
SwarmAgent spawn<200ms✅ Met
SwarmConsensus latency<100ms✅ Met
NeuralSONA adaptation<0.05ms⚡ Benchmarked
GraphBuild (1k nodes)<200ms✅ Met
GraphPageRank (1k nodes)<100ms✅ Met
LearningInsight recording<5ms✅ Met
LearningConsolidation<500ms✅ Met
TaskSuccess rate95%+✅ Met

Topology Performance

TopologyAgentsExecutionMemoryBest For
Centralized2-30.14-0.20s180-256 MBSimple tasks, single coordinator
Distributed4-50.10-0.12s128-160 MBParallel processing, speed
Hierarchical6+0.20s256 MBComplex tasks, clear authority
Mesh4+0.15s192 MBCollaborative, fault-tolerant
Hybrid7+0.18s320 MBMulti-domain, mixed workloads
Adaptive2+VariableDynamicAuto-scaling, unpredictable load