Multi-Agent Linux Command Execution System
Project description
Genux - A Multi-Agent Linux Command System
A AI-powered system that converts natural language requests into safe and executable Linux commands and execuutes them using a multi-agent architecture.
Features
- Natural Language Processing: Convert plain English requests into Linux commands
- Multi-Agent Architecture: Four specialized agents working together for optimal results
- Safety First: Built-in security analysis and risk assessment
- Knowledge Base: Learns from successful executions to improve future performance
- Web Search Integration: Searches for current information when needed
- Error Recovery: Automatic replanning when commands fail
Architecture
Here’s an overview of the system architecture showing how different components and agents interact with each other:
The system consists of four specialized agents:
1. Comprehend Agent
- Analyzes natural language input
- Determines task complexity and requirements
- Searches for additional context when needed
2. Planner Agent
- Creates step-by-step execution plans
- Leverages knowledge base for similar requests
- Generates Linux commands optimized for the task
3. Examiner Agent
- Performs security risk assessment
- Categorizes commands by danger level
- Requests user permission for risky operations
4. Execution Agent
- Safely executes approved commands
- Provides real-time feedback
- Handles errors and timeouts gracefully
📦 Installation
Prerequisites
- Python 3.8 or higher
- Linux operating system
- Internet connection for web search functionality
Required API Keys
-
Groq API Key – For AI language model access
- Sign up at Groq Console
- Generate an API key
-
Tavily API Key – For web search functionality
- Sign up at Tavily
- Get your API key
Setup Instructions
Install PyPi package
pip install genux
Or run manually
- Clone the repository
git clone https://github.com/Collgamer0008/Genux.git cd Genux
- Install dependencies:
pip install -r requirements.txt
- Run main:
cd genux python3 main.py
Usage
Run the system and choose your input method:
genux
if you have not saved API keys as Env Variables , You will be prompted to enter API keys manually
Enter your GROQ API Key:
Enter your TAVILY API Key:
Then, you'll be prompted to choose:
- Single line input: For simple requests
- Multi-line input: For complex, detailed requests (end with
END)
Example Requests
Simple Commands
Create a new folder called projectsInstall Docker on UbuntuSet up a Python virtual environment-
create folder structure like this : project-name/ │ ├── src/ │ ├── main/ │ ├── utils/ │ └── __init__.py │ ├── tests/ │ ├── docs/ │ ├── config/ │ ├── scripts/ │ ├── .gitignore ├── README.md ├── requirements.txt └── LICENSE ```
Dynamic Content
Create a file with today's weather informationGenerate a report with current cryptocurrency pricesMake a list of trending GitHub repositories
Security
The Examiner Agent checks the command plan generated for possible damageable commands or commands that install modules, etc, if present, asks for user permission to execute the plan, which adds a layer of human in the loop security, and categorizes the command into risk levels
Risk Assessment Levels
- Low Risk: Simple file operations, directory navigation
- Medium Risk: Package installations, non-system modifications
- High Risk: System file changes, service modifications, network configuration
Safety Mechanisms
- Command analysis before execution
- User permission requests for dangerous operations
- Timeout protection (5 minutes per command)
- Error handling and recovery
- No automatic system-level changes without approval
Knowledge Base
The system maintains a local knowledge base (command_action-kb.json) that:
- Stores successfully executed plans
- Enables faster responses for similar requests
- Improves accuracy over time
- Uses fuzzy matching to find relevant past solutions
Configuration
You can modify these parameters only if you install genux manually
Customizing the LLM Model
Edit the model configuration in the code:
llm = ChatGroq(
api_key=os.environ.get("GROQ_API_KEY"),
model="deepseek-r1-distill-llama-70b", # Change this
temperature=0.3
)
Adjusting Risk Thresholds
Modify the security classification in ExaminerAgent.examine_plan() to adjust what commands require permission.
Requirements
langchain>=0.1.0
langchain-groq>=0.1.0
langchain-community>=0.0.20
tavily-python>=0.3.0
langchain-tavily>=0.2.11
pyfiglet>=1.0.4
Contributing
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
3.Commit your changes
git commit -m "Add amazing feature"
4.Push to the branch
git push origin feature/amazing-feature
5.Open a Pull Request
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file genux-0.1.9.tar.gz.
File metadata
- Download URL: genux-0.1.9.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd7e6aeb9427bb07d4f691f38fe4bc7388a8e447ece98c2fc2049a87b9ea8aff
|
|
| MD5 |
270ea58d8cfdaab0684654a18e7d70b5
|
|
| BLAKE2b-256 |
70fe28277343fec62a4f0e4c5c4466aeafc76fcb7e59962a94e63198a6283585
|
File details
Details for the file genux-0.1.9-py3-none-any.whl.
File metadata
- Download URL: genux-0.1.9-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68c794b1ba3c212045affe8b6f199ffe13da66a1b265b1ee7097ef9f907ce952
|
|
| MD5 |
3003a62cd3793bba3e032679fa40d3ce
|
|
| BLAKE2b-256 |
a502639e5d2fcd82d3646e1b56747688d3b2f5e469aff64f229856da96e9ff75
|