# Multi-Agent Sysadmin Assistant A modular multi-agent system for system administration tasks using LangChain and LangGraph. ## Architecture The system is organized into several modules for better maintainability: ### 📁 Project Structure ``` multi-agent-supervisor/ ├── main-multi-agent.py # Main entry point ├── config.py # Configuration and settings ├── supervisor.py # Supervisor orchestration ├── utils.py # Utility functions ├── requirements.txt # Dependencies ├── custom_tools/ # Custom tool implementations │ ├── __init__.py │ ├── log_tail_tool.py # Log reading tool │ └── shell_tool_wrapper.py # Shell tool wrapper └── agents/ # Agent definitions ├── __init__.py ├── system_agents.py # System monitoring agents ├── service_agents.py # Service-specific agents ├── network_agents.py # Network and security agents └── analysis_agents.py # Analysis and remediation agents ``` ## Agents ### System Agents - **System Info Worker**: Gathers CPU, RAM, and disk usage - **Service Inventory Worker**: Lists running services ### Service Agents - **MariaDB Analyzer**: Checks MariaDB configuration and logs - **Nginx Analyzer**: Validates Nginx configuration and logs - **PHP-FPM Analyzer**: Monitors PHP-FPM status and performance ### Network Agents - **Network Diagnostics**: Uses ping, traceroute, and dig - **Certificate Checker**: Monitors TLS certificate expiration ### Analysis Agents - **Risk Scorer**: Aggregates findings and assigns severity levels - **Remediation Worker**: Proposes safe fixes for issues - **Harmonizer Worker**: Applies system hardening best practices ## Benefits of Modular Architecture 1. **Separation of Concerns**: Each module has a single responsibility 2. **Reusability**: Tools and agents can be easily reused across projects 3. **Maintainability**: Easy to update individual components 4. **Testability**: Each module can be tested independently 5. **Scalability**: Easy to add new agents or tools 6. **Code Organization**: Clear structure makes navigation easier ## Usage ```python from supervisor import create_sysadmin_supervisor # Create supervisor with all agents supervisor = create_sysadmin_supervisor() # Run analysis query = { "messages": [ { "role": "user", "content": "Check if my web server is running properly" } ] } result = supervisor.invoke(query) ``` ## Adding New Agents 1. Create agent function in appropriate module under `agents/` 2. Import and add to supervisor in `supervisor.py` 3. Update supervisor prompt in `config.py` ## Adding New Tools 1. Create tool class in `custom_tools/` 2. Export from `custom_tools/__init__.py` 3. Import and use in agent definitions