Skip to main content

Multi-Agent Patterns

Coordination, consensus, and distributed patterns for building multi-agent systems with AgentiCraft.

1 min read

Overview

AgentiCraft provides production-tested coordination patterns for multi-agent systems. These patterns handle the hard problems: consensus, fault tolerance, load distribution, and cascading failure prevention.

Pattern Categories

Coordination Patterns

Manage how agents work together on shared tasks.

Consensus — Agents agree on a shared decision. Handles Byzantine failures where agents may produce incorrect results.

Hub and Spoke — A central coordinator dispatches tasks to specialist agents and aggregates results. Simple but creates a single point of failure.

Gossip — Agents share state with random peers. Eventually consistent, highly fault-tolerant, no single point of failure.

Swarm — Emergent coordination through simple local rules. Each agent follows the same protocol; complex behavior emerges from interaction.

Cognitive Patterns

Shape how individual agents reason.

ReAct — Interleave reasoning and action. The agent thinks about what to do, does it, observes the result, and repeats.

Chain of Thought — Break complex problems into sequential reasoning steps. Improves accuracy on math and logic tasks.

Tree of Thought — Explore multiple reasoning paths in parallel and select the best. Useful when there are many possible approaches.

Self-Ask — The agent decomposes questions into sub-questions, answers them, and combines the results.

Resilience Patterns

Handle failures gracefully.

Circuit Breaker — Stop sending requests to a failing provider. Automatically test and recover when the provider comes back.

Retry with Backoff — Retry failed requests with exponential backoff and jitter. Prevents thundering herd on recovery.

Saga — Coordinate distributed transactions across agents. If one step fails, compensating actions undo previous steps.

Workflow Patterns

Structure multi-step processes.

Pipeline — Sequential processing where each agent's output feeds the next. Simple, predictable, easy to debug.

DAG — Directed acyclic graph of tasks with dependency tracking. Maximizes parallelism while respecting ordering constraints.

State Machine — Agents transition between well-defined states based on events. Good for complex business processes.

Choosing a Pattern

ScenarioRecommended Pattern
Multiple agents must agreeConsensus
Central task dispatchHub and Spoke
High fault tolerance neededGossip
Complex reasoningChain of Thought or Tree of Thought
Provider reliabilityCircuit Breaker
Multi-step workflowsPipeline or DAG
Business processesState Machine

Combining Patterns

Patterns compose naturally. A common production setup:

  1. DAG workflow orchestrates the overall process
  2. Consensus coordinates agents within each DAG node
  3. Circuit breaker protects each LLM provider call
  4. ReAct drives individual agent reasoning

Next Steps