ClaudeMod
Back to browse
Harnesses

claude-flow

The #1 AI automation framework — 87.8% SWE-bench verified. An advanced multi-agent orchestration system for Claude Code with enterprise-grade agentic capabilities.

Reuven Cohen29,626 starsAdded 1 months ago

🌊 RuFlo v3.5: Enterprise AI Orchestration Platform

Ruflo Banner

GitHub Project of the Day

Star on GitHub Monthly Downloads Total Downloads ruv.io Agentics Foundation Claude Code MIT License

Follow @ruv LinkedIn YouTube

Production-ready multi-agent AI orchestration for Claude Code

Deploy 100+ specialized agents in coordinated swarms with self-learning capabilities, fault-tolerant consensus, and enterprise-grade security.

Why Ruflo? Claude Flow is now Ruflo — named by Ruv, who loves Rust, flow states, and building things that feel inevitable. The "Ru" is the Ruv. The "flo" is the flow. Underneath, WASM kernels written in Rust power the policy engine, embeddings, and proof system. 6,000+ commits later, this is v3.5.

Getting into the Flow

Ruflo is a comprehensive AI agent orchestration framework that transforms Claude Code into a powerful multi-agent development platform. It enables teams to deploy, coordinate, and optimize specialized AI agents working together on complex software engineering tasks.

Self-Learning/Self-Optimizing Agent Architecture

User → Ruflo (CLI/MCP) → Router → Swarm → Agents → Memory → LLM Providers
                       ↑                          ↓
                       └──── Learning Loop ←──────┘
📐 Expanded Architecture — Full system diagram with RuVector intelligence
flowchart TB
    subgraph USER["👤 User Layer"]
        U[User]
    end

    subgraph ENTRY["🚪 Entry Layer"]
        CLI[CLI / MCP Server]
        AID[AIDefence Security]
    end

    subgraph ROUTING["🧭 Routing Layer"]
        QL[Q-Learning Router]
        MOE[MoE - 8 Experts]
        SK[Skills - 130+]
        HK[Hooks - 27]
    end

    subgraph SWARM["🐝 Swarm Coordination"]
        TOPO[Topologies<br/>mesh/hier/ring/star]
        CONS[Consensus<br/>Raft/BFT/Gossip/CRDT]
        CLM[Claims<br/>Human-Agent Coord]
    end

    subgraph AGENTS["🤖 100+ Agents"]
        AG1[coder]
        AG2[tester]
        AG3[reviewer]
        AG4[architect]
        AG5[security]
        AG6[...]
    end

    subgraph RESOURCES["📦 Resources"]
        MEM[(Memory<br/>AgentDB)]
        PROV[Providers<br/>Claude/GPT/Gemini/Ollama]
        WORK[Workers - 12<br/>ultralearn/audit/optimize]
    end

    subgraph RUVECTOR["🧠 RuVector Intelligence Layer"]
        direction TB
        subgraph ROW1[" "]
            SONA[SONA<br/>Self-Optimize<br/>&lt;0.05ms]
            EWC[EWC++<br/>No Forgetting]
            FLASH[Flash Attention<br/>2.49-7.47x]
        end
        subgraph ROW2[" "]
            HNSW[HNSW<br/>150x-12,500x faster]
            RB[ReasoningBank<br/>Pattern Store]
            HYP[Hyperbolic<br/>Poincaré]
        end
        subgraph ROW3[" "]
            LORA[LoRA/Micro<br/>128x compress]
            QUANT[Int8 Quant<br/>3.92x memory]
            RL[9 RL Algos<br/>Q/SARSA/PPO/DQN]
        end
    end

    subgraph LEARNING["🔄 Learning Loop"]
        L1[RETRIEVE] --> L2[JUDGE] --> L3[DISTILL] --> L4[CONSOLIDATE] --> L5[ROUTE]
    end

    U --> CLI
    CLI --> AID
    AID --> QL & MOE & SK & HK
    QL & MOE & SK & HK --> TOPO & CONS & CLM
    TOPO & CONS & CLM --> AG1 & AG2 & AG3 & AG4 & AG5 & AG6
    AG1 & AG2 & AG3 & AG4 & AG5 & AG6 --> MEM & PROV & WORK
    MEM --> SONA & EWC & FLASH
    SONA & EWC & FLASH --> HNSW & RB & HYP
    HNSW & RB & HYP --> LORA & QUANT & RL
    LORA & QUANT & RL --> L1
    L5 -.->|loops back| QL

    style RUVECTOR fill:#1a1a2e,stroke:#e94560,stroke-width:2px
    style LEARNING fill:#0f3460,stroke:#e94560,stroke-width:2px
    style USER fill:#16213e,stroke:#0f3460
    style ENTRY fill:#1a1a2e,stroke:#0f3460
    style ROUTING fill:#1a1a2e,stroke:#0f3460
    style SWARM fill:#1a1a2e,stroke:#0f3460
    style AGENTS fill:#1a1a2e,stroke:#0f3460
    style RESOURCES fill:#1a1a2e,stroke:#0f3460

RuVector Components (included with Ruflo):

ComponentPurposePerformance
SONASelf-Optimizing Neural Architecture - learns optimal routingFast adaptation
EWC++Elastic Weight Consolidation - prevents catastrophic forgettingPreserves learned patterns
Flash AttentionOptimized attention computation2-7x speedup (benchmarked)
HNSWHierarchical Navigable Small World vector searchSub-millisecond retrieval
ReasoningBankPattern storage with trajectory learningRETRIEVE→JUDGE→DISTILL
HyperbolicPoincare ball embeddings for hierarchical dataBetter code relationships
LoRA/MicroLoRALow-Rank Adaptation for efficient fine-tuningLightweight adaptation
Int8 QuantizationMemory-efficient weight storage~4x memory reduction
SemanticRouterSemantic task routing with cosine similarityFast intent routing
9 RL AlgorithmsQ-Learning, SARSA, A2C, PPO, DQN, Decision Transformer, etc.Task-specific learning
# Use RuVector via Ruflo
npx ruflo@latest hooks intelligence --status

