PHPackages                             iazaran/ai-insights - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. iazaran/ai-insights

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

iazaran/ai-insights
===================

Using AI to analyze data and receive insights to improve specific areas of your business

v1.2.0(1y ago)371MITPHPPHP ^8.1

Since Aug 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/iazaran/ai-insights)[ Packagist](https://packagist.org/packages/iazaran/ai-insights)[ Docs](https://github.com/iazaran/ai-insights)[ RSS](/packages/iazaran-ai-insights/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (2)Versions (8)Used By (0)

AI Insights
===========

[](#ai-insights)

Using AI LLMs to analyze data and receive insights and charts to improve specific areas of your business. The default LLM is OpenAI, but you can use any other LLMs.

Requirements
------------

[](#requirements)

- PHP &gt;=8.1
- Laravel &gt;= 10

Get Started
-----------

[](#get-started)

Install `iazaran/ai-insights` via the [Composer](https://getcomposer.org/) package manager:

```
composer require iazaran/ai-insights
```

Optionally, publish the configuration file

```
php artisan vendor:publish --provider="AIInsights\Providers\AIInsightsServiceProvider"
```

Set .env configuration. You can get your OpenAI API key [here](https://platform.openai.com/account/api-keys). Others are optional.

```
AI_BASE_URL=""
AI_CHAT_PATH=""
AI_IMAGE_PATH=""
AI_API_KEY=""
AI_ORGANIZATION=""
AI_PROJECT=""
AI_MODEL=""
AI_IMAGE_MODEL=""
AI_MAX_TOKENS=""
AI_TEMPERATURE=""
AI_INSIGHTS_DEFAULT_GOAL=""
AI_IMAGE_SIZE=""
```

Use the `AIInsightsProcessor` class to analyze your data. As default, it will use your last rows in DB

```
$businessType = 'Retail';
$goal = 'Increase sales';
$tables = ['orders', 'products'];
$limit = 5;
$insights = AIInsightsProcessor::analyze($businessType, $goal, $tables, $limit);
```

And sample response can be like this, if you are using OpenAI:

```
[
    'insights' => [
        [
            'index' => 0,
            'message' => [
                'role' => 'assistant',
                'content' => "Based on the provided data from the 'orders' and 'products' tables, here are some insights to improve your Retail business and increase sales:\n\n1. Focus on promoting high-margin products: The data shows that Product A has a higher profit margin compared to other products. Consider running targeted marketing campaigns for this item.\n2. Implement a loyalty program: Analyzing customer purchase history reveals repeat buyers. Introduce a loyalty program to incentivize these customers and encourage more frequent purchases.\n3. Optimize inventory management: The product data indicates some items have low stock levels. Ensure popular products are always available to avoid missing sales opportunities.\n4. Personalize marketing efforts: Use customer order history to create personalized product recommendations, potentially increasing cross-selling and upselling."
            ],
            'finish_reason' => 'stop',
        ],
    ],
    'charts' => [
        [
            'url' => 'https://oaidalleapiprodscus.blob.core.windows.net/private/org-123456/user-123456/img-abcdef.png'
        ],
    ]
]
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

7

Last Release

650d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10566709?v=4)[Ismael Azaran](/maintainers/iazaran)[@iazaran](https://github.com/iazaran)

---

Top Contributors

[![iazaran](https://avatars.githubusercontent.com/u/10566709?v=4)](https://github.com/iazaran "iazaran (24 commits)")

---

Tags

ailaravelllmopenaiphplaravel-packageai-insightsai insights laravelai data analysis

### Embed Badge

![Health badge](/badges/iazaran-ai-insights/health.svg)

```
[![Health](https://phpackages.com/badges/iazaran-ai-insights/health.svg)](https://phpackages.com/packages/iazaran-ai-insights)
```

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M973](/packages/statamic-cms)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[firefly-iii/data-importer

Firefly III Data Import Tool.

8015.8k](/packages/firefly-iii-data-importer)[ronasit/laravel-helpers

Provided helpers function and some helper class.

2085.6k30](/packages/ronasit-laravel-helpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
