Skip to content

πŸ†˜ AI-Powered System Rescue & Diagnostics Agent - Multi-Model Support (Gemini, OpenAI, Mercury)

Notifications You must be signed in to change notification settings

milhy545/sos-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

87 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ†˜ SOS Agent - System Rescue & Optimization

AI-Powered System Administrator Agent for Emergency Diagnostics & Recovery

License: MIT Python 3.11+ Poetry

SOS Agent is an intelligent system rescue tool powered by multiple AI models. It provides emergency diagnostics, performance optimization, and recovery assistance for Linux systems.

✨ Features

  • πŸ€– Multi-Model AI Support

    • Google Gemini (default, fast & free tier)
    • OpenAI GPT-4o (powerful reasoning)
    • Inception Labs Mercury (specialized for coding)
    • Claude via AgentAPI (OAuth, experimental)
  • πŸ”§ Comprehensive System Diagnostics

    • Hardware health monitoring
    • Service status checks
    • Log analysis & error detection
    • Performance metrics
  • πŸ›‘οΈ Safety First

    • Protected critical services (sshd, NetworkManager)
    • Emergency mode for urgent situations
    • Automatic backup recommendations
  • πŸ“Š Interactive TUI (Text User Interface)

    • Cyberpunk-themed visual interface
    • Persistent Chat with context
    • Guided Fixer system with Dry-Run safety
    • Real-time Dashboards

πŸš€ Quick Start

One-Command Installation

# Download and run installer
curl -fsSL https://raw.githubusercontent.com/milhy545/sos-agent/main/install.sh | bash

Or manual installation:

git clone https://github.com/milhy545/sos-agent.git
cd sos-agent
./install.sh

That's it! The installer handles everything automatically:

  • βœ… Checks Python 3.11+
  • βœ… Creates isolated environment
  • βœ… Installs dependencies
  • βœ… Creates global sos command
  • βœ… Runs setup wizard

First Run

Configure your AI provider:

sos setup

Then start diagnosing:

sos diagnose --category hardware

πŸ“– Detailed installation guide: INSTALL.md | INSTALL.cz.md

πŸ“– Usage

Available Commands

sos menu                        # πŸ–₯️ Launch Interactive TUI (Recommended)
sos diagnose --category <type>  # Run diagnostics (CLI)
sos diagnose --issue "problem"  # Run diagnostics with specific issue
sos chat --message "hi"         # Chat with the agent (stores session context)
sos fix                         # Interactive fix mode (CLI)
sos emergency                   # Emergency fallback diagnostics
sos monitor                     # Real-time system monitoring
sos check-boot                  # Boot/GRUB diagnostics
sos optimize-apps               # Clean & optimize applications
sos setup                       # Configure API keys

πŸ–₯️ Interactive TUI

Launch the full interface with:

sos menu

Features:

  • Grid Menu: Fast navigation (0-9 keys).
  • antiX-cli-cc vibe: Status bar with current issue + bold neon grid.
  • Chat: Persistent AI chat with system/issue context.
  • Fixers: Guided fix interface with Dry-Run + double-confirm execute.
  • Diagnostics Hub: See the last --issue and shell tips from TUI.
  • Logs: Tail recent agent logs directly in TUI.
  • Monitor: Start/stop real-time dashboards.

Diagnostic Categories

  • hardware - CPU, RAM, disk, sensors
  • network - Connectivity, interfaces, firewall
  • services - Systemd services status
  • security - Security audits & vulnerabilities
  • performance - CPU/RAM/disk performance analysis

πŸ”‘ Configuration

API Keys

Get your API keys:

Add to .env:

GEMINI_API_KEY=your_key_here
OPENAI_API_KEY=your_key_here  # Optional
INCEPTION_API_KEY=your_key_here  # Optional

Switch AI Provider

Edit config/default.yaml:

ai_provider: gemini  # or "openai", "inception"
gemini_model: gemini-2.0-flash-exp
openai_model: gpt-4o
inception_model: mercury-coder

πŸ› οΈ Development

# Install dev dependencies
poetry install --with dev

# Run tests
poetry run pytest

# Format code
poetry run black src/
poetry run ruff check src/

# Type checking
poetry run mypy src/

🌍 Localization

Documentation is available in:

  • πŸ‡¬πŸ‡§ English - README.md
  • πŸ‡¨πŸ‡Ώ Czech - README.cz.md

πŸ“š Documentation

⚠️ Safety

SOS Agent protects critical services:

  • Never disabled: sshd, NetworkManager, ollama, tailscaled
  • Emergency mode: Read-only diagnostics only
  • Backup first: Always recommends backups before changes

🀝 Contributing

Contributions welcome! Please read CONTRIBUTING.md first.

πŸ“„ License

MIT License - see LICENSE for details.

πŸ†˜ Support


Built with ❀️ for system administrators who need AI assistance in emergencies

About

πŸ†˜ AI-Powered System Rescue & Diagnostics Agent - Multi-Model Support (Gemini, OpenAI, Mercury)

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5