Get Started Fast

# One-line install (recommended)
curl -fsSL https://cdn.jsdelivr.net/gh/ruvnet/ruflo@main/scripts/install.sh | bash

# Or full setup with MCP + diagnostics
curl -fsSL https://cdn.jsdelivr.net/gh/ruvnet/ruflo@main/scripts/install.sh | bash -s -- --full

# Or via npx
npx ruflo@latest init --wizard

New to Ruflo? You don't need to learn 310+ MCP tools or 26 CLI commands. After running init, just use Claude Code normally — the hooks system automatically routes tasks to the right agents, learns from successful patterns, and coordinates multi-agent work in the background. The advanced tools exist for fine-grained control when you need it.


Key Capabilities

🤖 100+ Specialized Agents - Ready-to-use AI agents for coding, code review, testing, security audits, documentation, and DevOps. Each agent is optimized for its specific role.

🐝 Coordinated Agent Teams - Run unlimited agents simultaneously in organized swarms. Agents spawn sub-workers, communicate, share context, and divide work automatically using hierarchical (queen/workers) or mesh (peer-to-peer) patterns.

🧠 Learns From Your Workflow - The system remembers what works. Successful patterns are stored and reused, routing similar tasks to the best-performing agents. Gets smarter over time.

🔌 Works With Any LLM - Switch between Claude, GPT, Gemini, Cohere, or local models like Llama. Automatic failover if one provider is unavailable. Smart routing picks the cheapest option that meets quality requirements.

Plugs Into Claude Code - Native integration via MCP (Model Context Protocol). Use ruflo commands directly in your Claude Code sessions with full tool access.

🔒 Production-Ready Security - Built-in protection against prompt injection, input validation, path traversal prevention, command injection blocking, and safe credential handling.

🧩 Extensible Plugin System - Add custom capabilities with the plugin SDK. Create workers, hooks, providers, and security modules. Share plugins via the decentralized IPFS marketplace.


A multi-purpose Agent Tool Kit

🔄 Core Flow — How requests move through the system

Every request flows through four layers: from your CLI or Claude Code interface, through intelligent routing, to specialized agents, and finally to LLM providers for reasoning.

LayerComponentsWhat It Does
UserClaude Code, CLIYour interface to control and run commands
OrchestrationMCP Server, Router, HooksRoutes requests to the right agents
Agents100+ typesSpecialized workers (coder, tester, reviewer...)
ProvidersAnthropic, OpenAI, Google, OllamaAI models that power reasoning
🐝 Swarm Coordination — How agents work together

Agents organize into swarms led by queens that coordinate work, prevent drift, and reach consensus on decisions—even when some agents fail.

LayerComponentsWhat It Does
CoordinationQueen, Swarm, ConsensusManages agent teams (Raft, Byzantine, Gossip)
Drift ControlHierarchical topology, CheckpointsPrevents agents from going off-task
Hive MindQueen-led hierarchy, Collective memoryStrategic/tactical/adaptive queens coordinate workers
ConsensusByzantine, Weighted, MajorityFault-tolerant decisions (2/3 majority for BFT)

Hive Mind Capabilities:

  • 🐝 Queen Types: Strategic (planning), Tactical (execution), Adaptive (optimization)
  • 👷 8 Worker Types: Researcher, Coder, Analyst, Tester, Architect, Reviewer, Optimizer, Documenter
  • 🗳️ 3 Consensus Algorithms: Majority, Weighted (Queen 3x), Byzantine (f < n/3)
  • 🧠 Collective Memory: Shared knowledge, LRU cache, SQLite persistence with WAL
  • Performance: Fast batch spawning with parallel agent coordination
🧠 Intelligence & Memory — How the system learns and remembers

The system stores successful patterns in vector memory, builds a knowledge graph for structural understanding, learns from outcomes via neural networks, and adapts routing based on what works best.

LayerComponentsWhat It Does
MemoryHNSW, AgentDB, CacheStores and retrieves patterns with fast HNSW search
Knowledge GraphMemoryGraph, PageRank, CommunitiesIdentifies influential insights, detects clusters (ADR-049)
Self-LearningLearningBridge, SONA, ReasoningBankTriggers learning from insights, confidence lifecycle (ADR-049)
Agent ScopesAgentMemoryScope, 3-scope dirsPer-agent isolation + cross-agent knowledge transfer (ADR-049)
EmbeddingsONNX Runtime, MiniLMLocal vectors without API calls (75x faster)
LearningSONA, MoE, ReasoningBankSelf-improves from results (<0.05ms adaptation)
Fine-tuningMicroLoRA, EWC++Lightweight adaptation without full retraining
Optimization — How to reduce cost and latency

Skip expensive LLM calls for simple tasks using WebAssembly transforms, and compress tokens to reduce API costs by 30-50%.

LayerComponentsWhat It Does
Agent BoosterWASM, AST analysisSkips LLM for simple edits (<1ms)
Token OptimizerCompression, CachingReduces token usage 30-50%
🔧 Operations — Background services and integrations

Background daemons handle security audits, performance optimization, and session persistence automatically while you work.

