{"id":49034827,"url":"https://github.com/Lethe044/hermes-incident-commander","last_synced_at":"2026-05-05T15:00:41.295Z","repository":{"id":344146877,"uuid":"1179738591","full_name":"Lethe044/hermes-incident-commander","owner":"Lethe044","description":"Autonomous SRE agent built on Hermes - detects, heals, and learns from production incidents. Uses Memory + Skills + Cron + Gateway + Subagents + Atropos RL.","archived":false,"fork":false,"pushed_at":"2026-04-04T22:42:47.000Z","size":59,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-05T00:38:32.175Z","etag":null,"topics":["atropos","autonomous-agents","devops","hermes-agent","incident-response","llm-agent","nous-research","sre"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lethe044.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-12T10:29:49.000Z","updated_at":"2026-04-04T22:42:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Lethe044/hermes-incident-commander","commit_stats":null,"previous_names":["lethe044/hermes-incident-commander"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Lethe044/hermes-incident-commander","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lethe044%2Fhermes-incident-commander","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lethe044%2Fhermes-incident-commander/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lethe044%2Fhermes-incident-commander/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lethe044%2Fhermes-incident-commander/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lethe044","download_url":"https://codeload.github.com/Lethe044/hermes-incident-commander/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lethe044%2Fhermes-incident-commander/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32654618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atropos","autonomous-agents","devops","hermes-agent","incident-response","llm-agent","nous-research","sre"],"created_at":"2026-04-19T11:00:23.108Z","updated_at":"2026-05-05T15:00:41.281Z","avatar_url":"https://github.com/Lethe044.png","language":"Python","funding_links":[],"categories":["Skills \u0026 Plugins","技能与插件","Domain applications","Hermes-native skills \u0026 plugins","Research, Multi-Agent, and Domain Projects","Skills Library"],"sub_categories":["Community Skills","社区技能","Maintained here (small open-core set — optional)","Research and multi-agent work","By the Community"],"readme":"# ⚕ Hermes Incident Commander\n\n\u003e **An autonomous SRE agent that detects, diagnoses, and heals production infrastructure - then learns from every incident it resolves.**\n\nBuilt on [Hermes Agent](https://hermes-agent.nousresearch.com) by NousResearch.\nSubmitted for the *\"Show us what Hermes Agent can do\"* challenge.\n\n---\n\n## The Problem\n\nWhen a production server goes down at 3 AM, an on-call engineer has to:\n\n1. Wake up, check alerts\n2. SSH in, run diagnostics manually\n3. Piece together root cause from logs\n4. Apply a fix - hopefully the right one\n5. Verify it worked\n6. Write a post-mortem nobody will read\n\n**Mean time to resolve (MTTR) for P0 incidents averages 45–60 minutes.** Much of that is humans doing things a sufficiently capable agent could do faster and better.\n\nHermes Incident Commander does all of it - autonomously, in minutes, getting smarter with each incident it handles.\n\n---\n\n## Demo\n\n```bash\n# Install dependencies\npip install anthropic rich\n\n# Set your API key\nexport ANTHROPIC_API_KEY=sk-ant-...\n\n# Run a demo incident (disk full scenario)\npython demo/demo_incident.py --scenario disk-full-logs\n\n# Try other scenarios\npython demo/demo_incident.py --scenario svc-crash-nginx\npython demo/demo_incident.py --scenario cpu-runaway-process\n```\n\n**What you'll see:**\n- Hermes detects the incident and classifies severity (P0/P1/P2/P3)\n- Runs parallel diagnostics across CPU, memory, disk, and services\n- Identifies root cause with explicit reasoning\n- Applies the safest effective fix\n- Verifies the fix worked\n- Writes a structured post-incident report to `~/.hermes/incidents/`\n- Creates a **new prevention skill** in `~/.hermes/skills/` so it handles this faster next time\n\n---\n\n## How It Uses Every Hermes Feature\n\nThis project was designed to push every capability of Hermes Agent:\n\n| Hermes Feature | How It's Used |\n|---|---|\n| **Persistent Memory** | Builds a system topology map over time. Learns which services fail together, time-of-day patterns, and which remediations work on YOUR infrastructure. |\n| **Skill Auto-Creation** | After every novel incident, writes a new `SKILL.md` prevention playbook. Hermes gets measurably better at your stack over weeks. |\n| **Cron Scheduler** | Every 5 min: critical health check. Every hour: full audit. Daily 08:00: morning briefing to Telegram. |\n| **Gateway (Telegram/Discord)** | Real-time P0 alerts, resolution notices, and daily briefings delivered to your phone. |\n| **Subagent Spawning** | For multi-service environments, spawns parallel subagents to investigate nginx, database, and application layers simultaneously. |\n| **Session Search (FTS5)** | \"Have we seen this error before?\" - searches past incidents for matching patterns. |\n| **execute_code** | Collapses multi-step diagnostic pipelines into single inference turns, dramatically reducing latency. |\n| **MCP Integration** | Connects to cloud provider APIs (AWS/GCP/Azure MCP servers) for auto-scaling and cloud-native remediation. |\n\n---\n\n## Architecture\n\n```mermaid\nflowchart TD\n    ALERT([🚨 Incident Alert]) --\u003e DETECT\n\n    DETECT[\"🔍 DETECT\u003cbr/\u003eGather system vitals\u003cbr/\u003eCPU • Memory • Disk • Services\"]\n    TRIAGE[\"⚖️ TRIAGE\u003cbr/\u003eClassify severity\u003cbr/\u003eP0 · P1 · P2 · P3\"]\n    DIAGNOSE[\"🔬 DIAGNOSE\u003cbr/\u003eRoot cause analysis\u003cbr/\u003eLogs · Processes · Stack traces\"]\n    REMEDIATE[\"🔧 REMEDIATE\u003cbr/\u003eApply safest fix\u003cbr/\u003eTier 1 → 2 → 3\"]\n    VERIFY[\"✅ VERIFY\u003cbr/\u003eConfirm resolution\u003cbr/\u003eBefore vs after metrics\"]\n\n    DETECT --\u003e TRIAGE --\u003e DIAGNOSE --\u003e REMEDIATE --\u003e VERIFY\n\n    CRON[\"⏱️ CRON\u003cbr/\u003eEvery 5 min: health check\u003cbr/\u003eEvery hour: full audit\u003cbr/\u003eDaily 08:00: briefing\"]\n    CRON --\u003e|triggers| DETECT\n\n    LEARN[\"🧠 LEARN\u003cbr/\u003eWrite post-incident report\u003cbr/\u003eCreate prevention SKILL.md\u003cbr/\u003eUpdate MEMORY.md\u003cbr/\u003eSearch past incidents (FTS5)\"]\n    VERIFY --\u003e LEARN\n\n    GATEWAY[\"📲 GATEWAY\u003cbr/\u003eTelegram · Discord · Slack\"]\n    TRIAGE --\u003e|\"🚨 P0/P1 alert\"| GATEWAY\n    VERIFY --\u003e|\"✅ resolved\"| GATEWAY\n    CRON --\u003e|\"📋 daily briefing\"| GATEWAY\n\n    style DETECT fill:#1e3a5f,color:#fff\n    style TRIAGE fill:#7b2d00,color:#fff\n    style DIAGNOSE fill:#1e3a5f,color:#fff\n    style REMEDIATE fill:#1a4731,color:#fff\n    style VERIFY fill:#1a4731,color:#fff\n    style LEARN fill:#3d2068,color:#fff\n    style CRON fill:#2d2d2d,color:#fff\n    style GATEWAY fill:#2d2d2d,color:#fff\n    style ALERT fill:#7b2d00,color:#fff\n```\n\n---\n\n## Project Structure\n\n```mermaid\ngraph LR\n    ROOT[\"📁 hermes-incident-commander\"]\n\n    ROOT --\u003e SKILLS[\"📁 skills/\"]\n    ROOT --\u003e ENVS[\"📁 environments/\"]\n    ROOT --\u003e DEMO[\"📁 demo/\"]\n    ROOT --\u003e TESTS[\"📁 tests/\"]\n    ROOT --\u003e DOCS[\"📁 docs/\"]\n    ROOT --\u003e REQ[\"📄 requirements.txt\"]\n\n    SKILLS --\u003e SKILL_MD[\"📄 incident-commander/SKILL.md\u003cbr/\u003e← install into ~/.hermes/skills/\"]\n\n    ENVS --\u003e ENV_PY[\"🐍 incident_env.py\u003cbr/\u003e← Atropos RL environment\"]\n    ENVS --\u003e ENV_CFG[\"⚙️ incident_config.yaml\u003cbr/\u003e← training configuration\"]\n\n    DEMO --\u003e DEMO_PY[\"🐍 demo_incident.py\u003cbr/\u003e← standalone demo\"]\n\n    TESTS --\u003e TEST_PY[\"🐍 test_incident_env.py\u003cbr/\u003e← pytest test suite\"]\n\n    DOCS --\u003e SETUP[\"📄 SETUP.md\"]\n    DOCS --\u003e WRITEUP[\"📄 WRITEUP.md\"]\n\n    style ROOT fill:#1e3a5f,color:#fff\n    style SKILL_MD fill:#1a4731,color:#fff\n    style ENV_PY fill:#3d2068,color:#fff\n    style DEMO_PY fill:#7b2d00,color:#fff\n    style TEST_PY fill:#2d2d2d,color:#fff\n```\n\n---\n\n## Installation (Full Hermes Setup)\n\n### 1. Install Hermes Agent\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash\n```\n\n### 2. Configure Hermes\n\n```bash\nhermes setup        # Interactive setup wizard\nhermes model        # Choose your model (Nous Portal recommended)\nhermes gateway setup  # Connect Telegram/Discord for alerts\n```\n\n### 3. Install the Incident Commander Skill\n\n```bash\n# Copy the skill to Hermes's skills directory\ncp -r skills/incident-commander ~/.hermes/skills/\n\n# Verify it's loaded\nhermes\n\u003e /skills\n```\n\n### 4. Set Up Monitoring Cron Jobs\n\nIn your Hermes conversation:\n```\nSet up incident monitoring: run a health check every 5 minutes and alert me\non Telegram if anything is P0 or P1. Send me a daily briefing at 08:00.\n```\n\nHermes will install the cron jobs automatically.\n\n### 5. Run the RL Training Environment (Optional)\n\n```bash\n# Install Atropos\npip install atroposlib\n\n# Generate SFT training data\npython environments/incident_env.py process --config environments/incident_config.yaml\n\n# Full RL training (requires VLLM)\npython environments/incident_env.py serve --config environments/incident_config.yaml\n```\n\n---\n\n## Reward Function (for RL Training)\n\nThe training environment uses a multi-component reward that captures real SRE quality:\n\n```mermaid\npie title Reward Components\n    \"Resolution — Did the incident get fixed?\" : 50\n    \"RCA Quality — Root cause explained?\" : 15\n    \"Report Quality — Post-mortem written?\" : 15\n    \"Skill Created — Prevention skill added?\" : 10\n    \"Response Speed — Fast MTTR?\" : 5\n    \"Tool Efficiency — Minimal tool calls?\" : 5\n```\n\n---\n\n## Incident Scenarios (Training Scenarios)\n\n| ID | Severity | Category | Description |\n|---|---|---|---|\n| `svc-crash-nginx` | P0 | service | nginx crashed, website unreachable |\n| `disk-full-logs` | P1 | disk | 95% disk usage from exploded log files |\n| `memory-leak-process` | P1 | memory | Mystery process eating 150MB+ |\n| `cpu-runaway-process` | P2 | cpu | 95% CPU from runaway computation |\n| `failed-systemd-unit` | P2 | service | Custom worker service in failed state |\n\n---\n\n## Running Tests\n\n```bash\n# Install test dependencies\npip install pytest pytest-asyncio\n\n# Run full test suite\npytest tests/ -v\n\n# Run specific test classes\npytest tests/test_incident_env.py::TestScenarioDefinitions -v\npytest tests/test_incident_env.py::TestRewardFunction -v\npytest tests/test_incident_env.py::TestSkillFile -v\n```\n\n---\n\n## Why This Wins\n\n1. **Real problem, real impact.** P0 incidents cost companies thousands of dollars per minute. Shaving 30 minutes off MTTR with an autonomous agent is immediately valuable.\n\n2. **Uses every Hermes capability.** Memory, skills, cron, gateway, subagents, session search, execute_code - all integrated into a coherent, meaningful workflow.\n\n3. **Self-improving.** The longer Hermes runs, the better it gets at your specific infrastructure. This is Hermes's core promise - \"the agent that grows with you\" - demonstrated concretely.\n\n4. **Closes the training loop.** The Atropos RL environment means this isn't just a demo - it's a path to training models that are genuinely better at agentic SRE tasks.\n\n5. **Ships with working code.** The demo runs standalone, the tests pass, and the skill file installs in one command.\n\n---\n\n## License\n\nMIT\n\n---\n\n*Built with [Hermes Agent](https://hermes-agent.nousresearch.com) - the agent that grows with you.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLethe044%2Fhermes-incident-commander","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLethe044%2Fhermes-incident-commander","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLethe044%2Fhermes-incident-commander/lists"}