2025-06-26 14:52:36 +02:00

38 lines
1.3 KiB
Python

"""Multi-agent supervisor for sysadmin tasks."""
from langchain_openai import ChatOpenAI
from langgraph_supervisor import create_supervisor
from agents.system_agents import create_system_info_worker, create_service_inventory_worker
from agents.service_agents import create_mariadb_worker, create_nginx_worker, create_phpfpm_worker
from agents.network_agents import create_network_worker, create_cert_worker
from agents.analysis_agents import create_risk_worker, create_remediation_worker, create_harmonizer_worker
from config import get_base_model, SUPERVISOR_PROMPT
def create_sysadmin_supervisor():
"""Create a supervisor that coordinates sysadmin agents."""
# Create all the specialized agents
agents = [
create_system_info_worker(),
create_service_inventory_worker(),
create_mariadb_worker(),
create_nginx_worker(),
create_phpfpm_worker(),
create_network_worker(),
create_cert_worker(),
create_risk_worker(),
create_remediation_worker(),
create_harmonizer_worker(),
]
# Create and return the supervisor
supervisor = create_supervisor(
agents=agents,
model=get_base_model(),
prompt=SUPERVISOR_PROMPT
)
return supervisor.compile()