Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .agent/aidevops/claude-flow-comparison.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
description: Feature comparison between aidevops and Claude-Flow
mode: subagent
tools:
read: true
write: false
edit: false
bash: false
glob: false
grep: false
model: haiku
---

# Claude-Flow vs aidevops Comparison

Selective feature adoption from [ruvnet/claude-flow](https://github.com/ruvnet/claude-flow) v3.

## Philosophy

| Aspect | Claude-Flow | aidevops |
|--------|-------------|----------|
| Language | TypeScript (~340MB) | Shell scripts (~2MB) |
| Dependencies | Heavy (ONNX, WASM, gRPC) | Minimal (sqlite3, curl) |
| Architecture | Monolithic orchestrator | Composable subagents |
| Model routing | Automatic 3-tier | Guided via frontmatter |
| Memory | HNSW vector (built-in) | FTS5 default + embeddings opt-in |
| Coordination | Byzantine fault-tolerant | Async TOON mailbox |

## Feature Adoption Status

| Feature | Claude-Flow | aidevops Adoption | Status |
|---------|-------------|-------------------|--------|
| Vector memory | HNSW (built-in) | Optional embeddings via all-MiniLM-L6-v2 | Done |
| Cost routing | 3-tier automatic (SONA) | Model tier guidance + `model:` frontmatter | Done |
| Self-learning | SONA neural architecture | SUCCESS/FAILURE pattern tracking | Done |
| Swarm consensus | Byzantine/Raft | Skipped (async mailbox sufficient) | Skipped |
| WASM transforms | Agent Booster | Skipped (Edit tool fast enough) | Skipped |

## What We Adopted

### 1. Cost-Aware Model Routing

**Claude-Flow**: Automatic 3-tier routing with SONA neural architecture that learns optimal model selection.

**aidevops**: Documented routing guidance in `tools/context/model-routing.md` with `model:` field in subagent YAML frontmatter. Five tiers: haiku, flash, sonnet, pro, opus. `/route` command suggests optimal tier for a task.

**Why this approach**: aidevops agents run inside existing AI tools (Claude Code, OpenCode, Cursor) which handle model selection. Guidance is more appropriate than automatic routing.

### 2. Semantic Memory with Embeddings

**Claude-Flow**: Built-in HNSW vector index, always-on semantic search.

**aidevops**: Optional `memory-embeddings-helper.sh` using all-MiniLM-L6-v2 (~90MB). FTS5 keyword search remains default. `--semantic` flag on `memory-helper.sh recall` delegates to embeddings when available.

**Why this approach**: Most memory queries work fine with keyword search. Embeddings add ~90MB of dependencies. Opt-in keeps the framework lightweight for users who don't need it.

### 3. Success Pattern Tracking

**Claude-Flow**: SONA neural architecture tracks routing decisions and outcomes.

**aidevops**: `pattern-tracker-helper.sh` records SUCCESS_PATTERN and FAILURE_PATTERN memories tagged with task type and model tier. `/patterns` command surfaces relevant patterns for new tasks.

**Why this approach**: Simple pattern storage in existing SQLite memory is sufficient. No need for neural architecture when the pattern corpus is small (hundreds, not millions).

## What We Skipped

### Swarm Consensus

**Claude-Flow**: Byzantine fault-tolerant coordination for multi-agent consensus.

**Why skipped**: aidevops uses async TOON mailbox for inter-agent communication. Most tasks don't need consensus - they need coordination. The mailbox pattern is simpler and sufficient.

### WASM Transforms (Agent Booster)

**Claude-Flow**: WASM-based code transforms for performance.

**Why skipped**: The Edit tool is already fast enough. WASM adds complexity without meaningful benefit for the file sizes aidevops typically handles.

## Key Insight

Claude-Flow solves problems at scale (thousands of agents, millions of memories, real-time routing). aidevops operates at human scale (1-5 agents, hundreds of memories, session-based routing). The right solution depends on the scale.
44 changes: 44 additions & 0 deletions .agent/memory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ See `scripts/commands/remember.md` and `scripts/commands/recall.md` for full doc
| `TOOL_CONFIG` | Tool setup notes |
| `DECISION` | Architecture decisions |
| `CONTEXT` | Background info |
| `SUCCESS_PATTERN` | Approaches that consistently work for task types |
| `FAILURE_PATTERN` | Approaches that consistently fail for task types |

## Relation Types

Expand All @@ -105,11 +107,53 @@ Inspired by Supermemory's relational versioning:
This enables temporal reasoning like "what happened last week?" by distinguishing
between when you learned something vs when it happened.

## Semantic Search (Opt-in)

For similarity-based search beyond keyword matching, enable vector embeddings:

```bash
# One-time setup (~90MB model download)
memory-embeddings-helper.sh setup

# Index existing memories
memory-embeddings-helper.sh index

# Search by meaning (not just keywords)
memory-helper.sh recall "how to optimize database queries" --semantic

# Or use the embeddings helper directly
memory-embeddings-helper.sh search "authentication patterns"
```

FTS5 keyword search remains the default. Semantic search requires Python 3.9+ and sentence-transformers.

## Pattern Tracking

Track what works and what fails across task types and models:

```bash
# Record a pattern
pattern-tracker-helper.sh record --outcome success --task-type bugfix \
--model sonnet --description "Structured debugging found root cause"

# Get suggestions for a task
pattern-tracker-helper.sh suggest "refactor the auth middleware"

# View pattern statistics
pattern-tracker-helper.sh stats

# Or use the /patterns command
/patterns refactor
```

See `scripts/pattern-tracker-helper.sh` for full documentation.

## Storage Location

```text
~/.aidevops/.agent-workspace/memory/
├── memory.db # SQLite database with FTS5
├── embeddings.db # Optional: vector embeddings for semantic search
└── preferences/ # Optional: markdown preference files
```

Expand Down
41 changes: 41 additions & 0 deletions .agent/scripts/commands/patterns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
description: Show success/failure patterns from memory to guide task approach
agent: Build+
mode: subagent
model: haiku
---

Analyze and display success/failure patterns relevant to the current context.

Arguments: $ARGUMENTS

## Instructions

1. If arguments are provided, use them as a task description to find relevant patterns:

```bash
~/.aidevops/agents/scripts/pattern-tracker-helper.sh suggest "$ARGUMENTS"
```

2. If no arguments, show overall pattern statistics and recent patterns:

```bash
~/.aidevops/agents/scripts/pattern-tracker-helper.sh stats
~/.aidevops/agents/scripts/pattern-tracker-helper.sh analyze --limit 5
```

3. Present the results with actionable guidance:
- Highlight what approaches have worked for similar tasks
- Warn about approaches that have failed
- Suggest the optimal model tier based on pattern data

4. If no patterns exist yet, explain how to start recording:

```text
No patterns recorded yet. Patterns are recorded automatically during
development loops, or manually with:

pattern-tracker-helper.sh record --outcome success \
--task-type bugfix --model sonnet \
--description "Structured debugging approach found root cause quickly"
```
38 changes: 38 additions & 0 deletions .agent/scripts/commands/route.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
description: Suggest optimal model tier for a task description
agent: Build+
mode: subagent
model: haiku
---

Analyze the task description and recommend the optimal model tier.

Task: $ARGUMENTS

## Instructions

1. Read `tools/context/model-routing.md` for the routing rules and tier definitions.

2. Analyze the task description against the routing rules:
- **Complexity**: Simple transform vs reasoning vs novel design
- **Context size**: Small focused task vs large codebase sweep
- **Output type**: Classification vs code vs architecture

3. Output a recommendation in this format:

```text
Recommended: {tier} ({model_name})
Reason: {one-line justification}
Cost: ~{relative}x vs sonnet baseline
```

4. If the task is ambiguous, suggest the tier and note what would push it up or down:

```text
Recommended: sonnet (claude-sonnet-4)
Reason: Code modification with moderate reasoning
Cost: ~1x baseline

Could be haiku if: the change is a simple rename/reformat
Could be opus if: the change requires architectural decisions
```
Loading
Loading