# henryalouf/ruflow architecture

> Architecture diagram of the GitHub repository henryalouf/ruflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/henryalouf/ruflow
- Repository: https://github.com/henryalouf/ruflow

## Overview

Ruflow is an AI-agent orchestration toolkit and Claude Code capability library, rather than one standalone application. Its principal workflow is to accept a task, coordinate agent execution and resources, and validate or restore system state; the README also describes skills, commands, and MCP integration. The supplied tree and excerpts support detail on the v2 orchestration and verification components, but do not establish their complete CLI wiring or show the larger skill corpus, so those connections are left out.

Main entry points: [`src/claude-mem/src/services/worker/OpenRouterAgent.ts`](https://github.com/henryalouf/ruflow/blob/main/src/claude-mem/src/services/worker/OpenRouterAgent.ts) (Claude memory), [`v2/src/agents/agent-manager.ts`](https://github.com/henryalouf/ruflow/blob/main/v2/src/agents/agent-manager.ts) (Agent manager), [`v2/src/core/ConsensusEngine.ts`](https://github.com/henryalouf/ruflow/blob/main/v2/src/core/ConsensusEngine.ts) (Consensus engine), [`v2/src/cli/simple-commands/training-pipeline.js`](https://github.com/henryalouf/ruflow/blob/main/v2/src/cli/simple-commands/training-pipeline.js) (Training pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and integration"]
  node_cli["Ruflow CLI<br/>[cli.js]"]
  node_mcp["MCP bridge<br/>[index.js]"]
  node_ruvocal["Ruvocal app<br/>[+page.svelte]"]
end

subgraph group_orchestration["Agent orchestration"]
  node_agentmgr["Agent manager<br/>[agent-manager.ts]"]
  node_taskengine["Task engine<br/>[engine.ts]"]
  node_resources["Resource manager"]
  node_consensus["Consensus engine<br/>[ConsensusEngine.ts]"]
  node_hiveconsensus["Hive consensus<br/>[ConsensusEngine.ts]"]
end

subgraph group_reliability["Reliability controls"]
  node_verify["Verification pipeline"]
  node_rollback["Rollback engine<br/>[rollback-engine.ts]"]
end

subgraph group_learning["Training and learning"]
  node_training["Training pipeline"]
  node_memory["Claude memory<br/>[OpenRouterAgent.ts]"]
end

node_operator(("Operator"))
node_llm["OpenRouter"]
node_fallback["Claude SDK"]

node_operator -->|"invokes"| node_cli
node_operator -->|"uses"| node_ruvocal
node_agentmgr -->|"coordinates tasks"| node_taskengine
node_agentmgr -->|"manages agents"| node_resources
node_consensus -.->|"relationship unclear"| node_hiveconsensus
node_training -.->|"relationship unclear"| node_memory
node_memory -->|"requests generations"| node_llm
node_memory -.->|"falls back"| node_fallback

click node_cli "https://github.com/henryalouf/ruflow/blob/main/bin/cli.js"
click node_mcp "https://github.com/henryalouf/ruflow/blob/main/ruflo/src/mcp-bridge/index.js"
click node_ruvocal "https://github.com/henryalouf/ruflow/blob/main/ruflo/src/ruvocal/src/routes/%2Bpage.svelte"
click node_agentmgr "https://github.com/henryalouf/ruflow/blob/main/v2/src/agents/agent-manager.ts"
click node_taskengine "https://github.com/henryalouf/ruflow/blob/main/v2/src/task/engine.ts"
click node_resources "https://github.com/henryalouf/ruflow/blob/main/v2/src/resources/resource-manager.ts"
click node_consensus "https://github.com/henryalouf/ruflow/blob/main/v2/src/core/ConsensusEngine.ts"
click node_hiveconsensus "https://github.com/henryalouf/ruflow/blob/main/v2/src/hive-mind/integration/ConsensusEngine.ts"
click node_verify "https://github.com/henryalouf/ruflow/blob/main/v2/src/verification/verification-pipeline.ts"
click node_rollback "https://github.com/henryalouf/ruflow/blob/main/v2/src/verification/rollback-engine.ts"
click node_training "https://github.com/henryalouf/ruflow/blob/main/v2/src/cli/simple-commands/training-pipeline.js"
click node_memory "https://github.com/henryalouf/ruflow/blob/main/src/claude-mem/src/services/worker/OpenRouterAgent.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_mcp,node_ruvocal toneBlue
class node_agentmgr,node_taskengine,node_resources,node_consensus,node_hiveconsensus toneAmber
class node_verify,node_rollback,node_llm toneMint
class node_training,node_memory toneRose
class node_operator,node_fallback toneIndigo
```

## Components

### Entry and integration

- [Ruflow CLI](https://github.com/henryalouf/ruflow/blob/main/bin/cli.js): `bin/cli.js`
- [MCP bridge](https://github.com/henryalouf/ruflow/blob/main/ruflo/src/mcp-bridge/index.js): `ruflo/src/mcp-bridge/index.js`
- [Ruvocal app](https://github.com/henryalouf/ruflow/blob/main/ruflo/src/ruvocal/src/routes/%2Bpage.svelte): `ruflo/src/ruvocal/src/routes/+page.svelte`

### Agent orchestration

- [Agent manager](https://github.com/henryalouf/ruflow/blob/main/v2/src/agents/agent-manager.ts): `v2/src/agents/agent-manager.ts`
- [Task engine](https://github.com/henryalouf/ruflow/blob/main/v2/src/task/engine.ts): `v2/src/task/engine.ts`
- [Resource manager](https://github.com/henryalouf/ruflow/blob/main/v2/src/resources/resource-manager.ts): `v2/src/resources/resource-manager.ts`
- [Consensus engine](https://github.com/henryalouf/ruflow/blob/main/v2/src/core/ConsensusEngine.ts): `v2/src/core/ConsensusEngine.ts`
- [Hive consensus](https://github.com/henryalouf/ruflow/blob/main/v2/src/hive-mind/integration/ConsensusEngine.ts): `v2/src/hive-mind/integration/ConsensusEngine.ts`

### Reliability controls

- [Verification pipeline](https://github.com/henryalouf/ruflow/blob/main/v2/src/verification/verification-pipeline.ts): `v2/src/verification/verification-pipeline.ts`
- [Rollback engine](https://github.com/henryalouf/ruflow/blob/main/v2/src/verification/rollback-engine.ts): `v2/src/verification/rollback-engine.ts`

### Training and learning

- [Training pipeline](https://github.com/henryalouf/ruflow/blob/main/v2/src/cli/simple-commands/training-pipeline.js): `v2/src/cli/simple-commands/training-pipeline.js`
- [Claude memory](https://github.com/henryalouf/ruflow/blob/main/src/claude-mem/src/services/worker/OpenRouterAgent.ts): `src/claude-mem/src/services/worker/OpenRouterAgent.ts`

### Other components

- **Operator**
- **OpenRouter**
- **Claude SDK**

## Connections

- Operator → Ruflow CLI: invokes
- Operator → Ruvocal app: uses
- Agent manager → Task engine: coordinates tasks
- Agent manager → Resource manager: manages agents
- Consensus engine → Hive consensus: relationship unclear
- Training pipeline → Claude memory: relationship unclear
- Claude memory → OpenRouter: requests generations
- Claude memory → Claude SDK: falls back
