Metadata-Version: 2.4
Name: responseiq
Version: 2.0.0
Summary: AI-Powered Infrastructure Copilot: The Self-Healing SRE.
Project-URL: Homepage, https://github.com/infoyouth/responseiq
Project-URL: Repository, https://github.com/infoyouth/responseiq
Project-URL: Documentation, https://github.com/infoyouth/responseiq#readme
Project-URL: Bug Tracker, https://github.com/infoyouth/responseiq/issues
Project-URL: Changelog, https://github.com/infoyouth/responseiq/blob/main/CHANGELOG.md
Author-email: Youth Innovations <info.youthinno@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: ai-ops,devops,infrastructure-as-code,kubernetes,observability,platform-engineering,responseiq,self-healing,sre
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Debuggers
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.11
Requires-Dist: aiofiles>=23.0.0
Requires-Dist: fastapi>=0.100.0
Requires-Dist: googleapis-common-protos>=1.63.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: loguru>=0.7.0
Requires-Dist: opentelemetry-api>=1.24.0
Requires-Dist: opentelemetry-exporter-otlp>=1.24.0
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.45b0
Requires-Dist: opentelemetry-instrumentation-logging>=0.45b0
Requires-Dist: opentelemetry-instrumentation>=0.45b0
Requires-Dist: opentelemetry-sdk>=1.24.0
Requires-Dist: psycopg2-binary>=2.9.0
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pygithub>=1.59.0
Requires-Dist: ruamel-yaml>=0.17.0
Requires-Dist: slack-sdk>=3.20.0
Requires-Dist: sqlmodel>=0.0.8
Requires-Dist: uvicorn>=0.20.0
Description-Content-Type: text/markdown

# ResponseIQ

[![CI](https://github.com/infoyouth/responseiq/actions/workflows/ci.yml/badge.svg)](https://github.com/infoyouth/responseiq/actions)
[![GitHub Release](https://img.shields.io/github/v/release/infoyouth/responseiq)](https://github.com/infoyouth/responseiq/releases)
[![PyPI](https://img.shields.io/pypi/v/responseiq)](https://pypi.org/project/responseiq/)
[![License](https://img.shields.io/github/license/infoyouth/responseiq)](LICENSE)
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/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](docs/assets/demo_placeholder.gif)

*Above: ResponseIQ scanning a crash log, reading the `service.py` file mentioned in the stack trace, and proposing a specific code patch.*

---

## ✨ 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.

---

## 🚀 Quick Start (CLI Tool)

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

### 1. Install
```bash
pip install responseiq
```

### 2. Configure Credentials
ResponseIQ requires access to an LLM provider to reason about your code.

*Currently supported: OpenAI*

```bash
export OPENAI_API_KEY="sk-..."
```

### 3. Usage Examples

**Example A: Analyze Local Logs**
Scan a directory of log files and get a report of active incidents.
```bash
responseiq --mode scan --target ./var/log/app/
```

**Example B: The "Magic Fix"**
Analyze logs AND the current source code to generate a patch.
```bash
# Finds errors in logs, locates the source file, and explains the fix
responseiq --mode fix --target ./logs/error.log
```

**Example C: CI/CD Pipeline Integration**
Run ResponseIQ as a step in your GitHub Action to auto-triage build failures.
```bash
# In your workflow
responseiq --mode scan --target ./build_logs.txt >> summary.md
```

---

## 🏢 Platform Server (Self-Hosted)

For Platform Engineers who want to host a centralized incident response API (Webhook receiver for Datadog, PagerDuty, etc.).

### Prerequisites
- Docker & Docker Compose
- OpenAI API Key configured in `.env`

### Running with Docker
```bash
# 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](https://github.com/astral-sh/uv) for lightning-fast dependency management.

```bash
# Install dependencies
uv sync

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

---

## 🧪 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](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](docs/SECURITY.md).*