LayerComponentsWhat It Does
BackgroundDaemon, 12 WorkersAuto-runs audits, optimization, learning
SecurityAIDefence, ValidationBlocks injection, detects threats
SessionsPersist, Restore, ExportSaves context across conversations
GitHubPR, Issues, WorkflowsManages repos and code reviews
AnalyticsMetrics, BenchmarksMonitors performance, finds bottlenecks
🎯 Task Routing — Extend your Claude Code subscription by 250%

Smart routing skips expensive LLM calls when possible. Simple edits use WASM (free), medium tasks use cheaper models. This can extend your Claude Code usage by 250% or save significantly on direct API costs.

ComplexityHandlerSpeed
SimpleAgent Booster (WASM)<1ms
MediumHaiku/Sonnet~500ms
ComplexOpus + Swarm2-5s
Agent Booster (WASM) — Skip LLM for simple code transforms

Agent Booster uses WebAssembly to handle simple code transformations without calling the LLM at all. When the hooks system detects a simple task, it routes directly to Agent Booster for instant results.

Supported Transform Intents:

IntentWhat It DoesExample
var-to-constConvert var/let to constvar x = 1const x = 1
add-typesAdd TypeScript type annotationsfunction foo(x)function foo(x: string)
add-error-handlingWrap in try/catchAdds proper error handling
async-awaitConvert promises to async/await.then() chains → await
add-loggingAdd console.log statementsAdds debug logging
remove-consoleStrip console.* callsRemoves all console statements

Hook Signals:

When you see these in hook output, the system is telling you how to optimize:

# Agent Booster available - skip LLM entirely
[AGENT_BOOSTER_AVAILABLE] Intent: var-to-const
→ Use Edit tool directly, 352x faster than LLM

# Model recommendation for Task tool
[TASK_MODEL_RECOMMENDATION] Use model="haiku"
→ Pass model="haiku" to Task tool for cost savings

Performance:

MetricAgent BoosterLLM Call
Latency<1ms2-5s
Cost$0$0.0002-$0.015
Speedup352x fasterbaseline
💰 Token Optimizer — 30-50% token reduction

The Token Optimizer integrates agentic-flow optimizations to reduce API costs by compressing context and caching results.

Savings Breakdown:

OptimizationToken SavingsHow It Works
ReasoningBank retrieval-32%Fetches relevant patterns instead of full context
Agent Booster edits-15%Simple edits skip LLM entirely
Cache (95% hit rate)-10%Reuses embeddings and patterns
Optimal batch size-20%Groups related operations
Combined30-50%Stacks multiplicatively

Usage:

import { getTokenOptimizer } from '@claude-flow/integration';
const optimizer = await getTokenOptimizer();

// Get compact context (32% fewer tokens)
const ctx = await optimizer.getCompactContext("auth patterns");

// Optimized edit (352x faster for simple transforms)
await optimizer.optimizedEdit(file, oldStr, newStr, "typescript");

// Optimal config for swarm (100% success rate)
const config = optimizer.getOptimalConfig(agentCount);
🛡️ Anti-Drift Swarm Configuration — Prevent goal drift in multi-agent work

Complex swarms can drift from their original goals. Ruflo V3 includes anti-drift defaults that prevent agents from going off-task.

Recommended Configuration:

// Anti-drift defaults (ALWAYS use for coding tasks)
swarm_init({
  topology: "hierarchical",  // Single coordinator enforces alignment
  maxAgents: 8,              // Smaller team = less drift surface
  strategy: "specialized"    // Clear roles reduce ambiguity
})

Why This Prevents Drift:

SettingAnti-Drift Benefit
hierarchicalCoordinator validates each output against goal, catches divergence early
maxAgents: 6-8Fewer agents = less coordination overhead, easier alignment
specializedClear boundaries - each agent knows exactly what to do, no overlap
raft consensusLeader maintains authoritative state, no conflicting decisions

Additional Anti-Drift Measures:

  • Frequent checkpoints via post-task hooks
  • Shared memory namespace for all agents
  • Short task cycles with verification gates
  • Hierarchical coordinator reviews all outputs

Task → Agent Routing (Anti-Drift):

CodeTask TypeRecommended Agents
1Bug Fixcoordinator, researcher, coder, tester
3Featurecoordinator, architect, coder, tester, reviewer
5Refactorcoordinator, architect, coder, reviewer
7Performancecoordinator, perf-engineer, coder
9Securitycoordinator, security-architect, auditor
11Memorycoordinator, memory-specialist, perf-engineer

Claude Code: With vs Without Ruflo

CapabilityClaude Code AloneClaude Code + Ruflo
Agent CollaborationAgents work in isolation, no shared contextAgents collaborate via swarms with shared memory and consensus
CoordinationManual orchestration between tasksQueen-led hierarchy with 5 consensus algorithms (Raft, Byzantine, Gossip)
Hive Mind⛔ Not available🐝 Queen-led swarms with collective intelligence, 3 queen types, 8 worker types
Consensus⛔ No multi-agent decisionsByzantine fault-tolerant voting (f < n/3), weighted, majority
MemorySession-only, no persistenceHNSW vector memory with sub-ms retrieval + knowledge graph
Vector Database⛔ No native support🐘 RuVector PostgreSQL with 77+ SQL functions, ~61µs search, 16,400 QPS
Knowledge Graph⛔ Flat insight listsPageRank + community detection identifies influential insights (ADR-049)
Collective Memory⛔ No shared knowledgeShared knowledge base with LRU cache, SQLite persistence, 8 memory types
LearningStatic behavior, no adaptationSONA self-learning with <0.05ms adaptation, LearningBridge for insights
Agent ScopingSingle project scope3-scope agent memory (project/local/user) with cross-agent transfer
Task RoutingYou decide which agent to useIntelligent routing based on learned patterns (89% accuracy)
Complex TasksManual breakdown requiredAutomatic decomposition across 5 domains (Security, Core, Integration, Support)
Background WorkersNothing runs automatically12 context-triggered workers auto-dispatch on file changes, patterns, sessions
LLM ProviderAnthropic only6 providers with automatic failover and cost-based routing (85% savings)
SecurityStandard protectionsCVE-hardened with bcrypt, input validation, path traversal prevention
PerformanceBaselineFaster tasks via parallel swarm spawning and intelligent routing

