Skip to main content

AI-Powered Infrastructure Copilot: The Self-Healing SRE.

Project description

ResponseIQ

CI GitHub Release PyPI License Checked with mypy Code style: black

"Don't just debug. Fix."

ResponseIQ is an AI-Native Self-Healing Infrastructure Copilot. Unlike traditional parsers that match regex strings, ResponseIQ reads your application logs, loads your actual source code into an LLM context, and generates surgical, context-aware remediation patches for incidents.


📸 See It In Action

ResponseIQ CLI Demo

Above: ResponseIQ scanning a crash log, reading the service.py file mentioned in the stack trace, and proposing a specific code patch. (Full Asciinema recording coming — see Try it in 60 seconds to run it yourself.)


✨ Key Features

  • 🧠 AI-Native Analysis: Uses Generic AI reasoning instead of fragile regex parsing rules.
  • 👁️ Context-Aware: Reads the local source files referenced in logs to understand why the crash happened.
  • ⚡ Self-Healing: Can generate Pull Requests or apply patches directly (CLI mode).
  • 🛡️ Battle-Tested: Includes "Sandbox Mode" to safely test remediation logic.

⚡ Try it in 60 seconds (no API key needed)

A broken service and a pre-recorded crash log are included in the repo so you can see ResponseIQ work immediately:

pip install responseiq
git clone https://github.com/infoyouth/responseiq.git && cd responseiq

# Scan the included crash log — no LLM key required
responseiq --mode scan --target ./samples/crash.log

Expected output:

------------------------------------------------------------
  ResponseIQ Scan Report
  Target : samples/crash.log
  Status : SUCCESS
------------------------------------------------------------
  Scanned  : 3 message(s)
  Incidents: 3 found
------------------------------------------------------------
  1. [HIGH]     KeyError: 'email' in process_user_request
  2. [CRITICAL] Memory leak — _request_log unbounded growth
  3. [HIGH]     ZeroDivisionError: division by zero (reset race)
------------------------------------------------------------
  Tip: run with --mode fix to apply safe remediations.
------------------------------------------------------------

See samples/README.md for full details on the embedded bugs and how to reproduce them.


🚀 Quick Start (CLI Tool)

For developers who want to fix bugs in their local environment or CI pipeline.

1. Install

pip install responseiq

2. Configure an LLM

Choose one option:

Option A: Ollama (free, fully local — recommended)

# Install Ollama: https://ollama.com
ollama serve &
ollama pull llama3.2

# Add to .env in your project root:
echo "LLM_BASE_URL=http://localhost:11434/v1" >> .env
echo "LLM_ANALYSIS_MODEL=llama3.2" >> .env

Option B: OpenAI

echo "OPENAI_API_KEY=sk-..." >> .env

Option C: No config (rule-engine fallback) Works out of the box with no API key — uses a local heuristic parser.

3. Scan Your Logs

# Use the included sample scenario (fastest path — no setup needed)
responseiq --mode scan --target ./samples/crash.log

# Your own single file (JSON or .log or .txt)
responseiq --mode scan --target ./logs/error.log

# Your own directory
responseiq --mode scan --target ./var/log/app/

Example output:

------------------------------------------------------------
  ResponseIQ Scan Report
  Target : logs/error.log
  Status : SUCCESS
------------------------------------------------------------
  Scanned  : 1 message(s)
  Incidents: 1 found
------------------------------------------------------------
  1. [CRITICAL] Out of Memory Error
     Source     : ai
     Description: The system is experiencing a critical error due to an out of
                  memory condition caused by a resource leak or excessive allocation.
------------------------------------------------------------
  Tip: run with --mode fix to apply safe remediations.
------------------------------------------------------------

4. Shadow Mode (zero-risk demo)

Analyse all incidents and get a projected MTTR savings report — nothing is changed:

# Try it on the included samples first
responseiq --mode shadow --target ./samples/ --shadow-report

# Or point at your own logs
responseiq --mode shadow --target ./logs/ --shadow-report

🏢 Platform Server (Self-Hosted)

For Platform Engineers who want a centralized incident response API (webhooks for Datadog, PagerDuty, Sentry etc.).

Prerequisites

  • Docker & Docker Compose
  • LLM configured via .env (Ollama or OpenAI — see Quick Start above)

Running with Docker

# 1. Start the API and Database
docker-compose up -d

# 2. The API is now available at http://localhost:8000
curl http://localhost:8000/health

Development Setup (Local)

We use UV for lightning-fast dependency management.

# Install dependencies
uv sync

# Run the API server with hot-reload
uv run uvicorn src.app:app --reload

🔌 Compatible With

ResponseIQ's webhook API is designed to receive alert payloads from the tools your team already uses. Point your existing alert routing at POST /api/v1/incidents/ingest — no agents or plugins required.

Platform How to connect
Datadog Webhook integration → POST /api/v1/incidents/ingest
PagerDuty Event Orchestration webhook → same endpoint
Sentry Internal Integrations → Webhook URL
GitHub Actions curl step in your CI workflow (see docs/ARCHITECTURE.md)
Alertmanager Webhook receiver in alertmanager.yml

All integrations use standard HTTP webhooks — no vendor-specific SDK required.


🧪 Development & Contributing

Workflow

  1. Linting: make lint
  2. Testing: make test
  3. Format: make format

Project Structure

  • src/cli.py: Entry point for the CLI tool.
  • src/app.py: Entry point for the API Server.
  • src/services/remediation_service.py: The core "Brain" that interfaces with the LLM.

License

MIT


⚠️ Disclaimer & Liability

This tool uses Generative AI to suggest infrastructure and code fixes. By using ResponseIQ, you acknowledge that:

  1. AI Can Hallucinate: The suggestions provided may be syntactically correct but functionally wrong or insecure.
  2. Human Review is Mandatory: You must strictly review all Pull Requests or patches generated by this tool before deploying them.
  3. No Warranty: As per the MIT License, the authors assume no liability for system outages, data loss, or security vulnerabilities resulting from the use of this software.

For security reporting instructions, please see SECURITY.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

responseiq-2.17.0.tar.gz (147.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

responseiq-2.17.0-py3-none-any.whl (183.5 kB view details)

Uploaded Python 3

File details

Details for the file responseiq-2.17.0.tar.gz.

File metadata

  • Download URL: responseiq-2.17.0.tar.gz
  • Upload date:
  • Size: 147.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for responseiq-2.17.0.tar.gz
Algorithm Hash digest
SHA256 696f0871ba6db546d14ea1794793c50cf4130f687557ce906880c9db0e1da990
MD5 bff9e00bd7cdd4f8689d16e81cad0224
BLAKE2b-256 e1946244304124a5b034d69afe5fdf544192fdefc05c94cde1e8922d30f57794

See more details on using hashes here.

File details

Details for the file responseiq-2.17.0-py3-none-any.whl.

File metadata

  • Download URL: responseiq-2.17.0-py3-none-any.whl
  • Upload date:
  • Size: 183.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for responseiq-2.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08bb7907da8a1f1e79eac83bb3dae61a5363e14a45f3c3ed23ee63c1e4fd55d7
MD5 eca4f46b2fbaf1f2f153c500e92abc66
BLAKE2b-256 2c50b03307b53020f7f559f836e8ce7ea1e3485f24586cb009698ed6aa273f96

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page