Skip to main content
Like AOF? Give us a star!
If you find AOF useful, please star us on GitHub. It helps us reach more developers and grow the community.

AgentFleet YAML Reference

Complete specification for AOF AgentFleet configuration files.

Schema Overview

apiVersion: aof.dev/v1      # Required: API version
kind: AgentFleet # Required: Resource type
metadata: # Required: Fleet metadata
name: string # Required: Fleet identifier
labels: {} # Optional: Key-value labels
annotations: {} # Optional: Additional metadata
spec: # Required: Fleet specification
agents: [] # Required: List of agents
coordination: {} # Required: Coordination config
shared: {} # Optional: Shared resources
communication: {} # Optional: Communication config

Full Specification

Metadata

metadata:
name: my-fleet # Required: Unique identifier
labels: # Optional: Filterable labels
purpose: incident-response
team: platform
environment: production
annotations: # Optional: Non-filterable metadata
description: "Fleet for RCA analysis"
author: "Platform Team"
version: "1.0.0"

Agent Definition

Each agent in the spec.agents array can be defined inline or reference an external config file.

Inline Agent Definition

spec:
agents:
- name: security-reviewer # Required: Agent identifier
role: specialist # Optional: worker|manager|specialist|validator
tier: 2 # Optional: Tier for tiered mode (1, 2, 3, ...)
weight: 1.5 # Optional: Weight for weighted consensus
replicas: 1 # Optional: Number of instances (default: 1)
labels: # Optional: Agent-specific labels
model-provider: anthropic
spec: # Required if no 'config': Inline agent spec
model: anthropic:claude-sonnet-4-20250514
instructions: |
You are a security specialist...
tools:
- shell
- read_file
max_iterations: 5
temperature: 0.4

External Agent Reference

spec:
agents:
- name: security-reviewer
config: ./agents/security-reviewer.yaml # Path to agent YAML file
tier: 2
weight: 1.5
role: specialist

Agent Properties

PropertyTypeRequiredDefaultDescription
namestringYes-Unique identifier for the agent
configstringNo*-Path to external agent YAML file
specobjectNo*-Inline agent specification
rolestringNoworkerAgent role: worker, manager, specialist, validator
tierintegerNo-Execution tier for tiered mode
weightfloatNo1.0Vote weight for weighted consensus
replicasintegerNo1Number of agent instances
labelsobjectNo-Key-value labels for filtering

*Either config or spec must be provided, but not both.

Coordination Configuration

spec:
coordination:
mode: peer # Required: Coordination mode
distribution: round-robin # Optional: Task distribution strategy
consensus: {} # Optional: Consensus configuration
tiered: {} # Optional: Tiered mode configuration
deep: {} # Optional: Deep mode configuration

Coordination Modes

ModeDescriptionUse Case
peerAll agents work as equals in parallelCode review, multi-perspective analysis
hierarchicalManager delegates to workersComplex orchestration, incident response
pipelineSequential processingData transformation, ETL
swarmDynamic load-balanced coordinationHigh-volume task processing
tieredTier-based parallel executionMulti-model RCA, staged workflows
deepIterative planning + execution loopComplex investigations, RCA

Peer Mode

coordination:
mode: peer
distribution: round-robin
consensus:
algorithm: majority
min_votes: 2
timeout_ms: 60000
allow_partial: true

Hierarchical Mode

coordination:
mode: hierarchical
distribution: skill-based

agents:
- name: coordinator
role: manager # One agent must be manager
spec: ...

- name: worker-1
role: worker
spec: ...

Pipeline Mode

coordination:
mode: pipeline

agents:
# Order matters - first agent receives input, last produces output
- name: collector
spec: ...
- name: analyzer
spec: ...
- name: reporter
spec: ...

Swarm Mode

coordination:
mode: swarm
distribution: least-loaded

Tiered Mode

coordination:
mode: tiered
consensus:
algorithm: weighted
min_confidence: 0.6
tiered:
pass_all_results: true
final_aggregation: manager_synthesis
tier_consensus:
"1":
algorithm: first_wins
"2":
algorithm: weighted
min_votes: 2
"3":
algorithm: first_wins

Deep Mode

Deep mode adds an agentic loop: planning → execution → re-planning until goal achieved.

coordination:
mode: deep
deep:
max_iterations: 10 # Safety limit
planning: true # Enable planning phase
memory: true # Persist findings across iterations
planner_model: anthropic:claude-sonnet-4-20250514 # Optional: model for planning
planner_prompt: | # Optional: custom planning prompt
Generate investigation steps to find root cause.
synthesizer_prompt: | # Optional: custom synthesis prompt
Synthesize findings into a report with evidence.

Distribution Strategies

coordination:
distribution: round-robin # Distribution strategy
StrategyDescriptionBest For
round-robinCycle through agents sequentiallyEven distribution
least-loadedAssign to agent with fewest tasksLoad balancing
randomRandom agent selectionSimple scenarios
skill-basedMatch agent skills to task requirementsSpecialized work
stickySame task type → same agentCaching benefits

Consensus Configuration

coordination:
consensus:
algorithm: majority # Consensus algorithm
min_votes: 2 # Minimum responses required
timeout_ms: 60000 # Max wait time in milliseconds
allow_partial: true # Accept result if some agents fail
min_confidence: 0.7 # Minimum confidence threshold
weights: # Per-agent weights (for weighted algorithm)
senior-reviewer: 2.0
junior-reviewer: 1.0

Consensus Algorithms

AlgorithmDescriptionConfiguration
majority>50% of agents must agreemin_votes
unanimous100% of agents must agree-
weightedVotes weighted by agent weightweights or agent weight field
first_winsFirst response wins-
human_reviewAlways flags for human decisionmin_confidence

