AI-native Linux diagnostic agent that turns raw system telemetry into expert-level insight through natural language.
SysAgent is a conversational CLI tool designed to help you understand and diagnose your Linux system. Instead of manually correlating output from dozens of individual tools like top, dmesg, and ss, you can ask SysAgent questions in plain English.
It uses an autonomous ReAct orchestration loop to:
- Collect live system telemetry (CPU, memory, processes, logs).
- Retrieve relevant documentation via RAG (Retrieval-Augmented Generation) over an indexed corpus of man pages and Linux kernel documentation.
- Provide structured, grounded, and actionable diagnostic reports directly in your terminal.
- Natural Language Diagnostics: Resolve complex system issues without needing to memorize tool-specific command syntax.
- Agentic Reasoning Loop: An autonomous agent that decides which data to collect and which leads to follow to answer your query.
- Kernel Documentation RAG: Grounded diagnostics using a local vector store indexed with Linux kernel docs and man pages.
- Grounded Diagnostics: High-fidelity reports based on live system telemetry and official Linux documentation.
- Language: Python 3.10+
- LLM Provider: OpenAI (GPT-4o-mini default)
- Vector Database: ChromaDB
- Telemetry:
psutiland native Linux/proc//sysinterfaces. - CLI Framework:
prompt_toolkit.
- Linux OS (Debian/Ubuntu family recommended for v1).
- Python 3.10 or higher.
- An OpenAI API Key.
-
Clone the repository:
git clone https://github.com/LenaHelo/sysagent.git cd sysagent -
Create a virtual environment:
python3 -m venv .venv source .venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
- Environment Variables: Create a
.envfile in the root directory:touch .env
- Setup RAG Sources:
- Required: Add your
OPENAI_API_KEY=your_key_here. - Optional (Kernel Docs): Set
KERNEL_DOCS_PATHto your documentation folder.- Option 1 (System Package):
sudo apt install linux-doc(the path is usually/usr/share/doc/linux-doc/Documentation). - Option 2 (Manual Clone): Use this if the system package is missing. This command will dynamically fetch the documentation for your currently running kernel version:
KERNEL_VERSION=$(uname -r | cut -d. -f1,2) git clone --depth 1 --branch v${KERNEL_VERSION} --filter=blob:none --sparse https://github.com/torvalds/linux.git kernel-source cd kernel-source && git sparse-checkout set Documentation
- Option 1 (System Package):
- Required: Add your
To start the interactive diagnostic session, run:
# Standard mode (silent tool execution)
python3 -m sysagent.main
# Verbose mode (shows agent's internal reasoning and tool calls)
python3 -m sysagent.main -v # or --verbose├── sysagent/ # Core application package
│ ├── agent/ # LLM reasoning and ReAct loop logic
│ ├── rag/ # Vector database, embeddings, and ingestion pipeline
│ ├── system/ # Live system telemetry and diagnostic tools
│ └── main.py # Application entry point
├── docs/ # Project documentation and PRD
├── scripts/ # Utility and maintenance scripts
├── tests/ # Comprehensive test suite
├── requirements.txt # Project dependencies
└── README.md # This file
- Interactive Onboarding: Automatically prompt for missing API keys and configuration on first boot so users don't have to manually edit
.envfiles. - Security Posture Review: Integration with external security feeds to cross-reference live kernel versions with known CVEs and vulnerabilities.
- Packaging & Distribution: Support for
pip installto provide a globalsysagentcommand and easier environment setup. - Advanced System Inspection: Integration of deeper diagnostic tools (e.g.,
perf,strace, orebpf-based tracing) for advanced performance and behavioral analysis. - Rich Terminal UI: Move beyond plain text with structured tables, color-coded status panels, and high-scannability diagnostic reports.
(Demo GIF/Video Placeholder)
Developed as part of the Generative AI Developer Growth Lab | Place-IL