Skip to main content

kubeswarm Architecture - Agent Resource Model

kubeswarm organizes its Kubernetes agent resources into four layers. References flow upward only - a lower-layer resource never depends on a higher one. This layered architecture keeps blast radius contained and gives every kubeswarm primitive a principled home.

Resource Layers

LayerResourcesPurpose
4 - OrchestrationSwarmTeam, SwarmRun, SwarmEventCompose agents into workflows, track execution, trigger runs
3 - ComputeSwarmAgentThe atomic unit - manages a pool of LLM agent pods
2 - DiscoverySwarmRegistryCapability index - agents register, teams query
1 - InfrastructureSwarmSettings, SwarmMemory, SwarmBudget, SwarmNotifyShared config, memory, spend control, notifications

API keys use native Kubernetes Secrets via spec.apiKeyRef or spec.envFrom.

How Dispatch Works

Three mechanisms, each firing at a different point in time:

MechanismDecided byWhenPrimitive
Pipeline stepYAML authorDesign timeSwarmTeam pipeline DAG
Routed dispatchRouter LLMTrigger timeSwarmRegistry + routed mode
Tool callTask LLMInference timeMCP gateway / agents[] A2A

Build Bottom-up

  1. Infrastructure - Create a Secret with your API key, optionally SwarmSettings, SwarmMemory, SwarmBudget
  2. Discovery - A default SwarmRegistry is auto-created per namespace
  3. Compute - Deploy SwarmAgents with kubectl apply
  4. Orchestration - Compose SwarmTeams, wire SwarmEvents for automation

Standalone agents (step 3) are fully first-class - they support budgets, notifications, events and execution records without a team.