PHPackages                             hakam/ai-log-inspector-agent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. hakam/ai-log-inspector-agent

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

hakam/ai-log-inspector-agent
============================

AI-powered log inspector agent for PHP

v0.1.0(3mo ago)5232MITPHPPHP ^8.4CI passing

Since Sep 15Pushed 3mo agoCompare

[ Source](https://github.com/RamyHakam/ai-log-inspector-agent)[ Packagist](https://packagist.org/packages/hakam/ai-log-inspector-agent)[ Docs](https://github.com/RamyHakam/ai-log-inspector-agent)[ RSS](/packages/hakam-ai-log-inspector-agent/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (13)Used By (0)

🤖 AI Log Inspector Agent
========================

[](#-ai-log-inspector-agent)

[![Tests](https://github.com/RamyHakam/ai-log-inspector-agent/workflows/Tests/badge.svg)](https://github.com/RamyHakam/ai-log-inspector-agent/actions/workflows/tests.yml)[![PHP Version](https://camo.githubusercontent.com/bfb98d885e37493cddcc01059ebf02a8872de9da37c12691b8bb6d13fcdca735/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342532422d626c75652e737667)](https://php.net)[![Symfony AI](https://camo.githubusercontent.com/177130812876287ceb7fd9c6cd088f54f1af0129d15b16d821eb6b26664db362/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e7925323041492d4578706572696d656e74616c2d6f72616e67652e737667)](https://symfony.com/doc/current/ai.html)[![Status](https://camo.githubusercontent.com/b20f69837572ea4469935526f223886218e4bf042f04c41e49179749fa643f0f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374617475732d4578706572696d656e74616c2d7265642e737667)](#)[![License](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)🇵🇸 **Free Palestine**

### 🤖💬 Chat With Your Logs Using Smart AI 💬🤖

[](#-chat-with-your-logs-using-smart-ai-)

**Transform debugging from tedious to effortless!** 🔍 → ⚡
Stop digging through dashboards and complex queries. Just **ask your logs directly** in plain English.

---

🐌 Traditional vs ⚡ AI-Powered
-----------------------------

[](#-traditional-vs--ai-powered)

### 🐌 Traditional Way

[](#-traditional-way)

- Open **Kibana/ElasticSearch** dashboards
- Write complex **Datadog queries**
- Manual `grep` through log files
- Filter thousands of log entries
- Correlate timestamps &amp; request IDs by hand
- Spend hours finding root causes

**Result:** Hours of manual work 😩

### ⚡ AI Agent Way

[](#-ai-agent-way)

```
// Just ask naturally!
$agent->ask("Why did payments fail?");
$agent->ask("What caused the 3 PM outage?");
$agent->ask("Show me timeout patterns");
$agent->ask("How many users affected?");
```

**Result:** Instant intelligent answers 🧠

---

📚 Docs &amp; Examples
---------------------

[](#-docs--examples)

Live docs: [ramyhakam.github.io/ai-log-inspector-agent](https://ramyhakam.github.io/ai-log-inspector-agent/)

---

📚 Playground To Validate with your own logs and AI platform.
------------------------------------------------------------

[](#-playground--to-validate-with-your-own-logs-and-ai-platform)

Playground: [ramyhakam.github.io/ai-log-inspector-agent](https://ramyhakam.github.io/ai-log-inspector-agent/playground)

---

💬 Real Examples - Ask Anything!
-------------------------------

[](#-real-examples---ask-anything)

```
$agent = new LogInspectorAgent($platform, $model, $store);

// 🚨 Checkout Issues
$result = $agent->ask('Why did the last checkout request fail?');
// → "Payment gateway timeout after 30 seconds. The last 3 checkout attempts
//    all failed with 'gateway_timeout' errors between 14:23-14:25."

// 🔍 Database Problems
$result = $agent->ask('Show me all database errors from the last hour');
// → "Found 12 database connection failures. Pattern shows connection pool
//    exhaustion starting at 15:30, affecting user authentication service."

// 🌊 Performance Issues
$result = $agent->ask('What caused the sudden spike in API response times?');
// → "Memory leak in Redis connection causing 2.5s delays. Started after
//    deployment at 13:45, affecting 847 requests per minute."

// 🔐 Security Monitoring
$result = $agent->ask('Are there any suspicious login attempts?');
// → "Detected brute force attack from IP 192.168.1.100. 156 failed login
//    attempts in 5 minutes targeting admin accounts."

// 📊 Impact Assessment
$result = $agent->ask('How many users were affected by the outage?');
// → "Based on error logs, approximately 2,341 unique users experienced
//    service disruption between 14:15-14:32 during the database incident."
```

> ⚠️ **Note** - Built on Symfony AI (experimental). The package itself is NOT production-ready; platform maturity depends on your provider and deployment setup.

---

✨ What Makes It Special
-----------------------

[](#-what-makes-it-special)

🔍 **Semantic Search** - Understands context, not just keywords
🧠 **AI Analysis** - Explains what happened and why
⚡ **Lightning Fast** - Get answers in seconds, not hours
🛠️ **Tool-Based** - Extensible architecture with Symfony AI
📊 **Vector Powered** - Smart similarity matching
🔄 **Fallback Ready** - Works even when AI is unavailable
🌐 **Multi-Platform** - OpenAI, Anthropic, and Ollama support
🧩 **Multi-Tool** - `log_search` + `request_context` for request tracing
📂 **File Upload Indexing** - Upload logs and index via `LogFileIndexer`
💬 **Session Chat** - Persisted chat history for multi-turn investigations
🧪 **Production Demo** - Check Playground Demo

---

🚀 Quick Start
-------------

[](#-quick-start)

### Requirements

[](#requirements)

- PHP 8.4+
- Composer 2+

### Install

[](#install)

```
composer require hakam/ai-log-inspector-agent
```

### Setup &amp; Use

[](#setup--use)

```
