🛡️ Anti-Drift Swarm Configuration
/docs/getting-into-the-flow/anti-drift-swarm-configuration
Complex swarms can drift from their original goals. Ruflo V3 includes anti-drift defaults that prevent agents from going off-task.
Recommended Configuration:
javascript// 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-taskhooks - 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 |