Autonomous CI/CD Repair Agent powered by Gemini 3
Nightingale is an autonomous SRE agent that monitors your CI/CD pipelines and automatically repairs failures using Gemini 3's advanced reasoning capabilities.
When your tests break at 2 AM, Nightingale:
- Analyzes the failure logs
- Reasons about root causes using Gemini 3
- Generates minimal, targeted fixes
- Verifies in an isolated sandbox
- Decides to auto-resolve or escalate
# Clone and install
git clone https://github.com/yourusername/nightingale.git
cd nightingale
pip install -r requirements.txt
# Set your Gemini API key
export GEMINI_API_KEY=your_key_here # Linux/Mac
set GEMINI_API_KEY=your_key_here # Windows
# Run the demo
python main.py --demo- Up to 3 fix attempts
- Learns from verification failures
- Feeds logs back for root cause revision
confidence =
35% × test_pass_ratio +
25% × inverse_blast_radius +
15% × attempt_penalty +
15% × risk_modifier +
10% × self_consistency
- Sandbox isolation (never touches production)
- Blast radius analysis
- Automatic escalation when uncertain
- See SAFETY.md for details
- Webhook listener for CI events
- Dynamic workflow parsing
- No hardcoded test commands
python main.py --demopython main.py --webhook --port 8000GET /health- Health checkPOST /webhook/github- GitHub webhook receiverPOST /incident- Direct incident submission
See ARCHITECTURE_DIAGRAM.md for the full system architecture.
Incident → Parse → Context → [Analyze → Fix → Test]×3 → Score → Decide → Report
└─── Reflective Loop ───┘
- ARCHITECTURE_DIAGRAM.md - System architecture
- SAFETY.md - Safety and blast radius mitigation
- TELEMETRY.md - Metrics and logging
- DEMO_SCRIPT.md - 3-minute pitch script
- DEMO_VIDEO_GUIDE.md - Step-by-step demo commands
Nightingale uses the official google-genai SDK (v1.62.0+) with models/gemini-3-flash-preview for all reasoning. No legacy SDK, no deprecated endpoints.
Structured JSON Output: Every Gemini call returns validated JSON parsed through Pydantic models. The agent requests structured responses with explicit schema examples, and retries with corrective prompts if the response doesn't validate. This ensures reliable, machine-parseable output from every API call.
Reflective Reasoning Loop: The Marathon agent makes up to 3 fix attempts. If a fix fails verification, the failure logs are fed back into the next prompt, forcing Gemini to re-analyze the root cause and propose a different approach. This mimics how senior engineers debug — they learn from what didn't work.
Sandbox Safety: Fixes are applied in an isolated copy of the repository. The original repo is SHA-256 hashed before and after to guarantee zero contamination. No production code is ever modified.
Confidence-Based Decisions: A 5-factor weighted formula (test pass ratio 35%, blast radius 25%, attempt penalty 15%, risk modifier 15%, self-consistency 10%) produces a confidence score. Above 85%: auto-resolve. Below: escalate to a human engineer with a full incident report including root cause analysis, verification results, and confidence breakdown.