Quick Start

Prerequisites

  • Node.js 20+ (required)
  • npm 9+ / pnpm / bun package manager

IMPORTANT: Claude Code must be installed first:

# 1. Install Claude Code globally
npm install -g @anthropic-ai/claude-code

# 2. (Optional) Skip permissions check for faster setup
claude --dangerously-skip-permissions

Installation

One-Line Install (Recommended)

# curl-style installer with progress display
curl -fsSL https://cdn.jsdelivr.net/gh/ruvnet/ruflo@main/scripts/install.sh | bash

# Full setup (global + MCP + diagnostics)
curl -fsSL https://cdn.jsdelivr.net/gh/ruvnet/ruflo@main/scripts/install.sh | bash -s -- --full
Install Options
OptionDescription
--global, -gInstall globally (npm install -g)
--minimal, -mSkip optional deps (faster, ~15s)
--setup-mcpAuto-configure MCP server for Claude Code
--doctor, -dRun diagnostics after install
--no-initSkip project initialization (init runs by default)
--full, -fFull setup: global + MCP + doctor
--version=X.X.XInstall specific version

Examples:

# Minimal global install (fastest)
curl ... | bash -s -- --global --minimal

# With MCP auto-setup
curl ... | bash -s -- --global --setup-mcp

# Full setup with diagnostics
curl ... | bash -s -- --full

Speed:

ModeTime
npx (cached)~3s
npx (fresh)~20s
global~35s
--minimal~15s

npm/npx Install

# Quick start (no install needed)
npx ruflo@latest init

# Or install globally
npm install -g ruflo@latest
ruflo init

# With Bun (faster)
bunx ruflo@latest init

Install Profiles

ProfileSizeUse Case
--omit=optional~45MBCore CLI only (fastest)
Default~340MBFull install with ML/embeddings
# Minimal install (skip ML/embeddings)
npm install -g ruflo@latest --omit=optional
🤖 OpenAI Codex CLI Support — Full Codex integration with self-learning

Ruflo supports both Claude Code and OpenAI Codex CLI via the @claude-flow/codex package, following the Agentics Foundation standard.

Quick Start for Codex

# Initialize for Codex CLI (creates AGENTS.md instead of CLAUDE.md)
npx ruflo@latest init --codex

# Full Codex setup with all 137+ skills
npx ruflo@latest init --codex --full

# Initialize for both platforms (dual mode)
npx ruflo@latest init --dual

Platform Comparison

FeatureClaude CodeOpenAI Codex
Config FileCLAUDE.mdAGENTS.md
Skills Dir.claude/skills/.agents/skills/
Skill Syntax/skill-name$skill-name
Settingssettings.jsonconfig.toml
MCPNativeVia codex mcp add
Default Modelclaude-sonnetgpt-5.3

Key Concept: Execution Model

┌─────────────────────────────────────────────────────────────────┐
│  CLAUDE-FLOW = ORCHESTRATOR (tracks state, stores memory)       │
│  CODEX = EXECUTOR (writes code, runs commands, implements)      │
└─────────────────────────────────────────────────────────────────┘

Codex does the work. Claude-flow coordinates and learns.

Dual-Mode Integration (Claude Code + Codex)

Run Claude Code for interactive development and spawn headless Codex workers for parallel background tasks:

┌─────────────────────────────────────────────────────────────────┐
│  CLAUDE CODE (interactive)  ←→  CODEX WORKERS (headless)        │
│  - Main conversation         - Parallel background execution    │
│  - Complex reasoning         - Bulk code generation            │
│  - Architecture decisions    - Test execution                   │
│  - Final integration         - File processing                  │
└─────────────────────────────────────────────────────────────────┘
# Spawn parallel Codex workers from Claude Code
claude -p "Analyze src/auth/ for security issues" --session-id "task-1" &
claude -p "Write unit tests for src/api/" --session-id "task-2" &
claude -p "Optimize database queries in src/db/" --session-id "task-3" &
wait  # Wait for all to complete
Dual-Mode FeatureBenefit
Parallel Execution4-8x faster for bulk tasks
Cost OptimizationRoute simple tasks to cheaper workers
Context PreservationShared memory across platforms
Best of BothInteractive + batch processing

Dual-Mode CLI Commands (NEW)

# List collaboration templates
npx @claude-flow/codex dual templates

# Run feature development swarm (architect → coder → tester → reviewer)
npx @claude-flow/codex dual run --template feature --task "Add user auth"

# Run security audit swarm (scanner → analyzer → fixer)
npx @claude-flow/codex dual run --template security --task "src/auth/"

# Run refactoring swarm (analyzer → planner → refactorer → validator)
npx @claude-flow/codex dual run --template refactor --task "src/legacy/"

Pre-Built Collaboration Templates

TemplatePipelinePlatforms
featurearchitect → coder → tester → reviewerClaude + Codex
securityscanner → analyzer → fixerCodex + Claude
refactoranalyzer → planner → refactorer → validatorClaude + Codex

MCP Integration for Codex

When you run init --codex, the MCP server is automatically registered:

