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.

Core Concepts

AOF uses a simple, composable model: Agents are single-purpose building blocks, Fleets compose agents into teams, Flows define multi-step workflows, and Triggers route messages to handlers.

┌─────────────────────────────────────────────────────────────┐
│ AOF Building Blocks │
├─────────────────────────────────────────────────────────────┤
│ │
│ AGENT FLEET FLOW TRIGGER │
│ ┌────┐ ┌─────────┐ ┌──────────┐ ┌──────────┐ │
│ │ 🔧 │ │ 🔧 🔧 │ │ Node │ │ Platform │ │
│ └────┘ │ 🔧 🔧 │ │ ↓ │ │ ↓ │ │
│ Single └─────────┘ │ Node │ │ Commands │ │
│ Purpose Composition │ ↓ │ │ ↓ │ │
│ │ End │ │ Handler │ │
│ └──────────┘ └──────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

The Mental Model

ConceptWhat It IsExample
AgentSingle-purpose specialistkubectl-agent, prometheus-agent
FleetTeam of agents for a purposedevops-fleet, rca-fleet
FlowMulti-step workflow with nodesdeploy-flow, incident-flow
TriggerPlatform + command routingslack-prod, telegram-oncall

One way to do it: Build single-purpose agents, compose them into fleets, define workflows as flows, connect to chat platforms via triggers.


1. Agent

An Agent is a single-purpose AI specialist. It does one thing well.

Key Principle: Single Responsibility

# ✅ GOOD: Single-purpose agent
apiVersion: aof.dev/v1alpha1
kind: Agent
metadata:
name: k8s-agent
spec:
model: google:gemini-2.5-flash
tools:
- kubectl
- helm
system_prompt: |
You are a Kubernetes specialist.
Focus ONLY on Kubernetes operations.
When asked about non-K8s topics, indicate another specialist should handle it.
# ❌ BAD: "Super agent" with too many responsibilities
spec:
tools:
- kubectl
- docker
- terraform
- git
- aws
# This agent tries to do everything - hard to maintain, not reusable

Why Single-Purpose Agents?

BenefitDescription
ReusableSame postgres-agent works in database-fleet and rca-fleet
FocusedBetter prompts, better results
ComposableMix and match to build any fleet
TestableTest each agent in isolation
Multi-modelDifferent agents can use different LLMs

Agent Library

AOF provides a library of pre-built single-purpose agents:

AgentToolsPurpose
k8s-agentkubectl, helmKubernetes operations
docker-agentdockerContainer management
git-agentgitVersion control
aws-agentawsAWS cloud operations
terraform-agentterraformInfrastructure as Code
prometheus-agentprometheus_queryMetrics analysis
loki-agentloki_queryLog analysis
postgres-agentpsqlPostgreSQL operations
redis-agentredis-cliRedis operations

Agent YAML Structure

apiVersion: aof.dev/v1alpha1
kind: Agent
metadata:
name: k8s-agent
labels:
library: core
domain: kubernetes
spec:
# LLM model
model: google:gemini-2.5-flash

# Tools this agent can use (focused set)
tools:
- kubectl
- helm

# Focused system prompt
system_prompt: |
You are a Kubernetes operations specialist.
Focus ONLY on Kubernetes cluster management.

# Optional: Memory configuration
memory:
type: InMemory
config:
max_messages: 20

2. Fleet

A Fleet is a composition of agents that work together for a specific purpose.

Key Principle: Composition Over Configuration

Instead of one "super agent" with 20 tools, compose single-purpose agents:

# Fleet = Composition of single-purpose agents
apiVersion: aof.dev/v1alpha1
kind: AgentFleet
metadata:
name: devops-fleet
spec:
display:
name: "DevOps"
emoji: "🔧"
description: "Full-stack DevOps operations"

# Compose agents from the library
agents:
- ref: library/k8s-agent.yaml
role: specialist
- ref: library/docker-agent.yaml
role: specialist
- ref: library/git-agent.yaml
role: specialist
- ref: library/prometheus-agent.yaml
role: specialist

coordination:
mode: hierarchical
distribution: skill-based

Built-in Fleets

FleetAgentsPurpose
DevOpsk8s + docker + git + prometheusFull-stack DevOps
Kubernetesk8s + prometheus + lokiK8s cluster operations
AWSaws + terraformAWS cloud infrastructure
Databasepostgres + redisDatabase operations
RCAcollectors + multi-model analystsRoot cause analysis

Coordination Modes

ModeDescriptionUse Case
hierarchicalRoutes to right specialistDefault for most fleets
peerAll agents work in parallelCode review, voting
tieredCollectors → Analysts → SynthesizerMulti-model RCA
pipelineSequential processingData transformation
swarmSelf-organizing, load balancedHigh-volume parallel
deepIterative planning + execution loopComplex investigations

How Fleets Work

User: "Why are pods crashing?"


┌───────────────┐
│ DevOps Fleet │
│ (coordinator) │
└───────┬───────┘
│ routes to specialist

┌───────────────┐
│ k8s-agent │ ← Single-purpose specialist
└───────────────┘


Response: "Pods crashing due to OOMKilled..."

Multi-Model RCA Fleet

For critical analysis, use multiple LLM models for consensus:

apiVersion: aof.dev/v1alpha1
kind: AgentFleet
metadata:
name: rca-fleet
spec:
agents:
# Tier 1: Data collectors (cheap, fast)
- ref: library/k8s-agent.yaml
tier: 1
- ref: library/prometheus-agent.yaml
tier: 1
- ref: library/loki-agent.yaml
tier: 1

