diff --git a/multi-agent-supervisor/agents/logs_analyzer.py b/multi-agent-supervisor/agents/logs_analyzer.py index 761eff3..5bdc057 100644 --- a/multi-agent-supervisor/agents/logs_analyzer.py +++ b/multi-agent-supervisor/agents/logs_analyzer.py @@ -3,13 +3,13 @@ from langchain_openai import ChatOpenAI from langgraph.prebuilt import create_react_agent from langchain_community.tools.shell.tool import ShellTool -from custom_tools import print_poem, configured_remote_server +from custom_tools import configured_remote_server def create_logs_analyzer_worker(): """Create a logs analyzer agent that investigates system and application logs.""" - tools = [configured_remote_server, print_poem] + tools = [configured_remote_server] return create_react_agent( model=ChatOpenAI(model="gpt-4.1", temperature=0), diff --git a/multi-agent-supervisor/agents/os_detector.py b/multi-agent-supervisor/agents/os_detector.py index 82a4fb5..632cfeb 100644 --- a/multi-agent-supervisor/agents/os_detector.py +++ b/multi-agent-supervisor/agents/os_detector.py @@ -3,13 +3,13 @@ from langchain_openai import ChatOpenAI from langgraph.prebuilt import create_react_agent from langchain_community.tools.shell.tool import ShellTool -from custom_tools import print_poem, configured_remote_server +from custom_tools import configured_remote_server def create_os_detector_worker(): """Create an OS detector agent that identifies system information and environment.""" - tools = [configured_remote_server, print_poem] + tools = [configured_remote_server] return create_react_agent( model=ChatOpenAI(model="gpt-4.1", temperature=0), diff --git a/multi-agent-supervisor/agents/performance_analyzer.py b/multi-agent-supervisor/agents/performance_analyzer.py index f705bf0..5758860 100644 --- a/multi-agent-supervisor/agents/performance_analyzer.py +++ b/multi-agent-supervisor/agents/performance_analyzer.py @@ -3,13 +3,13 @@ from langchain_openai import ChatOpenAI from langgraph.prebuilt import create_react_agent from langchain_community.tools.shell.tool import ShellTool -from custom_tools import print_poem, configured_remote_server +from custom_tools import configured_remote_server def create_performance_analyzer_worker(): """Create a performance analyzer agent that monitors and diagnoses performance issues.""" - tools = [configured_remote_server, print_poem] + tools = [configured_remote_server] return create_react_agent( model=ChatOpenAI(model="gpt-4.1", temperature=0), diff --git a/multi-agent-supervisor/custom_tools/__init__.py b/multi-agent-supervisor/custom_tools/__init__.py index 20450d8..e50ffea 100644 --- a/multi-agent-supervisor/custom_tools/__init__.py +++ b/multi-agent-supervisor/custom_tools/__init__.py @@ -1,6 +1,5 @@ """Custom tools for the multi-agent sysadmin system.""" -from .poem_tool import print_poem from .ssh_tool import SSHTool from .ssh_connection_manager import ssh_manager from langchain_community.tools.shell.tool import ShellTool @@ -17,4 +16,4 @@ configured_remote_server = SSHTool( ) -__all__ = ["print_poem", "SSHTool", "ShellTool", "configured_remote_server", "ssh_manager"] +__all__ = ["SSHTool", "ShellTool", "configured_remote_server", "ssh_manager"] diff --git a/multi-agent-supervisor/main-multi-agent.py b/multi-agent-supervisor/main-multi-agent.py index 1236faa..fd9f82e 100644 --- a/multi-agent-supervisor/main-multi-agent.py +++ b/multi-agent-supervisor/main-multi-agent.py @@ -16,7 +16,8 @@ from agents import ( create_performance_analyzer_worker, create_service_discovery_worker ) -from custom_tools import print_poem, configured_remote_server +from custom_tools import configured_remote_server +from langchain_community.tools.shell.tool import ShellTool # Suppress the shell tool warning since worker agents use it intentionally for sysadmin tasks warnings.filterwarnings("ignore", message="The shell tool has no safeguards by default. Use at your own risk.") @@ -32,7 +33,6 @@ def print_welcome(): print(" • šŸ“Š Logs Analyzer - Log investigation and error diagnosis (local & remote)") print(" • ⚔ Performance Analyzer - Resource monitoring and optimization (local & remote)") print(" • šŸ” Service Discovery - Comprehensive service enumeration across all platforms") - print(" • šŸŽ­ Morale Booster - Motivational poems for tough debugging sessions!") print("\n🌐 Remote Server Access: My agents can execute commands on both:") print(" • Local machine via shell commands") print(" • Remote server via SSH (g@157.90.211.119:8081)") @@ -50,7 +50,6 @@ def print_examples(): print(" - 'Compare disk usage between local and remote server'") print(" - 'Check if services are running on both systems'") print(" - 'My web server is down, help me troubleshoot'") - print(" - 'Write me a motivational poem about debugging'") print("\n" + "-"*80) @@ -82,8 +81,7 @@ Your role: 1. **Task Analysis**: Understand the user's request and determine which agent(s) to engage 2. **Coordination**: Delegate tasks to appropriate agents based on their specialties 3. **Synthesis**: Combine insights from multiple agents into coherent solutions -4. **Direct Action**: Handle simple tasks yourself without delegation -5. **Morale Boost**: Use the poem tool to encourage users during tough debugging sessions +4. **Direct Action**: Handle simple tasks yourself using shell commands when appropriate IMPORTANT: To prevent SSH connection issues, delegate tasks SEQUENTIALLY, not in parallel. Wait for one agent to complete their SSH tasks before starting the next one. @@ -107,10 +105,10 @@ Communication style: - Be professional yet approachable - Provide clear explanations of your delegation decisions - Synthesize agent findings into actionable recommendations -- Add a touch of humor when appropriate (especially with poems!) +- Use shell commands directly when it's more efficient than delegation Remember: Your goal is to solve system problems efficiently by leveraging your team's specialized skills while maintaining a positive debugging experience!""", - tools=[print_poem] # Supervisor only has poem tool - no shell/SSH access + tools=[ShellTool()] # Supervisor can execute shell commands directly ) return supervisor.compile()