| 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()