# Verify MCP is registered
codex mcp list

# If not present, add manually:
codex mcp add ruflo -- npx ruflo mcp start

Self-Learning Workflow

1. LEARN:   memory_search(query="task keywords") → Find similar patterns
2. COORD:   swarm_init(topology="hierarchical") → Set up coordination
3. EXECUTE: YOU write code, run commands       → Codex does real work
4. REMEMBER: memory_store(key, value, namespace="patterns") → Save for future

The Intelligence Loop (ADR-050) automates this cycle through hooks. Each session automatically:

  • Builds a knowledge graph from memory entries (PageRank + Jaccard similarity)
  • Injects ranked context into every route decision
  • Tracks edit patterns and generates new insights
  • Boosts confidence for useful patterns, decays unused ones
  • Saves snapshots so you can track improvement with node .claude/helpers/hook-handler.cjs stats

MCP Tools for Learning

ToolPurposeWhen to Use
memory_searchSemantic vector searchBEFORE starting any task
memory_storeSave patterns with embeddingsAFTER completing successfully
swarm_initInitialize coordinationStart of complex tasks
agent_spawnRegister agent rolesMulti-agent workflows
neural_trainTrain on patternsPeriodic improvement

137+ Skills Available

CategoryExamples
V3 Core$v3-security-overhaul, $v3-memory-unification, $v3-performance-optimization
AgentDB$agentdb-vector-search, $agentdb-optimization, $agentdb-learning
Swarm$swarm-orchestration, $swarm-advanced, $hive-mind-advanced
GitHub$github-code-review, $github-workflow-automation, $github-multi-repo
SPARC$sparc-methodology, $sparc:architect, $sparc:coder, $sparc:tester
Flow Nexus$flow-nexus-neural, $flow-nexus-swarm, $flow-nexus:workflow
Dual-Mode$dual-spawn, $dual-coordinate, $dual-collect

Vector Search Details

  • Embedding Dimensions: 384
  • Search Algorithm: HNSW (sub-millisecond)
  • Similarity Scoring: 0-1 (higher = better)
    • Score > 0.7: Strong match, use pattern
    • Score 0.5-0.7: Partial match, adapt
    • Score < 0.5: Weak match, create new

Basic Usage

# Initialize project
npx ruflo@latest init

# Start MCP server for Claude Code integration
npx ruflo@latest mcp start

# Spawn a coding agent
npx ruflo@latest agent spawn -t coder --name my-coder

# Launch a hive-mind swarm with an objective
npx ruflo@latest hive-mind spawn "Implement user authentication"

# List available agent types
npx ruflo@latest agent list

Upgrading

# Update helpers and statusline (preserves your data)
npx ruflo@latest init upgrade

# Update AND add any missing skills/agents/commands
npx ruflo@latest init upgrade --add-missing

The --add-missing flag automatically detects and installs new skills, agents, and commands that were added in newer versions, without overwriting your existing customizations.

Claude Code MCP Integration

Add ruflo as an MCP server for seamless integration:

# Add ruflo MCP server to Claude Code
claude mcp add ruflo -- npx -y ruflo@latest mcp start

# Verify installation
claude mcp list

Once added, Claude Code can use all 313 ruflo MCP tools directly:

  • swarm_init - Initialize agent swarms
  • agent_spawn - Spawn specialized agents
  • memory_search - Search patterns with HNSW vector search
  • hooks_route - Intelligent task routing
  • And 255+ more tools...

What is it exactly? Agents that learn, build and work perpetually.

🆚 Why Ruflo v3?

Ruflo v3 introduces self-learning neural capabilities that no other agent orchestration framework offers. While competitors require manual agent configuration and static routing, Ruflo learns from every task execution, prevents catastrophic forgetting of successful patterns, and intelligently routes work to specialized experts.

🧠 Neural & Learning

FeatureRuflo v3CrewAILangGraphAutoGenManus
Self-Learning✅ SONA + EWC++
Prevents Forgetting✅ EWC++ consolidation
Pattern Learning✅ From trajectories
Expert Routing✅ MoE (8 experts)ManualGraph edgesFixed
Attention Optimization✅ Flash Attention
Low-Rank Adaptation✅ LoRA (128x compress)

💾 Memory & Embeddings

FeatureRuflo v3CrewAILangGraphAutoGenManus
Vector Memory✅ HNSW (sub-ms search)Via plugins
Knowledge Graph✅ PageRank + communities
Self-Learning Memory✅ LearningBridge (SONA)
Agent-Scoped Memory✅ 3-scope (project/local/user)
PostgreSQL Vector DB✅ RuVector (77+ SQL functions)pgvector only
Hyperbolic Embeddings✅ Poincaré ball (native + SQL)
Quantization✅ Int8 (~4x savings)
Persistent Memory✅ SQLite + AgentDB + PostgreSQLLimited
Cross-Session Context✅ Full restoration
GNN/Attention in SQL✅ 39 attention mechanisms

🐝 Swarm & Coordination

FeatureRuflo v3CrewAILangGraphAutoGenManus
Swarm Topologies✅ 4 types1111
Consensus Protocols✅ 5 (Raft, BFT, etc.)
Work Ownership✅ Claims system
Background Workers✅ 12 auto-triggered
Multi-Provider LLM✅ 6 with failover2321

🔧 Developer Experience

FeatureRuflo v3CrewAILangGraphAutoGenManus
MCP Integration✅ Native (313 tools)
Skills System✅ 42+ pre-builtLimited
Stream Pipelines✅ JSON chainsVia code
Pair Programming✅ Driver/Navigator
Auto-Updates✅ With rollback

🛡️ Security & Platform

