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

📚 Complete Guide: This is a quick reference. For the complete guide with all 6 resource types and composable architecture, see Introduction to Core Concepts.

AOF has three main building blocks: Agents, AgentFleets, and AgentFlows. If you know Kubernetes, these will feel familiar.

Agent

An Agent is a single AI assistant with specific instructions, tools, and model configuration.

Think of it like a Kubernetes Pod - it's the smallest deployable unit.

apiVersion: aof.dev/v1
kind: Agent
metadata:
name: my-agent
spec:
model: google:gemini-2.5-flash
instructions: "You are a helpful assistant"
tools:
- type: Shell

When to Use

  • Simple, focused tasks (code review, Q&A)
  • Single-purpose automation
  • Interactive chat sessions
  • Quick prototyping

Key Components

ComponentDescriptionExample
modelLLM to usegoogle:gemini-2.5-flash, google:gemini-2.5-flash
instructionsSystem prompt"You are a K8s expert"
toolsWhat the agent can doShell, HTTP, MCP servers
memoryConversation persistenceIn-memory, file, database

AgentFleet

An AgentFleet is a team of agents working together on a shared task.

Think of it like a Kubernetes Deployment - multiple replicas working in parallel.

apiVersion: aof.dev/v1
kind: AgentFleet
metadata:
name: code-review-team
spec:
agents:
- name: security-reviewer
model: google:gemini-2.5-flash
instructions: "Focus on security vulnerabilities"

- name: performance-reviewer
model: google:gemini-2.5-flash
instructions: "Focus on performance issues"

- name: style-reviewer
model: ollama:llama3
instructions: "Focus on code style and readability"

When to Use

  • Complex tasks requiring multiple perspectives
  • Parallel processing of data
  • Consensus-building (multiple agents vote)
  • Specialized expertise (security + performance + style)

How It Works

  1. You submit a task to the fleet
  2. Each agent processes it independently
  3. Results are aggregated (consensus, summary, or all responses)

AgentFlow

An AgentFlow is an event-driven workflow that orchestrates agents, tools, and integrations in a directed graph.

Think of it like an n8n workflow or Argo Workflow - trigger-based automation. Unlike step-based Workflows, AgentFlows are designed for real-time event handling (Slack bots, webhooks, scheduled jobs).

apiVersion: aof.dev/v1
kind: AgentFlow
metadata:
name: slack-k8s-bot-flow
spec:
trigger:
type: Slack
config:
events:
- app_mention
- message
bot_token: ${SLACK_BOT_TOKEN}
signing_secret: ${SLACK_SIGNING_SECRET}

nodes:
- id: parse-message
type: Transform
config:
script: |
export MESSAGE_TEXT="${event.text}"
export SLACK_CHANNEL="${event.channel}"

- id: agent-process
type: Agent
config:
agent: my-assistant
input: ${MESSAGE_TEXT}

- id: send-response
type: Slack
config:
channel: ${SLACK_CHANNEL}
message: ${agent-process.output}

connections:
- from: trigger
to: parse-message
- from: parse-message
to: agent-process
- from: agent-process
to: send-response

When to Use

  • Chat platform bots (Slack, Discord, Telegram, WhatsApp)
  • Webhook-driven automation
  • Scheduled jobs and reports
  • Human-in-the-loop approval flows with reactions
  • Multi-step workflows with conditional routing
  • Multi-tenant bot deployments - Route different channels to different agents/clusters

Node Types

Node TypeDescriptionExample Use Case
AgentRun an AI agentDiagnose incident, write code
TransformData transformation & variable exportParse incoming events, format output
ConditionalIf/else logic with expressionsRoute based on approval status
SlackSend Slack messages, wait for reactionsNotify team, request approval
DiscordSend Discord messagesNotify Discord channels
HTTPMake HTTP requestsCall external APIs
WaitPause executionCooldown periods
ParallelFork into multiple branchesRun concurrent checks
JoinWait for parallel branchesAggregate results
ApprovalHuman approval gateCritical action confirmation
EndTerminal nodeMark flow completion

Trigger Types

TriggerDescriptionExample
SlackSlack events (mentions, DMs, slash commands)Bot interactions
DiscordDiscord bot eventsMessage/command handling
TelegramTelegram bot eventsChat messages
WhatsAppWhatsApp Business APICustomer messaging
HTTPGeneric webhook endpointExternal integrations
ScheduleCron-based scheduled executionDaily reports, health checks
ManualCLI invocationAd-hoc runs, testing

Multi-Tenant Routing

