π Ruflo v3: Enterprise AI Orchestration Platform
Production-ready multi-agent AI orchestration for Claude Code
Deploy 60+ 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. 5,800 commits later, the alpha is over. 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.
Q-Learning, SARSA, A2C, PPO, DQN, Decision Transformer, etc.
Task-specific learning
1
2
# Use RuVector via Ruflonpx ruflo@latest hooks intelligence --status
Get Started Fast
1
2
3
4
5
6
7
8
# One-line install (recommended)curl -fsSL https://cdn.jsdelivr.net/gh/ruvnet/claude-flow@main/scripts/install.sh | bash
# Or full setup with MCP + diagnosticscurl -fsSL https://cdn.jsdelivr.net/gh/ruvnet/claude-flow@main/scripts/install.sh | bash -s -- --full
# Or via npxnpx ruflo@latest init --wizard
Key Capabilities
π€ 60+ 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.
π 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.
Layer
Components
What It Does
User
Claude Code, CLI
Your interface to control and run commands
Orchestration
MCP Server, Router, Hooks
Routes requests to the right agents
Agents
60+ types
Specialized workers (coder, tester, reviewerβ¦)
Providers
Anthropic, OpenAI, Google, Ollama
AI 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.
β‘ 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.
Layer
Components
What It Does
Memory
HNSW, AgentDB, Cache
Stores and retrieves patterns with fast HNSW search
Triggers learning from insights, confidence lifecycle (ADR-049)
Agent Scopes
AgentMemoryScope, 3-scope dirs
Per-agent isolation + cross-agent knowledge transfer (ADR-049)
Embeddings
ONNX Runtime, MiniLM
Local vectors without API calls (75x faster)
Learning
SONA, MoE, ReasoningBank
Self-improves from results (<0.05ms adaptation)
Fine-tuning
MicroLoRA, 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%.
Layer
Components
What It Does
Agent Booster
WASM, AST analysis
Skips LLM for simple edits (<1ms)
Token Optimizer
Compression, Caching
Reduces token usage 30-50%
π§ Operations β Background services and integrations
Background daemons handle security audits, performance optimization, and session persistence automatically while you work.
Layer
Components
What It Does
Background
Daemon, 12 Workers
Auto-runs audits, optimization, learning
Security
AIDefence, Validation
Blocks injection, detects threats
Sessions
Persist, Restore, Export
Saves context across conversations
GitHub
PR, Issues, Workflows
Manages repos and code reviews
Analytics
Metrics, Benchmarks
Monitors 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.
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:
Intent
What It Does
Example
var-to-const
Convert var/let to const
var x = 1 β const x = 1
add-types
Add TypeScript type annotations
function foo(x) β function foo(x: string)
add-error-handling
Wrap in try/catch
Adds proper error handling
async-await
Convert promises to async/await
.then() chains β await
add-logging
Add console.log statements
Adds debug logging
remove-console
Strip console.* calls
Removes all console statements
Hook Signals:
When you see these in hook output, the system is telling you how to optimize:
1
2
3
4
5
6
7
# 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:
Metric
Agent Booster
LLM Call
Latency
<1ms
2-5s
Cost
$0
$0.0002-$0.015
Speedup
352x faster
baseline
π° 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:
Optimization
Token Savings
How 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
Combined
30-50%
Stacks multiplicatively
Usage:
1
2
3
4
5
6
7
8
9
10
11
import{getTokenOptimizer}from'@claude-flow/integration';constoptimizer=awaitgetTokenOptimizer();// Get compact context (32% fewer tokens)
constctx=awaitoptimizer.getCompactContext("auth patterns");// Optimized edit (352x faster for simple transforms)
awaitoptimizer.optimizedEdit(file,oldStr,newStr,"typescript");// Optimal config for swarm (100% success rate)
constconfig=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:
1
2
3
4
5
6
// 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:
Setting
Anti-Drift Benefit
hierarchical
Coordinator validates each output against goal, catches divergence early
maxAgents: 6-8
Fewer agents = less coordination overhead, easier alignment
specialized
Clear boundaries - each agent knows exactly what to do, no overlap
raft consensus
Leader 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):
Code
Task Type
Recommended Agents
1
Bug Fix
coordinator, researcher, coder, tester
3
Feature
coordinator, architect, coder, tester, reviewer
5
Refactor
coordinator, architect, coder, reviewer
7
Performance
coordinator, perf-engineer, coder
9
Security
coordinator, security-architect, auditor
11
Memory
coordinator, memory-specialist, perf-engineer
Claude Code: With vs Without Ruflo
Capability
Claude Code Alone
Claude Code + Ruflo
Agent Collaboration
Agents work in isolation, no shared context
Agents collaborate via swarms with shared memory and consensus
Coordination
Manual orchestration between tasks
Queen-led hierarchy with 5 consensus algorithms (Raft, Byzantine, Gossip)
# Initialize for Codex CLI (creates AGENTS.md instead of CLAUDE.md)npx ruflo@latest init --codex
# Full Codex setup with all 137+ skillsnpx ruflo@latest init --codex --full
# Initialize for both platforms (dual mode)npx ruflo@latest init --dual
# Spawn parallel Codex workers from Claude Codeclaude -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 Feature
Benefit
Parallel Execution
4-8x faster for bulk tasks
Cost Optimization
Route simple tasks to cheaper workers
Context Preservation
Shared memory across platforms
Best of Both
Interactive + batch processing
Dual-Mode CLI Commands (NEW)
1
2
3
4
5
6
7
8
9
10
11
# List collaboration templatesnpx @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
Template
Pipeline
Platforms
feature
architect β coder β tester β reviewer
Claude + Codex
security
scanner β analyzer β fixer
Codex + Claude
refactor
analyzer β planner β refactorer β validator
Claude + Codex
MCP Integration for Codex
When you run init --codex, the MCP server is automatically registered:
1
2
3
4
5
# Verify MCP is registeredcodex mcp list
# If not present, add manually:codex mcp add ruflo -- npx ruflo mcp start
Self-Learning Workflow
1
2
3
4
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
# Initialize projectnpx ruflo@latest init
# Start MCP server for Claude Code integrationnpx ruflo@latest mcp start
# Run a task with agentsnpx ruflo@latest --agent coder --task "Implement user authentication"# List available agentsnpx ruflo@latest --list
Upgrading
1
2
3
4
5
# Update helpers and statusline (preserves your data)npx ruflo@v3alpha init upgrade
# Update AND add any missing skills/agents/commandsnpx ruflo@v3alpha 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:
1
2
3
4
5
# Add ruflo MCP server to Claude Codeclaude mcp add ruflo -- npx -y ruflo@latest mcp start
# Verify installationclaude mcp list
Once added, Claude Code can use all 175+ 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 170+ 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.
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.
Feature
What It Does
Technical Details
π§
SONA
Learns which agents perform best for each task type and routes work accordingly
Self-Optimizing Neural Architecture
π
EWC++
Preserves learned patterns when training on new ones β no forgetting
Routes tasks through 8 specialized expert networks based on task type
Mixture of 8 Experts with dynamic gating
β‘
Flash Attention
Accelerates attention computation for faster agent responses
Optimized attention via @ruvector/attention
π
Hyperbolic Embeddings
Represents hierarchical code relationships in compact vector space
Poincare ball model for hierarchical data
π¦
LoRA
Lightweight model adaptation so agents fit in limited memory
Low-Rank Adaptation via @ruvector/sona
ποΈ
Int8 Quantization
Converts 32-bit weights to 8-bit with minimal accuracy loss
~4x memory reduction with calibrated integers
π€
Claims System
Manages task ownership between humans and agents with handoff support
Work ownership with claim/release/handoff protocols
π‘οΈ
Byzantine Consensus
Coordinates agents even when some fail or return bad results
Fault-tolerant, handles up to 1/3 failing agents
π
RuVector PostgreSQL
Enterprise-grade vector database with 77+ SQL functions for AI operations
Fast 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.
π 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:
Capability
What It Does
π― Spec-First Planning
Agents generate ADRs before writing code, capturing requirements and decisions
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
π 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 60+ agents, swarm coordination, and self-learning capabilities from Claude Desktop, VS Code, Cursor, Windsurf, ChatGPT, and more.
Quick Add Command
1
2
# Start Ruflo MCP server in any environmentnpx ruflo@v3alpha mcp start
Use with Google AI Studio, Gemini, and other AI platforms
Native SDK Integration:
1
2
3
4
5
6
7
8
9
10
11
12
import{GoogleGenAI}from'@google/genai';constai=newGoogleGenAI({apiKey:'YOUR_API_KEY'});// MCP definitions are natively supported in the Gen AI SDK
constmcpConfig={servers:[{name:'ruflo',command:'npx',args:['ruflo@v3alpha','mcp','start']}]};
β οΈ Never hardcode API keys in config files checked into version control.
1
2
3
4
5
# Use environment variables insteadexportANTHROPIC_API_KEY="sk-ant-..."# Or use a .env file (add to .gitignore)echo"ANTHROPIC_API_KEY=sk-ant-..." >> .env
π‘οΈ @claude-flow/guidance β Long-horizon governance control plane for Claude Code agents
Overview
@claude-flow/guidance turns CLAUDE.md into a runtime governance system with enforcement gates, cryptographic proofs, and feedback loops. Agents that normally drift after 30 minutes can now operate for days β rules are enforced mechanically at every step, not remembered by the model.
π Swarm Topologies β 6 coordination patterns for any workload
Choose the right topology for your task complexity and team size.
Topology
Recommended Agents
Best For
Execution Time
Memory/Agent
Hierarchical
6+
Structured tasks, clear authority chains
0.20s
256 MB
Mesh
4+
Collaborative work, high redundancy
0.15s
192 MB
Ring
3+
Sequential processing pipelines
0.12s
128 MB
Star
5+
Centralized control, spoke workers
0.14s
180 MB
Hybrid (Hierarchical-Mesh)
7+
Complex multi-domain tasks
0.18s
320 MB
Adaptive
2+
Dynamic workloads, auto-scaling
Variable
Dynamic
π Hive Mind β Queen-led collective intelligence with consensus
The Hive Mind system implements queen-led hierarchical coordination where strategic queen agents direct specialized workers through collective decision-making and shared memory.
Install these optional plugins to extend Ruflo capabilities:
Plugin
Version
Description
Install Command
@claude-flow/plugin-agentic-qe
3.0.0-alpha.2
Quality Engineering with 58 AI agents across 12 DDD contexts. TDD, coverage analysis, security scanning, chaos engineering, accessibility testing.
npm install @claude-flow/plugin-agentic-qe
@claude-flow/plugin-prime-radiant
0.1.4
Mathematical AI interpretability with 6 engines: sheaf cohomology, spectral analysis, causal inference, quantum topology, category theory, HoTT proofs.
npm install @claude-flow/plugin-prime-radiant
@claude-flow/plugin-gastown-bridge
0.1.0
Gas Town orchestrator integration with WASM-accelerated formula parsing (352x faster), Beads sync, convoy management, and graph analysis. 20 MCP tools.
πͺ Hooks System β Pattern learning with ReasoningBank and HNSW indexing
Component
Description
Performance
ReasoningBank
Pattern storage with HNSW indexing
150x faster retrieval
GuidanceProvider
Context-aware development guidance
Real-time suggestions
PatternLearning
Automatic strategy extraction
Continuous improvement
QualityTracking
Success/failure rate per pattern
Performance metrics
DomainDetection
Auto-categorization of patterns
Security, testing, etc.
AgentRouting
Task-to-agent optimization
Historical performance
Consolidation
Prune low-quality, promote high-quality
Memory optimization
Phase
Hooks
Purpose
Pre-Edit
pre-edit
Context gathering, security checks
Post-Edit
post-edit
Outcome recording, pattern learning
Pre-Command
pre-command
Risk assessment, validation
Post-Command
post-command
Success/failure tracking
Pre-Task
pre-task
Setup, resource allocation
Post-Task
post-task
Cleanup, learning
Session
session-end, session-restore
State management
π V3 Statusline β Real-time development status for Claude Code
Real-time development status display integrated directly into Claude Codeβs status bar. Shows DDD progress, swarm activity, security status, AgentDB metrics, and live session data (model, context usage, cost).
How It Works:
Claude Code pipes JSON session data via stdin to the statusline script after each assistant message (debounced ~300ms). The script reads this data and combines it with local project metrics to produce a single-line status output.
Run npx ruflo@latest init β this generates .claude/settings.json with the correct statusline config and creates the helper script at .claude/helpers/statusline.cjs.
The generated config uses a fast local script (no npx cold-start):
.claude-flow/metrics/swarm-activity.json β Active agent counts
.claude-flow/security/audit-status.json β CVE remediation status
AgentDB files β Vector count (estimated from file size), HNSW index status
Process detection via ps aux β Real-time memory and agent counts
Git branch via git branch --show-current
GitHub user via gh api user
βοΈ Background Daemons β Auto-scheduled workers for continuous optimization
V3 Node.js Worker Daemon (Recommended)
Cross-platform TypeScript-based daemon service with auto-scheduling:
Worker
Interval
Priority
Description
map
5min
normal
Codebase structure mapping
audit
10min
critical
Security vulnerability scanning
optimize
15min
high
Performance optimization
consolidate
30min
low
Memory consolidation
testgaps
20min
normal
Test coverage analysis
Commands:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Start daemon (auto-runs on SessionStart hooks)npx ruflo@v3alpha daemon start
# Check status with worker historynpx ruflo@v3alpha daemon status
# Manually trigger a workernpx ruflo@v3alpha daemon trigger map
# Enable/disable workersnpx ruflo@v3alpha daemon enable map audit optimize
# Stop daemonnpx ruflo@v3alpha daemon stop
Daemon Status Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
+-- Worker Daemon ---+
| Status: β RUNNING |
| PID: 12345 |
| Workers Enabled: 5 |
| Max Concurrent: 3 |
+--------------------+
Worker Status
+-------------+----+----------+------+---------+----------+----------+
| Worker | On | Status | Runs | Success | Last Run | Next Run |
+-------------+----+----------+------+---------+----------+----------+
| map | β | idle | 12 | 100% | 2m ago | in 3m |
| audit | β | idle | 6 | 100% | 5m ago | in 5m |
| optimize | β | running | 4 | 100% | now | - |
| consolidate | β | idle | 2 | 100% | 15m ago | in 15m |
| testgaps | β | idle | 3 | 100% | 8m ago | in 12m |
+-------------+----+----------+------+---------+----------+----------+
Legacy Shell Daemons (V2)
Shell-based daemons for monitoring (Linux/macOS only):
Daemon
Interval
Purpose
Output
Swarm Monitor
3s
Process detection, agent counting
swarm-activity.json
Metrics Daemon
30s
V3 progress sync, SQLite metrics
metrics.db
Commands:
1
2
3
4
5
6
7
8
# Start all daemons.claude/helpers/daemon-manager.sh start 35# Check daemon status.claude/helpers/daemon-manager.sh status
# Stop all daemons.claude/helpers/daemon-manager.sh stop
Worker Manager (7 Scheduled Workers)
Worker
Interval
Purpose
perf
5 min
Performance benchmarks
health
5 min
Disk, memory, CPU monitoring
patterns
15 min
Pattern dedup & pruning
ddd
10 min
DDD progress tracking
adr
15 min
ADR compliance checking
security
30 min
Security vulnerability scans
learning
30 min
Learning pattern optimization
Commands:
1
2
3
4
5
6
7
8
# Start worker manager.claude/helpers/worker-manager.sh start 60# Force run all workers immediately.claude/helpers/worker-manager.sh force
# Check worker status.claude/helpers/worker-manager.sh status
β¨οΈ V3 CLI Commands β 26 commands with 140+ subcommands
Complete command-line interface for all Ruflo operations.
Core Commands:
Command
Subcommands
Description
init
4
Project initialization with wizard, presets, skills, hooks
agent
8
Agent lifecycle (spawn, list, status, stop, metrics, pool, health, logs)
swarm
6
Multi-agent swarm coordination and orchestration
memory
11
AgentDB memory with vector search (150x-12,500x faster)
Run npx ruflo@v3alpha doctor to diagnose and fix common issues.
Health Checks Performed:
Check
Requirement
Auto-Fix
Node.js version
20+
β Manual upgrade required
npm version
9+
β Manual upgrade required
Git installation
Any version
β Manual install required
Config file validity
Valid JSON/YAML
β Regenerates defaults
Daemon status
Running
β Restarts daemons
Memory database
SQLite writable
β Recreates if corrupt
API keys
Valid format
β Manual configuration
MCP servers
Responsive
β Restarts unresponsive servers
Disk space
>100MB free
β Manual cleanup required
TypeScript
Installed
β Installs if missing
Commands:
1
2
3
4
5
6
7
8
9
10
11
# Run full diagnosticsnpx ruflo@v3alpha doctor
# Run diagnostics with auto-fixnpx ruflo@v3alpha doctor --fix
# Check specific componentnpx ruflo@v3alpha doctor --component memory
# Verbose outputnpx ruflo@v3alpha doctor --verbose
Ruflo eliminates Claude Codeβs context window ceiling with a real-time memory management system that archives, optimizes, and restores conversation context automatically.
βΎοΈ Context Autopilot β Never lose context to compaction again
The Problem
Claude Code has a finite context window (~200K tokens). When full, it compacts β summarizing the conversation and discarding details like exact file paths, tool outputs, decision reasoning, and code snippets. This creates a βcontext cliffβ where Claude loses the ability to reference earlier work.
The Solution: Context Autopilot (ADR-051)
Ruflo intercepts the compaction lifecycle with three hooks that make context loss invisible:
1
2
3
4
5
6
7
8
9
10
11
12
Every Prompt Context Full After Compact
β β β
βΌ βΌ βΌ
UserPromptSubmit PreCompact SessionStart
β β β
Archive turns Archive + BLOCK Restore from archive
to SQLite auto-compaction via additionalContext
(incremental) (exit code 2) (importance-ranked)
β β β
βΌ βΌ βΌ
Track tokens Manual /compact Seamless continuation
Report % used still allowed with full history
How Memory is Optimized
Layer
What It Does
When
Proactive Archiving
Every user prompt archives new turns to SQLite with SHA-256 dedup
Every prompt
Token Tracking
Reads actual API usage data (input + cache tokens) for accurate %
Every prompt
Compaction Blocking
PreCompact hook returns exit code 2 to cancel auto-compaction
When context fills
Manual Compact
/compact is allowed β archives first, resets autopilot, then compresses
On user request
Importance Ranking
Entries scored by recency Γ frequency Γ richness for smart retrieval
On restore
Access Tracking
Restored entries get access_count++ creating a relevance feedback loop
On restore
Auto-Pruning
Never-accessed entries older than 30 days are automatically removed
On PreCompact
Content Compaction
Old session entries trimmed to summaries, reducing archive storage
Manual or scheduled
RuVector Sync
SQLite entries auto-replicated to PostgreSQL when configured
On PreCompact
Optimization Thresholds
Zone
Threshold
Statusline
Action
OK
<70%
π‘οΈ 43% 86.7K β (green)
Normal operation, track growth trend
Warning
70-85%
π‘οΈ 72% 144K β (yellow)
Flag approaching limit, archive aggressively
Optimize
85%+
π‘οΈ 88% 176K β³2 (red)
Prune stale entries, keep responses concise
Real-Time Statusline
The statusline shows live context metrics read from autopilot-state.json:
# Context Autopilot (all have sensible defaults)CLAUDE_FLOW_CONTEXT_AUTOPILOT=true# Enable/disable autopilot (default: true)CLAUDE_FLOW_CONTEXT_WINDOW=200000# Context window size in tokensCLAUDE_FLOW_AUTOPILOT_WARN=0.70 # Warning threshold (70%)CLAUDE_FLOW_AUTOPILOT_PRUNE=0.85 # Optimization threshold (85%)CLAUDE_FLOW_COMPACT_RESTORE_BUDGET=4000# Max chars restored after compactionCLAUDE_FLOW_RETENTION_DAYS=30# Auto-prune never-accessed entriesCLAUDE_FLOW_AUTO_OPTIMIZE=true# Importance ranking + pruning + sync
Commands
1
2
3
4
5
6
7
8
9
# Check archive status and autopilot statenode .claude/helpers/context-persistence-hook.mjs status
# Manual compact (archives first, then allows Claude Code to compress)# Use /compact in Claude Code β autopilot allows manual, blocks auto# Query archive directlysqlite3 .claude-flow/data/transcript-archive.db \
"SELECT COUNT(*), SUM(LENGTH(content)) FROM transcript_entries;"
Architecture Reference
ADR-051: Infinite Context via Compaction-to-Memory Bridge
Ruflo uses RVF β a compact binary storage format that replaces the 18MB sql.js WASM dependency with pure TypeScript. No native compilation, no WASM downloads, works everywhere Node.js runs.
πΎ RVF Storage β Binary format, vector search, migration, and auto-selection
Why RVF?
Previous versions shipped sql.js (18MB WASM blob) for persistent storage. This caused slow cold starts, large installs, and compatibility issues on ARM/Alpine. RVF eliminates all of that:
Before (sql.js)
After (RVF)
Install size
+18MB WASM
0 extra deps
Cold start
~2s (WASM compile)
<50ms
Platform support
x86/ARM issues
Runs everywhere
Native deps
Optional hnswlib-node
Pure TypeScript fallback
How it works
RVF files use a simple binary layout: a 4-byte magic header (RVF\0), a JSON metadata section, then packed entries. Each module has its own format variant:
Format
Magic Bytes
Used By
Purpose
RVF\0
0x52564600
Memory backend
Entries + HNSW index
RVEC
0x52564543
Embedding cache
Cached vectors with LRU eviction
RVFL
0x5256464C
Event log
Append-only domain events
RVLS
β
Learning store
SONA patterns + trajectories
Storage auto-selection
You donβt need to pick a backend. The DatabaseProvider tries each option in order and uses the first one available:
RVF is always available since it has zero dependencies, so it wins by default. If you have better-sqlite3 installed (e.g., for advanced queries), it gets priority.
Vector search with HnswLite
RVF includes HnswLite β a pure TypeScript implementation of the HNSW (Hierarchical Navigable Small World) algorithm for fast nearest-neighbor search. Itβs used automatically when storing entries with embeddings.
1
2
3
4
5
6
7
8
9
10
import{RvfBackend}from'@claude-flow/memory';constbackend=newRvfBackend({databasePath:'./memory.rvf'});awaitbackend.initialize();// Store entries β embeddings are indexed automatically
awaitbackend.store({id:'1',key:'auth-pattern',content:'...',embedding: vector});// Search by similarity
constresults=awaitbackend.search({embedding: queryVector,limit: 10});
Supports cosine, dot product, and Euclidean distance metrics. For large datasets (100K+ entries), install hnswlib-node for the native implementation β the backend switches automatically.
Migrating from older formats
The RvfMigrator converts between JSON files, SQLite databases, and RVF:
1
2
3
4
5
6
7
8
9
10
11
import{RvfMigrator}from'@claude-flow/memory';// Auto-detect format and migrate
awaitRvfMigrator.autoMigrate('./old-memory.db','./memory.rvf');// Or be explicit
awaitRvfMigrator.fromJsonFile('./backup.json','./memory.rvf');awaitRvfMigrator.fromSqlite('./legacy.db','./memory.rvf');// Export back to JSON for inspection
awaitRvfMigrator.toJsonFile('./memory.rvf','./export.json');
Format detection works by reading the first few bytes of the file β no file extension guessing.
Crash safety
All write operations use atomic writes: data goes to a temporary file first, then a single rename() call swaps it into place. If the process crashes mid-write, the old file stays intact.
The PersistentSonaCoordinator stores learning patterns and trajectories in RVF format, so agents retain knowledge across sessions:
1
2
3
4
5
6
7
8
9
10
11
import{PersistentSonaCoordinator}from'@claude-flow/memory';constsona=newPersistentSonaCoordinator({storePath:'./data/sona-learning.rvls',});awaitsona.initialize();// Patterns survive restarts
constsimilar=sona.findSimilarPatterns(embedding,5);sona.storePattern('routing',embedding);awaitsona.shutdown();// persists to disk
Security
RVF validates inputs at every boundary:
Path validation β null bytes and traversal attempts are rejected
Header validation β corrupted files are detected before parsing
Payload limits β event log entries cap at 100MB to prevent memory exhaustion
Dimension validation β embedding dimensions must be between 1 and 10,000
Concurrent write protection β a lock flag prevents overlapping disk flushes
Configuration
1
2
3
4
5
6
7
# Environment variablesCLAUDE_FLOW_MEMORY_BACKEND=hybrid # auto-selects RVFCLAUDE_FLOW_MEMORY_PATH=./data/memory
# Or via CLIruflo memory init --force
ruflo config set memory.backend hybrid
π§ Intelligence & Learning
Self-learning hooks, pattern recognition, and intelligent task routing.
Hooks intercept operations (file edits, commands, tasks) and learn from outcomes. Unlike static automation, hooks improve over time by tracking what works and applying those patterns to future tasks.
# Route a task with explanationnpx ruflo@v3alpha hooks route "refactor authentication to use JWT" --include-explanation
# Bootstrap intelligence from your codebasenpx ruflo@v3alpha hooks pretrain --depth deep --model-type moe
Discover and install community plugins from the live IPFS registry with 19 official plugins and live ratings via Cloud Function.
Command
Description
plugins list
List available plugins with live ratings
plugins rate
Rate a plugin (1-5 stars)
transfer plugin-search
Search plugins by type or category
transfer plugin-info
Get plugin details and dependencies
transfer plugin-featured
Browse featured plugins
transfer plugin-official
List official/verified plugins
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# List plugins with live ratings from Cloud Functionnpx ruflo@v3alpha plugins list
# Filter by typenpx ruflo@v3alpha plugins list --type integration
# Rate a pluginnpx ruflo@v3alpha plugins rate --name @claude-flow/embeddings --rating 5# Search for MCP tool pluginsnpx ruflo@v3alpha transfer plugin-search --type "mcp-tool" --verified
# Get plugin infonpx ruflo@v3alpha transfer plugin-info --name "semantic-code-search"# List official pluginsnpx ruflo@v3alpha transfer plugin-official
Live IPFS Plugin Registry
The official plugin registry is hosted on IPFS with Ed25519 signature verification:
# Fetch live registry directlycurl -s "https://gateway.pinata.cloud/ipfs/bafkreiahw4ufxwycbwwswt7rgbx6hkgnvg3rophhocatgec4bu5e7tzk2a"
IPFS Integration
Patterns and models are distributed via IPFS for decentralization and integrity.
Feature
Benefit
Content Addressing
Patterns identified by hash, tamper-proof
Decentralized
No single point of failure
Ed25519 Signatures
Cryptographic registry verification
Multi-Gateway
Automatic failover (Pinata, ipfs.io, dweb.link)
PII Detection
Automatic scanning before publish
1
2
3
4
5
# Resolve IPNS name to CIDnpx ruflo@v3alpha transfer ipfs-resolve --name "/ipns/patterns.ruflo.io"# Detect PII before publishingnpx ruflo@v3alpha transfer detect-pii --content "$(cat ./patterns.json)"
Model & Learning Pattern Import/Export
Share trained neural patterns and learning models via IPFS.
Operation
Description
Export
Pin learning patterns to IPFS, get shareable CID
Import
Fetch patterns from any IPFS CID
Analytics
Track downloads and sharing metrics
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Export a learning pattern to IPFScurl -X POST "https://api.pinata.cloud/pinning/pinJSONToIPFS"\
-H "Authorization: Bearer $PINATA_JWT"\
-d '{
"pinataContent": {
"type": "learning-pattern",
"name": "my-patterns",
"patterns": [...]
},
"pinataMetadata": {"name": "ruflo-learning-pattern"}
}'# Import a pattern from IPFS CIDcurl -s "https://gateway.pinata.cloud/ipfs/QmYourCIDHere"# Via Cloud Function (when deployed)curl "https://publish-registry-xxx.cloudfunctions.net?action=export-model" -d @model.json
curl "https://publish-registry-xxx.cloudfunctions.net?action=import-model&cid=QmXxx"
Supported Model Types
Type
Description
Use Case
learning-pattern
Agent learning patterns
Code review, security analysis
neural-weights
Trained neural weights
SONA, MoE routing
reasoning-bank
Reasoning trajectories
Few-shot learning
agent-config
Agent configurations
Swarm templates
Pre-trained Model Registry
Import pre-trained learning patterns for common tasks. 90.5% average accuracy across 40 patterns trained on 110,600+ examples.
Scripts, coordination systems, and collaborative development features.
π οΈ Helper Scripts β 30+ Development Automation Tools
The .claude/helpers/ directory contains 30+ automation scripts for development, monitoring, learning, and swarm coordination. These scripts integrate with hooks and can be called directly or via the V3 master tool.
Quick Start
1
2
3
4
5
6
7
8
# Master V3 tool - access all helpers.claude/helpers/v3.sh help# Show all commands.claude/helpers/v3.sh status # Quick development status.claude/helpers/v3.sh update domain 3# Update metrics# Quick setup.claude/helpers/quick-start.sh # Initialize development environment.claude/helpers/setup-mcp.sh # Configure MCP servers
π Skills System β 42 Pre-Built Workflows for Any Task
Skills are reusable workflows that combine agents, hooks, and patterns into ready-to-use solutions. Think of them as βrecipesβ for common development tasks.
π¬ Specialized Skills β Version control, benchmarks, workers
Skill
What It Does
When To Use
agentic-jujutsu
Self-learning version control for AI agents
Multi-agent coordination
worker-benchmarks
Performance benchmarking framework
Measuring improvements
worker-integration
Worker-agent coordination patterns
Background processing
1
2
# Example: Run benchmarks/worker-benchmarks
Running Skills
1
2
3
4
5
6
7
8
9
# In Claude Code - just use the slash command/github-code-review
/pair-programming --mode tdd
/v3-security-overhaul
# Via CLInpx ruflo@v3alpha skill run github-code-review
npx ruflo@v3alpha skill list
npx ruflo@v3alpha skill info sparc-methodology
Creating Custom Skills
Use the skill-builder skill to create your own:
1
/skill-builder
Skills are defined in YAML with:
Frontmatter: Name, description, agents needed
Workflow: Steps to execute
Learning: How to improve from outcomes
π« Claims & Work Coordination β Human-Agent Task Management
The Claims system manages who is working on what β whether human or agent. It prevents conflicts, enables handoffs, and balances work across your team.
β‘ Agentic-Flow Integration β Core AI Infrastructure
Ruflo v3 is built on top of agentic-flow, a production-ready AI agent orchestration platform. This deep integration provides 352x faster code transformations, learning memory, and geometric intelligence.
Quick Start
1
2
3
4
5
6
7
8
9
10
11
# Install globallynpm install -g agentic-flow
# Or run directly with npxnpx agentic-flow --help
# Start MCP servernpx agentic-flow mcp start
# Add to Claude Codeclaude mcp add agentic-flow -- npx agentic-flow mcp start
import{ReasoningBank}from'agentic-flow/reasoningbank';constbank=newReasoningBank();// Record successful outcome
awaitbank.recordOutcome({task:'implement authentication',outcome:'JWT with refresh tokens',success: true,context:{framework:'express'}});// Retrieve similar patterns for new task
constpatterns=awaitbank.retrieveSimilar('add user login',{k: 5});// Returns past successful auth implementations
// Judge and distill learnings
awaitbank.judge(trajectoryId,'success');awaitbank.distill();// Extract key patterns
awaitbank.consolidate();// Prevent forgetting (EWC++)
4-Step Pipeline:
RETRIEVE β Fetch relevant patterns via HNSW (150x faster)
import{getOptimizedEmbedder,cosineSimilarity}from'agentic-flow/embeddings';constembedder=getOptimizedEmbedder();awaitembedder.init();// Generate embedding (3ms local vs 230ms Transformers.js)
constvector=awaitembedder.embed('authentication patterns');// Batch processing
constvectors=awaitembedder.embedBatch(['user login flow','password reset','session management']);// Calculate similarity
constsimilarity=cosineSimilarity(vectors[0],vectors[1]);
Provider
Latency
Cost
Offline
Agentic-Flow ONNX
~3ms
Free
β
Transformers.js
~230ms
Free
β
OpenAI
~50-100ms
$0.02-0.13/1M
β
π Embedding Geometry β Intelligence as Geometry
Advanced patterns treating embeddings as geometric control surfaces:
Semantic Drift Detection:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import{getOptimizedEmbedder,cosineSimilarity}from'agentic-flow/embeddings';constembedder=getOptimizedEmbedder();letbaseline: Float32Array;// Set baseline context
baseline=awaitembedder.embed('User asking about API authentication');// Check for drift
constcurrent=awaitembedder.embed(userMessage);constdrift=1-cosineSimilarity(baseline,current);if(drift>0.15){console.log('Semantic drift detected - escalate');}
Memory Physics:
Temporal decay (forgetting)
Interference detection (nearby memories weaken)
Memory consolidation (merge similar patterns)
Swarm Coordination:
1
2
3
4
5
6
// Agents coordinate via embedding positions, not messages
constagentPosition=awaitembedder.embed(agentRole);consttaskPosition=awaitembedder.embed(currentTask);// Geometric alignment for task routing
constalignment=cosineSimilarity(agentPosition,taskPosition);
Coherence Monitoring:
1
2
3
4
5
6
// Detect model degradation/poisoning via embedding drift
awaitmonitor.calibrate(knownGoodOutputs);constresult=awaitmonitor.check(newOutput);if(result.anomalyScore>1.5){console.log('WARNING: Output drifting from baseline');}
π Multi-Model Router β Intelligent Model Selection
Route tasks to optimal models based on complexity:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import{ModelRouter}from'agentic-flow/router';constrouter=newModelRouter();// Automatic routing based on task complexity
constresult=awaitrouter.route({task:'Add console.log to function',preferCost: true});// Returns: { model: 'haiku', reason: 'simple task, low complexity' }
constresult2=awaitrouter.route({task:'Design distributed caching architecture'});// Returns: { model: 'opus', reason: 'complex architecture, high reasoning' }
Complexity
Model
Cost
Use Case
Agent Booster intent
Skip LLM
$0
varβconst, add-types
Low (<30%)
Haiku
$0.0002
Simple fixes, docs
Medium (30-70%)
Sonnet
$0.003
Features, debugging
High (>70%)
Opus
$0.015
Architecture, security
Savings: 30-50% on LLM costs through intelligent routing
π₯ Agentic-Jujutsu β Self-Learning AI Version Control
Agentic-Jujutsu is self-learning version control designed for multiple AI agents working simultaneously without conflicts. Built on Jujutsu, it provides faster performance than Git with automatic conflict resolution.
Quick Start
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Install globally (zero dependencies - jj binary embedded!)npm install -g agentic-jujutsu
# Or run directly with npxnpx agentic-jujutsu --help
# Analyze repository for AI agent compatibilitynpx agentic-jujutsu analyze
# Start MCP server for AI agentsnpx agentic-jujutsu mcp-server
# Compare performance with Gitnpx agentic-jujutsu compare-git
Why Agentic-Jujutsu?
What
Git
Agentic-Jujutsu
Multiple AIs working together
β Locks & conflicts
β Works smoothly
Speed with 3+ agents
Slow (waits)
23x faster
Installation
Need to install git
One npm command
AI integration
Manual work
Built-in (MCP protocol)
Self-learning capabilities
β None
β ReasoningBank
Automatic conflict resolution
30-40% auto
87% auto
Cryptographic security
Basic
SHA3-512 fingerprints
Core Capabilities
π§ Self-Learning with ReasoningBank β Track operations, learn patterns, get AI suggestions
const{JjWrapper}=require('agentic-jujutsu');constjj=newJjWrapper();// Start learning trajectory
consttrajectoryId=jj.startTrajectory('Deploy to production');// Perform operations (automatically tracked)
awaitjj.branchCreate('release/v1.0');awaitjj.newCommit('Release v1.0');// Record operations to trajectory
jj.addToTrajectory();// Finalize with success score (0.0-1.0) and critique
jj.finalizeTrajectory(0.95,'Deployment successful, no issues');// Later: Get AI-powered suggestions for similar tasks
constsuggestion=JSON.parse(jj.getSuggestion('Deploy to staging'));console.log('AI Recommendation:',suggestion.reasoning);console.log('Confidence:',(suggestion.confidence*100).toFixed(1)+'%');
ReasoningBank Methods:
Method
Description
Returns
startTrajectory(task)
Begin learning trajectory
string (trajectory ID)
addToTrajectory()
Add recent operations
void
finalizeTrajectory(score, critique?)
Complete trajectory (0.0-1.0)
void
getSuggestion(task)
Get AI recommendation
JSON: DecisionSuggestion
getLearningStats()
Get learning metrics
JSON: LearningStats
getPatterns()
Get discovered patterns
JSON: Pattern[]
queryTrajectories(task, limit)
Find similar trajectories
JSON: Trajectory[]
π€ Multi-Agent Coordination β DAG architecture for conflict-free collaboration
// All agents work concurrently (no conflicts!)
constagents=['researcher','coder','tester'];constresults=awaitPromise.all(agents.map(async(agentName)=>{constjj=newJjWrapper();// Start tracking
jj.startTrajectory(`${agentName}: Feature implementation`);// Get AI suggestion based on learned patterns
constsuggestion=JSON.parse(jj.getSuggestion(`${agentName} task`));// Execute task (no lock waiting!)
awaitjj.newCommit(`Changes by ${agentName}`);// Record learning
jj.addToTrajectory();jj.finalizeTrajectory(0.9);return{agent:agentName,success:true};}));console.log('All agents completed:',results);
Performance Comparison:
Metric
Git
Agentic Jujutsu
Concurrent commits
15 ops/s
350 ops/s (23x)
Context switching
500-1000ms
50-100ms (10x)
Conflict resolution
30-40% auto
87% auto (2.5x)
Lock waiting
50 min/day
0 min (β)
SHA3-512 fingerprints
N/A
<1ms
π Cryptographic Security β SHA3-512 fingerprints and AES-256 encryption
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const{generateQuantumFingerprint,verifyQuantumFingerprint}=require('agentic-jujutsu');// Generate SHA3-512 fingerprint (NIST FIPS 202)
constdata=Buffer.from('commit-data');constfingerprint=generateQuantumFingerprint(data);console.log('Fingerprint:',fingerprint.toString('hex'));// Verify integrity (<1ms)
constisValid=verifyQuantumFingerprint(data,fingerprint);console.log('Valid:',isValid);// HQC-128 encryption for trajectories
constcrypto=require('crypto');constjj=newJjWrapper();constkey=crypto.randomBytes(32).toString('base64');jj.enableEncryption(key);
Security Methods:
Method
Description
Returns
generateQuantumFingerprint(data)
Generate SHA3-512 fingerprint
Buffer (64 bytes)
verifyQuantumFingerprint(data, fp)
Verify fingerprint
boolean
enableEncryption(key, pubKey?)
Enable HQC-128 encryption
void
disableEncryption()
Disable encryption
void
Ruflo Skill
Ruflo includes a dedicated /agentic-jujutsu skill for AI-powered version control:
1
2
# Invoke the skill/agentic-jujutsu
Use this skill when you need:
β Multiple AI agents modifying code simultaneously
β Lock-free version control (faster than Git for concurrent agents)
β Pattern recognition and intelligent suggestions
MCP Tools for AI Agents
1
2
3
4
5
6
7
8
# Start the MCP servernpx agentic-jujutsu mcp-server
# List available toolsnpx agentic-jujutsu mcp-tools
# Call a tool from your agentnpx agentic-jujutsu mcp-call jj_status
# Repository Operationsnpx agentic-jujutsu status # Show working copy statusnpx agentic-jujutsu log --limit 10# Show commit historynpx agentic-jujutsu diff # Show changesnpx agentic-jujutsu new "message"# Create new commit# AI Agent Operationsnpx agentic-jujutsu analyze # Analyze repo for AI compatibilitynpx agentic-jujutsu ast "command"# Convert to AI-readable AST formatnpx agentic-jujutsu mcp-server # Start MCP servernpx agentic-jujutsu mcp-tools # List MCP tools# Performancenpx agentic-jujutsu bench # Run benchmarksnpx agentic-jujutsu compare-git # Compare with Git# Infonpx agentic-jujutsu help# Show all commandsnpx agentic-jujutsu version # Show version infonpx agentic-jujutsu examples # Show usage examples
RuVector is a high-performance distributed vector database combining vector search, graph queries, and self-learning neural networks. Written in Rust with Node.js/WASM bindings, it powers Rufloβs intelligence layer with native speed.
Key Capabilities
Capability
Description
Performance
Vector Search
HNSW indexing with SIMD acceleration
~61Β΅s latency, 16,400 QPS
Graph Queries
Full Cypher syntax (MATCH, WHERE, CREATE)
Native graph traversal
Self-Learning
GNN layers that improve search over time
Automatic optimization
Distributed
Raft consensus, multi-master replication
Auto-sharding
Compression
Adaptive tiered (hot/warm/cool/cold)
2-32x memory reduction
39 Attention Types
Flash, linear, sparse, graph, hyperbolic
GPU-accelerated SQL
Performance Benchmarks
Operation
Latency
Throughput
HNSW Search (k=10, 384-dim)
61Β΅s
16,400 QPS
HNSW Search (k=100)
164Β΅s
6,100 QPS
Cosine Distance (1536-dim)
143ns
7M ops/sec
Dot Product (384-dim)
33ns
30M ops/sec
Batch Distance (1000 vectors)
237Β΅s
4.2M/sec
Memory (1M vectors with PQ8)
-
200MB
Quick Start
1
2
3
4
5
6
7
8
# Install ruvector (auto-detects native vs WASM)npm install ruvector
# Or run directlynpx ruvector --help
# Start Postgres for centralized coordinationdocker run -d -p 5432:5432 ruvnet/ruvector-postgres
# Run the pipelinenpx ruflo@v3alpha stream-chain run feature-pipeline \
--input '{"requirements": "Add user dashboard with analytics"}'# Monitor progressnpx ruflo@v3alpha stream-chain status feature-pipeline
Use Cases
Pipeline
Stages
Output
Feature Development
research β design β implement β test β review
Reviewed code
Security Audit
scan β analyze β remediate β verify
Security report
Documentation
research β outline β write β review
Documentation
Migration
analyze β plan β migrate β validate
Migrated code
π₯ Pair Programming β Collaborative AI Development
The Pair Programming skill provides human-AI collaborative coding with role switching, TDD support, and real-time verification.
Modes
Mode
Human Role
AI Role
Best For
Driver
Writing code
Reviewing, suggesting
Learning, exploration
Navigator
Directing, reviewing
Writing code
High productivity
Switch
Alternating
Alternating
Balanced collaboration
TDD
Writing tests
Implementing
Test-first development
Starting a Session
1
2
3
4
5
6
7
8
# Start pair programming/pair-programming
# Or with specific mode/pair-programming --mode tdd
# Via CLInpx ruflo@v3alpha pair start --mode navigator
TDD Mode Workflow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TDD PAIR PROGRAMMING β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β 1. Human writes failing test β
β β β
β 2. AI implements minimal code to pass β
β β β
β 3. Tests run automatically β
β β β
β 4. AI suggests refactoring β
β β β
β 5. Human approves/modifies β
β β β
β 6. Repeat β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Features
Feature
Description
Real-time Verification
Code is continuously verified as you write
Quality Monitoring
Track code quality metrics during session
Automatic Role Switch
Switches roles based on context
Security Scanning
Built-in security checks
Performance Hints
Suggestions for optimization
Learning Mode
AI explains decisions and teaches patterns
Session Commands
1
2
3
4
5
6
7
8
9
10
11
# Switch roles mid-sessionnpx ruflo@v3alpha pair switch
# Get AI explanationnpx ruflo@v3alpha pair explain
# Run testsnpx ruflo@v3alpha pair test# End session with summarynpx ruflo@v3alpha pair end
π‘οΈ Security
AI manipulation defense, threat detection, and input validation.
AI Manipulation Defense System (AIMDS) β Protect AI applications from prompt injection, jailbreaks, and data exposure with sub-millisecond detection.
Domain-Driven Design with bounded contexts, clean architecture, and measured performance across all topologies.
V3 Module Structure
Module
Purpose
Key Features
@claude-flow/hooks
Event-driven lifecycle
ReasoningBank, 27 hooks, pattern learning
@claude-flow/memory
Unified vector storage
AgentDB, RVF binary format, HnswLite, RvfMigrator, SONA persistence, LearningBridge, MemoryGraph
@claude-flow/security
CVE remediation
Input validation, path security, AIDefence
@claude-flow/swarm
Multi-agent coordination
6 topologies, Byzantine consensus, auto-scaling
@claude-flow/plugins
WASM extensions
RuVector plugins, semantic search, intent routing
@claude-flow/cli
Command interface
26 commands, 140+ subcommands, shell completions
@claude-flow/neural
Self-learning
SONA, 9 RL algorithms, EWC++ memory preservation
@claude-flow/testing
Quality assurance
London School TDD, Vitest, fixtures, mocks
@claude-flow/deployment
Release automation
Versioning, changelogs, NPM publishing
@claude-flow/shared
Common utilities
Types, validation schemas, RvfEventLog, constants
@claude-flow/browser
Browser automation
59 MCP tools, element refs, trajectory learning
Architecture Principles
Principle
Implementation
Benefit
Bounded Contexts
Each module owns its domain
No cross-module coupling
Dependency Injection
Constructor-based DI
Testable, mockable components
Event Sourcing
All state changes as events
Full audit trail, replay capability
CQRS
Separate read/write paths
Optimized queries, scalable writes
Clean Architecture
Domain β Application β Infrastructure
Business logic isolation
Performance Benchmarks
Benchmarks measured on Node.js 20+ with local SQLite. Results vary by hardware and workload.
Category
Metric
Target
Status
Startup
CLI cold start
<500ms
β Met
Startup
MCP server init
<400ms
β Met
Memory
HNSW search
<1ms
β Sub-ms
Memory
Pattern retrieval
<10ms
β Met
Swarm
Agent spawn
<200ms
β Met
Swarm
Consensus latency
<100ms
β Met
Neural
SONA adaptation
<0.05ms
β Met
Graph
Build (1k nodes)
<200ms
β Met
Graph
PageRank (1k nodes)
<100ms
β Met
Learning
Insight recording
<5ms
β Met
Learning
Consolidation
<500ms
β Met
Task
Success rate
95%+
β Met
Topology Performance
Topology
Agents
Execution
Memory
Best For
Centralized
2-3
0.14-0.20s
180-256 MB
Simple tasks, single coordinator
Distributed
4-5
0.10-0.12s
128-160 MB
Parallel processing, speed
Hierarchical
6+
0.20s
256 MB
Complex tasks, clear authority
Mesh
4+
0.15s
192 MB
Collaborative, fault-tolerant
Hybrid
7+
0.18s
320 MB
Multi-domain, mixed workloads
Adaptive
2+
Variable
Dynamic
Auto-scaling, unpredictable load
π Browser Automation β @claude-flow/browser
AI-optimized browser automation integrating agent-browser with ruflo for intelligent web automation, trajectory learning, and multi-agent browser coordination.
Installation
1
2
3
4
npm install @claude-flow/browser
# agent-browser CLI (auto-suggested on install, or install manually)npm install -g agent-browser@latest
import{createBrowserService}from'@claude-flow/browser';constbrowser=createBrowserService({sessionId:'my-session',enableSecurity: true,// URL/PII scanning
enableMemory: true,// Trajectory learning
});// Track actions for ReasoningBank/SONA learning
browser.startTrajectory('Login to dashboard');awaitbrowser.open('https://example.com/login');// Use element refs (shorter tokens vs full CSS selectors)
constsnapshot=awaitbrowser.snapshot({interactive: true});awaitbrowser.fill('@e1','user@example.com');awaitbrowser.fill('@e2','password');awaitbrowser.click('@e3');awaitbrowser.endTrajectory(true,'Login successful');awaitbrowser.close();
Key Features
Feature
Description
59 MCP Tools
Complete browser automation via MCP protocol
Element Refs
Compact @e1, @e2 refs instead of verbose CSS selectors
Automated release management, versioning, and CI/CD for Ruflo packages.
Features
Feature
Description
Performance
Version Bumping
Automatic major/minor/patch/prerelease
Instant
Changelog Generation
From conventional commits
<2s
Git Integration
Auto-tagging and committing
<1s
NPM Publishing
Multi-tag support (alpha, beta, latest)
<5s
Pre-Release Validation
Lint, test, build, dependency checks
Configurable
Dry Run Mode
Test releases without changes
Safe testing
Quick Start
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import{prepareRelease,publishToNpm,validate}from'@claude-flow/deployment';// Bump version and generate changelog
constresult=awaitprepareRelease({bumpType:'patch',// major | minor | patch | prerelease
generateChangelog: true,createTag: true,commit: true});console.log(`Released ${result.newVersion}`);// Publish to NPM
awaitpublishToNpm({tag:'latest',access:'public'});
import{BenchmarkRunner}from'@claude-flow/performance';construnner=newBenchmarkRunner('Memory Operations');// Run individual benchmarks
awaitrunner.run('vector-search',async()=>{awaitindex.search(query,10);});awaitrunner.run('memory-write',async()=>{awaitstore.write(entry);});// Run all at once
constsuite=awaitrunner.runAll([{name:'search',fn:()=>search()},{name:'write',fn:()=>write()},{name:'index',fn:()=>index()}]);// Print formatted results
runner.printResults();// Export as JSON
constjson=runner.toJSON();
# Run all benchmarksnpm run bench
# Run attention benchmarksnpm run bench:attention
# Run startup benchmarksnpm run bench:startup
# Performance reportnpx ruflo@v3alpha performance report
# Benchmark specific suitenpx ruflo@v3alpha performance benchmark --suite memory
π§ͺ Testing Framework β @claude-flow/testing
Comprehensive TDD framework implementing London School patterns with behavior verification, shared fixtures, and mock services.
Philosophy: London School TDD
1
2
3
4
5
6
7
8
9
10
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LONDON SCHOOL TDD β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 1. ARRANGE - Set up mocks BEFORE acting β
β 2. ACT - Execute the behavior under test β
β 3. ASSERT - Verify behavior (interactions), not state β
β β
β "Test behavior, not implementation" β
β "Mock external dependencies, test interactions" β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
import{setupV3Tests,createMockApplication,agentConfigs,swarmConfigs,waitFor,}from'@claude-flow/testing';// Configure test environment
setupV3Tests();describe('MyModule',()=>{constapp=createMockApplication();beforeEach(()=>{vi.clearAllMocks();});it('should spawn an agent',async()=>{constresult=awaitapp.agentLifecycle.spawn(agentConfigs.queenCoordinator);expect(result.success).toBe(true);expect(result.agent.type).toBe('queen-coordinator');});});
import{createMockApplication,createMockEventBus,createMockTaskManager,createMockSecurityService,createMockSwarmCoordinator,}from'@claude-flow/testing';// Full application with all mocks
constapp=createMockApplication();// Use in tests
awaitapp.taskManager.create({name:'Test',type:'coding',payload:{}});expect(app.taskManager.create).toHaveBeenCalled();// Access tracked state
expect(app.eventBus.publishedEvents).toHaveLength(1);expect(app.taskManager.tasks.size).toBe(1);
import{waitFor,waitUntilChanged,retry,withTimeout,parallelLimit,}from'@claude-flow/testing';// Wait for condition
awaitwaitFor(()=>element.isVisible(),{timeout: 5000});// Wait for value to change
awaitwaitUntilChanged(()=>counter.value,{from:0});// Retry with exponential backoff
constresult=awaitretry(async()=>awaitfetchData(),{maxAttempts: 3,backoff: 100});// Timeout wrapper
awaitwithTimeout(async()=>awaitlongOp(),5000);// Parallel with concurrency limit
constresults=awaitparallelLimit(items.map(item=>()=>processItem(item)),5// max 5 concurrent
);
# View current configurationnpx ruflo@v3alpha config list
# Get specific valuenpx ruflo@v3alpha config get --key memory.type
# Set configuration valuenpx ruflo@v3alpha config set --key swarm.maxAgents --value 10# Export configurationnpx ruflo@v3alpha config export > my-config.json
# Import configurationnpx ruflo@v3alpha config import --file my-config.json
# Reset to defaultsnpx ruflo@v3alpha config reset --key swarm
# Initialize with wizardnpx ruflo@v3alpha init --wizard
π Help & Resources
Troubleshooting, migration guides, and documentation links.
π§ Troubleshooting
Common Issues
MCP server wonβt start
1
2
3
4
5
6
# Check if port is in uselsof -i :3000
# Kill existing processkill -9 <PID>
# Restart MCP servernpx ruflo@v3alpha mcp start
Agent spawn failures
1
2
3
4
# Check available memoryfree -m
# Reduce max agents if memory constrainedexportCLAUDE_FLOW_MAX_AGENTS=5
Pattern search returning no results
1
2
3
4
# Verify patterns are storednpx ruflo@v3alpha hooks metrics
# Re-run pretraining if emptynpx ruflo@v3alpha hooks pretrain
Windows path issues
1
2
3
4
# Use forward slashes or escape backslashes$env:CLAUDE_FLOW_MEMORY_PATH="./data"# Or use absolute path$env:CLAUDE_FLOW_MEMORY_PATH="C:/Users/name/ruflo/data"
Permission denied errors
1
2
3
# Fix npm permissions (Linux/macOS)sudo chown -R $(whoami) ~/.npm
# Or use nvm to manage Node.js