FeatureRuflo v3CrewAILangGraphAutoGenManus
Threat Detection✅ AIDefence (<10ms)
Cloud Platform✅ Flow Nexus
Code Transforms✅ Agent Booster (WASM)
Input Validation✅ Zod + Path security

Comparison updated February 2026. Feature availability based on public documentation.

🚀 Key Differentiators — Self-learning, memory optimization, fault tolerance

What makes Ruflo different from other agent frameworks? These 10 capabilities work together to create a system that learns from experience, runs efficiently on any hardware, and keeps working even when things go wrong.

FeatureWhat It DoesTechnical Details
🧠SONALearns which agents perform best for each task type and routes work accordinglySelf-Optimizing Neural Architecture
🔒EWC++Preserves learned patterns when training on new ones — no forgettingElastic Weight Consolidation prevents catastrophic forgetting
🎯MoERoutes tasks through 8 specialized expert networks based on task typeMixture of 8 Experts with dynamic gating
Flash AttentionAccelerates attention computation for faster agent responsesOptimized attention via @ruvector/attention
🌐Hyperbolic EmbeddingsRepresents hierarchical code relationships in compact vector spacePoincare ball model for hierarchical data
📦LoRALightweight model adaptation so agents fit in limited memoryLow-Rank Adaptation via @ruvector/sona
🗜️Int8 QuantizationConverts 32-bit weights to 8-bit with minimal accuracy loss~4x memory reduction with calibrated integers
🤝Claims SystemManages task ownership between humans and agents with handoff supportWork ownership with claim/release/handoff protocols
🛡️Byzantine ConsensusCoordinates agents even when some fail or return bad resultsFault-tolerant, handles up to 1/3 failing agents
🐘RuVector PostgreSQLEnterprise-grade vector database with 77+ SQL functions for AI operationsFast vector search with GNN/attention in SQL
💰 Intelligent 3-Tier Model Routing — Save 75% on API costs, extend Claude Max 2.5x

Not every task needs the most powerful (and expensive) model. Ruflo analyzes each request and automatically routes it to the cheapest handler that can do the job well. Simple code transforms skip the LLM entirely using WebAssembly. Medium tasks use faster, cheaper models. Only complex architecture decisions use Opus.

Cost & Usage Benefits:

BenefitImpact
💵 API Cost Reduction75% lower costs by using right-sized models
⏱️ Claude Max Extension2.5x more tasks within your quota limits
🚀 Faster Simple Tasks<1ms for transforms vs 2-5s with LLM
🎯 Zero Wasted TokensSimple edits use 0 tokens (WASM handles them)

Routing Tiers:

TierHandlerLatencyCostUse Cases
1Agent Booster (WASM)<1ms$0Simple transforms: var→const, add-types, remove-console
2Haiku/Sonnet500ms-2s$0.0002-$0.003Bug fixes, refactoring, feature implementation
3Opus2-5s$0.015Architecture, security design, distributed systems

Benchmark Results: 100% routing accuracy, 0.57ms avg routing decision latency

📋 Spec-Driven Development — Build complete specs, implement without drift

Complex projects fail when implementation drifts from the original plan. Ruflo solves this with a spec-first approach: define your architecture through ADRs (Architecture Decision Records), organize code into DDD bounded contexts, and let the system enforce compliance as agents work. The result is implementations that match specifications — even across multi-agent swarms working in parallel.

How It Prevents Drift:

CapabilityWhat It Does
🎯 Spec-First PlanningAgents generate ADRs before writing code, capturing requirements and decisions
🔍 Real-Time ComplianceStatusline shows ADR compliance %, catches deviations immediately
🚧 Bounded ContextsEach domain (Security, Memory, etc.) has clear boundaries agents can't cross
Validation Gateshooks progress blocks merges that violate specifications
🔄 Living DocumentationADRs update automatically as requirements evolve

Specification Features:

FeatureDescription
Architecture Decision Records70+ ADRs defining system behavior, integration patterns, and security requirements
Domain-Driven Design5 bounded contexts with clean interfaces preventing cross-domain pollution
Automated Spec GenerationAgents create specs from requirements using SPARC methodology
Drift DetectionContinuous monitoring flags when code diverges from spec
Hierarchical CoordinationQueen agent enforces spec compliance across all worker agents

DDD Bounded Contexts:

┌─────────────┐  ┌─────────────┐  ┌─────────────┐
│    Core     │  │   Memory    │  │  Security   │
│  Agents,    │  │  AgentDB,   │  │  AIDefence, │
│  Swarms,    │  │  HNSW,      │  │  Validation │
│  Tasks      │  │  Cache      │  │  CVE Fixes  │
└─────────────┘  └─────────────┘  └─────────────┘
┌─────────────┐  ┌─────────────┐
│ Integration │  │Coordination │
│ agentic-    │  │  Consensus, │
│ flow,MCP    │  │  Hive-Mind  │
└─────────────┘  └─────────────┘

Key ADRs:

  • ADR-001: agentic-flow@alpha as foundation (eliminates 10,000+ duplicate lines)
  • ADR-006: Unified Memory Service with AgentDB
  • ADR-008: Vitest testing framework (10x faster than Jest)
  • ADR-009: Hybrid Memory Backend (SQLite + HNSW)
  • ADR-026: Intelligent 3-tier model routing
  • ADR-048: Auto Memory Bridge (Claude Code ↔ AgentDB bidirectional sync)
  • ADR-049: Self-Learning Memory with GNN (LearningBridge, MemoryGraph, AgentMemoryScope)

🏗️ Architecture Diagrams