AgentFlows support trigger filtering for multi-tenant bot deployments. Route messages to different flows based on:

  • Channel - Route #production to prod-cluster agent, #staging to staging-cluster
  • User - Restrict flows to specific users (admins, SRE team)
  • Pattern - Match commands like kubectl, deploy, scale
spec:
trigger:
type: Slack
config:
events: [app_mention]
channels: [production, prod-alerts] # Only these channels
users: [U012ADMIN] # Only these users
patterns: ["^(kubectl|k8s|deploy)"] # Only matching messages

context:
kubeconfig: ${KUBECONFIG_PROD}
namespace: default
cluster: prod-cluster
env:
REQUIRE_APPROVAL: "true"

Each flow can specify its own execution context (kubeconfig, namespace, environment variables), enabling a single daemon to serve multiple clusters.

Tools

Tools extend what agents can do. AOF supports three types:

1. Built-in Tools

Pre-configured tools that work out of the box:

  • Shell: Execute terminal commands
  • HTTP: Make HTTP/REST requests
  • FileSystem: Read/write files
tools:
- type: Shell
config:
allowed_commands: ["kubectl", "helm"]

- type: HTTP
config:
base_url: https://api.github.com
headers:
Authorization: "token ${GITHUB_TOKEN}"

2. MCP Servers

Model Context Protocol servers for specialized functionality:

  • kubectl-mcp: Kubernetes operations
  • github-mcp: GitHub API access
  • postgres-mcp: Database queries
tools:
- type: MCP
config:
server: kubectl-mcp
command: ["npx", "-y", "@modelcontextprotocol/server-kubectl"]

3. Custom Integrations

Platform-specific integrations:

  • Slack
  • PagerDuty
  • Jira
  • Datadog
tools:
- type: Slack
config:
token: ${SLACK_BOT_TOKEN}

Models

AOF supports multiple LLM providers. Use the format provider:model:

model: google:gemini-2.5-flash
model: google:gemini-2.0-flash
model: google:gemini-1.5-pro

OpenAI

model: openai:gpt-4o
model: openai:gpt-4o-mini
model: openai:gpt-4-turbo

Anthropic

model: anthropic:claude-3-5-sonnet-20241022
model: anthropic:claude-3-haiku-20240307
model: anthropic:claude-3-opus-20240229

Ollama (Local)

model: ollama:llama3
model: ollama:mistral
model: ollama:codellama

Groq

model: groq:llama-3.1-70b-versatile
model: groq:mixtral-8x7b-32768

Provider Environment Variables

ProviderEnvironment Variable
GoogleGOOGLE_API_KEY
OpenAIOPENAI_API_KEY
AnthropicANTHROPIC_API_KEY
GroqGROQ_API_KEY
OllamaNone (runs locally)

Memory

Memory lets agents remember conversation context across sessions.

Memory Types

TypeDescriptionUse Case
InMemoryRAM-based (default)Testing, short sessions
FileJSON file storageDevelopment, small scale
SQLiteEmbedded databaseProduction, single instance
PostgreSQLExternal databaseProduction, multi-instance

Example

spec:
memory:
type: SQLite
config:
path: ./agent-memory.db

# OR PostgreSQL for production
memory:
type: PostgreSQL
config:
url: postgres://user:pass@localhost/aof

YAML Structure

All AOF resources follow Kubernetes-style structure:

apiVersion: aof.dev/v1          # API version
kind: Agent # Resource type (Agent, AgentFleet, AgentFlow)

metadata: # Resource metadata
name: my-resource # Unique identifier
labels: # Key-value labels
env: production
team: platform
annotations: # Additional metadata
description: "My agent"

spec: # Resource specification
# Resource-specific configuration

kubectl-Style CLI

AOF's CLI mirrors kubectl for familiarity using verb-noun syntax:

# Apply configuration
aofctl apply -f agent.yaml

# Get resources
aofctl get agents
aofctl get agent my-agent

# Describe details
aofctl describe agent my-agent

# Run an agent
aofctl run agent agent.yaml -i "What pods are failing?"

# View logs
aofctl logs agent my-agent

# Delete resource
aofctl delete agent my-agent

# List all resource types
aofctl api-resources

Next Steps

Now that you understand the concepts, try building something:

Quick Comparison

FeatureAgentAgentFleetAgentFlow
Use CaseSingle taskParallel tasksEvent-driven workflows
ComplexitySimpleMediumAdvanced
K8s AnalogPodDeploymentArgo Workflow
ExampleCode reviewMulti-reviewerSlack bot, incident response
TriggersManual/CLIManual/CLISlack, Discord, HTTP, Schedule
Spec Typekind: Agentkind: AgentFleetkind: AgentFlow
Multi-TenantNoNoYes (channel/user/pattern routing)

Ready to build?First Agent Tutorial