Consensus Properties

PropertyTypeRequiredDefaultDescription
algorithmstringNomajorityConsensus algorithm
min_votesintegerNo1Minimum votes required
timeout_msintegerNo60000Maximum wait time
allow_partialbooleanNotrueAccept partial consensus
min_confidencefloatNo-Minimum confidence (0.0-1.0)
weightsobjectNo-Per-agent weight overrides

Tiered Configuration

For mode: tiered, additional configuration is available:

coordination:
tiered:
pass_all_results: true # Pass all results vs consensus winner
final_aggregation: manager_synthesis # How to aggregate final tier
tier_consensus: # Per-tier consensus override
"1":
algorithm: first_wins
"2":
algorithm: weighted
min_votes: 2
min_confidence: 0.5

Tiered Properties

PropertyTypeRequiredDefaultDescription
pass_all_resultsbooleanNofalsePass all results to next tier
final_aggregationstringNoconsensusconsensus, merge, manager_synthesis
tier_consensusobjectNo-Per-tier consensus configuration

Final Aggregation Strategies

StrategyDescription
consensusApply global consensus algorithm
mergeMerge all results into single output
manager_synthesisManager agent synthesizes final output

Deep Configuration

For mode: deep, additional configuration is available:

coordination:
deep:
max_iterations: 10 # Safety limit - stop after N iterations
planning: true # Enable planning phase
memory: true # Persist findings across iterations
planner_model: anthropic:claude-sonnet-4-20250514 # Override model for planning
planner_prompt: | # Custom planning system prompt
Generate investigation steps to find root cause.
synthesizer_prompt: | # Custom synthesis system prompt
Synthesize findings into a report with evidence.

Deep Properties

PropertyTypeRequiredDefaultDescription
max_iterationsintegerNo10Safety limit - maximum iterations before stopping
planningbooleanNotrueEnable planning phase (LLM generates investigation steps)
memorybooleanNotruePersist findings across iterations
planner_modelstringNo-Override model for planning phase
planner_promptstringNo-Custom system prompt for planning phase
synthesizer_promptstringNo-Custom system prompt for synthesis phase

Deep Mode Workflow

  1. Plan - LLM generates investigation steps based on the query
  2. Execute - Each step is executed using available tools
  3. Iterate - Continue until goal achieved or max_iterations reached
  4. Re-plan - Adjust plan based on findings (if needed)
  5. Synthesize - Produce final answer with evidence and recommendations

Shared Resources

spec:
shared:
memory:
type: inmemory # Memory backend type
namespace: my-fleet # Memory namespace
ttl: 3600 # Time-to-live in seconds
url: redis://localhost:6379 # Connection URL (for redis/postgres)

Memory Types

TypeDescriptionConfiguration
inmemoryRAM-based storagenamespace, ttl
redisDistributed cacheurl, namespace, ttl
sqliteLocal databasepath, namespace
postgresDistributed databaseurl, namespace

Communication Configuration

spec:
communication:
pattern: broadcast # Communication pattern
broadcast:
channel: team-updates # Channel name
include_sender: false # Include sender in broadcast
direct:
timeout_ms: 5000 # Direct message timeout
pub_sub:
topics: # Available topics
- errors
- metrics
- alerts

Communication Patterns

PatternDescriptionConfiguration
directPoint-to-point messagingtimeout_ms
broadcastAll agents receive messagechannel, include_sender
pub_subTopic-based messagingtopics
request_replyRequest-response patterntimeout_ms

Complete Example

apiVersion: aof.dev/v1
kind: AgentFleet
metadata:
name: code-review-fleet
labels:
purpose: code-review
team: engineering
annotations:
description: "Multi-perspective code review with consensus"

spec:
agents:
- name: security-reviewer
role: specialist
weight: 1.5
spec:
model: anthropic:claude-sonnet-4-20250514
instructions: |
Focus on security vulnerabilities:
- SQL injection
- XSS
- Authentication flaws
tools:
- read_file
- git

- name: performance-reviewer
role: specialist
weight: 1.0
spec:
model: google:gemini-2.5-flash
instructions: |
Focus on performance issues:
- Algorithm complexity
- Memory leaks
- N+1 queries
tools:
- read_file
- git

- name: quality-reviewer
role: specialist
weight: 1.0
spec:
model: google:gemini-2.5-flash
instructions: |
Focus on code quality:
- SOLID principles
- Error handling
- Test coverage
tools:
- read_file
- git

coordination:
mode: peer
distribution: round-robin
consensus:
algorithm: weighted
min_votes: 2
timeout_ms: 120000
allow_partial: true
min_confidence: 0.6

shared:
memory:
type: inmemory
namespace: code-review
ttl: 3600

communication:
pattern: broadcast
broadcast:
channel: review-findings

Multi-Document YAML

Fleet files can contain multiple YAML documents separated by ---:

# Fleet definition
apiVersion: aof.dev/v1
kind: AgentFleet
metadata:
name: primary-fleet
spec:
agents:
- name: agent-1
config: ./agent-1.yaml
coordination:
mode: peer

---
# Alternative simplified fleet
apiVersion: aof.dev/v1
kind: AgentFleet
metadata:
name: simple-fleet
spec:
agents:
- name: simple-agent
spec:
model: google:gemini-2.0-flash
instructions: Simple instructions
coordination:
mode: peer

Environment Variable Substitution

Fleet files support environment variable substitution:

spec:
shared:
memory:
type: redis
url: ${REDIS_URL} # Substituted at runtime

Validation

Validate fleet configuration:

aofctl validate fleet my-fleet.yaml

See Also