📊 System Overview — High-level architecture
flowchart TB
    subgraph User["👤 User Layer"]
        CC[Claude Code]
        CLI[CLI Commands]
    end

    subgraph Orchestration["🎯 Orchestration Layer"]
        MCP[MCP Server]
        Router[Intelligent Router]
        Hooks[Self-Learning Hooks]
    end

    subgraph Agents["🤖 Agent Layer"]
        Queen[Queen Coordinator]
        Workers[100+ Specialized Agents]
        Swarm[Swarm Manager]
    end

    subgraph Intelligence["🧠 Intelligence Layer"]
        SONA[SONA Learning]
        MoE[Mixture of Experts]
        HNSW[HNSW Vector Search]
    end

    subgraph Providers["☁️ Provider Layer"]
        Anthropic[Anthropic]
        OpenAI[OpenAI]
        Google[Google]
        Ollama[Ollama]
    end

    CC --> MCP
    CLI --> MCP
    MCP --> Router
    Router --> Hooks
    Hooks --> Queen
    Queen --> Workers
    Queen --> Swarm
    Workers --> Intelligence
    Intelligence --> Providers
🔄 Request Flow — How tasks are processed
sequenceDiagram
    participant U as User
    participant R as Router
    participant H as Hooks
    participant A as Agent Pool
    participant M as Memory
    participant P as Provider

    U->>R: Submit Task
    R->>H: pre-task hook
    H->>H: Analyze complexity

    alt Simple Task
        H->>A: Agent Booster (WASM)
        A-->>U: Result (<1ms)
    else Medium Task
        H->>A: Spawn Haiku Agent
        A->>M: Check patterns
        M-->>A: Cached context
        A->>P: LLM Call
        P-->>A: Response
        A->>H: post-task hook
        H->>M: Store patterns
        A-->>U: Result
    else Complex Task
        H->>A: Spawn Swarm
        A->>A: Coordinate agents
        A->>P: Multiple LLM calls
        P-->>A: Responses
        A->>H: post-task hook
        A-->>U: Result
    end
🧠 Memory Architecture — How knowledge is stored, learned, and retrieved
flowchart LR
    subgraph Input["📥 Input"]
        Query[Query/Pattern]
        Insight[New Insight]
    end

    subgraph Processing["⚙️ Processing"]
        Embed[ONNX Embeddings]
        Normalize[Normalization]
        Learn[LearningBridge<br/>SONA + ReasoningBank]
    end

    subgraph Storage["💾 Storage"]
        HNSW[(HNSW Index<br/>150x faster)]
        SQLite[(SQLite Cache)]
        AgentDB[(AgentDB)]
        Graph[MemoryGraph<br/>PageRank + Communities]
    end

    subgraph Retrieval["🔍 Retrieval"]
        Vector[Vector Search]
        Semantic[Semantic Match]
        Rank[Graph-Aware Ranking]
        Results[Top-K Results]
    end

    Query --> Embed
    Embed --> Normalize
    Normalize --> HNSW
    Normalize --> SQLite
    Insight --> Learn
    Learn --> AgentDB
    AgentDB --> Graph
    HNSW --> Vector
    SQLite --> Vector
    AgentDB --> Semantic
    Vector --> Rank
    Semantic --> Rank
    Graph --> Rank
    Rank --> Results

Self-Learning Memory (ADR-049):

ComponentPurposePerformance
LearningBridgeConnects insights to SONA/ReasoningBank neural pipeline0.12 ms/insight
MemoryGraphPageRank + label propagation knowledge graph2.78 ms build (1k nodes)
AgentMemoryScope3-scope agent memory (project/local/user) with cross-agent transfer1.25 ms transfer
AutoMemoryBridgeBidirectional sync: Claude Code auto memory files ↔ AgentDBADR-048
🧠 AgentDB v3 Controllers — 20+ intelligent memory controllers

Ruflo V3 integrates AgentDB v3 (3.0.0-alpha.10) providing 20+ memory controllers accessible via MCP tools and the CLI.

Core Memory:

ControllerMCP ToolDescription
HierarchicalMemoryagentdb_hierarchical-store/recallWorking → episodic → semantic memory tiers with Ebbinghaus forgetting curves and spaced repetition
MemoryConsolidationagentdb_consolidateAutomatic clustering and merging of related memories into semantic summaries
BatchOperationsagentdb_batchBulk insert/update/delete operations for high-throughput memory management
ReasoningBankagentdb_pattern-store/searchPattern storage with BM25+semantic hybrid search

Intelligence:

ControllerMCP ToolDescription
SemanticRouteragentdb_semantic-routeRoute tasks to agents using vector similarity instead of manual rules
ContextSynthesizeragentdb_context-synthesizeAuto-generate context summaries from memory entries
GNNServiceGraph neural network for intent classification and skill recommendation
SonaTrajectoryServiceRecord and predict learning trajectories for agents
GraphTransformerServiceSublinear attention, causal attention, Granger causality extraction

Causal & Explainable:

ControllerMCP ToolDescription
CausalRecallagentdb_causal-edgeRecall with causal re-ranking and utility scoring
ExplainableRecallCertificates proving why a memory was recalled
CausalMemoryGraphDirected causal relationships between memory entries
MMRDiversityRankerMaximal Marginal Relevance for diverse search results

Security & Integrity:

ControllerMCP ToolDescription
GuardedVectorBackendCryptographic proof-of-work before vector insert/search
MutationGuardToken-validated mutations with cryptographic proofs
AttestationLogImmutable audit trail of all memory operations

Optimization:

ControllerMCP ToolDescription
RVFOptimizer4-bit adaptive quantization and progressive compression

MCP Tool Examples:

# Store to hierarchical memory
agentdb_hierarchical-store --key "auth-pattern" --value "JWT refresh" --tier "semantic"

# Recall from memory tiers
agentdb_hierarchical-recall --query "authentication" --topK 5

# Run memory consolidation
agentdb_consolidate

# Batch insert
agentdb_batch --operation insert --entries '[{"key":"k1","value":"v1"}]'

# Synthesize context
agentdb_context-synthesize --query "error handling patterns"

# Semantic routing
agentdb_semantic-route --input "fix auth bug in login"

Hierarchical Memory Tiers:

┌─────────────────────────────────────────────┐
│  Working Memory                             │  ← Active context, fast access
│  Size-based eviction (1MB limit)            │
├─────────────────────────────────────────────┤
│  Episodic Memory                            │  ← Recent patterns, moderate retention
│  Importance × retention score ranking       │
├─────────────────────────────────────────────┤
│  Semantic Memory                            │  ← Consolidated knowledge, persistent
│  Promoted from episodic via consolidation   │
└─────────────────────────────────────────────┘
🐝 Swarm Topology — Multi-agent coordination patterns
flowchart TB
    subgraph Hierarchical["👑 Hierarchical (Default)"]
        Q1[Queen] --> W1[Worker 1]
        Q1 --> W2[Worker 2]
        Q1 --> W3[Worker 3]
    end

    subgraph Mesh["🕸️ Mesh"]
        M1[Agent] <--> M2[Agent]
        M2 <--> M3[Agent]
        M3 <--> M1[Agent]
    end

    subgraph Ring["💍 Ring"]
        R1[Agent] --> R2[Agent]
        R2 --> R3[Agent]
        R3 --> R1
    end

    subgraph Star["⭐ Star"]
        S1[Hub] --> S2[Agent]
        S1 --> S3[Agent]
        S1 --> S4[Agent]
    end
🔒 Security Layer — Threat detection and prevention
flowchart TB
    subgraph Input["📥 Input Validation"]
        Req[Request] --> Scan[AIDefence Scan]
        Scan --> PII[PII Detection]
        Scan --> Inject[Injection Check]
        Scan --> Jailbreak[Jailbreak Detection]
    end

    subgraph Decision["⚖️ Decision"]
        PII --> Risk{Risk Level}
        Inject --> Risk
        Jailbreak --> Risk
    end

    subgraph Action["🎬 Action"]
        Risk -->|Safe| Allow[✅ Allow]
        Risk -->|Warning| Sanitize[🧹 Sanitize]
        Risk -->|Threat| Block[⛔ Block]
    end

    subgraph Learn["📚 Learning"]
        Allow --> Log[Log Pattern]
        Sanitize --> Log
        Block --> Log
        Log --> Update[Update Model]
    end

🔌 Setup & Configuration

Connect Ruflo to your development environment.

🔌 MCP Setup — Connect Ruflo to Any AI Environment

Ruflo runs as an MCP (Model Context Protocol) server, allowing you to connect it to any MCP-compatible AI client. This means you can use Ruflo's 100+ agents, swarm coordination, and self-learning capabilities from Claude Desktop, VS Code, Cursor, Windsurf, ChatGPT, and more.

Quick Add Command

# Start Ruflo MCP server in any environment
npx ruflo@latest mcp start
🖥️ Claude Desktop

Config Location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Access: Claude → Settings → Developers → Edit Config

{
  "mcpServers": {
    "ruflo": {
      "command": "npx",
      "args": ["ruflo@latest", "mcp", "start"],
      "env": {
        "ANTHROPIC_API_KEY": "sk-ant-..."
      }
    }
  }
}

Restart Claude Desktop after saving. Look for the MCP indicator (hammer icon) in the input box.

Sources: Claude Help Center, Anthropic Desktop Extensions

⌨️ Claude Code (CLI)
# Add via CLI (recommended)
claude mcp add ruflo -- npx ruflo@latest mcp start

# Or add with environment variables
claude mcp add ruflo \
  --env ANTHROPIC_API_KEY=sk-ant-... \
  -- npx ruflo@latest mcp start

# Verify installation
claude mcp list

Sources: Claude Code MCP Docs

💻 VS Code

Requires: VS Code 1.102+ (MCP support is GA)

Method 1: Command Palette

  1. Press Cmd+Shift+P (Mac) / Ctrl+Shift+P (Windows)
  2. Run MCP: Add Server
  3. Enter server details

Method 2: Workspace Config

Create .vscode/mcp.json in your project:

{
  "mcpServers": {
    "ruflo": {
      "command": "npx",
      "args": ["ruflo@latest", "mcp", "start"],
      "env": {
        "ANTHROPIC_API_KEY": "sk-ant-..."
      }
    }
  }
}

Sources: VS Code MCP Docs, MCP Integration Guides

🎯 Cursor IDE

Method 1: One-Click (if available in Cursor MCP marketplace)

**Method 2: Manual Confi

More Harnesss

Harnesses

claude-simone

Structured project management harness for Claude Code — define milestones and sprints in markdown, then run execution loops that drive Claude through each task.

project-managementmilestonessprints+2
by Helmi
GitHub
Harnesses

Claude Squad

Multi-agent tmux orchestrator — spawn N isolated Claude Code sessions in parallel, each in its own git worktree, then merge the best results back to main.

multi-agentparalleltmux+3
by SMTG AI
GitHub
Harnesses

Claude Swarm

Distributed Claude agent swarms — agents communicate via MCP, share tool access, and collaborate on complex tasks with configurable topology and role specialization.

swarmdistributedmulti-agent+3
by parruda
GitHub

Command Palette

Search for a command to run...