# Tier 2: Analysts (multiple models for diverse perspectives)
- name: claude-analyst
tier: 2
spec:
model: anthropic:claude-sonnet-4-20250514

- name: gemini-analyst
tier: 2
spec:
model: google:gemini-2.5-pro

coordination:
mode: tiered
consensus: weighted

3. Flow

A Flow is a multi-step workflow with nodes and connections. Flows are pure workflow logic - they define what happens in a sequence of steps.

Key Principle: Declarative Workflows

apiVersion: aof.dev/v1
kind: AgentFlow
metadata:
name: deploy-flow
spec:
description: "Deployment workflow with approval gate"

nodes:
- id: validate
type: Agent
config:
agent: validator-agent

- id: approval
type: HumanApproval
config:
timeout: 300
message: "Approve deployment to production?"

- id: deploy
type: Agent
config:
agent: k8s-agent

- id: notify
type: End

connections:
- from: start
to: validate
- from: validate
to: approval
- from: approval
to: deploy
condition: approved
- from: deploy
to: notify

Flow Nodes

Node TypePurposeExample
AgentExecute single agentk8s-agent, docker-agent
FleetExecute agent fleetrca-fleet, devops-fleet
HumanApprovalWait for human approvalDeployment gates
ConditionalBranch based on conditionsSuccess/failure paths
EndTerminal nodeFinal response

4. Trigger

A Trigger defines message sources and command routing. Triggers are self-contained units that include platform configuration and command bindings.

Key Principle: Self-Contained Routing

apiVersion: aof.dev/v1
kind: Trigger
metadata:
name: slack-production
spec:
type: Slack
config:
bot_token: ${SLACK_BOT_TOKEN}
signing_secret: ${SLACK_SIGNING_SECRET}

# Route commands to handlers
commands:
/diagnose:
fleet: rca-fleet
description: "Multi-model root cause analysis"
/deploy:
flow: deploy-flow
description: "Deployment workflow with approvals"
/kubectl:
agent: k8s-agent
description: "Direct Kubernetes operations"

# Fallback for natural language
default_agent: devops

Trigger Types

TriggerEventsUse Case
Telegrammessage, commandMobile DevOps
Slackmessage, app_mention, slash_commandTeam chat
WhatsAppmessageCustomer support
PagerDutyincident eventsAutomated response
HTTPwebhook POSTGeneric integrations

Command Binding Options

Each command routes to one target:

TargetWhen to UseExample
agentSingle-purpose task/kubectl → k8s-agent
fleetMulti-agent coordination/diagnose → rca-fleet
flowMulti-step workflow/deploy → deploy-flow

Platform Safety

Triggers automatically apply platform-appropriate safety:

PlatformRead OperationsWrite Operations
CLI✅ Allowed✅ Allowed
Slack✅ Allowed✅ With approval
Telegram✅ Allowed❌ Blocked
WhatsApp✅ Allowed❌ Blocked

Putting It Together

The Full Picture

┌──────────────────────────────────────────────────────────────────────┐
│ Complete Architecture │
├──────────────────────────────────────────────────────────────────────┤
│ │
│ AGENTS FLEETS FLOWS TRIGGERS │
│ (building blocks) (compositions) (workflows) (routing) │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌───────────┐ ┌────────────┐ │
│ │ k8s-agent │──▶│devops-fleet │ │deploy-flow│◀─│slack-prod │ │
│ ├─────────────┤ └─────────────┘ └───────────┘ ├────────────┤ │
│ │docker-agent │ │ │ │
│ ├─────────────┤ ┌─────────────┐ │ /deploy │──▶│
│ │ git-agent │──▶│ rca-fleet │◀────────────────│ /diagnose │ │
│ ├─────────────┤ └─────────────┘ │ /kubectl │ │
│ │prometheus │ └────────────┘ │
│ ├─────────────┤ ┌─────────────┐ ┌────────────┐ │
│ │ loki-agent │──▶│ k8s-fleet │◀────────────────│telegram │ │
│ ├─────────────┤ └─────────────┘ └────────────┘ │
│ │postgres │ │
│ └─────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────────┘

CLI Usage

# Run a single agent (for testing)
aofctl run agent library/k8s-agent.yaml -i "list pods"

# Run a fleet (composed agents)
aofctl run fleet examples/fleets/devops-fleet.yaml -i "check cluster health"

# Start the daemon (connects triggers to handlers)
aofctl serve --config examples/config/daemon.yaml

Chat Usage

Via Slack or Telegram, use slash commands defined in your triggers:

/diagnose pod is crashing     # → Routes to rca-fleet
/deploy v2.1.0 # → Routes to deploy-flow
/kubectl get pods # → Routes to k8s-agent

# Or just chat naturally with the default agent:
"what's the memory usage in production?"

When to Use What

ScenarioUse ThisWhy
Test a single toolAgentQuick, focused testing
Kubernetes operationsFleet (k8s-fleet)K8s + monitoring agents
Full DevOpsFleet (devops-fleet)K8s + Docker + Git + monitoring
Root cause analysisFleet (rca-fleet)Multi-model consensus
Multi-step workflowFlowApproval gates, pipelines
Chat platform botTriggerSlack, Telegram with command routing

Summary

ConceptPurposeRemember
AgentSingle-purpose building blockOne tool domain, reusable
FleetComposition of agentsTeams of specialists
FlowMulti-step workflowNodes, connections, approval gates
TriggerPlatform + command routingMaps commands to handlers

The simple rule: Build focused agents → Compose into fleets → Define workflows as flows → Connect to chat via triggers.


Next Steps