| name | agents |
| description | Manage and develop AI agents using kubani CLI. Use for checking agent health, versions, deployment status, running tests, evaluations, and managing Nexus proactive background missions. |
AI Agents Management
Manage AI agents using the kubani CLI and cluster tools.
Quick Commands
kubani agent draft --name my-agent --description "..."
kubani agent status my-agent
kubani agents list
kubani run k8s-monitor --hot-reload
kubani test k8s-monitor
kubani eval k8s-monitor
kubani trace k8s-monitor
kubani dashboard
Nexus Proactive Missions
The Nexus agent supports background missions — scheduled, autonomous tasks that run without user interaction. Missions are dispatched by the NexusHeartbeatWorkflow Temporal Schedule (every 1 minute) and executed as bounded run_mission_agent_turn activities.
Mission Management
python -c "
from kubani.nexus.orchestrator.worker import register_heartbeat_schedule
import asyncio
asyncio.run(register_heartbeat_schedule())
"
kubectl apply -f infrastructure/gitops/apps/nexus/missions-migration-job.yaml
psql $NEXUS_DATABASE_URL -c "SELECT id, title, status, schedule, next_run_at FROM nexus_missions WHERE status='active';"
psql $NEXUS_DATABASE_URL -c "SELECT mission_id, status, tool_calls_made, found_anomaly, duration_ms FROM nexus_mission_runs ORDER BY started_at DESC LIMIT 20;"
temporal schedule pause --schedule-id nexus-heartbeat
temporal schedule unpause --schedule-id nexus-heartbeat
Mission Policies
| Policy | Allowed MCP Servers | Use Case |
|---|
nexus | memory, skills, fetch | Safe missions (research, summarisation) |
nexus-proactive | + kubernetes, discord, temporal | Cluster monitoring missions |
Destructive operations in nexus-proactive (delete, scale, exec) require HITL approval.
Arguments
agent-name: Optional specific agent name for detailed info
Instructions
List All Agents
cd /home/al/git/kubani
echo "=== AI Agents ==="
echo ""
for earthfile in agents/*/Earthfile; do
agent_dir=$(dirname "$earthfile")
agent_name=$(basename "$agent_dir")
[ "$agent_name" = "core" ] && continue
version=$(grep '^version = ' "$agent_dir/pyproject.toml" | sed 's/version = "\(.*\)"/\1/')
deployed=$(KUBECONFIG=/home/al/.kube/config kubectl get deploy $agent_name -n ai-agents -o jsonpath='{.spec.template.spec.containers[0].image}' 2>/dev/null || echo "not deployed")
status=$(KUBECONFIG=/home/al/.kube/config kubectl get pods -n ai-agents -l app.kubernetes.io/name=$agent_name -o jsonpath='{.items[0].status.phase}' 2>/dev/null || echo "unknown")
echo "$agent_name"
echo " Source version: $version"
echo " Deployed image: $deployed"
echo " Pod status: $status"
echo ""
Development Workflow
Use kubani for agent development:
kubani init
kubani run k8s-monitor --hot-reload
kubani run k8s-monitor --mock-mcp --mock-redis
kubani test k8s-monitor --coverage
kubani eval k8s-monitor
kubani eval k8s-monitor --layer llm
Detailed Agent Info
For a specific agent, show detailed information:
AGENT_NAME="k8s-monitor"
KUBECONFIG=/home/al/.kube/config kubectl get pods -n ai-agents -l app.kubernetes.io/name=$AGENT_NAME -o wide
KUBECONFIG=/home/al/.kube/config kubectl logs -n ai-agents -l app.kubernetes.io/name=$AGENT_NAME --tail=20
git log --oneline -5 gitops/apps/ai-agents/$AGENT_NAME/deployment.yaml
kubani trace $AGENT_NAME --last 10
kubani metrics $AGENT_NAME
Build and Deploy
kubani build k8s-monitor
kubani deploy k8s-monitor
kubani deploy k8s-monitor --rollback
Create New Agent
kubani new my-agent
kubani new my-agent --template federated
Framework
The kubani/framework/ package provides shared functionality:
Architecture
kubani/
├── framework/ # Core framework
│ ├── config.py # Unified configuration
│ ├── events/ # Event bus (hybrid types)
│ ├── mcp/ # MCP client
│ └── registry/ # Service registry
├── agents/ # Reusable agent implementations
│ ├── _base/ # Base agent class (KubaniAgent)
│ ├── critic/ # Execution evaluation (learning)
│ ├── reflection/ # Cross-agent insights (learning)
│ ├── skill_synthesizer/ # Skill proposal (learning)
│ ├── event_classifier/ # Event classification
│ ├── remediator/ # Remediation actions
│ └── ... # Other specialized agents
├── syndicates/ # Multi-agent orchestration
│ ├── _base/ # Base syndicate class
│ ├── k8s_monitor/ # Kubernetes monitoring
│ ├── news_digest/ # News aggregation
│ └── learning_system/ # Continuous learning (Critic + Reflection + Synthesizer)
├── nexus/ # Nexus agent (always-on, proactive)
│ ├── orchestrator/ # Temporal workflows and activities
│ │ ├── workflow.py # NexusOrchestratorWorkflow (proactive_mission signal)
│ │ ├── heartbeat_workflow.py # NexusHeartbeatWorkflow (cron dispatcher)
│ │ ├── activities.py # run_agent_turn, run_mission_agent_turn
│ │ └── worker.py # Worker + register_heartbeat_schedule
│ ├── missions/ # Mission CRUD, scheduler, activities
│ ├── models/ # NexusMission, NexusMissionRun models
│ └── tools/ # MCP clients (policy-aware), security
└── mcp/servers/ # MCP server implementations
Learning System
The continuous learning system runs as a syndicate (kubani/syndicates/learning_system/):
from kubani.syndicates.learning_system import LearningSystemSyndicate
from kubani.agents.critic import CriticAgent
from kubani.agents.reflection import ReflectionAgent
from kubani.agents.skill_synthesizer import SkillSynthesizerAgent
syndicate = LearningSystemSyndicate()
await syndicate.start()